// File: /workspace/github_c_makefile_star2_O1/mattn[P]orelang/ore.c
// Function: ore_object_new
static ore_value
ore_object_new(ore_context* ore, mpc_ast_t* t) {
  ore_value clazz = ore_find_global(ore, t->children[1]->contents);
  ore_value v = { ORE_TYPE_OBJECT };
  switch (clazz.t) {
    case ORE_TYPE_CLASS:
      v = ore_class_new(ore, clazz);
      ore_value initialize = ore_prop(v.v.o->e, "__initialize__");
      if (initialize.t == ORE_TYPE_FUNC) {
        ore_value* args = ore_bind_args(ore, initialize.v.f.x.o, v.v.o->e, t);
        ore_func_call(v.v.o->e, initialize, t->children_num / 2 - 1, args);
      }
      break;
    case ORE_TYPE_CCLASS:
      {
        v.v.o = (ore_object*) malloc(sizeof(ore_object));
        if (!v.v.o) {
          fprintf(stderr, "failed to allocate memory\n");
          ore->err = ORE_ERROR_EXCEPTION;
          return ore_value_nil();
        }
        v.v.o->t = clazz.t;
        v.v.o->c = clazz.v.x;
        v.v.o->e = clazz.v.x->e;
        v.v.o->ref = -1;
        /*
        ore_value initialize = ore_prop(this, "__initialize__");
        if (initialize.t == ORE_TYPE_FUNC) {
          ore_value* args = ore_bind_args(ore, initialize.v.f.x.o, this, t);
          ore_func_call(this, initialize, 0, NULL);
        }
        */
      }
      break;
    default:
      fprintf(stderr, "unknown class '%s'\n", t->children[1]->contents);
      ore->err = ORE_ERROR_EXCEPTION;
      return ore_value_nil();
  }
  return v;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x30(%rdx), %r14
movq 0x30(%rdx), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdx
movq %rsi, %rax
movq %rax, %rsi
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x11dae
leaq 0x78(%rsp), %r13
movq %r13, %rdi
callq 0xcec9
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movl (%r13), %ebp
cmpl $0xc, %ebp
je 0x11ec1
cmpl $0xb, %ebp
jne 0x11f28
movq 0x98(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x78(%rsp), %xmm0
movups 0x88(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xa0(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x129f7
movl (%r13), %eax
movl %eax, 0x2c(%rsp)
movl 0x4(%r13), %ebp
movq 0x8(%r13), %r14
movups 0x10(%r13), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x20(%r13), %rax
movq %rax, 0x40(%rsp)
movq 0x10(%r14), %rsi
leaq 0x42cd(%rip), %rdx      # 0x1611f
leaq 0x50(%rsp), %r13
movq %r13, %rdi
callq 0xcec9
cmpl $0x8, (%r13)
jne 0x11ebb
movq 0x68(%rsp), %rsi
movq 0x10(%r14), %rdx
movq %r15, %rdi
movq %r12, %rcx
callq 0x12b7c
movq 0x10(%r14), %rsi
movl 0x28(%r12), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
decl %edx
movq 0x70(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movups 0x50(%rsp), %xmm0
movups 0x60(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xa0(%rsp), %rdi
movq %rax, %rcx
callq 0xd989
movl 0x2c(%rsp), %eax
jmp 0x11ef8
movl $0x20, %edi
callq 0x21a0
testq %rax, %rax
je 0x11f38
movq %rax, %r14
movl %ebp, (%rax)
movq 0x80(%rsp), %rax
movq %rax, 0x8(%r14)
movq 0x8(%rax), %rax
movq %rax, 0x10(%r14)
movl $0xffffffff, 0x18(%r14) # imm = 0xFFFFFFFF
movl $0xd, %eax
xorl %ebp, %ebp
movl %eax, (%rbx)
movl %ebp, 0x4(%rbx)
movq %r14, 0x8(%rbx)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x10(%rbx)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rbx)
movq %rbx, %rax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x28e0
jmp 0x11f13
movq %r15, %rdi
movq %rbx, %rsi
callq 0x289b
jmp 0x11f13