// File: /workspace/github_c_makefile_star2_O0/cogbee[P]vmir-latest/src/vmir_wasm_parser.c
// Function: wasm_numeric
static void
wasm_numeric(ir_unit_t *iu, ir_bb_t *ib, int code)
{
  int binop = -1;
  switch(code) {
  case 0x67:  return wasm_vmop(iu, ib, 1, VM_CLZ32, WASM_TYPE_I32);
  case 0x68:  return wasm_vmop(iu, ib, 1, VM_CTZ32, WASM_TYPE_I32);
  case 0x69:  return wasm_vmop(iu, ib, 1, VM_POP32, WASM_TYPE_I32);
  case 0x79:  return wasm_vmop(iu, ib, 1, VM_CLZ64, WASM_TYPE_I64);
  case 0x7a:  return wasm_vmop(iu, ib, 1, VM_CTZ64, WASM_TYPE_I64);
  case 0x7b:  return wasm_vmop(iu, ib, 1, VM_POP64, WASM_TYPE_I64);

  case 0x9c:  return wasm_vmop(iu, ib, 1, VM_FLOOR,  WASM_TYPE_F64);
  case 0x8e:  return wasm_vmop(iu, ib, 1, VM_FLOORF, WASM_TYPE_F32);

  case 0x92:
  case 0xa0:
  case 0x7c:
  case 0x6a: binop = BINOP_ADD;  break;
  case 0x93:
  case 0xa1:
  case 0x7d:
  case 0x6b: binop = BINOP_SUB;  break;
  case 0x94:
  case 0xa2:
  case 0x7e:
  case 0x6c: binop = BINOP_MUL;  break;
  case 0x95:
  case 0xa3:
  case 0x7f:
  case 0x6d: binop = BINOP_SDIV; break;
  case 0x80:
  case 0x6e: binop = BINOP_UDIV; break;
  case 0x81:
  case 0x6f: binop = BINOP_SREM; break;
  case 0x82:
  case 0x70: binop = BINOP_UREM; break;
  case 0x83:
  case 0x71: binop = BINOP_AND;  break;
  case 0x84:
  case 0x72: binop = BINOP_OR;   break;
  case 0x85:
  case 0x73: binop = BINOP_XOR;  break;
  case 0x86:
  case 0x74: binop = BINOP_SHL;  break;
  case 0x87:
  case 0x75: binop = BINOP_ASHR; break;
  case 0x88:
  case 0x76: binop = BINOP_LSHR; break;
  case 0x89:
  case 0x77: binop = BINOP_ROL;  break;
  case 0x8a:
  case 0x78: binop = BINOP_ROR;  break;
  default:
    parser_error(iu, "Can't handle binop 0x%x", code);
  }

  ir_instr_binary_t *i = instr_add(ib, sizeof(ir_instr_binary_t), IR_IC_BINOP);
  i->rhs_value = vstack_pop(iu);
  i->lhs_value = vstack_pop(iu);
  i->op = binop;
  value_alloc_instr_ret(iu, i->lhs_value.type, &i->super);
  vstack_push(iu, i->super.ii_ret);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movl -0x14(%rbp), %eax
addl $-0x67, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x3c, %eax
ja 0x21de0
movq -0x38(%rbp), %rax
leaq 0x1b6b6(%rip), %rcx     # 0x3d2f0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %r8d
movl $0x1f5, %ecx            # imm = 0x1F5
movl %r8d, %edx
callq 0x224a0
jmp 0x21e90
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %r8d
movl $0x1f4, %ecx            # imm = 0x1F4
movl %r8d, %edx
callq 0x224a0
jmp 0x21e90
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %r8d
movl $0x1f6, %ecx            # imm = 0x1F6
movl %r8d, %edx
callq 0x224a0
jmp 0x21e90
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
movl $0x1f8, %ecx            # imm = 0x1F8
movl $0x2, %r8d
callq 0x224a0
jmp 0x21e90
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
movl $0x1f7, %ecx            # imm = 0x1F7
movl $0x2, %r8d
callq 0x224a0
jmp 0x21e90
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
movl $0x1f9, %ecx            # imm = 0x1F9
movl $0x2, %r8d
callq 0x224a0
jmp 0x21e90
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
movl $0x1be, %ecx            # imm = 0x1BE
movl $0x4, %r8d
callq 0x224a0
jmp 0x21e90
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x1, %edx
movl $0x1ca, %ecx            # imm = 0x1CA
movl $0x3, %r8d
callq 0x224a0
jmp 0x21e90
movl $0x0, -0x18(%rbp)
jmp 0x21e02
movl $0x1, -0x18(%rbp)
jmp 0x21e02
movl $0x2, -0x18(%rbp)
jmp 0x21e02
movl $0x4, -0x18(%rbp)
jmp 0x21e02
movl $0x3, -0x18(%rbp)
jmp 0x21e02
movl $0x6, -0x18(%rbp)
jmp 0x21e02
movl $0x5, -0x18(%rbp)
jmp 0x21e02
movl $0xa, -0x18(%rbp)
jmp 0x21e02
movl $0xb, -0x18(%rbp)
jmp 0x21e02
movl $0xc, -0x18(%rbp)
jmp 0x21e02
movl $0x7, -0x18(%rbp)
jmp 0x21e02
movl $0x9, -0x18(%rbp)
jmp 0x21e02
movl $0x8, -0x18(%rbp)
jmp 0x21e02
movl $0xd, -0x18(%rbp)
jmp 0x21e02
movl $0xe, -0x18(%rbp)
jmp 0x21e02
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %r8d
leaq 0x1c9ed(%rip), %rsi     # 0x3e7dc
movl $0x272, %edx            # imm = 0x272
leaq 0x1d209(%rip), %rcx     # 0x3f004
movb $0x0, %al
callq 0x18220
movq -0x10(%rbp), %rdi
movl $0x70, %esi
movl $0x2, %edx
callq 0x20c10
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1ea10
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq %rcx, 0x64(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1ea10
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq -0x30(%rbp), %rcx
movq %rcx, 0x5c(%rax)
movl -0x18(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x58(%rax)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x60(%rax), %esi
movq -0x20(%rbp), %rdx
callq 0x22410
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x2c(%rax), %rsi
callq 0x1f360
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)