// File: /workspace/github_c_makefile_star2_O0/Nealsbo[P]C-Software-Renderer/src/objloader.c
// Function: Model_Test
void Model_Test(void *_model){
    obj_model_t *model = (obj_model_t *)_model;
    int i;
    if(model == NULL){
        printf("====================\n");
        printf("Warning: Bad model test!\n");
        return;
    }
    printf("====================\n");
    printf("Model Test(obj parser):\n\tModel name: \"%s\"\n\tVertex count: %d, Face count: %d, Triangle count: %d\n",
           model->name, model->vertCount, model->trisCount / 2, model->trisCount);

    printf("\tPosition: ");
    vec3_print(model->position);
    printf("\tRotation: ");
    vec3_print(model->rotation);
    printf("\tScale: ");
    vec3_print(model->scale);

    printf("Vertices: \n");
    for(i = 0; i < model->vertCount; i++){
        vec3_print(model->vertices[i]);
    }

    printf("Normals: \n");
    for(i = 0; i < model->trisCount * 2; i++){
        vec3_print(model->normals[i]);
    }

    printf("Texture Coordinates: \n");
    for(i = 0; i < model->trisCount * 2; i++){
        vec2_print(model->textcoords[i]);
    }

    printf("Faces: \n");
    for(i = 0; i < model->trisCount; i++){
        Face_Print(model->faces[i]);
    }
    printf("====================\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xa7bc
leaq 0x42e2(%rip), %rdi      # 0xea84
movb $0x0, %al
callq 0x1040
leaq 0x42ea(%rip), %rdi      # 0xea9a
movb $0x0, %al
callq 0x1040
jmp 0xaa0a
leaq 0x42c1(%rip), %rdi      # 0xea84
xorl %eax, %eax
movb %al, -0x69(%rbp)
callq 0x1040
movb -0x69(%rbp), %al
movq -0x10(%rbp), %rsi
movl 0x120(%rsi), %edx
movl 0x12c(%rsi), %r8d
movl %r8d, %edi
shrl $0x1f, %edi
movl %r8d, %ecx
addl %edi, %ecx
sarl %ecx
leaq 0x42bf(%rip), %rdi      # 0xeab4
callq 0x1040
movb -0x69(%rbp), %al
leaq 0x4311(%rip), %rdi      # 0xeb15
callq 0x1040
movq -0x10(%rbp), %rax
movl 0x138(%rax), %ecx
movl %ecx, -0x20(%rbp)
movq 0x130(%rax), %rax
movq %rax, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movss -0x20(%rbp), %xmm1
callq 0x4f00
movb -0x69(%rbp), %al
leaq 0x42e7(%rip), %rdi      # 0xeb21
callq 0x1040
movq -0x10(%rbp), %rax
movl 0x144(%rax), %ecx
movl %ecx, -0x30(%rbp)
movq 0x13c(%rax), %rax
movq %rax, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
movss -0x30(%rbp), %xmm1
callq 0x4f00
movb -0x69(%rbp), %al
leaq 0x42bd(%rip), %rdi      # 0xeb2d
callq 0x1040
movq -0x10(%rbp), %rax
movl 0x150(%rax), %ecx
movl %ecx, -0x40(%rbp)
movq 0x148(%rax), %rax
movq %rax, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movss -0x40(%rbp), %xmm1
callq 0x4f00
leaq 0x4293(%rip), %rdi      # 0xeb36
movb $0x0, %al
callq 0x1040
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x120(%rcx), %eax
jge 0xa8fc
movq -0x10(%rbp), %rax
movq 0x100(%rax), %rax
movslq -0x14(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
movl 0x8(%rax,%rcx,4), %edx
movl %edx, -0x50(%rbp)
movq (%rax,%rcx,4), %rax
movq %rax, -0x58(%rbp)
movsd -0x58(%rbp), %xmm0
movss -0x50(%rbp), %xmm1
callq 0x4f00
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa8b1
leaq 0x423f(%rip), %rdi      # 0xeb42
movb $0x0, %al
callq 0x1040
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x12c(%rcx), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0xa960
movq -0x10(%rbp), %rax
movq 0x110(%rax), %rax
movslq -0x14(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
movl 0x8(%rax,%rcx,4), %edx
movl %edx, -0x60(%rbp)
movq (%rax,%rcx,4), %rax
movq %rax, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movss -0x60(%rbp), %xmm1
callq 0x4f00
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa911
leaq 0x41e6(%rip), %rdi      # 0xeb4d
movb $0x0, %al
callq 0x1040
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x12c(%rcx), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0xa9ac
movq -0x10(%rbp), %rax
movq 0x118(%rax), %rax
movslq -0x14(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
callq 0x3e60
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa975
leaq 0x41b1(%rip), %rdi      # 0xeb64
movb $0x0, %al
callq 0x1040
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x12c(%rcx), %eax
jge 0xa9fc
movq -0x10(%rbp), %rax
movq 0x108(%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %edi
movq 0x8(%rax), %rsi
callq 0x8430
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xa9c1
leaq 0x4081(%rip), %rdi      # 0xea84
movb $0x0, %al
callq 0x1040
addq $0x70, %rsp
popq %rbp
retq