// File: /workspace/github_cpp_makefile_star2_O3/devaigergely81[P]flex-bison-example/code_generator_implementation.cc
// Function: operator_code(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string operator_code(std::string op) {
    std::stringstream ss;
    if(op == "+") {
        ss << "add eax,ecx" << std::endl;
    } else if(op == "-") {
        ss << "sub eax,ecx" << std::endl;
    } else if(op == "*") {
        ss << "xor edx,edx" << std::endl;
        ss << "mul ecx" << std::endl;
    } else if(op == "/") {
        ss << "xor edx,edx" << std::endl;
        ss << "div ecx" << std::endl;   
    } else if(op == "%") {
        ss << "xor edx,edx" << std::endl;
        ss << "div ecx" << std::endl;
        ss << "mov eax,edx" << std::endl;
    } else if(op == "<") {
        ss << "cmp eax,ecx" << std::endl;
        ss << "mov al,0" << std::endl;
        ss << "mov cx,1" << std::endl;
        ss << "cmovb ax,cx" << std::endl;
    } else if(op == "<=") {
        ss << "cmp eax,ecx" << std::endl;
        ss << "mov al,0" << std::endl;
        ss << "mov cx,1" << std::endl;
        ss << "cmovbe ax,cx" << std::endl;
    } else if(op == ">") {
        ss << "cmp eax,ecx" << std::endl;
        ss << "mov al,0" << std::endl;
        ss << "mov cx,1" << std::endl;
        ss << "cmova ax,cx" << std::endl;
    } else if(op == ">=") {
        ss << "cmp eax,ecx" << std::endl;
        ss << "mov al,0" << std::endl;
        ss << "mov cx,1" << std::endl;
        ss << "cmovae ax,cx" << std::endl;
    } else if(op == "and") {
        ss << "cmp al,1" << std::endl;
        ss << "cmove ax,cx" << std::endl;
    } else if(op == "or") {
        ss << "cmp al,0" << std::endl;
        ss << "cmove ax,cx" << std::endl;
    } else {
        error(-1, std::string("Bug: Unsupported binary operator: ") + op);
    }
    return ss.str();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x1e0(%rbp), %rdi
callq 0x3190
leaq 0x3a18(%rip), %rsi      # 0xce01
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x9553
leaq 0x3a03(%rip), %rsi      # 0xce03
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x958b
leaq 0x39ee(%rip), %rsi      # 0xce05
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x95c3
leaq 0x39d9(%rip), %rsi      # 0xce07
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x963a
leaq 0x39c4(%rip), %rsi      # 0xce09
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x96b1
leaq 0x39af(%rip), %rsi      # 0xce0b
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x97b4
leaq 0x399c(%rip), %rsi      # 0xce0f
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x9828
leaq 0x3983(%rip), %rsi      # 0xce0d
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x989c
leaq 0x3971(%rip), %rsi      # 0xce12
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x9910
leaq 0x395d(%rip), %rsi      # 0xce15
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x9981
leaq 0x3958(%rip), %rsi      # 0xce27
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x99ba
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x3cb0(%rip), %rsi      # 0xd19e
leaq 0x3ccb(%rip), %rdx      # 0xd1c0
leaq -0x38(%rbp), %rdi
callq 0x51de
leaq -0x58(%rbp), %rdi
leaq -0x38(%rbp), %rsi
movq %r14, %rdx
callq 0xb0a1
leaq -0x58(%rbp), %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x7274
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9535
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x9775
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0x9775
leaq -0x1d0(%rbp), %r14
leaq 0x3b8f(%rip), %rsi      # 0xd0f0
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
jmp 0x9762
leaq -0x1d0(%rbp), %r14
leaq 0x3b63(%rip), %rsi      # 0xd0fc
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
jmp 0x9762
leaq -0x1d0(%rbp), %r14
leaq 0x3b37(%rip), %rsi      # 0xd108
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
leaq 0x3b04(%rip), %rsi      # 0xd114
movl $0x7, %edx
movq %r14, %rdi
callq 0x3270
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
jmp 0x9762
leaq -0x1d0(%rbp), %r14
leaq 0x3ac0(%rip), %rsi      # 0xd108
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
leaq 0x3a95(%rip), %rsi      # 0xd11c
movl $0x7, %edx
movq %r14, %rdi
callq 0x3270
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
jmp 0x9762
leaq -0x1d0(%rbp), %r14
leaq 0x3a49(%rip), %rsi      # 0xd108
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
leaq 0x3a1e(%rip), %rsi      # 0xd11c
movl $0x7, %edx
movq %r14, %rdi
callq 0x3270
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
leaq 0x39e7(%rip), %rsi      # 0xd124
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq -0x1d0(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
leaq -0x1c8(%rbp), %rsi
movq %rbx, %rdi
callq 0x3320
movq 0x881d(%rip), %rsi      # 0x11fa8
leaq -0x1e0(%rbp), %rdi
callq 0x31b0
leaq -0x160(%rbp), %rdi
callq 0x30d0
movq %rbx, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x1d0(%rbp), %r14
leaq 0x396e(%rip), %rsi      # 0xd130
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x395e(%rip), %rsi      # 0xd13c
movl $0x8, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x394b(%rip), %rsi      # 0xd145
movl $0x8, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x3938(%rip), %rsi      # 0xd14e
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
jmp 0x99f1
leaq -0x1d0(%rbp), %r14
leaq 0x38fa(%rip), %rsi      # 0xd130
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x38ea(%rip), %rsi      # 0xd13c
movl $0x8, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x38d7(%rip), %rsi      # 0xd145
movl $0x8, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x38d0(%rip), %rsi      # 0xd15a
movl $0xc, %edx
movq %r14, %rdi
callq 0x3270
jmp 0x99f1
leaq -0x1d0(%rbp), %r14
leaq 0x3886(%rip), %rsi      # 0xd130
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x3876(%rip), %rsi      # 0xd13c
movl $0x8, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x3863(%rip), %rsi      # 0xd145
movl $0x8, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x3869(%rip), %rsi      # 0xd167
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
jmp 0x99f1
leaq -0x1d0(%rbp), %r14
leaq 0x3812(%rip), %rsi      # 0xd130
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x3802(%rip), %rsi      # 0xd13c
movl $0x8, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x37ef(%rip), %rsi      # 0xd145
movl $0x8, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x3801(%rip), %rsi      # 0xd173
movl $0xc, %edx
movq %r14, %rdi
callq 0x3270
jmp 0x99f1
leaq -0x1d0(%rbp), %r14
leaq 0x37f1(%rip), %rsi      # 0xd180
movl $0x8, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x37de(%rip), %rsi      # 0xd189
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
jmp 0x99f1
leaq -0x1d0(%rbp), %r14
leaq 0x37cd(%rip), %rsi      # 0xd195
movl $0x8, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
leaq 0x37a5(%rip), %rsi      # 0xd189
movl $0xb, %edx
movq %r14, %rdi
callq 0x3270
movq %r14, %rdi
callq 0x3130
jmp 0x9775
movq %rax, %rbx
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x9a1f
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0x9a1f
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x9a3b
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0x9a3b
jmp 0x9a38
movq %rax, %rbx
movq 0x8566(%rip), %rsi      # 0x11fa8
leaq -0x1e0(%rbp), %rdi
callq 0x31b0
leaq -0x160(%rbp), %rdi
callq 0x30d0
movq %rbx, %rdi
callq 0x3380