// File: 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
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x190(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x30, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x188(%rbp)
callq 0x212a0
jmp 0x284d8
movq -0x188(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x30, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x198(%rbp)
callq 0x212a0
jmp 0x28501
movq -0x190(%rbp), %rsi
movq -0x198(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0x1be70
movq -0x1a8(%rbp), %rdi
leaq 0xc2e3(%rip), %rsi      # 0x34814
callq 0x13710
movb %al, -0x199(%rbp)
jmp 0x2853e
leaq -0x50(%rbp), %rdi
callq 0x9658
movb -0x199(%rbp), %al
testb $0x1, %al
jne 0x28556
jmp 0x28643
movq -0x10(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movl $0x18, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1b0(%rbp)
movq -0x18(%rbp), %rsi
callq 0x22800
jmp 0x28583
movq -0x1b0(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x1c0(%rbp)
je 0x285ab
movq -0x1b0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x1c0(%rbp)
movq -0x1b8(%rbp), %rdi
movq -0x1c0(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x28b59
movq -0x188(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x30, %esi
callq 0x9360
jmp 0x28efa
movq -0x198(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x30, %esi
callq 0x9360
jmp 0x28efa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x9658
jmp 0x28efa
movq -0x1b0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x28efa
movq -0x190(%rbp), %rsi
leaq -0x70(%rbp), %rdi
movq %rdi, -0x1d0(%rbp)
callq 0x1be70
movq -0x1d0(%rbp), %rdi
leaq 0xc1af(%rip), %rsi      # 0x34817
callq 0x13710
movb %al, -0x1c1(%rbp)
jmp 0x28675
leaq -0x70(%rbp), %rdi
callq 0x9658
movb -0x1c1(%rbp), %al
testb $0x1, %al
jne 0x2868d
jmp 0x28736
movq -0x10(%rbp), %rax
movq %rax, -0x1e0(%rbp)
movl $0x18, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x1d8(%rbp)
movq -0x18(%rbp), %rsi
callq 0x24a00
jmp 0x286ba
movq -0x1d8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x1e8(%rbp)
je 0x286e2
movq -0x1d8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x1e8(%rbp)
movq -0x1e0(%rbp), %rdi
movq -0x1e8(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x28b57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x9658
jmp 0x28efa
movq -0x1d8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x28efa
movq -0x190(%rbp), %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0x1f8(%rbp)
callq 0x1be70
movq -0x1f8(%rbp), %rdi
leaq 0xc0bc(%rip), %rsi      # 0x3481a
callq 0x13710
movb %al, -0x1e9(%rbp)
jmp 0x2876b
leaq -0x90(%rbp), %rdi
callq 0x9658
movb -0x1e9(%rbp), %al
testb $0x1, %al
jne 0x28786
jmp 0x28832
movq -0x10(%rbp), %rax
movq %rax, -0x208(%rbp)
movl $0x18, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x200(%rbp)
movq -0x18(%rbp), %rsi
callq 0x22a00
jmp 0x287b3
movq -0x200(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x210(%rbp)
je 0x287db
movq -0x200(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x210(%rbp)
movq -0x208(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x28b55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x9658
jmp 0x28efa
movq -0x200(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x28efa
movq -0x190(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x1be70
movq -0x220(%rbp), %rdi
leaq 0xbfc2(%rip), %rsi      # 0x3481c
callq 0x13710
movb %al, -0x211(%rbp)
jmp 0x28867
leaq -0xb0(%rbp), %rdi
callq 0x9658
movb -0x211(%rbp), %al
testb $0x1, %al
jne 0x28882
jmp 0x2892e
movq -0x10(%rbp), %rax
movq %rax, -0x230(%rbp)
movl $0x18, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x228(%rbp)
movq -0x18(%rbp), %rsi
callq 0x22600
jmp 0x288af
movq -0x228(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x238(%rbp)
je 0x288d7
movq -0x228(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x238(%rbp)
movq -0x230(%rbp), %rdi
movq -0x238(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x28b53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x9658
jmp 0x28efa
movq -0x228(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x28efa
movq -0x190(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0x1be70
movq -0x248(%rbp), %rdi
leaq 0xbec2(%rip), %rsi      # 0x34818
callq 0x13710
movb %al, -0x239(%rbp)
jmp 0x28963
leaq -0xd0(%rbp), %rdi
callq 0x9658
movb -0x239(%rbp), %al
testb $0x1, %al
jne 0x2897e
jmp 0x28a2a
movq -0x10(%rbp), %rax
movq %rax, -0x258(%rbp)
movl $0x18, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x250(%rbp)
movq -0x18(%rbp), %rsi
callq 0x22020
jmp 0x289ab
movq -0x250(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x260(%rbp)
je 0x289d3
movq -0x250(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x260(%rbp)
movq -0x258(%rbp), %rdi
movq -0x260(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x28b51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x9658
jmp 0x28efa
movq -0x250(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x28efa
movq -0x190(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0x1be70
movq -0x270(%rbp), %rdi
leaq 0xbdcd(%rip), %rsi      # 0x3481f
callq 0x13710
movb %al, -0x261(%rbp)
jmp 0x28a5f
leaq -0xf0(%rbp), %rdi
callq 0x9658
movb -0x261(%rbp), %al
testb $0x1, %al
jne 0x28a7a
jmp 0x28b23
movq -0x10(%rbp), %rax
movq %rax, -0x280(%rbp)
movl $0x18, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x278(%rbp)
movq -0x18(%rbp), %rsi
callq 0x24620
jmp 0x28aa7
movq -0x278(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x288(%rbp)
je 0x28acf
movq -0x278(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x288(%rbp)
movq -0x280(%rbp), %rdi
movq -0x288(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x28b4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x9658
jmp 0x28efa
movq -0x278(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x28efa
movq 0x1c4c6(%rip), %rdi     # 0x44ff0
leaq 0xbcf1(%rip), %rsi      # 0x34822
callq 0x9340
movq %rax, %rdi
movq 0x1c470(%rip), %rsi     # 0x44fb0
callq 0x9380
movl $0x1, %edi
callq 0x9410
jmp 0x28b51
jmp 0x28b53
jmp 0x28b55
jmp 0x28b57
jmp 0x28b59
movq -0x10(%rbp), %rax
movq %rax, -0x298(%rbp)
movl $0x10, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x290(%rbp)
callq 0x24730
jmp 0x28b82
movq -0x290(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x2a0(%rbp)
je 0x28baa
movq -0x290(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x2a0(%rbp)
movq -0x298(%rbp), %rdi
movq -0x2a0(%rbp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movq -0x10(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movl $0x18, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2a8(%rbp)
movq -0x30(%rbp), %rsi
callq 0x23de0
jmp 0x28bed
movq -0x2a8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x2b8(%rbp)
je 0x28c15
movq -0x2a8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x2b8(%rbp)
movq -0x2b0(%rbp), %rdi
movq -0x2b8(%rbp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movq -0x10(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movl $0x30, %edi
callq 0x9350
movq %rax, -0x2c0(%rbp)
movb $0x1, -0x131(%rbp)
movq -0x18(%rbp), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x130(%rbp), %rdi
callq *%rax
jmp 0x28c63
leaq 0xba8a(%rip), %rdx      # 0x346f4
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xcc00
jmp 0x28c7f
movq -0x2c0(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x21560
jmp 0x28c94
movq -0x2c0(%rbp), %rsi
movq -0x2c8(%rbp), %rdi
movb $0x0, -0x131(%rbp)
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
jmp 0x28cb3
leaq -0x110(%rbp), %rdi
callq 0x9658
leaq -0x130(%rbp), %rdi
callq 0x9658
movq -0x10(%rbp), %rax
movq %rax, -0x2d8(%rbp)
movl $0x10, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x2d0(%rbp)
callq 0x236a0
jmp 0x28cf4
movq -0x2d0(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x2e0(%rbp)
je 0x28d1c
movq -0x2d0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x2e0(%rbp)
movq -0x2d8(%rbp), %rdi
movq -0x2e0(%rbp), %rsi
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
movq -0x10(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movl $0x30, %edi
callq 0x9350
movq %rax, -0x2e8(%rbp)
movb $0x1, -0x179(%rbp)
movq -0x30(%rbp), %rsi
movq (%rsi), %rax
movq (%rax), %rax
leaq -0x178(%rbp), %rdi
callq *%rax
jmp 0x28d6a
leaq 0xb983(%rip), %rdx      # 0x346f4
leaq -0x158(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0xcc00
jmp 0x28d86
movq -0x2e8(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x21560
jmp 0x28d9b
movq -0x2e8(%rbp), %rsi
movq -0x2f0(%rbp), %rdi
movb $0x0, -0x179(%rbp)
movq (%rdi), %rax
movq (%rax), %rax
callq *%rax
jmp 0x28dba
leaq -0x158(%rbp), %rdi
callq 0x9658
leaq -0x178(%rbp), %rdi
callq 0x9658
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
movq -0x290(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x10, %esi
callq 0x9360
jmp 0x28efa
movq -0x2a8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x28efa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x28e5f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x28e53
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x9658
leaq -0x130(%rbp), %rdi
callq 0x9658
testb $0x1, -0x131(%rbp)
jne 0x28e6a
jmp 0x28e7b
movq -0x2c0(%rbp), %rdi
movl $0x30, %esi
callq 0x9360
jmp 0x28efa
movq -0x2d0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x10, %esi
callq 0x9360
jmp 0x28efa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x28edc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x28ed0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x9658
leaq -0x178(%rbp), %rdi
callq 0x9658
testb $0x1, -0x179(%rbp)
jne 0x28ee7
jmp 0x28ef8
movq -0x2e8(%rbp), %rdi
movl $0x30, %esi
callq 0x9360
jmp 0x28efa
movq -0x20(%rbp), %rdi
callq 0x95b0
nopw %cs:(%rax,%rax)