// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rdx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rdx), %r15
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 0x11a0d
leaq 0x90(%rsp), %r13
movq %r13, %rdi
callq 0xccb4
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
movl (%r13), %eax
cmpl $0xc, %eax
je 0x11b2c
cmpl $0xb, %eax
jne 0x11b92
movq 0xb0(%rsp), %rax
movq %rax, 0x20(%rsp)
movups 0x90(%rsp), %xmm0
movups 0xa0(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xb8(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x1272a
movsd (%r13), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x8(%r13), %r15
movups 0x10(%r13), %xmm0
movaps %xmm0, 0x30(%rsp)
movq 0x20(%r13), %rax
movq %rax, 0x40(%rsp)
movq 0x10(%r15), %rsi
leaq 0x463c(%rip), %rdx      # 0x160f2
leaq 0x68(%rsp), %r13
movq %r13, %rdi
callq 0xccb4
cmpl $0x8, (%r13)
jne 0x11b25
movq 0x80(%rsp), %rsi
movq 0x10(%r15), %rdx
movq %r14, %rdi
movq %r12, %rcx
callq 0x128ac
movq 0x10(%r15), %rsi
movl 0x28(%r12), %ecx
movl %ecx, %edx
shrl $0x1f, %edx
addl %ecx, %edx
sarl %edx
decl %edx
movq 0x88(%rsp), %rcx
movq %rcx, 0x20(%rsp)
movups 0x68(%rsp), %xmm0
movups 0x78(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xb8(%rsp), %rdi
movq %rax, %rcx
callq 0xd774
movaps 0x50(%rsp), %xmm0
jmp 0x11b68
movl $0x20, %edi
callq 0x21a0
testq %rax, %rax
je 0x11ba2
movq %rax, %r15
movl $0xc, (%rax)
movq 0x98(%rsp), %rax
movq %rax, 0x8(%r15)
movq 0x8(%rax), %rax
movq %rax, 0x10(%r15)
movl $0xffffffff, 0x18(%r15) # imm = 0xFFFFFFFF
movss 0x2ee8(%rip), %xmm0     # 0x14a50
movlps %xmm0, (%rbx)
movq %r15, 0x8(%rbx)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x10(%rbx)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rbx)
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x288f
jmp 0x11b81
movq %r14, %rdi
movq %rbx, %rsi
callq 0x284a
jmp 0x11b81