

===================== parser output ===============================

let rec f  Tu1 = 123
in 
   let rec g  Tu2 = 456
   in 
      let rec h  Tu3 = 789
      in 
         let x  = (f ())
         in (print_int (
            if (x <= 0)
            then (g ())
            else (h ()) + x))

===================== typing output ===============================

let rec f  : (unit) -> int Tu1 : unit = 123
in 
   let rec g  : (unit) -> int Tu2 : unit = 456
   in 
      let rec h  : (unit) -> int Tu3 : unit = 789
      in 
         let x  : int = (f ())
         in (print_int (
            if (x <= 0)
            then (g ())
            else (h ()) + x))

===================== knormal output ===============================

let f  : (unit) -> intTu1 : unit = 123
in 
   let g  : (unit) -> intTu2 : unit = 456
   in 
      let h  : (unit) -> intTu3 : unit = 789
      in 
         let x  : int = let Tu4  : unit = () in
         (f Tu4) in
         
         let Ti9  : int = let Ti8  : int = let Ti5  : int = 0 in
         
         if x <= Ti5 
         then 
            let Tu6  : unit = () in
            (g Tu6)
         else 
            let Tu7  : unit = () in
            (h Tu7) in
         (Ti8 + x) in
         EXTERN(print_int Ti9)

===================== alpha output ===============================

let f_10  : (unit) -> intTu1_11 : unit = 123
in 
   let g_12  : (unit) -> intTu2_13 : unit = 456
   in 
      let h_14  : (unit) -> intTu3_15 : unit = 789
      in 
         let x_16  : int = let Tu4_22  : unit = () in
         (f_10 Tu4_22) in
         
         let Ti9_17  : int = let Ti8_18  : int = let Ti5_19  : int = 0 in
         
         if x_16 <= Ti5_19 
         then 
            let Tu6_21  : unit = () in
            (g_12 Tu6_21)
         else 
            let Tu7_20  : unit = () in
            (h_14 Tu7_20) in
         (Ti8_18 + x_16) in
         EXTERN(print_int Ti9_17)

===================== simplify output ===============================

let f_10  : (unit) -> intTu1_11 : unit = 123
in 
   let g_12  : (unit) -> intTu2_13 : unit = 456
   in 
      let h_14  : (unit) -> intTu3_15 : unit = 789
      in 
         let Tu4_22  : unit = () in
         
         let x_16  : int = (f_10 Tu4_22) in
         
         let Ti5_19  : int = 0 in
         
         let Ti8_18  : int = 
         if x_16 <= Ti5_19 
         then 
            let Tu6_21  : unit = () in
            (g_12 Tu6_21)
         else 
            let Tu7_20  : unit = () in
            (h_14 Tu7_20) in
         
         let Ti9_17  : int = (Ti8_18 + x_16) in
         EXTERN(print_int Ti9_17)

===================== closure output ===============================
let LABEL(f_10) [] Tu1_11 : unit = 123
in

let LABEL(g_12) [] Tu2_13 : unit = 456
in

let LABEL(h_14) [] Tu3_15 : unit = 789
in

let Tu4_22  : unit = () in

let x_16  : int = APPLY_DIRECT(LABEL(f_10) Tu4_22) in

let Ti5_19  : int = 0 in

let Ti8_18  : int = 
if x_16 <= Ti5_19 
then 
   let Tu6_21  : unit = () in
   APPLY_DIRECT(LABEL(g_12) Tu6_21)
else 
   let Tu7_20  : unit = () in
   APPLY_DIRECT(LABEL(h_14) Tu7_20) in

let Ti9_17  : int = (Ti8_18 + x_16) in
APPLY_DIRECT(LABEL(min_caml_print_int) Ti9_17)

===================== virtual  output ===============================
==== Data Segment =======
==== Function Declarations =======

LABEL(f_10) (arg=(), farg=())

ANSWER(set(123))

LABEL(g_12) (arg=(), farg=())

ANSWER(set(456))

LABEL(h_14) (arg=(), farg=())

ANSWER(set(789))
==== Expression =======

LET(Tu4_22, nop, 
   LET(x_16, CallDirect(LABEL(f_10), args=(), farg=()), 
      LET(Ti5_19, set(0), 
         LET(Ti8_18, 
            IfLE(x_16, Ti5_19, 
               LET(Tu6_21, nop, 
                  ANSWER(CallDirect(LABEL(g_12), args=(), farg=()))), 
               LET(Tu7_20, nop, 
                  ANSWER(CallDirect(LABEL(h_14), args=(), farg=())))), 
            LET(Ti9_17, add(Ti8_18, x_16), 
               ANSWER(CallDirect(LABEL(min_caml_print_int), args=(Ti9_17), farg=())))))))


=====================  simm13  output ===============================
==== Data Segment =======
==== Function Declarations =======

LABEL(f_10) (arg=(), farg=())

ANSWER(set(123))

LABEL(g_12) (arg=(), farg=())

ANSWER(set(456))

LABEL(h_14) (arg=(), farg=())

ANSWER(set(789))
==== Expression =======

LET(Tu4_22, nop, 
   LET(x_16, CallDirect(LABEL(f_10), args=(), farg=()), 
      LET(Ti8_18, 
         IfLE(x_16, 0, 
            LET(Tu6_21, nop, 
               ANSWER(CallDirect(LABEL(g_12), args=(), farg=()))), 
            LET(Tu7_20, nop, 
               ANSWER(CallDirect(LABEL(h_14), args=(), farg=())))), 
         LET(Ti9_17, add(Ti8_18, x_16), 
            ANSWER(CallDirect(LABEL(min_caml_print_int), args=(Ti9_17), farg=()))))))


===================== RegAlloc output ===============================
==== Data Segment =======
==== Function Declarations =======

LABEL(f_10) (arg=(), farg=())

ANSWER(set(123))

LABEL(g_12) (arg=(), farg=())

ANSWER(set(456))

LABEL(h_14) (arg=(), farg=())

ANSWER(set(789))
==== Expression =======

LET(%g0, nop, 
   LET(%i2, CallDirect(LABEL(f_10), args=(), farg=()), 
      LET(%g0, save(%i2, x_16), 
         LET(%i2, 
            IfLE(%i2, 0, 
               LET(%g0, nop, 
                  ANSWER(CallDirect(LABEL(g_12), args=(), farg=()))), 
               LET(%g0, nop, 
                  ANSWER(CallDirect(LABEL(h_14), args=(), farg=())))), 
            LET(%i2, mov(%i2), 
               LET(%i3, restore(x_16), 
                  LET(%i2, add(%i2, %i3), 
                     ANSWER(CallDirect(LABEL(min_caml_print_int), args=(%i2), farg=())))))))))


===================== Emit output ===============================
.section	".rodata"
.align	8
.section	".text"
f_10:
	set	123, %i2
	retl
	nop
g_12:
	set	456, %i2
	retl
	nop
h_14:
	set	789, %i2
	retl
	nop
.global	min_caml_start
min_caml_start:
	save	%sp, -112, %sp
	st	%o7, [%i0 + 4]
	call	f_10
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	st	%i2, [%i0 + 0]
	cmp	%i2, 0
	bg	ble_else_32
	nop
	st	%o7, [%i0 + 4]
	call	g_12
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	b	ble_cont_33
	nop
ble_else_32:
	st	%o7, [%i0 + 4]
	call	h_14
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
ble_cont_33:
	ld	[%i0 + 0], %i3
	add	%i2, %i3, %i2
	st	%o7, [%i0 + 4]
	call	min_caml_print_int
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	ret
	restore
