// File: /workspace/github_cpp_makefile_star2_O2/martinda3[P]Compiler/src/JVM/JVMgenUtils.cpp
// Function: toyc::JVMgenUtils::gen_RELOP(toyc::TCtoken, toyc::JVMtargetCode*)
void JVMgenUtils::gen_RELOP(TCtoken tok, JVMtargetCode *tc) {
    label *l0 = new label(), *l1 = new label();
    if (tok.getLexeme()=="==")      tc->add(new IF_ICMPNE(l0));
    else if (tok.getLexeme()=="<>") tc->add(new IF_ICMPEQ(l0));
    else if (tok.getLexeme()=="<")  tc->add(new IF_ICMPGE(l0));
    else if (tok.getLexeme()=="<=") tc->add(new IF_ICMPGT(l0));
    else if (tok.getLexeme()==">")  tc->add(new IF_ICMPLE(l0));
    else if (tok.getLexeme()==">=") tc->add(new IF_ICMPLT(l0));
    else { // shouldn't happen
      std::cerr << "Error: gen_RELOP: internal error" << std::endl;
      exit(EXIT_FAILURE);
    }
    tc->add(new ICONST_1());
    tc->add(new GOTO(l1));
    tc->add(new codeLabel(l0->toString()+""));
    tc->add(new ICONST_0());
    tc->add(new codeLabel(l1->toString()+""));
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r12
pushq $0x30
popq %rdi
callq 0x8250
movq %rax, %r15
movq %rax, %rdi
callq 0x143ac
pushq $0x30
popq %rdi
callq 0x8250
movq %rax, %r14
movq %rax, %rdi
callq 0x143ac
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x119f4
leaq 0x70cd(%rip), %rsi      # 0x1e68c
movq %r13, %rdi
callq 0xd821
movl %eax, %ebp
movq %r13, %rdi
callq 0x8478
testb %bpl, %bpl
je 0x175f1
pushq $0x18
popq %rdi
callq 0x8250
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x14d1c
jmp 0x1775a
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x119f4
leaq 0x7087(%rip), %rsi      # 0x1e68f
movq %r13, %rdi
callq 0xd821
movl %eax, %ebp
movq %r13, %rdi
callq 0x8478
testb %bpl, %bpl
je 0x1763a
pushq $0x18
popq %rdi
callq 0x8250
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x15ae8
jmp 0x1775a
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x119f4
leaq 0x7041(%rip), %rsi      # 0x1e692
movq %r13, %rdi
callq 0xd821
movl %eax, %ebp
movq %r13, %rdi
callq 0x8478
testb %bpl, %bpl
je 0x17683
pushq $0x18
popq %rdi
callq 0x8250
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x14de8
jmp 0x1775a
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x119f4
leaq 0x6ffa(%rip), %rsi      # 0x1e694
movq %r13, %rdi
callq 0xd821
movl %eax, %ebp
movq %r13, %rdi
callq 0x8478
testb %bpl, %bpl
je 0x176cc
pushq $0x18
popq %rdi
callq 0x8250
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x14c50
jmp 0x1775a
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x119f4
leaq 0x6fad(%rip), %rsi      # 0x1e690
movq %r13, %rdi
callq 0xd821
movl %eax, %ebp
movq %r13, %rdi
callq 0x8478
testb %bpl, %bpl
je 0x17712
pushq $0x18
popq %rdi
callq 0x8250
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x14a28
jmp 0x1775a
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x119f4
leaq 0x6f6e(%rip), %rsi      # 0x1e697
movq %r13, %rdi
callq 0xd821
movl %eax, %ebp
movq %r13, %rdi
callq 0x8478
testb %bpl, %bpl
je 0x1789f
pushq $0x18
popq %rdi
callq 0x8250
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x1598c
addq $0x8, %r12
movq (%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *(%rax)
pushq $0x10
popq %rdi
callq 0x8250
movq %rax, %r12
movq %rax, %rdi
callq 0x15a10
addq $0x8, %r12
movq (%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *(%rax)
pushq $0x18
popq %rdi
callq 0x8250
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x155b4
addq $0x8, %r12
movq (%rbx), %rax
movq %rbx, %rdi
movq %r12, %rsi
callq *(%rax)
pushq $0x30
popq %rdi
callq 0x8250
movq %rax, %r12
movq (%r15), %rax
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq *(%rax)
leaq 0x6d8b(%rip), %rdx      # 0x1e55a
leaq 0x48(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xa06b
movb $0x1, %bpl
leaq 0x48(%rsp), %rsi
movq %r12, %rdi
callq 0x14524
movq (%rbx), %rax
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r12, %rsi
callq *(%rax)
leaq 0x48(%rsp), %rdi
callq 0x8478
leaq 0x8(%rsp), %rdi
callq 0x8478
pushq $0x10
popq %rdi
callq 0x8250
movq %rax, %r15
movq %rax, %rdi
callq 0x1527c
addq $0x8, %r15
movq (%rbx), %rax
movq %rbx, %rdi
movq %r15, %rsi
callq *(%rax)
pushq $0x30
popq %rdi
callq 0x8250
movq %rax, %r15
movq (%r14), %rax
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq *(%rax)
leaq 0x6d0a(%rip), %rdx      # 0x1e55a
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xa06b
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
callq 0x14524
movq (%rbx), %rax
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
callq *(%rax)
leaq 0x28(%rsp), %rdi
callq 0x8478
leaq 0x8(%rsp), %rdi
callq 0x8478
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1574a(%rip), %rdi     # 0x2cff0
leaq 0x6ded(%rip), %rsi      # 0x1e69a
callq 0x8240
movq %rax, %rdi
callq 0x8130
pushq $0x1
popq %rdi
callq 0x82c0
jmp 0x178ec
jmp 0x178ec
jmp 0x178ec
jmp 0x178ec
jmp 0x178ec
jmp 0x178ec
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x17917
jmp 0x17905
movq %rax, %rbx
pushq $0x10
jmp 0x17928
movq %rax, %rbx
movb $0x1, %bpl
jmp 0x1793b
movq %rax, %rbx
jmp 0x1794a
movq %rax, %rbx
pushq $0x18
jmp 0x1794c
movq %rax, %rbx
pushq $0x10
jmp 0x1794c
movq %rax, %rbx
pushq $0x30
popq %rsi
movq %r14, %rdi
jmp 0x17950
movq %rax, %rbx
jmp 0x17926
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x8478
leaq 0x8(%rsp), %rdi
callq 0x8478
testb %bpl, %bpl
je 0x17955
pushq $0x30
popq %rsi
movq %r15, %rdi
jmp 0x17950
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x8478
leaq 0x8(%rsp), %rdi
callq 0x8478
testb %bpl, %bpl
je 0x17955
pushq $0x30
popq %rsi
movq %r12, %rdi
callq 0x8260
movq %rbx, %rdi
callq 0x8400
nop