

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

let rec inprod  v1 v2 i = 
   if not((0 <= i))
   then 0.
   else ((v1.(i) *. v2.(i)) +. (inprod v1 v2 (i - 1)))
in 
   let v1  = Array.create 3 1.23
   in 
      let v2  = Array.create 3 4.56
      in (print_int (truncate (1000000. *. (inprod v1 v2 2))))

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

let rec inprod  : (float array, float array, int) -> float v1 : float array v2 : float array i : int = 
   if not((0 <= i))
   then 0.
   else ((v1.(i) *. v2.(i)) +. (inprod v1 v2 (i - 1)))
in 
   let v1  : float array = Array.create 3 1.23
   in 
      let v2  : float array = Array.create 3 4.56
      in (print_int (truncate (1000000. *. (inprod v1 v2 2))))

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

let inprod  : (float array, float array, int) -> floatv1 : float array v2 : float array i : int = 
   let Ti10  : int = 0 in
   
   if Ti10 <= i 
   then 
      let Td13  : float = let Td11  : float = v1.(i) in
      
      let Td12  : float = v2.(i) in
      (Td11 *. Td12) in
      
      let Td16  : float = let Ti15  : int = let Ti14  : int = 1 in
      (i - Ti14) in
      (inprod v1 v2 Ti15) in
      (Td13 +. Td16)
   else 0.
in 
   let v1  : float array = let Ti1  : int = 3 in
   
   let Td2  : float = 1.23 in
   EXTERN(create_float_array Ti1 Td2) in
   
   let v2  : float array = let Ti3  : int = 3 in
   
   let Td4  : float = 4.56 in
   EXTERN(create_float_array Ti3 Td4) in
   
   let Ti9  : int = let Td8  : float = let Td5  : float = 1000000. in
   
   let Td7  : float = let Ti6  : int = 2 in
   (inprod v1 v2 Ti6) in
   (Td5 *. Td7) in
   EXTERN(truncate Td8) in
   EXTERN(print_int Ti9)

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

let inprod_17  : (float array, float array, int) -> floatv1_18 : float array v2_19 : float array i_20 : int = 
   let Ti10_32  : int = 0 in
   
   if Ti10_32 <= i_20 
   then 
      let Td13_33  : float = let Td11_37  : float = v1_18.(i_20) in
      
      let Td12_38  : float = v2_19.(i_20) in
      (Td11_37 *. Td12_38) in
      
      let Td16_34  : float = let Ti15_35  : int = let Ti14_36  : int = 1 in
      (i_20 - Ti14_36) in
      (inprod_17 v1_18 v2_19 Ti15_35) in
      (Td13_33 +. Td16_34)
   else 0.
in 
   let v1_21  : float array = let Ti1_30  : int = 3 in
   
   let Td2_31  : float = 1.23 in
   EXTERN(create_float_array Ti1_30 Td2_31) in
   
   let v2_22  : float array = let Ti3_28  : int = 3 in
   
   let Td4_29  : float = 4.56 in
   EXTERN(create_float_array Ti3_28 Td4_29) in
   
   let Ti9_23  : int = let Td8_24  : float = let Td5_25  : float = 1000000. in
   
   let Td7_26  : float = let Ti6_27  : int = 2 in
   (inprod_17 v1_21 v2_22 Ti6_27) in
   (Td5_25 *. Td7_26) in
   EXTERN(truncate Td8_24) in
   EXTERN(print_int Ti9_23)

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

let inprod_17  : (float array, float array, int) -> floatv1_18 : float array v2_19 : float array i_20 : int = 
   let Ti10_32  : int = 0 in
   
   if Ti10_32 <= i_20 
   then 
      let Td11_37  : float = v1_18.(i_20) in
      
      let Td12_38  : float = v2_19.(i_20) in
      
      let Td13_33  : float = (Td11_37 *. Td12_38) in
      
      let Ti14_36  : int = 1 in
      
      let Ti15_35  : int = (i_20 - Ti14_36) in
      
      let Td16_34  : float = (inprod_17 v1_18 v2_19 Ti15_35) in
      (Td13_33 +. Td16_34)
   else 0.
in 
   let Ti1_30  : int = 3 in
   
   let Td2_31  : float = 1.23 in
   
   let v1_21  : float array = EXTERN(create_float_array Ti1_30 Td2_31) in
   
   let Ti3_28  : int = 3 in
   
   let Td4_29  : float = 4.56 in
   
   let v2_22  : float array = EXTERN(create_float_array Ti3_28 Td4_29) in
   
   let Td5_25  : float = 1000000. in
   
   let Ti6_27  : int = 2 in
   
   let Td7_26  : float = (inprod_17 v1_21 v2_22 Ti6_27) in
   
   let Td8_24  : float = (Td5_25 *. Td7_26) in
   
   let Ti9_23  : int = EXTERN(truncate Td8_24) in
   EXTERN(print_int Ti9_23)

===================== closure output ===============================
let LABEL(inprod_17) [] v1_18 : float array, v2_19 : float array, i_20 : int = 
   let Ti10_32  : int = 0 in
   
   if Ti10_32 <= i_20 
   then 
      let Td11_37  : float = v1_18.(i_20) in
      
      let Td12_38  : float = v2_19.(i_20) in
      
      let Td13_33  : float = (Td11_37 *. Td12_38) in
      
      let Ti14_36  : int = 1 in
      
      let Ti15_35  : int = (i_20 - Ti14_36) in
      
      let Td16_34  : float = APPLY_DIRECT(LABEL(inprod_17) v1_18 v2_19 Ti15_35) in
      (Td13_33 +. Td16_34)
   else 0.
in

let Ti1_30  : int = 3 in

let Td2_31  : float = 1.23 in

let v1_21  : float array = APPLY_DIRECT(LABEL(min_caml_create_float_array) Ti1_30 Td2_31) in

let Ti3_28  : int = 3 in

let Td4_29  : float = 4.56 in

let v2_22  : float array = APPLY_DIRECT(LABEL(min_caml_create_float_array) Ti3_28 Td4_29) in

let Td5_25  : float = 1000000. in

let Ti6_27  : int = 2 in

let Td7_26  : float = APPLY_DIRECT(LABEL(inprod_17) v1_21 v2_22 Ti6_27) in

let Td8_24  : float = (Td5_25 *. Td7_26) in

let Ti9_23  : int = APPLY_DIRECT(LABEL(min_caml_truncate) Td8_24) in
APPLY_DIRECT(LABEL(min_caml_print_int) Ti9_23)

===================== virtual  output ===============================
==== Data Segment =======
l_48:	! 1000000.000000
	.long	0x0
	.long	0x412e8480
l_46:	! 4.560000
	.long	0xa3d70a3d
	.long	0x40123d70
l_44:	! 1.230000
	.long	0x7ae147ae
	.long	0x3ff3ae14
l_40:	! 0.000000
	.long	0x0
	.long	0x0
==== Function Declarations =======

LABEL(inprod_17) (arg=(v1_18, v2_19, i_20), farg=())

LET(Ti10_32, set(0), 
   ANSWER(
      IfLE(Ti10_32, i_20, 
         LET(o_42, sub(i_20, 3), 
            LET(Td11_37, LdDF(v1_18, o_42), 
               LET(o_43, sub(i_20, 3), 
                  LET(Td12_38, LdDF(v2_19, o_43), 
                     LET(Td13_33, fmul(Td11_37, Td12_38), 
                        LET(Ti14_36, set(1), 
                           LET(Ti15_35, sub(i_20, Ti14_36), 
                              LET(Td16_34, CallDirect(LABEL(inprod_17), args=(v1_18, v2_19, Ti15_35), farg=()), 
                                 ANSWER(fadd(Td13_33, Td16_34)))))))))), 
         LET(l_41, set(LABEL(l_40)), 
            ANSWER(LdDF(l_41, 0))))))
==== Expression =======

LET(Ti1_30, set(3), 
   LET(l_45, set(LABEL(l_44)), 
      LET(Td2_31, LdDF(l_45, 0), 
         LET(v1_21, CallDirect(LABEL(min_caml_create_float_array), args=(Ti1_30), farg=(Td2_31)), 
            LET(Ti3_28, set(3), 
               LET(l_47, set(LABEL(l_46)), 
                  LET(Td4_29, LdDF(l_47, 0), 
                     LET(v2_22, CallDirect(LABEL(min_caml_create_float_array), args=(Ti3_28), farg=(Td4_29)), 
                        LET(l_49, set(LABEL(l_48)), 
                           LET(Td5_25, LdDF(l_49, 0), 
                              LET(Ti6_27, set(2), 
                                 LET(Td7_26, CallDirect(LABEL(inprod_17), args=(v1_21, v2_22, Ti6_27), farg=()), 
                                    LET(Td8_24, fmul(Td5_25, Td7_26), 
                                       LET(Ti9_23, CallDirect(LABEL(min_caml_truncate), args=(), farg=(Td8_24)), 
                                          ANSWER(CallDirect(LABEL(min_caml_print_int), args=(Ti9_23), farg=()))))))))))))))))


=====================  simm13  output ===============================
==== Data Segment =======
l_48:	! 1000000.000000
	.long	0x0
	.long	0x412e8480
l_46:	! 4.560000
	.long	0xa3d70a3d
	.long	0x40123d70
l_44:	! 1.230000
	.long	0x7ae147ae
	.long	0x3ff3ae14
l_40:	! 0.000000
	.long	0x0
	.long	0x0
==== Function Declarations =======

LABEL(inprod_17) (arg=(v1_18, v2_19, i_20), farg=())

ANSWER(
   IfGE(i_20, 0, 
      LET(o_42, sub(i_20, 3), 
         LET(Td11_37, LdDF(v1_18, o_42), 
            LET(o_43, sub(i_20, 3), 
               LET(Td12_38, LdDF(v2_19, o_43), 
                  LET(Td13_33, fmul(Td11_37, Td12_38), 
                     LET(Ti15_35, sub(i_20, 1), 
                        LET(Td16_34, CallDirect(LABEL(inprod_17), args=(v1_18, v2_19, Ti15_35), farg=()), 
                           ANSWER(fadd(Td13_33, Td16_34))))))))), 
      LET(l_41, set(LABEL(l_40)), 
         ANSWER(LdDF(l_41, 0)))))
==== Expression =======

LET(Ti1_30, set(3), 
   LET(l_45, set(LABEL(l_44)), 
      LET(Td2_31, LdDF(l_45, 0), 
         LET(v1_21, CallDirect(LABEL(min_caml_create_float_array), args=(Ti1_30), farg=(Td2_31)), 
            LET(Ti3_28, set(3), 
               LET(l_47, set(LABEL(l_46)), 
                  LET(Td4_29, LdDF(l_47, 0), 
                     LET(v2_22, CallDirect(LABEL(min_caml_create_float_array), args=(Ti3_28), farg=(Td4_29)), 
                        LET(l_49, set(LABEL(l_48)), 
                           LET(Td5_25, LdDF(l_49, 0), 
                              LET(Ti6_27, set(2), 
                                 LET(Td7_26, CallDirect(LABEL(inprod_17), args=(v1_21, v2_22, Ti6_27), farg=()), 
                                    LET(Td8_24, fmul(Td5_25, Td7_26), 
                                       LET(Ti9_23, CallDirect(LABEL(min_caml_truncate), args=(), farg=(Td8_24)), 
                                          ANSWER(CallDirect(LABEL(min_caml_print_int), args=(Ti9_23), farg=()))))))))))))))))


===================== RegAlloc output ===============================
==== Data Segment =======
l_48:	! 1000000.000000
	.long	0x0
	.long	0x412e8480
l_46:	! 4.560000
	.long	0xa3d70a3d
	.long	0x40123d70
l_44:	! 1.230000
	.long	0x7ae147ae
	.long	0x3ff3ae14
l_40:	! 0.000000
	.long	0x0
	.long	0x0
==== Function Declarations =======

LABEL(inprod_17) (arg=(%i2, %i3, %i4), farg=())

ANSWER(
   IfGE(%i4, 0, 
      LET(%i5, sub(%i4, 3), 
         LET(%f0, LdDF(%i2, %i5), 
            LET(%i5, sub(%i4, 3), 
               LET(%f2, LdDF(%i3, %i5), 
                  LET(%f0, fmul(%f0, %f2), 
                     LET(%g0, save(%f0, Td13_33), 
                        LET(%i4, sub(%i4, 1), 
                           LET(%f0, CallDirect(LABEL(inprod_17), args=(%i2, %i3, %i4), farg=()), 
                              LET(%f0, fmovd(%f0), 
                                 LET(%f2, restore(Td13_33), 
                                    ANSWER(fadd(%f2, %f0)))))))))))), 
      LET(%i2, set(LABEL(l_40)), 
         ANSWER(LdDF(%i2, 0)))))
==== Expression =======

LET(%i2, set(3), 
   LET(%i3, set(LABEL(l_44)), 
      LET(%f0, LdDF(%i3, 0), 
         LET(%i2, CallDirect(LABEL(min_caml_create_float_array), args=(%i2), farg=(%f0)), 
            LET(%g0, save(%i2, v1_21), 
               LET(%i2, set(3), 
                  LET(%i3, set(LABEL(l_46)), 
                     LET(%f0, LdDF(%i3, 0), 
                        LET(%i2, CallDirect(LABEL(min_caml_create_float_array), args=(%i2), farg=(%f0)), 
                           LET(%i3, mov(%i2), 
                              LET(%i2, set(LABEL(l_48)), 
                                 LET(%f0, LdDF(%i2, 0), 
                                    LET(%g0, save(%f0, Td5_25), 
                                       LET(%i4, set(2), 
                                          LET(%i2, restore(v1_21), 
                                             LET(%f0, CallDirect(LABEL(inprod_17), args=(%i2, %i3, %i4), farg=()), 
                                                LET(%f0, fmovd(%f0), 
                                                   LET(%f2, restore(Td5_25), 
                                                      LET(%f0, fmul(%f2, %f0), 
                                                         LET(%i2, CallDirect(LABEL(min_caml_truncate), args=(), farg=(%f0)), 
                                                            ANSWER(CallDirect(LABEL(min_caml_print_int), args=(%i2), farg=()))))))))))))))))))))))


===================== Emit output ===============================
.section	".rodata"
.align	8
l_48:	! 1000000.000000
	.long	0x0
	.long	0x412e8480
l_46:	! 4.560000
	.long	0xa3d70a3d
	.long	0x40123d70
l_44:	! 1.230000
	.long	0x7ae147ae
	.long	0x3ff3ae14
l_40:	! 0.000000
	.long	0x0
	.long	0x0
.section	".text"
inprod_17:
	cmp	%i4, 0
	bl	bge_else_57
	nop
	sll	%i4, 3, %i5
	ldd	[%i2 + %i5], %f0
	sll	%i4, 3, %i5
	ldd	[%i3 + %i5], %f2
	fmuld	%f0, %f2, %f0
	std	%f0, [%i0 + 0]
	sub	%i4, 1, %i4
	st	%o7, [%i0 + 12]
	call	inprod_17
	add	%i0, 16, %i0	! delay slot
	sub	%i0, 16, %i0
	ld	[%i0 + 12], %o7
	ldd	[%i0 + 0], %f2
	faddd	%f2, %f0, %f0
	retl
	nop
bge_else_57:
	set	l_40, %i2
	ldd	[%i2 + 0], %f0
	retl
	nop
.global	min_caml_start
min_caml_start:
	save	%sp, -112, %sp
	set	3, %i2
	set	l_44, %i3
	ldd	[%i3 + 0], %f0
	st	%o7, [%i0 + 4]
	call	min_caml_create_float_array
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	st	%i2, [%i0 + 0]
	set	3, %i2
	set	l_46, %i3
	ldd	[%i3 + 0], %f0
	st	%o7, [%i0 + 4]
	call	min_caml_create_float_array
	add	%i0, 8, %i0	! delay slot
	sub	%i0, 8, %i0
	ld	[%i0 + 4], %o7
	mov	%i2, %i3
	set	l_48, %i2
	ldd	[%i2 + 0], %f0
	std	%f0, [%i0 + 8]
	set	2, %i4
	ld	[%i0 + 0], %i2
	st	%o7, [%i0 + 20]
	call	inprod_17
	add	%i0, 24, %i0	! delay slot
	sub	%i0, 24, %i0
	ld	[%i0 + 20], %o7
	ldd	[%i0 + 8], %f2
	fmuld	%f2, %f0, %f0
	st	%o7, [%i0 + 20]
	call	min_caml_truncate
	add	%i0, 24, %i0	! delay slot
	sub	%i0, 24, %i0
	ld	[%i0 + 20], %o7
	st	%o7, [%i0 + 20]
	call	min_caml_print_int
	add	%i0, 24, %i0	! delay slot
	sub	%i0, 24, %i0
	ld	[%i0 + 20], %o7
	ret
	restore
