// File: martinda3[P]Compiler/src/JVM/JVMgenUtils.cpp
// Function: toyc::JVMgenUtils::gen_ICONST(int, toyc::JVMtargetCode*)
void JVMgenUtils::gen_ICONST(int n,JVMtargetCode *tc){ 	
    switch(n){
    case -1: tc->add(new ICONST_M1()); break;
    case 0:  tc->add(new ICONST_0());  break;
    case 1:  tc->add(new ICONST_1());  break;
    case 2:  tc->add(new ICONST_2());  break;
    case 3:  tc->add(new ICONST_3());  break;
    case 4:  tc->add(new ICONST_4());  break;
    case 5:  tc->add(new ICONST_5());  break;
    default:
      if (n >= -128 && n <= 127)
        tc->add(new BIPUSH(n));
      else if (n >= -32768 && n <= 32767)
        tc->add(new SIPUSH(n));
      else tc->add(new LDC(n));
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %eax
incl %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x6, %eax
ja 0x27e94
movq -0x28(%rbp), %rax
leaq 0xcc8f(%rip), %rcx      # 0x347b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x10, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x30(%rbp)
callq 0x232c0
jmp 0x27b4d
movq -0x30(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x40(%rbp)
je 0x27b69
movq -0x30(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x2806a
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x9360
jmp 0x28073
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x10, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
callq 0x236a0
jmp 0x27bbd
movq -0x48(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x58(%rbp)
je 0x27bd9
movq -0x48(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x2806a
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x9360
jmp 0x28073
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x10, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x60(%rbp)
callq 0x24730
jmp 0x27c2d
movq -0x60(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x70(%rbp)
je 0x27c49
movq -0x60(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x70(%rbp)
movq -0x68(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x2806a
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x9360
jmp 0x28073
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movl $0x10, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x78(%rbp)
callq 0x22130
jmp 0x27c9d
movq -0x78(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x88(%rbp)
je 0x27cbf
movq -0x78(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x88(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x2806a
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x9360
jmp 0x28073
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
movl $0x10, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x90(%rbp)
callq 0x24df0
jmp 0x27d1c
movq -0x90(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0xa0(%rbp)
je 0x27d44
movq -0x90(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
movq -0xa0(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x2806a
movq -0x90(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x9360
jmp 0x28073
movq -0x10(%rbp), %rax
movq %rax, -0xb0(%rbp)
movl $0x10, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xa8(%rbp)
callq 0x235b0
jmp 0x27da7
movq -0xa8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0xb8(%rbp)
je 0x27dcf
movq -0xa8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x2806a
movq -0xa8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x9360
jmp 0x28073
movq -0x10(%rbp), %rax
movq %rax, -0xc8(%rbp)
movl $0x10, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xc0(%rbp)
callq 0x22c00
jmp 0x27e32
movq -0xc0(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0xd0(%rbp)
je 0x27e5a
movq -0xc0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x2806a
movq -0xc0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x9360
jmp 0x28073
cmpl $-0x80, -0x4(%rbp)
jl 0x27f36
cmpl $0x7f, -0x4(%rbp)
jg 0x27f36
movq -0x10(%rbp), %rax
movq %rax, -0xe0(%rbp)
movl $0x18, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xd8(%rbp)
movl -0x4(%rbp), %esi
callq 0x22ed0
jmp 0x27ed4
movq -0xd8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0xe8(%rbp)
je 0x27efc
movq -0xd8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xe8(%rbp)
movq -0xe0(%rbp), %rdi
movq -0xe8(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x28068
movq -0xd8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x28073
cmpl $0xffff8000, -0x4(%rbp) # imm = 0xFFFF8000
jl 0x27fde
cmpl $0x7fff, -0x4(%rbp)     # imm = 0x7FFF
jg 0x27fde
movq -0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
movl $0x18, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xf0(%rbp)
movl -0x4(%rbp), %esi
callq 0x24ee0
jmp 0x27f7c
movq -0xf0(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x100(%rbp)
je 0x27fa4
movq -0xf0(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x100(%rbp)
movq -0xf8(%rbp), %rdi
movq -0x100(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x28066
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x18, %esi
callq 0x9360
jmp 0x28073
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
movl $0x38, %edi
callq 0x9350
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x108(%rbp)
movl -0x4(%rbp), %esi
callq 0x23a80
jmp 0x2800a
movq -0x108(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movq %rax, -0x118(%rbp)
je 0x28032
movq -0x108(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rdi
movq -0x118(%rbp), %rsi
movq (%rdi), %rax
callq *(%rax)
jmp 0x28066
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x38, %esi
callq 0x9360
jmp 0x28073
jmp 0x28068
jmp 0x2806a
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x95b0
nopl (%rax)