// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rcx, %r13
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, 0x48(%rsp)
movl 0x28(%rcx), %ebp
movl %ebp, %r15d
shrl $0x1f, %r15d
addl %ebp, %r15d
sarl %r15d
movslq %r15d, %rax
shlq $0x3, %rax
leaq (%rax,%rax,4), %rdi
addq $-0x28, %rdi
callq 0x21a0
testq %rax, %rax
je 0x12fc2
decl %r15d
cmpl $0x4, %ebp
jl 0x12c05
cmpl $0x2, %r15d
movl $0x1, %ecx
cmovgel %r15d, %ecx
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rdx
xorl %ecx, %ecx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
movq $0x0, 0x20(%rax,%rcx)
addq $0x28, %rcx
cmpq %rcx, %rdx
jne 0x12bea
movq %rax, 0x30(%rsp)
movl %r15d, 0x3c(%rsp)
movq %r14, 0x40(%rsp)
movq %rbx, 0x50(%rsp)
testl %ebp, %ebp
movq %rbp, 0x70(%rsp)
jle 0x12c5a
movq 0x30(%r13), %r15
xorl %ebx, %ebx
leaq 0x18c9(%rip), %r14      # 0x144f8
movq (%r15,%rbx,8), %r12
movq (%r12), %rdi
movq %r14, %rsi
callq 0x2290
testq %rax, %rax
je 0x12c4e
movq 0x8(%r12), %rax
cmpb $0x28, (%rax)
je 0x12c5e
incq %rbx
cmpq %rbx, %rbp
jne 0x12c2f
movl %ebp, %ebx
jmp 0x12c60
xorl %ebx, %ebx
jmp 0x12c60
incl %ebx
cmpl 0x28(%r13), %ebx
jge 0x12cf0
movslq %ebx, %r15
xorl %r12d, %r12d
leaq 0x1881(%rip), %r14      # 0x144f8
movq 0x30(%r13), %rax
movq (%rax,%r15,8), %rbx
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x2290
testq %rax, %rax
je 0x12c9a
movq 0x8(%rbx), %rax
cmpb $0x29, (%rax)
jne 0x12ce4
jmp 0x12cf0
movslq %r12d, %rax
incl %r12d
leaq (%rax,%rax,4), %rbp
leaq 0xb0(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq %rbx, %rdx
callq 0xdee3
movq 0xd0(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, 0x20(%rcx,%rbp,8)
movups 0xb0(%rsp), %xmm0
movups 0xc0(%rsp), %xmm1
movups %xmm1, 0x10(%rcx,%rbp,8)
movups %xmm0, (%rcx,%rbp,8)
incq %r15
movslq 0x28(%r13), %rax
cmpq %rax, %r15
jl 0x12c77
movq 0x40(%rsp), %r12
movl 0x28(%r12), %r15d
testl %r15d, %r15d
jle 0x12d38
movq 0x30(%r12), %r12
xorl %ebx, %ebx
leaq 0x17eb(%rip), %r14      # 0x144f8
movq (%r12,%rbx,8), %r13
movq (%r13), %rdi
movq %r14, %rsi
callq 0x2290
testq %rax, %rax
je 0x12d2b
movq 0x8(%r13), %rax
cmpb $0x28, (%rax)
je 0x12d3c
incq %rbx
cmpq %rbx, %r15
jne 0x12d0d
movl %r15d, %ebx
jmp 0x12d3e
xorl %ebx, %ebx
jmp 0x12d43
incl %ebx
movq 0x40(%rsp), %r12
cmpl 0x28(%r12), %ebx
movq 0x50(%rsp), %r15
jge 0x12fab
movl 0x3c(%rsp), %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movl %ebx, %r13d
negq %rcx
movq %rcx, 0x80(%rsp)
xorl %ebp, %ebp
movq 0x30(%r12), %rax
movq (%rax,%r13,8), %rbx
movq (%rbx), %r14
movq %r14, %rdi
leaq 0x1770(%rip), %rsi      # 0x144f8
callq 0x2290
testq %rax, %rax
je 0x12d9f
movq 0x8(%rbx), %rax
cmpb $0x29, (%rax)
je 0x12fab
movq %r14, %rdi
leaq 0x1daa(%rip), %rsi      # 0x14b53
callq 0x2290
testq %rax, %rax
je 0x12dff
movq %rbp, 0x78(%rsp)
movl $0x1, %edi
movl $0x20, %esi
callq 0x2140
movq %rax, %r14
movl $0x1, %edi
movl $0x20, %esi
callq 0x2140
movq %rax, %rbp
incq (%rax)
movq %rax, 0x10(%r14)
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x12e61
movq 0x18(%rbp), %rcx
leaq -0x1(%rax), %rdx
movq %rdx, 0x8(%rbp)
movq -0x8(%rcx,%rax,8), %rax
jmp 0x12e70
movq %r14, %rdi
leaq 0x1d51(%rip), %rsi      # 0x14b5a
callq 0x2290
testq %rax, %rax
setne %al
cmpl 0x3c(%rsp), %ebp
setl %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x12f9a
movq 0x8(%rbx), %rsi
movslq %ebp, %rax
incl %ebp
leaq (%rax,%rax,4), %rax
movq 0x30(%rsp), %rdx
movq 0x20(%rdx,%rax,8), %rcx
movq %rcx, 0x20(%rsp)
movups (%rdx,%rax,8), %xmm0
movups 0x10(%rdx,%rax,8), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
callq 0xd5d3
jmp 0x12f9a
movl $0x1, %edi
movl $0x30, %esi
callq 0x2140
movq %rax, 0x8(%r14)
movq %rax, (%r14)
movq $0x0, 0x28(%rax)
cmpl $0x4, 0x70(%rsp)
jl 0x12f41
movq %r13, 0x68(%rsp)
movq (%rbp), %rax
movq %rax, 0x60(%rsp)
movq 0x8(%rbp), %r12
movq 0x8(%r14), %r13
movq 0x18(%r14), %rax
movq %rax, 0x58(%rsp)
xorl %ebx, %ebx
movq 0x30(%rsp), %r15
testq %r12, %r12
je 0x12ecc
movq 0x18(%rbp), %rax
leaq -0x1(%r12), %rcx
movq %rcx, 0x8(%rbp)
movq -0x8(%rax,%r12,8), %rax
movq %rcx, %r12
jmp 0x12edb
movl $0x1, %edi
movl $0x30, %esi
callq 0x2140
movq $0x0, 0x28(%rax)
movq %rax, 0x28(%r13)
movq %rax, 0x8(%r14)
movq 0x20(%r15), %rcx
movq %rcx, 0x20(%r13)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups %xmm1, 0x10(%r13)
movups %xmm0, (%r13)
addq $0x28, %r15
decq %rbx
movq %rax, %r13
cmpq %rbx, 0x80(%rsp)
jne 0x12eb0
movq 0x60(%rsp), %rax
subq %rbx, %rax
movq %rax, (%rbp)
movq 0x58(%rsp), %rax
subq %rbx, %rax
movq %rax, 0x18(%r14)
movq 0x50(%rsp), %r15
movq 0x40(%rsp), %r12
movq 0x68(%rsp), %r13
movq 0x30(%r12), %rax
movq -0x8(%rax,%r13,8), %rax
movq 0x8(%rax), %rbx
leaq 0x88(%rsp), %rdi
movq 0x48(%rsp), %rsi
movq %r14, %rdx
callq 0xde8c
movq 0xa8(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x88(%rsp), %xmm0
movups 0x98(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xd5d3
movq 0x78(%rsp), %rbp
incq %r13
movslq 0x28(%r12), %rax
cmpq %rax, %r13
jl 0x12d72
movq 0x30(%rsp), %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x48(%rsp), %rdi
callq 0x29fc
xorl %eax, %eax
jmp 0x12fb0