;==============================================================
; 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,  8
         ; Let Ti1_20 = 
         ; Integer 789
         MOV   EAX,  789
         MOV   [EBP-4],  EAX
         ; Let Ti2_19 = 
         ; Apply direct even_17
         PUSH  dword ptr [EBP-4]
         CALL  even_17
         ADD   ESP,  4
         MOV   [EBP-8],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-8]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function odd_21:

odd_21 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  24
         ; Let Ti9_29 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-4],  EAX
         ; If x_22 <= Ti9_29
         MOV   EAX,  [EBP+8]
         CMP   EAX,  [EBP-4]
         JG    else_35
         ; Let Ti10_32 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-8],  EAX
         ; If Ti10_32 <= x_22
         MOV   EAX,  [EBP-8]
         CMP   EAX,  [EBP+8]
         JG    else_36
         ; Integer 456
         MOV   EAX,  456
         MOV   ESP,  EBP
         POP   EBP
         RET
else_36:
         ; Let Ti11_34 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-12],  EAX
         ; Let Ti12_33 = 
         ; Add x_22 + Ti11_34
         MOV   EAX,  [EBP+8]
         ADD   EAX,  [EBP-12]
         MOV   [EBP-16],  EAX
         ; Apply direct even_17
         PUSH  dword ptr [EBP-16]
         CALL  even_17
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         RET
else_35:
         ; Let Ti13_31 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-20],  EAX
         ; Let Ti14_30 = 
         ; Sub x_22 - Ti13_31
         MOV   EAX,  [EBP+8]
         SUB   EAX,  [EBP-20]
         MOV   [EBP-24],  EAX
         ; Apply direct even_17
         PUSH  dword ptr [EBP-24]
         CALL  even_17
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         RET
odd_21 endp

;==============================================================
; Function even_17:

even_17 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  24
         ; Let Ti3_23 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-4],  EAX
         ; If x_18 <= Ti3_23
         MOV   EAX,  [EBP+8]
         CMP   EAX,  [EBP-4]
         JG    else_37
         ; Let Ti4_26 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-8],  EAX
         ; If Ti4_26 <= x_18
         MOV   EAX,  [EBP-8]
         CMP   EAX,  [EBP+8]
         JG    else_38
         ; Integer 123
         MOV   EAX,  123
         MOV   ESP,  EBP
         POP   EBP
         RET
else_38:
         ; Let Ti5_28 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-12],  EAX
         ; Let Ti6_27 = 
         ; Add x_18 + Ti5_28
         MOV   EAX,  [EBP+8]
         ADD   EAX,  [EBP-12]
         MOV   [EBP-16],  EAX
         ; Apply direct odd_21
         PUSH  dword ptr [EBP-16]
         CALL  odd_21
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         RET
else_37:
         ; Let Ti7_25 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-20],  EAX
         ; Let Ti8_24 = 
         ; Sub x_18 - Ti7_25
         MOV   EAX,  [EBP+8]
         SUB   EAX,  [EBP-20]
         MOV   [EBP-24],  EAX
         ; Apply direct odd_21
         PUSH  dword ptr [EBP-24]
         CALL  odd_21
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         RET
even_17 endp

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

END start

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

