// File: /workspace/github_c_makefile_star2_O3/Nealsbo[P]C-Software-Renderer/src/libmath.c
// Function: mat4_rotation
void mat4_rotation( mat4 dest, float x, float y, float z ){
    mat4 mx, my, mz, tmp;
    mat4_create(tmp);
    mat4_create(dest);
    mat4_rotx(mx, x);
    mat4_roty(my, y);
    mat4_rotz(mz, z);
    mat4_mlt( my, mx, tmp );
    mat4_mlt( mz, tmp, dest );
    //mat4_print(mx);
    //mat4_print(my);
    //mat4_print(mz);
    //mat4_print(tmp);
    //mat4_print(dest);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x160, %rsp            # imm = 0x160
movss %xmm2, 0x40(%rsp)
movss %xmm1, 0x20(%rsp)
movq %rdi, %rbx
xorps %xmm1, %xmm1
movaps %xmm1, 0xd0(%rsp)
movaps %xmm1, 0xc0(%rsp)
movaps %xmm1, 0xb0(%rsp)
movaps %xmm1, 0xa0(%rsp)
movups %xmm1, 0x30(%rdi)
movups %xmm1, 0x20(%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm1, (%rdi)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x1250
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1080
movaps %xmm0, 0x30(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1080
cvtsd2ss %xmm0, %xmm0
xorps 0x3463(%rip), %xmm0     # 0x7150
movaps %xmm0, 0x50(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1250
cvtsd2ss %xmm0, %xmm0
movl $0x3f800000, %ebp       # imm = 0x3F800000
leaq 0x120(%rsp), %r14
movl %ebp, (%r14)
xorps %xmm2, %xmm2
movups %xmm2, 0x4(%r14)
movapd 0x10(%rsp), %xmm1
unpcklpd 0x30(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
cvtpd2ps %xmm1, %xmm1
movupd %xmm1, 0x14(%r14)
movaps 0x50(%rsp), %xmm1
movss %xmm1, 0x24(%r14)
movss %xmm0, 0x28(%r14)
movups %xmm2, 0x2c(%r14)
movl %ebp, 0x3c(%r14)
xorps %xmm0, %xmm0
cvtss2sd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x1250
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1080
cvtsd2ss %xmm0, %xmm0
xorps 0x33d3(%rip), %xmm0     # 0x7150
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1080
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x30(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1250
cvtsd2ss %xmm0, %xmm0
leaq 0xe0(%rsp), %r15
movss 0x20(%rsp), %xmm1
movss %xmm1, (%r15)
xorl %r12d, %r12d
movl %r12d, 0x4(%r15)
movaps 0x10(%rsp), %xmm1
movss %xmm1, 0x8(%r15)
movaps 0x35ae(%rip), %xmm1     # 0x7380
movups %xmm1, 0xc(%r15)
movl %r12d, 0x1c(%r15)
movss 0x30(%rsp), %xmm1
movss %xmm1, 0x20(%r15)
movl %r12d, 0x24(%r15)
movss %xmm0, 0x28(%r15)
xorps %xmm0, %xmm0
movups %xmm0, 0x2c(%r15)
movl %ebp, 0x3c(%r15)
xorps %xmm0, %xmm0
cvtss2sd 0x40(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x1250
movaps %xmm0, 0x40(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1080
movaps %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1080
cvtsd2ss %xmm0, %xmm0
xorps 0x3314(%rip), %xmm0     # 0x7150
movaps %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1250
cvtsd2ss %xmm0, %xmm0
movapd 0x40(%rsp), %xmm1
unpcklpd 0x20(%rsp), %xmm1       # xmm1 = xmm1[0],mem[0]
cvtpd2ps %xmm1, %xmm1
movapd %xmm1, 0x60(%rsp)
movaps 0x10(%rsp), %xmm1
movss %xmm1, 0x70(%rsp)
movss %xmm0, 0x74(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%rsp)
movl %ebp, 0x88(%rsp)
movups %xmm0, 0x8c(%rsp)
movl %ebp, 0x9c(%rsp)
leaq (,%r12,4), %rax
movq %r14, %rcx
xorl %edx, %edx
movq %rdx, %rsi
orq %rax, %rsi
movss 0xa0(%rsp,%rsi,4), %xmm0
xorl %edi, %edi
movss (%r15,%rdi), %xmm1
mulss (%rcx,%rdi,4), %xmm1
addss %xmm1, %xmm0
addq $0x4, %rdi
cmpq $0x10, %rdi
jne 0x3eb3
movss %xmm0, 0xa0(%rsp,%rsi,4)
incq %rdx
addq $0x4, %rcx
cmpq $0x4, %rdx
jne 0x3ea2
incq %r12
addq $0x10, %r15
cmpq $0x4, %r12
jne 0x3e95
leaq 0x60(%rsp), %rax
xorl %ecx, %ecx
leaq 0xa0(%rsp), %rdx
leaq (,%rcx,4), %rsi
movq %rdx, %rdi
xorl %r8d, %r8d
movq %r8, %r9
orq %rsi, %r9
movss (%rbx,%r9,4), %xmm0
xorl %r10d, %r10d
movss (%rax,%r10), %xmm1
mulss (%rdi,%r10,4), %xmm1
addss %xmm1, %xmm0
addq $0x4, %r10
cmpq $0x10, %r10
jne 0x3f1b
movss %xmm0, (%rbx,%r9,4)
incq %r8
addq $0x4, %rdi
cmpq $0x4, %r8
jne 0x3f0c
incq %rcx
addq $0x10, %rax
cmpq $0x4, %rcx
jne 0x3efe
addq $0x160, %rsp            # imm = 0x160
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq