// File: /workspace/github_c_makefile_star2_O0/cogbee[P]vmir-latest/src/vmir_transform.c
// Function: instr_replace_values
static void
instr_replace_values(ir_instr_t *ii, ir_unit_t *iu, int from, int to)
{
  if(ii->ii_ret.value < -1) {
    for(int i = 0; i < -ii->ii_ret.value; i++) {
      instr_replace_value(iu, &ii->ii_rets[i], from, to);
    }
  } else {
    instr_replace_value(iu, &ii->ii_ret, from, to);
  }

  switch(ii->ii_class) {
  case IR_IC_UNREACHABLE:
  case IR_IC_STACKSHRINK:
  case IR_IC_LANDINGPAD:
    break;

  case IR_IC_RET:
  case IR_IC_CAST:
  case IR_IC_VAARG:
    instr_replace_value(iu, &((ir_instr_unary_t *)ii)->value, from, to);
    break;
  case IR_IC_LOAD:
    instr_replace_value(iu, &((ir_instr_load_t *)ii)->ptr, from, to);
    instr_replace_value(iu, &((ir_instr_load_t *)ii)->value_offset, from, to);
    break;

  case IR_IC_BINOP:
  case IR_IC_CMP2:
    instr_replace_value(iu, &((ir_instr_binary_t *)ii)->lhs_value, from, to);
    instr_replace_value(iu, &((ir_instr_binary_t *)ii)->rhs_value, from, to);
    break;
  case IR_IC_CMP_BRANCH:
    instr_replace_value(iu, &((ir_instr_cmp_branch_t *)ii)->lhs_value, from, to);
    instr_replace_value(iu, &((ir_instr_cmp_branch_t *)ii)->rhs_value, from, to);
    break;
  case IR_IC_STORE:
    instr_replace_value(iu, &((ir_instr_store_t *)ii)->value, from, to);
    instr_replace_value(iu, &((ir_instr_store_t *)ii)->ptr, from, to);
    break;
  case IR_IC_BR:
    instr_replace_value(iu, &((ir_instr_br_t *)ii)->condition, from, to);
    break;
  case IR_IC_ALLOCA:
    instr_replace_value(iu, &((ir_instr_alloca_t *)ii)->num_items_value, from, to);
    break;
  case IR_IC_SELECT:
    instr_replace_value(iu, &((ir_instr_select_t *)ii)->pred, from, to);
    instr_replace_value(iu, &((ir_instr_select_t *)ii)->true_value, from, to);
    instr_replace_value(iu, &((ir_instr_select_t *)ii)->false_value, from, to);
    break;
  case IR_IC_LEA:
    instr_replace_value(iu, &((ir_instr_lea_t *)ii)->baseptr, from, to);
    instr_replace_value(iu, &((ir_instr_lea_t *)ii)->value_offset, from, to);
    break;
  case IR_IC_CALL:
  case IR_IC_VMOP:
  case IR_IC_INVOKE:
    {
      ir_instr_call_t *p = (ir_instr_call_t *)ii;
      instr_replace_value(iu, &p->callee, from, to);
      for(int i = 0; i < p->argc; i++)
        instr_replace_value(iu, &p->argv[i].value, from, to);
    }
    break;
  case IR_IC_SWITCH:
    {
      ir_instr_switch_t *s = (ir_instr_switch_t *)ii;
      instr_replace_value(iu, &s->value, from, to);
    }
    break;
  case IR_IC_MOVE:
    {
      ir_instr_move_t *p = (ir_instr_move_t *)ii;
      instr_replace_value(iu, &p->value, from, to);
    }
    break;
  case IR_IC_STACKCOPY:
    {
      ir_instr_stackcopy_t *sc = (ir_instr_stackcopy_t *)ii;
      instr_replace_value(iu, &sc->value, from, to);
    }
    break;
  case IR_IC_MLA:
    instr_replace_value(iu, &((ir_instr_ternary_t *)ii)->arg1, from, to);
    instr_replace_value(iu, &((ir_instr_ternary_t *)ii)->arg2, from, to);
    instr_replace_value(iu, &((ir_instr_ternary_t *)ii)->arg3, from, to);
    break;
  case IR_IC_CMP_SELECT:
    instr_replace_value(iu, &((ir_instr_cmp_select_t *)ii)->true_value, from, to);
    instr_replace_value(iu, &((ir_instr_cmp_select_t *)ii)->false_value, from, to);
    instr_replace_value(iu, &((ir_instr_cmp_select_t *)ii)->lhs_value, from, to);
    instr_replace_value(iu, &((ir_instr_cmp_select_t *)ii)->rhs_value, from, to);
    break;
  case IR_IC_RESUME:
    {
      ir_instr_resume_t *irc = (ir_instr_resume_t *)ii;
      for (int i=0; i<irc->num_values; ++i)
        instr_replace_value(iu, &irc->values[i], from, to);
    }
    break;

  default:
    printf("liveness_replace_values: can't handle instruction class %d\n",
           ii->ii_class);
    abort();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x2c(%rax)
jge 0x2a726
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rdx
xorl %ecx, %ecx
subl 0x2c(%rdx), %ecx
cmpl %ecx, %eax
jge 0x2a724
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rsi
movslq -0x1c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2a6e7
jmp 0x2a73d
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x2c, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movq %rax, -0x60(%rbp)
subq $0x1b, %rax
ja 0x2aaca
movq -0x60(%rbp), %rax
leaq 0x130df(%rip), %rcx     # 0x3d83c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x64, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x5c, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x64, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x5c, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x64, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x60, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x5c, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x68, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x60, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x64, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
jge 0x2a967
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x70, %rsi
movslq -0x2c(%rbp), %rax
imulq $0xc, %rax, %rax
addq %rax, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2a92e
jmp 0x2aae4
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x58, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x60, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x68, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x6c, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x74, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x5c, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x64, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
jmp 0x2aae4
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl 0x58(%rcx), %eax
jge 0x2aac8
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
addq $0x5c, %rsi
movslq -0x54(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
callq 0x2b3b0
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2aa8f
jmp 0x2aae4
movq -0x8(%rbp), %rax
movl 0x28(%rax), %esi
leaq 0x15388(%rip), %rdi     # 0x3fe60
movb $0x0, %al
callq 0x3170
callq 0x3050
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)