// File: /workspace/github_c_makefile_star2_O0/cogbee[P]vmir-latest/src/vmir_bitcode_instr.c
// Function: instr_get_vtp
static ir_valuetype_t
instr_get_vtp(ir_unit_t *iu, unsigned int *argcp, const int64_t **argvp)
{
  const int64_t *argv = *argvp;
  int argc = *argcp;
  if(argc < 1)
    parser_error(iu, "Missing value code");

  unsigned int val = iu->iu_next_value - argv[0];
  int type;

  if(val < iu->iu_next_value) {
    *argvp = argv + 1;
    *argcp = argc - 1;
    type = VECTOR_ITEM(&iu->iu_values, val)->iv_type;
  } else {

    type = argv[1];

    if(val >= VECTOR_LEN(&iu->iu_values)) {
      size_t prevsize = VECTOR_LEN(&iu->iu_values);
      VECTOR_RESIZE(&iu->iu_values, val + 1);
      for(int i = prevsize; i <= val; i++) {
        VECTOR_ITEM(&iu->iu_values, i) = NULL;
      }
    }
    ir_value_t *iv = VECTOR_ITEM(&iu->iu_values, val);

    if(iv == NULL) {
      iv = calloc(1, sizeof(ir_value_t));
      VECTOR_ITEM(&iu->iu_values, val) = iv;
      iv->iv_class = IR_VC_UNDEF;
    }
    iv->iv_type = type;

    *argvp = argv + 2;
    *argcp = argc - 2;
  }
  ir_valuetype_t r = {.type = type, .value = val};
  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x1, -0x2c(%rbp)
jge 0x37a8c
movq -0x10(%rbp), %rdi
leaq 0x9246(%rip), %rsi      # 0x40cbf
movl $0xc, %edx
leaq 0x92d7(%rip), %rcx      # 0x40d5c
movb $0x0, %al
callq 0x18220
movq -0x10(%rbp), %rax
movslq 0x198(%rax), %rax
movq -0x28(%rbp), %rcx
subq (%rcx), %rax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x198(%rcx), %eax
jae 0x37ae8
movq -0x28(%rbp), %rcx
addq $0x8, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x180(%rax), %rax
movl -0x30(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x24(%rax), %eax
movl %eax, -0x34(%rbp)
jmp 0x37c34
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, -0x34(%rbp)
movl -0x30(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpq 0x188(%rcx), %rax
jb 0x37bbf
movq -0x10(%rbp), %rax
movq 0x188(%rax), %rax
movq %rax, -0x40(%rbp)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movq -0x10(%rbp), %rcx
cmpq 0x190(%rcx), %rax
jbe 0x37b77
movl -0x30(%rbp), %eax
addl $0x1, %eax
shll %eax
movl %eax, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, 0x190(%rax)
movq -0x10(%rbp), %rax
movq 0x190(%rax), %rax
shlq $0x3, %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x180(%rax), %rdi
movq -0x48(%rbp), %rsi
callq 0x3390
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x180(%rax)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, 0x188(%rax)
movq -0x40(%rbp), %rax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x30(%rbp), %eax
ja 0x37bbd
movq -0x10(%rbp), %rax
movq 0x180(%rax), %rax
movslq -0x4c(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x37b93
jmp 0x37bbf
movq -0x10(%rbp), %rax
movq 0x180(%rax), %rax
movl -0x30(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x37c0f
movl $0x1, %edi
movl $0x48, %esi
callq 0x32c0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x180(%rax), %rax
movl -0x30(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movq -0x58(%rbp), %rax
movl $0x0, (%rax)
movl -0x34(%rbp), %ecx
movq -0x58(%rbp), %rax
movl %ecx, 0x24(%rax)
movq -0x28(%rbp), %rcx
addq $0x10, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl -0x30(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)