; hello world
(hello name
  !hello $0
)

; executes a command N times using a recursive macro
(loop times cmd
  ? $0 == 0
  ?? ()
  $1
  .(loop $0-1 $1)
)

; dummy hello world
(foo one two
  x $0 @ $1
)

(disasm x
  f foo @ $0
  label:
  pd 1
  s +$$$
  f foo @ foo-1
  ? foo != 0
  ??.label:
)


; implementation of a numeric range 'for' loop in radare script
; usage:  x @@ .(for 10 100)

(for from to
  ?$@+$0==$1
  ??()
  ()$@+$0
)

; function iterator
; x @@ .(for-fun)
(for-fun
 ()`C*~CF [3]#$@`
)

; Likely/Unlikely branch commenter
; (step-post-anal,?z`ao@oeip~type = cond,??(),?eip==`ao@oeip~jump =[2],??CC likely@oeip,??(),CC unlikely@oeip,)

(step-post-anal
 ?z`ao@oeip~type = cond`
  ??()
 ?eip==`ao@oeip~jump =[2]`
  ??CC likely@oeip
  ??()
 CC unlikely@oeip
)

(label-test
 f foo @ 3
 loop:
 !! echo LOOP
 f foo @ foo-1
 ? foo
 ?!.loop:
)
