;==============================================================
; Intel Asm
;==============================================================
         .486
         .model flat, stdcall
         option casemap :none
         include \masm32\include\windows.inc
         include \masm32\include\masm32.inc
         include \masm32\include\kernel32.inc
         include \masm32\macros\macros.asm

         includelib \masm32\lib\masm32.lib
         includelib \masm32\lib\kernel32.lib

;==============================================================
         .data
Txt db ?, 0
float_constant0      DQ   6.
float_constant8      DQ   5.
float_constant16      DQ   4.
float_constant24      DQ   3.
float_constant32      DQ   2.
float_constant40      DQ   1.

;==============================================================
; Entry point:
         .code
start:
         FINIT
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  68
         ; Let Td1_37 = 
         ; Double 1.
         FLD   qword ptr [float_constant40]
         FSTP  qword ptr [EBP-8]
         ; Let Td2_38 = 
         ; Double 2.
         FLD   qword ptr [float_constant32]
         FSTP  qword ptr [EBP-16]
         ; Let Td3_39 = 
         ; Double 3.
         FLD   qword ptr [float_constant24]
         FSTP  qword ptr [EBP-24]
         ; Let Tt4_32 = 
         ; Tuple
         PUSH  28
         CALL  min_caml_malloc
         ADD   ESP,  4
         MOV   EDI,  EAX
         FLD   qword ptr [EBP-8]
         FSTP  qword ptr [EDI + 0]
         FLD   qword ptr [EBP-16]
         FSTP  qword ptr [EDI + 8]
         FLD   qword ptr [EBP-24]
         FSTP  qword ptr [EDI + 16]
         MOV   [EBP-28],  EAX
         ; Let Td5_34 = 
         ; Double 4.
         FLD   qword ptr [float_constant16]
         FSTP  qword ptr [EBP-36]
         ; Let Td6_35 = 
         ; Double 5.
         FLD   qword ptr [float_constant8]
         FSTP  qword ptr [EBP-44]
         ; Let Td7_36 = 
         ; Double 6.
         FLD   qword ptr [float_constant0]
         FSTP  qword ptr [EBP-52]
         ; Let Tt8_33 = 
         ; Tuple
         PUSH  28
         CALL  min_caml_malloc
         ADD   ESP,  4
         MOV   EDI,  EAX
         FLD   qword ptr [EBP-36]
         FSTP  qword ptr [EDI + 0]
         FLD   qword ptr [EBP-44]
         FSTP  qword ptr [EDI + 8]
         FLD   qword ptr [EBP-52]
         FSTP  qword ptr [EDI + 16]
         MOV   [EBP-56],  EAX
         ; Let Td9_31 = 
         ; Apply direct inprod_27
         PUSH  dword ptr [EBP-56]
         PUSH  dword ptr [EBP-28]
         CALL  inprod_27
         ADD   ESP,  8
         FSTP  qword ptr [EBP-64]
         ; Let Ti10_30 = 
         ; Apply direct min_caml_int_of_float
         PUSH  dword ptr [EBP-60]
         PUSH  dword ptr [EBP-64]
         CALL  min_caml_int_of_float
         ADD   ESP,  8
         MOV   [EBP-68],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-68]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function getx_21:

getx_21 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  24
         ; Let tuple = v_22
         MOV   EDI,  [EBP+8]
         FLD   qword ptr [EDI+0]
         FSTP  qword ptr [EBP-8]
         FLD   qword ptr [EDI+8]
         FSTP  qword ptr [EBP-16]
         FLD   qword ptr [EDI+16]
         FSTP  qword ptr [EBP-24]
         ; Var x_56
         FLD   qword ptr [EBP-8]
         MOV   ESP,  EBP
         POP   EBP
         RET
getx_21 endp

;==============================================================
; Function gety_23:

gety_23 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  24
         ; Let tuple = v_24
         MOV   EDI,  [EBP+8]
         FLD   qword ptr [EDI+0]
         FSTP  qword ptr [EBP-8]
         FLD   qword ptr [EDI+8]
         FSTP  qword ptr [EBP-16]
         FLD   qword ptr [EDI+16]
         FSTP  qword ptr [EBP-24]
         ; Var y_54
         FLD   qword ptr [EBP-16]
         MOV   ESP,  EBP
         POP   EBP
         RET
gety_23 endp

;==============================================================
; Function getz_25:

getz_25 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  24
         ; Let tuple = v_26
         MOV   EDI,  [EBP+8]
         FLD   qword ptr [EDI+0]
         FSTP  qword ptr [EBP-8]
         FLD   qword ptr [EDI+8]
         FSTP  qword ptr [EBP-16]
         FLD   qword ptr [EDI+16]
         FSTP  qword ptr [EBP-24]
         ; Var z_52
         FLD   qword ptr [EBP-24]
         MOV   ESP,  EBP
         POP   EBP
         RET
getz_25 endp

;==============================================================
; Function inprod_27:

inprod_27 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  80
         ; Let Td11_48 = 
         ; Apply direct getx_21
         PUSH  dword ptr [EBP+8]
         CALL  getx_21
         ADD   ESP,  4
         FSTP  qword ptr [EBP-8]
         ; Let Td12_49 = 
         ; Apply direct getx_21
         PUSH  dword ptr [EBP+12]
         CALL  getx_21
         ADD   ESP,  4
         FSTP  qword ptr [EBP-16]
         ; Let Td13_44 = 
         ; FMul Td11_48 * Td12_49
         FLD   qword ptr [EBP-8]
         FMUL  qword ptr [EBP-16]
         FSTP  qword ptr [EBP-24]
         ; Let Td14_46 = 
         ; Apply direct gety_23
         PUSH  dword ptr [EBP+8]
         CALL  gety_23
         ADD   ESP,  4
         FSTP  qword ptr [EBP-32]
         ; Let Td15_47 = 
         ; Apply direct gety_23
         PUSH  dword ptr [EBP+12]
         CALL  gety_23
         ADD   ESP,  4
         FSTP  qword ptr [EBP-40]
         ; Let Td16_45 = 
         ; FMul Td14_46 * Td15_47
         FLD   qword ptr [EBP-32]
         FMUL  qword ptr [EBP-40]
         FSTP  qword ptr [EBP-48]
         ; Let Td17_40 = 
         ; FAdd Td13_44 + Td16_45
         FLD   qword ptr [EBP-24]
         FADD  qword ptr [EBP-48]
         FSTP  qword ptr [EBP-56]
         ; Let Td18_42 = 
         ; Apply direct getz_25
         PUSH  dword ptr [EBP+8]
         CALL  getz_25
         ADD   ESP,  4
         FSTP  qword ptr [EBP-64]
         ; Let Td19_43 = 
         ; Apply direct getz_25
         PUSH  dword ptr [EBP+12]
         CALL  getz_25
         ADD   ESP,  4
         FSTP  qword ptr [EBP-72]
         ; Let Td20_41 = 
         ; FMul Td18_42 * Td19_43
         FLD   qword ptr [EBP-64]
         FMUL  qword ptr [EBP-72]
         FSTP  qword ptr [EBP-80]
         ; FAdd Td17_40 + Td20_41
         FLD   qword ptr [EBP-56]
         FADD  qword ptr [EBP-80]
         MOV   ESP,  EBP
         POP   EBP
         RET
inprod_27 endp

;==============================================================
; need to copy min_caml_intel.asm from min-caml directory to output directoty
include min_caml_intel.asm

END start

;==============================================================

