// File: /workspace/github_c_makefile_star2_O1/masyagin1998[P]GCI/src/bytecode-generator/bytecode-generator.c
// Function: relational_expr_ast_bytecode_generate
static enum BYTECODE_GENERATOR_CODES relational_expr_ast_bytecode_generate(bytecode_generator_type_t bc_gen, const struct RELATIONAL_EXPR_AST*ast)
{
    enum BYTECODE_GENERATOR_CODES r = additive_expr_ast_bytecode_generate(bc_gen, ast->left);
    if (r != BYTECODE_GENERATOR_OK) {
        return r;
    }
    if (ast->right != NULL) {
        r = additive_expr_ast_bytecode_generate(bc_gen, ast->right);
        if (r != BYTECODE_GENERATOR_OK) {
            return r;
        }
        switch (ast->rel_op) {
        case AST_REL_OP_LT:
            PUSH_BACK(bc_gen->bc->op_codes, BC_OP_REL_LT);
            break;
        case AST_REL_OP_GT:
            PUSH_BACK(bc_gen->bc->op_codes, BC_OP_REL_GT);
            break;
        case AST_REL_OP_LE:
            PUSH_BACK(bc_gen->bc->op_codes, BC_OP_REL_LE);
            break;
        case AST_REL_OP_GE:
            PUSH_BACK(bc_gen->bc->op_codes, BC_OP_REL_GE);
            break;
        default:
            fprintf(stderr, "Invalid AST_REL_OP type: %d\n", ast->rel_op);
            exit(EXIT_FAILURE);            
            break;
        }
    }

    return BYTECODE_GENERATOR_OK;    
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
movq (%rsi), %rsi
callq 0xc80f
testl %eax, %eax
je 0xc5f6
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x10(%r15), %rsi
xorl %ebx, %ebx
testq %rsi, %rsi
je 0xc5e8
movq %r14, %rdi
callq 0xc80f
testl %eax, %eax
jne 0xc5e6
movl 0x8(%r15), %edi
cmpq $0x3, %rdi
ja 0xc805
leaq 0x3cae(%rip), %rax      # 0x102d0
movslq (%rax,%rdi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x8(%r14), %r12
addq $0x8, %r14
movq 0x10(%r12), %rsi
movl $0x10, %r15d
cmpq %rsi, 0x8(%r12)
jne 0xc7ee
testq %rsi, %rsi
je 0xc7b1
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r12)
movq (%r12), %rdi
shlq $0x4, %rsi
callq 0x1160
movq (%r14), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xc7ee
callq 0x3118
movq 0x8(%r14), %r12
addq $0x8, %r14
movq 0x10(%r12), %rsi
movl $0x12, %r15d
cmpq %rsi, 0x8(%r12)
jne 0xc7ee
testq %rsi, %rsi
je 0xc76f
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r12)
movq (%r12), %rdi
shlq $0x4, %rsi
callq 0x1160
movq (%r14), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xc7ee
callq 0x3046
movq 0x8(%r14), %r12
addq $0x8, %r14
movq 0x10(%r12), %rsi
movl $0x13, %r15d
cmpq %rsi, 0x8(%r12)
jne 0xc7ee
testq %rsi, %rsi
je 0xc790
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r12)
movq (%r12), %rdi
shlq $0x4, %rsi
callq 0x1160
movq (%r14), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xc7ee
callq 0x2fdd
movq 0x8(%r14), %r12
addq $0x8, %r14
movq 0x10(%r12), %rsi
movl $0x11, %r15d
cmpq %rsi, 0x8(%r12)
jne 0xc7ee
testq %rsi, %rsi
je 0xc7d2
leaq (%rsi,%rsi), %rax
movq %rax, 0x10(%r12)
movq (%r12), %rdi
shlq $0x4, %rsi
callq 0x1160
movq (%r14), %rdi
movq %rax, (%rdi)
testq %rax, %rax
jne 0xc7ee
callq 0x30af
movq $0x1, 0x10(%r12)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r12)
testq %rax, %rax
jne 0xc7ee
callq 0x307e
movq $0x1, 0x10(%r12)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r12)
testq %rax, %rax
jne 0xc7ee
callq 0x3015
movq $0x1, 0x10(%r12)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r12)
testq %rax, %rax
jne 0xc7ee
callq 0x3150
movq $0x1, 0x10(%r12)
movl $0x8, %edi
callq 0x1130
movq %rax, (%r12)
testq %rax, %rax
je 0xc80a
movq (%r14), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq %r15, (%rcx,%rdx,8)
incq 0x8(%rax)
jmp 0xc5e8
callq 0x3181
callq 0x30e7