// File: martinda3[P]Compiler/src/JVM/JVMgenerateStatement.cpp
// Function: toyc::JVMgenerateStatement::IfStatement(toyc::ASifState*, toyc::JVMtargetCode*)
void JVMgenerateStatement::IfStatement(ASifState *ThisIf,JVMtargetCode *tc) {
        ASexpr *expr_set; ASstatement *statement_set; ASblockState *FunctionBlock;
        if (!ThisIf->isBinary()){
            expr_set = dynamic_cast<ASexpr*>(ThisIf->getOp1());
            JVMgenerateExpression::genExpression(expr_set, tc);
            statement_set = dynamic_cast<ASstatement*>(ThisIf->getOp2());
            FunctionBlock = dynamic_cast<ASblockState*>(statement_set);
            JVMgenerateStatement::BlockStatement(FunctionBlock, tc);
        } else {
            expr_set = dynamic_cast<ASexpr*>(ThisIf->getOp1());
            JVMgenerateExpression::genExpression(expr_set, tc);
            statement_set = dynamic_cast<ASstatement*>(ThisIf->getOp2());
            FunctionBlock = dynamic_cast<ASblockState*>(statement_set);
            JVMgenerateStatement::BlockStatement(FunctionBlock, tc);
            statement_set = dynamic_cast<ASstatement*>(ThisIf->getOp3());
            FunctionBlock = dynamic_cast<ASblockState*>(statement_set);
            JVMgenerateStatement::BlockStatement(FunctionBlock, tc);
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd390
testb $0x1, %al
jne 0x27063
movq -0x8(%rbp), %rdi
callq 0xd3b0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x26fe8
movq -0x30(%rbp), %rdi
leaq 0x1bd66(%rip), %rsi     # 0x42d38
leaq 0x1dca7(%rip), %rdx     # 0x44c80
xorl %eax, %eax
movl %eax, %ecx
callq 0x93e0
movq %rax, -0x38(%rbp)
jmp 0x26ff0
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0x26ff0
movq -0x38(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2a000
movq -0x8(%rbp), %rdi
callq 0xd3d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
je 0x27041
movq -0x40(%rbp), %rdi
leaq 0x1bc1d(%rip), %rsi     # 0x42c48
leaq 0x1dc7e(%rip), %rdx     # 0x44cb0
xorl %eax, %eax
movl %eax, %ecx
callq 0x93e0
movq %rax, -0x48(%rbp)
jmp 0x27049
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0x27049
movq -0x48(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x26730
jmp 0x27166
movq -0x8(%rbp), %rdi
callq 0xd3b0
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x27097
movq -0x50(%rbp), %rdi
leaq 0x1bcb7(%rip), %rsi     # 0x42d38
leaq 0x1dbf8(%rip), %rdx     # 0x44c80
xorl %eax, %eax
movl %eax, %ecx
callq 0x93e0
movq %rax, -0x58(%rbp)
jmp 0x2709f
xorl %eax, %eax
movq %rax, -0x58(%rbp)
jmp 0x2709f
movq -0x58(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2a000
movq -0x8(%rbp), %rdi
callq 0xd3d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, %rax
je 0x270f0
movq -0x60(%rbp), %rdi
leaq 0x1bb6e(%rip), %rsi     # 0x42c48
leaq 0x1dbcf(%rip), %rdx     # 0x44cb0
xorl %eax, %eax
movl %eax, %ecx
callq 0x93e0
movq %rax, -0x68(%rbp)
jmp 0x270f8
xorl %eax, %eax
movq %rax, -0x68(%rbp)
jmp 0x270f8
movq -0x68(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x26730
movq -0x8(%rbp), %rdi
callq 0xd3f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, %rax
je 0x27149
movq -0x70(%rbp), %rdi
leaq 0x1bb15(%rip), %rsi     # 0x42c48
leaq 0x1db76(%rip), %rdx     # 0x44cb0
xorl %eax, %eax
movl %eax, %ecx
callq 0x93e0
movq %rax, -0x78(%rbp)
jmp 0x27151
xorl %eax, %eax
movq %rax, -0x78(%rbp)
jmp 0x27151
movq -0x78(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x26730
addq $0x80, %rsp
popq %rbp
retq
nop