;==============================================================
; 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

;==============================================================
; Entry point:
         .code
start:
         FINIT
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  12
         ; Let Ti1_8 = 
         ; Integer 7
         MOV   EAX,  7
         MOV   [EBP-4],  EAX
         ; Let Ti2_9 = 
         ; Integer 9
         MOV   EAX,  9
         MOV   [EBP-8],  EAX
         ; Let Ti3_7 = 
         ; Apply direct two_4
         PUSH  dword ptr [EBP-8]
         PUSH  dword ptr [EBP-4]
         CALL  two_4
         ADD   ESP,  8
         MOV   [EBP-12],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-12]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function offset_10:

offset_10 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  0
         ; Add z_11 + y_6
         MOV   EAX,  [EBP+8]
         ADD   EAX,  [ESI+4]
         MOV   ESP,  EBP
         POP   EBP
         RET
offset_10 endp

;==============================================================
; Function two_4:

two_4 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  4
         ; Make closure offset_10
         PUSH  8
         CALL  min_caml_malloc
         ADD   ESP,  4
         MOV   [EBP-4],  EAX
         MOV   EDI,  EAX
         MOV   [EDI],  offset_10
         MOV   EAX,  [EBP+12]
         MOV   [EDI+4],  EAX
         ; Apply closure offset_10
         MOV   ESI,  [EBP-4]
         MOV   EAX, [ESI]
         PUSH  dword ptr [EBP+8]
         CALL  EAX
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         RET
two_4 endp

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

END start

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

