// File: /workspace/github_c_makefile_star2_O0/Nealsbo[P]C-Software-Renderer/src/objloader.c
// Function: Model_Create
obj_model_t *Model_Create( const char *model_name){
    obj_model_t *model = (obj_model_t *)malloc(sizeof(obj_model_t));
    if(model == NULL){
        printf("Error: Cannot create model object '%s'\n", model_name);
        return NULL;
    }

    memcpy(model->name, model_name, MAX_NAME_LENGTH);

    model->vertCount   = 0;                                             //Allocation prepared data for model, box in that case
    model->trisCount   = 0;
    model->position    = vec3_create(0.1, 2.3, 4.5);
    model->rotation    = vec3_create(6.7, 8.9, 0.1);
    model->scale       = vec3_create(1.3, 1.6, 1.9);
    model->baseColor   = Color_Init(63, 127, 191, 255);
    model->diffmap     = NULL;
    model->normalmap   = NULL;
    model->vertices    = NULL;
    model->faces       = NULL;
    model->normals     = NULL;
    model->textcoords  = NULL;

    return model;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movl $0x170, %edi            # imm = 0x170
callq 0x11b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x85b3
movq -0x10(%rbp), %rsi
leaq 0x6401(%rip), %rdi      # 0xe9a0
movb $0x0, %al
callq 0x1040
movq $0x0, -0x8(%rbp)
jmp 0x8795
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1110
movq -0x18(%rbp), %rax
movl $0x0, 0x120(%rax)
movq -0x18(%rbp), %rax
movl $0x0, 0x12c(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0xa8(%rbp)
movss 0x637c(%rip), %xmm0     # 0xe970
movss %xmm0, -0x9c(%rbp)
movss 0x6370(%rip), %xmm1     # 0xe974
movss 0x636c(%rip), %xmm2     # 0xe978
callq 0x4270
movq -0xa8(%rbp), %rax
movss -0x9c(%rbp), %xmm2
movss %xmm1, -0x30(%rbp)
movlpd %xmm0, -0x38(%rbp)
movl -0x30(%rbp), %ecx
movl %ecx, -0x20(%rbp)
movq -0x38(%rbp), %rcx
movq %rcx, -0x28(%rbp)
movl -0x20(%rbp), %ecx
movl %ecx, 0x138(%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x130(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x98(%rbp)
movss 0x631d(%rip), %xmm0     # 0xe97c
movss 0x6319(%rip), %xmm1     # 0xe980
callq 0x4270
movq -0x98(%rbp), %rax
movss %xmm1, -0x50(%rbp)
movlpd %xmm0, -0x58(%rbp)
movl -0x50(%rbp), %ecx
movl %ecx, -0x40(%rbp)
movq -0x58(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movl -0x40(%rbp), %ecx
movl %ecx, 0x144(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x13c(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x90(%rbp)
movss 0x62d2(%rip), %xmm0     # 0xe984
movss 0x62ce(%rip), %xmm1     # 0xe988
movss 0x62ca(%rip), %xmm2     # 0xe98c
callq 0x4270
movq -0x90(%rbp), %rax
movss %xmm1, -0x70(%rbp)
movlpd %xmm0, -0x78(%rbp)
movq -0x78(%rbp), %rcx
movq %rcx, -0x64(%rbp)
movl -0x70(%rbp), %ecx
movl %ecx, -0x5c(%rbp)
movq -0x64(%rbp), %rcx
movq %rcx, 0x148(%rax)
movl -0x5c(%rbp), %ecx
movl %ecx, 0x150(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0x3f, %edi
movl $0x7f, %esi
movl $0xbf, %edx
movl $0xff, %ecx
callq 0x2c20
movl %eax, %ecx
movq -0x88(%rbp), %rax
movl %ecx, -0x7c(%rbp)
movl -0x7c(%rbp), %ecx
movl %ecx, 0x154(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x158(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x160(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x100(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x108(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x110(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x118(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)