

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

let rec sum  acc x = 
   if (x <= 0)
   then acc
   else (sum (acc + x) (x - 1))
in (print_int (sum 0 5))

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

let rec sum  : (int, int) -> int acc : int x : int = 
   if (x <= 0)
   then acc
   else (sum (acc + x) (x - 1))
in (print_int (sum 0 5))

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

let sum  : (int, int) -> intacc : int x : int = 
   let Ti4  : int = 0 in
   
   if x <= Ti4 
   then acc
   else 
      let Ti5  : int = (acc + x) in
      
      let Ti7  : int = let Ti6  : int = 1 in
      (x - Ti6) in
      (sum Ti5 Ti7)
in 
   let Ti3  : int = let Ti1  : int = 0 in
   
   let Ti2  : int = 5 in
   (sum Ti1 Ti2) in
   EXTERN(print_int Ti3)

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

let sum_8  : (int, int) -> intacc_9 : int x_10 : int = 
   let Ti4_14  : int = 0 in
   
   if x_10 <= Ti4_14 
   then acc_9
   else 
      let Ti5_15  : int = (acc_9 + x_10) in
      
      let Ti7_16  : int = let Ti6_17  : int = 1 in
      (x_10 - Ti6_17) in
      (sum_8 Ti5_15 Ti7_16)
in 
   let Ti3_11  : int = let Ti1_12  : int = 0 in
   
   let Ti2_13  : int = 5 in
   (sum_8 Ti1_12 Ti2_13) in
   EXTERN(print_int Ti3_11)

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

let sum_8  : (int, int) -> intacc_9 : int x_10 : int = 
   let Ti4_14  : int = 0 in
   
   if x_10 <= Ti4_14 
   then acc_9
   else 
      let Ti5_15  : int = (acc_9 + x_10) in
      
      let Ti6_17  : int = 1 in
      
      let Ti7_16  : int = (x_10 - Ti6_17) in
      (sum_8 Ti5_15 Ti7_16)
in 
   let Ti1_12  : int = 0 in
   
   let Ti2_13  : int = 5 in
   
   let Ti3_11  : int = (sum_8 Ti1_12 Ti2_13) in
   EXTERN(print_int Ti3_11)

===================== closure output ===============================
let LABEL(sum_8) [] acc_9 : int, x_10 : int = 
   let Ti4_14  : int = 0 in
   
   if x_10 <= Ti4_14 
   then acc_9
   else 
      let Ti5_15  : int = (acc_9 + x_10) in
      
      let Ti6_17  : int = 1 in
      
      let Ti7_16  : int = (x_10 - Ti6_17) in
      APPLY_DIRECT(LABEL(sum_8) Ti5_15 Ti7_16)
in

let Ti1_12  : int = 0 in

let Ti2_13  : int = 5 in

let Ti3_11  : int = APPLY_DIRECT(LABEL(sum_8) Ti1_12 Ti2_13) in
APPLY_DIRECT(LABEL(min_caml_print_int) Ti3_11)

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

LABEL(sum_8) (arg=(acc_9, x_10), farg=())

LET(Ti4_14, set(0), 
   ANSWER(
      IfLE(x_10, Ti4_14, 
         ANSWER(mov(acc_9)), 
         LET(Ti5_15, add(acc_9, x_10), 
            LET(Ti6_17, set(1), 
               LET(Ti7_16, sub(x_10, Ti6_17), 
                  ANSWER(CallDirect(LABEL(sum_8), args=(Ti5_15, Ti7_16), farg=()))))))))
==== Expression =======

LET(Ti1_12, set(0), 
   LET(Ti2_13, set(5), 
      LET(Ti3_11, CallDirect(LABEL(sum_8), args=(Ti1_12, Ti2_13), farg=()), 
         ANSWER(CallDirect(LABEL(min_caml_print_int), args=(Ti3_11), farg=())))))


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

LABEL(sum_8) (arg=(acc_9, x_10), farg=())

ANSWER(
   IfLE(x_10, 0, 
      ANSWER(mov(acc_9)), 
      LET(Ti5_15, add(acc_9, x_10), 
         LET(Ti7_16, sub(x_10, 1), 
            ANSWER(CallDirect(LABEL(sum_8), args=(Ti5_15, Ti7_16), farg=()))))))
==== Expression =======

LET(Ti1_12, set(0), 
   LET(Ti2_13, set(5), 
      LET(Ti3_11, CallDirect(LABEL(sum_8), args=(Ti1_12, Ti2_13), farg=()), 
         ANSWER(CallDirect(LABEL(min_caml_print_int), args=(Ti3_11), farg=())))))


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

LABEL(sum_8) (arg=(%i2, %i3), farg=())

ANSWER(
   IfLE(%i3, 0, 
      ANSWER(mov(%i2)), 
      LET(%i2, add(%i2, %i3), 
         LET(%i3, sub(%i3, 1), 
            ANSWER(CallDirect(LABEL(sum_8), args=(%i2, %i3), farg=()))))))
==== Expression =======

LET(%i2, set(0), 
   LET(%i3, set(5), 
      LET(%i2, CallDirect(LABEL(sum_8), args=(%i2, %i3), farg=()), 
         ANSWER(CallDirect(LABEL(min_caml_print_int), args=(%i2), farg=())))))


===================== Emit output ===============================
.section	".rodata"
.align	8
.section	".text"
sum_8:
	cmp	%i3, 0
	bg	ble_else_20
	nop
	retl
	nop
ble_else_20:
	add	%i2, %i3, %i2
	sub	%i3, 1, %i3
	b	sum_8
	nop
.global	min_caml_start
min_caml_start:
	save	%sp, -112, %sp
	set	0, %i2
	set	5, %i3
	st	%o7, [%i0 + 4]
	call	sum_8
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	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
