// File: fondoger[P]C0-Compiler/src/grammar.cpp
// Function: pCondition()
static void pCondition()
{
    std::string left_val, right_val;
    DataType left_dtype, right_dtype;
    pExpression(left_val, left_dtype);
    if ( g_sym == EQL || g_sym == NEQ || g_sym == LSS ||
         g_sym == LEQ || g_sym == GTR || g_sym == GEQ) {
        std::string op = tokens[g_sym];
        readSymbol();
        pExpression(right_val, right_dtype);
        if (left_dtype != right_dtype) {
            error(ERR_COMPARE_TYPE_NOT_MATCH);
        }
        genMidCode(COMPARE, left_val, op, right_val);
    } else {
        // must be DT_INT
        if (left_dtype != DT_INT) {
            error(ERR_EXPECT_INT_TYPE_SINGLE_CONDITION);
        }
        genMidCode(COMPARE, left_val, NONE, NONE);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
leaq -0x20(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0x3450
leaq -0x40(%rbp), %rdi
callq 0x3450
movq -0xd0(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x1f630
jmp 0x1f3b6
leaq 0x2c2f3(%rip), %rax     # 0x4b6b0
cmpl $0x17, (%rax)
je 0x1f402
leaq 0x2c2e7(%rip), %rax     # 0x4b6b0
cmpl $0x18, (%rax)
je 0x1f402
leaq 0x2c2db(%rip), %rax     # 0x4b6b0
cmpl $0x19, (%rax)
je 0x1f402
leaq 0x2c2cf(%rip), %rax     # 0x4b6b0
cmpl $0x1a, (%rax)
je 0x1f402
leaq 0x2c2c3(%rip), %rax     # 0x4b6b0
cmpl $0x1b, (%rax)
je 0x1f402
leaq 0x2c2b7(%rip), %rax     # 0x4b6b0
cmpl $0x1c, (%rax)
jne 0x1f530
leaq 0x2c2a7(%rip), %rax     # 0x4b6b0
movl (%rax), %eax
shlq $0x5, %rax
leaq 0x26daa(%rip), %rsi     # 0x461c0
addq %rax, %rsi
leaq -0x78(%rbp), %rdi
callq 0x3140
jmp 0x1f424
callq 0x2e050
jmp 0x1f42b
leaq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x1f630
jmp 0x1f43a
movl -0x44(%rbp), %eax
cmpl -0x48(%rbp), %eax
je 0x1f4f0
leaq -0x99(%rbp), %rdi
movq %rdi, -0xd8(%rbp)
callq 0x3570
movq -0xd8(%rbp), %rdx
leaq 0x160a0(%rip), %rsi     # 0x35507
leaq -0x98(%rbp), %rdi
callq 0x3440
jmp 0x1f475
leaq -0x98(%rbp), %rdi
callq 0x18620
jmp 0x1f483
leaq -0x98(%rbp), %rdi
callq 0x35e8
leaq -0x99(%rbp), %rdi
callq 0x3370
jmp 0x1f4f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1f608
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1f522
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1f4e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x98(%rbp), %rdi
callq 0x35e8
leaq -0x99(%rbp), %rdi
callq 0x3370
jmp 0x1f522
movl $0x11, -0xa0(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x78(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x26340
jmp 0x1f514
leaq -0x78(%rbp), %rdi
callq 0x35e8
jmp 0x1f5ed
leaq -0x78(%rbp), %rdi
callq 0x35e8
jmp 0x1f608
cmpl $0x1, -0x44(%rbp)
je 0x1f5c5
leaq -0xc1(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x3570
movq -0xe0(%rbp), %rdx
leaq 0x15fc6(%rip), %rsi     # 0x35521
leaq -0xc0(%rbp), %rdi
callq 0x3440
jmp 0x1f569
leaq -0xc0(%rbp), %rdi
callq 0x18620
jmp 0x1f577
leaq -0xc0(%rbp), %rdi
callq 0x35e8
leaq -0xc1(%rbp), %rdi
callq 0x3370
jmp 0x1f5c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x1f5b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x35e8
leaq -0xc1(%rbp), %rdi
callq 0x3370
jmp 0x1f608
movl $0x11, -0xc8(%rbp)
leaq 0x27a2a(%rip), %rcx     # 0x47000
leaq -0xc8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movq %rcx, %rdx
callq 0x26340
jmp 0x1f5eb
jmp 0x1f5ed
leaq -0x40(%rbp), %rdi
callq 0x35e8
leaq -0x20(%rbp), %rdi
callq 0x35e8
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x40(%rbp), %rdi
callq 0x35e8
leaq -0x20(%rbp), %rdi
callq 0x35e8
movq -0x50(%rbp), %rdi
callq 0x3560
nopw %cs:(%rax,%rax)