// File: /workspace/github_c_makefile_star2_O0/mattn[P]orelang/ore.c
// Function: ore_bind_args
static ore_value*
ore_bind_args(ore_context* ore, mpc_ast_t* f, ore_context* this, mpc_ast_t* t) {
  int num_in = t->children_num / 2 - 1, n = 0, i;
  ore_value* args = (ore_value*) malloc(sizeof(ore_value) * num_in);
  if (!args) {
    fprintf(stderr, "failed to allocate memory\n");
    ore->err = ORE_ERROR_EXCEPTION;
    return NULL;
  }
  for (i = 0; i < num_in; i++) {
    args[i] = ore_value_nil();
  }
  i = 0;
  for (i = 0; i < t->children_num; i++) {
    if (is_a(t->children[i], "char") && t->children[i]->contents[0] == '(') {
      i++;
      break;
    }
  }
  for (; i < t->children_num; i++) {
    if (is_a(t->children[i], "char")) {
      if (t->children[i]->contents[0] == ')') {
        i++;
        break;
      }
    } else
      args[n++] = ore_eval(ore, t->children[i]);
  }

  for (i = 0; i < f->children_num; i++) {
    if (is_a(f->children[i], "char") && f->children[i]->contents[0] == '(') {
      i++;
      break;
    }
  }
  n = 0;
  for (; i < f->children_num; i++) {
    if (is_a(f->children[i], "char") && f->children[i]->contents[0] == ')') {
      i++;
      break;
    }
    if (is_a(f->children[i], "vararg")) {
      ore_array_t* a = kl_init(value);
      int j;
      for (j = 0; j < num_in; j++) {
        *kl_pushp(value, a) = args[j];
      }
      ore_define(this, f->children[i-1]->contents, ore_value_array_from_klist(ore, a));
    } else if (is_a(f->children[i], "ident")) {
      if (n < num_in)
        ore_define(this, f->children[i]->contents, args[n++]);
    }
  }
  return args;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x28(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movslq -0x2c(%rbp), %rax
imulq $0x28, %rax, %rdi
callq 0x2190
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x1896f
movq 0x86b2(%rip), %rax      # 0x20ff8
movq (%rax), %rdi
leaq 0x226e(%rip), %rsi      # 0x1abbe
movb $0x0, %al
callq 0x2140
movq -0x10(%rbp), %rax
movl $0x1, 0x20(%rax)
movq $0x0, -0x8(%rbp)
jmp 0x18d61
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x189bd
movq -0x40(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x10670
movq -0xd0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x28, %edx
callq 0x2170
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x18976
movl $0x0, -0x34(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x18a30
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdi
leaq 0x1c31(%rip), %rsi      # 0x1a622
callq 0x2260
cmpq $0x0, %rax
je 0x18a23
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x18a23
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x18a30
jmp 0x18a25
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x189cb
jmp 0x18a32
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x18af8
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdi
leaq 0x1bc6(%rip), %rsi      # 0x1a622
callq 0x2260
cmpq $0x0, %rax
je 0x18a90
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
jne 0x18a8e
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x18af8
jmp 0x18ae8
movq -0x40(%rbp), %rax
movl -0x30(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x30(%rbp)
movslq %ecx, %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq -0x90(%rbp), %rdi
callq 0x119b0
movq -0xd8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x28, %edx
callq 0x2170
jmp 0x18aea
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x18a32
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x18b64
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdi
leaq 0x1afd(%rip), %rsi      # 0x1a622
callq 0x2260
cmpq $0x0, %rax
je 0x18b57
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x28, %eax
jne 0x18b57
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x18b64
jmp 0x18b59
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x18aff
movl $0x0, -0x30(%rbp)
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jge 0x18d59
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdi
leaq 0x1a8d(%rip), %rsi      # 0x1a622
callq 0x2260
cmpq $0x0, %rax
je 0x18bca
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x29, %eax
jne 0x18bca
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x18d59
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdi
leaq 0x2037(%rip), %rsi      # 0x1ac1b
callq 0x2260
cmpq $0x0, %rax
je 0x18cca
callq 0x11820
movq %rax, -0x98(%rbp)
movl $0x0, -0x9c(%rbp)
movl -0x9c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x18c50
movq -0x98(%rbp), %rdi
callq 0x11890
movq %rax, %rdi
movq -0x40(%rbp), %rsi
movslq -0x9c(%rbp), %rax
imulq $0x28, %rax, %rax
addq %rax, %rsi
movl $0x28, %edx
callq 0x2170
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0x18c09
movq -0x20(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rsi
movq -0x98(%rbp), %rdx
leaq -0xc8(%rbp), %rdi
callq 0x11900
movq -0xe8(%rbp), %rdi
movq -0xe0(%rbp), %rsi
movq -0xa8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, 0x20(%rax)
movups -0xc8(%rbp), %xmm0
movups -0xb8(%rbp), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x11030
jmp 0x18d49
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rdi
leaq 0x1f3e(%rip), %rsi      # 0x1ac22
callq 0x2260
cmpq $0x0, %rax
je 0x18d47
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x18d45
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rsi
movq -0x40(%rbp), %rcx
movl -0x30(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x30(%rbp)
cltq
imulq $0x28, %rax, %rax
addq %rax, %rcx
movq 0x20(%rcx), %rdx
movq %rsp, %rax
movq %rdx, 0x20(%rax)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x11030
jmp 0x18d47
jmp 0x18d49
jmp 0x18d4b
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x18b6b
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nop