LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/jo_jpeg.c
// Function: jo_writeBits
static void jo_writeBits(FILE *fp,
                         int *bitBuf, int *bitCnt,
                         const unsigned short *bs) {
  (*bitCnt) += bs[1];
  (*bitBuf) |= bs[0] << (24 - (*bitCnt));
  while((*bitCnt) >= 8) {
    unsigned char c = ((*bitBuf) >> 16) & 255;
    putc(c, fp);
    if(c == 255) {
      putc(0, fp);
    }
    (*bitBuf) <<= 8;
    (*bitCnt) -= 8;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x2(%rax), %ecx
movq -0x18(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movzwl (%rax), %eax
movq -0x18(%rbp), %rdx
movl $0x18, %ecx
subl (%rdx), %ecx
shll %cl, %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
cmpl $0x8, (%rax)
jl 0x40959b
movq -0x10(%rbp), %rax
movl (%rax), %eax
sarl $0x10, %eax
andl $0xff, %eax
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %edi
movq -0x8(%rbp), %rsi
callq 0x440a60
movzbl -0x21(%rbp), %eax
cmpl $0xff, %eax
jne 0x409583
movq -0x8(%rbp), %rsi
xorl %edi, %edi
callq 0x440a60
movq -0x10(%rbp), %rax
movl (%rax), %ecx
shll $0x8, %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl (%rax), %ecx
subl $0x8, %ecx
movl %ecx, (%rax)
jmp 0x409546
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/jo_jpeg.c
// Function: jo_calcBits
static void jo_calcBits(int val, unsigned short bits[2]) {
  int tmp1 = val < 0 ? -val : val;
  val = val < 0 ? val-1 : val;
  bits[1] = 1;
  while(tmp1 >>= 1) {
    ++bits[1];
  }
  bits[0] = val & ((1<<bits[1])-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x40983b
xorl %eax, %eax
subl -0x4(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x409841
movl -0x4(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x4(%rbp)
jge 0x409858
movl -0x4(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x40985e
movl -0x4(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movq -0x10(%rbp), %rax
movw $0x1, 0x2(%rax)
movl -0x14(%rbp), %eax
sarl %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x40988d
movq -0x10(%rbp), %rax
movw 0x2(%rax), %cx
addw $0x1, %cx
movw %cx, 0x2(%rax)
jmp 0x40986e
movl -0x4(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
andl %ecx, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/kdtree.c
// Function: boundingEdgeCompare
int boundingEdgeCompare(const void *a,const void *b) {
  const struct BoundingEdge *aa=(const struct BoundingEdge*)a;
  const struct BoundingEdge *bb=(const struct BoundingEdge*)b;

  if(aa->val==bb->val) {
    return (aa->type < bb->type)?-1:1;
  }

  return (aa->val<bb->val)?-1:1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x28(%rbp), %rax
ucomiss 0x4(%rax), %xmm0
jne 0x409911
jp 0x409911
movq -0x20(%rbp), %rax
movl (%rax), %edx
movq -0x28(%rbp), %rax
movl (%rax), %esi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl %esi, %edx
cmovll %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x409936
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm1
movq -0x28(%rbp), %rax
movss 0x4(%rax), %xmm0
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
ucomiss %xmm1, %xmm0
cmoval %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/kdtree.c
// Function: calcBoundingBoxSa
float calcBoundingBoxSa(const float *start,const float *end) {
  float diag[3];
  diag[0]=end[0]-start[0];
  diag[1]=end[1]-start[1];
  diag[2]=end[2]-start[2];
  return 2.0f*(diag[0]*diag[1]+diag[0]*diag[2]+diag[1]*diag[2]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
movq -0x8(%rbp), %rax
subss (%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x8(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x14(%rbp)
movss -0x1c(%rbp), %xmm0
movss -0x18(%rbp), %xmm2
movss -0x1c(%rbp), %xmm1
mulss -0x14(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss -0x18(%rbp), %xmm1
movss -0x14(%rbp), %xmm2
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss 0xdaf47(%rip), %xmm0    # 0x4e490c
mulss %xmm1, %xmm0
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/kdtree.c
// Function: calcBoundingBoxMaximumExtent
int calcBoundingBoxMaximumExtent(const float *start,const float *end) {
  float diag[3];

  diag[0]=end[0]-start[0];
  diag[1]=end[1]-start[1];
  diag[2]=end[2]-start[2];

  if (diag[0] > diag[1] && diag[0] > diag[2]) {
    return 0;
  } else if (diag[1] > diag[2]) {
    return 1;
  }

  return 2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movss (%rax), %xmm0
movq -0x10(%rbp), %rax
subss (%rax), %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x24(%rbp), %xmm0
ucomiss -0x20(%rbp), %xmm0
jbe 0x409a3e
movss -0x24(%rbp), %xmm0
ucomiss -0x1c(%rbp), %xmm0
jbe 0x409a3e
movl $0x0, -0x4(%rbp)
jmp 0x409a5b
movss -0x20(%rbp), %xmm0
ucomiss -0x1c(%rbp), %xmm0
jbe 0x409a52
movl $0x1, -0x4(%rbp)
jmp 0x409a5b
jmp 0x409a54
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/kdtree.c
// Function: PowInt
int PowInt(int base, int exp) {
  int result = 1;

  while (exp) {
    if (exp & 1) {
      result *= base;
    }

    exp >>= 1;
    base *= base;
  }

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x40a410
movl -0x8(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x40a3fc
movl -0x4(%rbp), %eax
imull -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
sarl %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
imull -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x40a3e1
movl -0xc(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: InvSqrt
float InvSqrt(float x){
    float xhalf = 0.5f*x;
    int i = *(int*)&x;
    i = 0x5f3759df - (i>>1);
    x = *(float*)&i;
    x = x*(1.5f - xhalf*x*x);
    return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movss %xmm0, -0x4(%rbp)
movss 0xd6c43(%rip), %xmm0    # 0x4e3464
mulss -0x4(%rbp), %xmm0
movss %xmm0, -0x8(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %ecx
sarl %ecx
movl $0x5f3759df, %eax       # imm = 0x5F3759DF
subl %ecx, %eax
movl %eax, -0xc(%rbp)
movss -0xc(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
movss -0x4(%rbp), %xmm0
movss -0x8(%rbp), %xmm1
mulss -0x4(%rbp), %xmm1
movss -0x4(%rbp), %xmm2
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm1
movss 0xd8389(%rip), %xmm2    # 0x4e4c00
addss %xmm2, %xmm1
mulss %xmm1, %xmm0
movss %xmm0, -0x4(%rbp)
movss -0x4(%rbp), %xmm0
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: vec3_cross
void vec3_cross(float *out,const float *a,const float *b) {
  float tmp[3]={a[1]*b[2]-a[2]*b[1],
                a[2]*b[0]-a[0]*b[2],
                a[0]*b[1]-a[1]*b[0]};


  memcpy(out,tmp,sizeof(tmp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
movss 0x8(%rax), %xmm2
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm1
movq -0x18(%rbp), %rax
mulss 0x4(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x18(%rbp), %rax
movss (%rax), %xmm2
movq -0x10(%rbp), %rax
movss (%rax), %xmm1
movq -0x18(%rbp), %rax
mulss 0x8(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm2
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm1
movq -0x18(%rbp), %rax
mulss (%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq -0x24(%rbp), %rcx
movq %rcx, (%rax)
movl -0x1c(%rbp), %ecx
movl %ecx, 0x8(%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: vec3_normal
void vec3_normal(float *out,const float *v) {
  float l=1.0f/vec3_length(v);
  // float l= InvSqrt(vec3_dot(v,v));
  out[0]=v[0]*l;
  out[1]=v[1]*l;
  out[2]=v[2]*l;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x40c9d0
movaps %xmm0, %xmm1
movss 0xd6a60(%rip), %xmm0    # 0x4e3484
divss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
mulss -0x14(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, (%rax)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
mulss -0x14(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
mulss -0x14(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_transpose
void mat4_transpose(float *out,float *m) {
  int i,j;
  for(i=0;i<4;i++){
    for(j=i+1;j<4;j++){
      float a = m[i*4+j];
      out[i*4+j] = m[j*4+i];
      out[j*4+i] = a;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0x40ccb5
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x4, -0x18(%rbp)
jge 0x40cca5
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x2, %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
shll $0x2, %ecx
addl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
shll $0x2, %ecx
addl -0x18(%rbp), %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movss -0x1c(%rbp), %xmm0
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
shll $0x2, %ecx
addl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x40cc36
jmp 0x40cca7
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x40cc23
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_mul
void mat4_mul(float *out,const float *a,
                   const float *b) {
  int i,j,k;
  float tmp[16];

  for(i=0;i<4;i++) {
    for(j=0;j<4;j++){
      float x=0.0f;

      for(k=0;k<4;k++){
        x+=a[i*4+k]*b[k*4+j];
      }

      tmp[i*4+j]=x;
    }
  }

  memcpy(out,tmp,sizeof(tmp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
jge 0x40cd89
movl $0x0, -0x20(%rbp)
cmpl $0x4, -0x20(%rbp)
jge 0x40cd79
xorps %xmm0, %xmm0
movss %xmm0, -0x74(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x4, -0x24(%rbp)
jge 0x40cd55
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
shll $0x2, %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x18(%rbp), %rax
movl -0x24(%rbp), %ecx
shll $0x2, %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm2
movss -0x74(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x74(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x40cd08
movss -0x74(%rbp), %xmm0
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl -0x20(%rbp), %eax
cltq
movss %xmm0, -0x70(%rbp,%rax,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x40ccef
jmp 0x40cd7b
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x40ccde
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl $0x40, %edx
callq 0x401058
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_mulVector
void mat4_mulVector(float *out,
                         const float *m,
                         const float *v) {
  int i,j;
  float tmp[4];

  for(i=0;i<4;i++) {
    tmp[i]=0.0f;

    for(j=0;j<4;j++){
      tmp[i]+=m[i*4+j]*v[j];
    }
  }

  memcpy(out,tmp,sizeof(tmp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
jge 0x40ce39
movslq -0x1c(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, -0x30(%rbp,%rax,4)
movl $0x0, -0x20(%rbp)
cmpl $0x4, -0x20(%rbp)
jge 0x40ce2c
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
shll $0x2, %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movss (%rax,%rcx,4), %xmm2
movslq -0x1c(%rbp), %rax
movss -0x30(%rbp,%rax,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x30(%rbp,%rax,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x40cde1
jmp 0x40ce2e
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x40cdc7
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x8(%rax)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_inverse
void mat4_inverse(float *out,const float *m) {
  int K,q,L;
  float m2[16],tmp[16];
  mat4_identity(tmp);

  memcpy(m2,m,sizeof(m2));

  for(K=0;K<4;++K) {
    float factor = m2[K*4+K];

    for(q=0;q<4;q++) {
      m2[K*4+q] /= factor;
      tmp[K*4+q] /= factor;
    }

    for(L=0;L<4;++L){
      if(K==L) {
        continue;
      }

      float coefficient = m2[L*4+K];

      for(q=0;q<4;q++) {
        m2[L*4+q] -= coefficient*m2[K*4+q];
        tmp[L*4+q] -= coefficient*tmp[K*4+q];
      }
    }
  }

  memcpy(out,tmp,sizeof(tmp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x40cba0
leaq -0x60(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl $0x40, %edx
callq 0x401058
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0x40d01a
movl -0x14(%rbp), %eax
shll $0x2, %eax
addl -0x14(%rbp), %eax
cltq
movss -0x60(%rbp,%rax,4), %xmm0
movss %xmm0, -0xa4(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x4, -0x18(%rbp)
jge 0x40cf0f
movss -0xa4(%rbp), %xmm1
movl -0x14(%rbp), %eax
shll $0x2, %eax
addl -0x18(%rbp), %eax
cltq
movss -0x60(%rbp,%rax,4), %xmm0
divss %xmm1, %xmm0
movss %xmm0, -0x60(%rbp,%rax,4)
movss -0xa4(%rbp), %xmm1
movl -0x14(%rbp), %eax
shll $0x2, %eax
addl -0x18(%rbp), %eax
cltq
movss -0xa0(%rbp,%rax,4), %xmm0
divss %xmm1, %xmm0
movss %xmm0, -0xa0(%rbp,%rax,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x40ceb2
movl $0x0, -0x1c(%rbp)
cmpl $0x4, -0x1c(%rbp)
jge 0x40d00a
movl -0x14(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x40cf2d
jmp 0x40cffc
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl -0x14(%rbp), %eax
cltq
movss -0x60(%rbp,%rax,4), %xmm0
movss %xmm0, -0xa8(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x4, -0x18(%rbp)
jge 0x40cffa
movss -0xa8(%rbp), %xmm0
movl -0x14(%rbp), %eax
shll $0x2, %eax
addl -0x18(%rbp), %eax
cltq
movss -0x60(%rbp,%rax,4), %xmm2
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl -0x18(%rbp), %eax
cltq
movss -0x60(%rbp,%rax,4), %xmm1
movd %xmm0, %ecx
xorl $0x80000000, %ecx       # imm = 0x80000000
movd %ecx, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x60(%rbp,%rax,4)
movss -0xa8(%rbp), %xmm0
movl -0x14(%rbp), %eax
shll $0x2, %eax
addl -0x18(%rbp), %eax
cltq
movss -0xa0(%rbp,%rax,4), %xmm2
movl -0x1c(%rbp), %eax
shll $0x2, %eax
addl -0x18(%rbp), %eax
cltq
movss -0xa0(%rbp,%rax,4), %xmm1
movd %xmm0, %ecx
xorl $0x80000000, %ecx       # imm = 0x80000000
movd %ecx, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0xa0(%rbp,%rax,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x40cf4d
jmp 0x40cffc
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x40cf16
jmp 0x40d00c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x40ce88
movq -0x8(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
movl $0x40, %edx
callq 0x401058
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_normal
void mat4_normal(float *out,const float *m) {
  float m2[16];
  mat4_inverse(m2,m);
  mat4_transpose(m2,m2);

  memcpy(out,m2,sizeof(m2));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x50(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x40ce50
leaq -0x50(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x40cc10
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x40, %edx
callq 0x401058
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_translate
void mat4_translate(float *out,const float *v, bool mul) {
  int i;
  float mat[16];
  mat4_identity(mat);

  for(i=0;i<3;i++) {
    mat[3+i*4]=v[i];
  }

  //
  if(mul) {
    mat4_mul(out,out,mat);
  } else {
    memcpy(out,mat,sizeof(mat));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x40cba0
movl $0x0, -0x18(%rbp)
cmpl $0x3, -0x18(%rbp)
jge 0x40d156
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movl -0x18(%rbp), %eax
shll $0x2, %eax
addl $0x3, %eax
cltq
movss %xmm0, -0x60(%rbp,%rax,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x40d127
testb $0x1, -0x11(%rbp)
je 0x40d16f
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x40ccc0
jmp 0x40d181
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x40, %edx
callq 0x401058
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_scale
void mat4_scale(float *out,const float *v,bool mul) {
  int i;
  float mat[16];
  mat4_identity(mat);

  for(i=0;i<3;i++) {
    mat[i*5]=v[i];
  }

  //
  if(mul) {
    mat4_mul(out,out,mat);
  } else {
    memcpy(out,mat,sizeof(mat));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x40cba0
movl $0x0, -0x18(%rbp)
cmpl $0x3, -0x18(%rbp)
jge 0x40d1e1
movq -0x10(%rbp), %rax
movslq -0x18(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
imull $0x5, -0x18(%rbp), %eax
cltq
movss %xmm0, -0x60(%rbp,%rax,4)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x40d1b7
testb $0x1, -0x11(%rbp)
je 0x40d1fa
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x40ccc0
jmp 0x40d20c
movq -0x8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x40, %edx
callq 0x401058
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_rotateX
void mat4_rotateX(float *out,float x, bool mul) {
  float mat[16];
  mat4_identity(mat);

  float c=cosf(x);
  float s=sinf(x);

  mat[5]=c;
  mat[6]=-s;
  mat[9]=s;
  mat[10]=c;

  //
  if(mul) {
    mat4_mul(out,out,mat);
  } else {
    memcpy(out,mat,sizeof(mat));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
andb $0x1, %al
movb %al, -0xd(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x40cba0
movss -0xc(%rbp), %xmm0
callq 0x401078
movss %xmm0, -0x54(%rbp)
movss -0xc(%rbp), %xmm0
callq 0x401118
movss %xmm0, -0x58(%rbp)
movss -0x54(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x58(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x38(%rbp)
movss -0x58(%rbp), %xmm0
movss %xmm0, -0x2c(%rbp)
movss -0x54(%rbp), %xmm0
movss %xmm0, -0x28(%rbp)
testb $0x1, -0xd(%rbp)
je 0x40d2ae
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x40ccc0
jmp 0x40d2c0
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x40, %edx
callq 0x401058
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_rotateY
void mat4_rotateY(float *out,float y,bool mul) {
  float mat[16];
  mat4_identity(mat);

  float c=cosf(y);
  float s=sinf(y);

  mat[0]=c;
  mat[2]=s;
  mat[8]=-s;
  mat[10]=c;

  //
  if(mul) {
    mat4_mul(out,out,mat);
  } else {
    memcpy(out,mat,sizeof(mat));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
andb $0x1, %al
movb %al, -0xd(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x40cba0
movss -0xc(%rbp), %xmm0
callq 0x401078
movss %xmm0, -0x54(%rbp)
movss -0xc(%rbp), %xmm0
callq 0x401118
movss %xmm0, -0x58(%rbp)
movss -0x54(%rbp), %xmm0
movss %xmm0, -0x50(%rbp)
movss -0x58(%rbp), %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x58(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x30(%rbp)
movss -0x54(%rbp), %xmm0
movss %xmm0, -0x28(%rbp)
testb $0x1, -0xd(%rbp)
je 0x40d35e
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x40ccc0
jmp 0x40d370
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x40, %edx
callq 0x401058
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_rotateZ
void mat4_rotateZ(float *out,float z,bool mul) {
  float mat[16];
  mat4_identity(mat);

  float c=cosf(z);
  float s=sinf(z);

  mat[0]=c;
  mat[1]=-s;
  mat[4]=s;
  mat[5]=c;

  //
  if(mul) {
    mat4_mul(out,out,mat);
  } else {
    memcpy(out,mat,sizeof(mat));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
andb $0x1, %al
movb %al, -0xd(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x40cba0
movss -0xc(%rbp), %xmm0
callq 0x401078
movss %xmm0, -0x54(%rbp)
movss -0xc(%rbp), %xmm0
callq 0x401118
movss %xmm0, -0x58(%rbp)
movss -0x54(%rbp), %xmm0
movss %xmm0, -0x50(%rbp)
movss -0x58(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x58(%rbp), %xmm0
movss %xmm0, -0x40(%rbp)
movss -0x54(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
testb $0x1, -0xd(%rbp)
je 0x40d40e
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq -0x50(%rbp), %rdx
callq 0x40ccc0
jmp 0x40d420
movq -0x8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x40, %edx
callq 0x401058
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat3_mulVector
void mat3_mulVector(float *out,const float *m,const float *v) {
  int i,j;
  float tmp[3];

  for(i=0;i<3;i++) {
    tmp[i]=0.0f;

    for(j=0;j<3;j++){
      tmp[i]+=m[i*3+j]*v[j];
    }
  }

  memcpy(out,tmp,sizeof(tmp));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x3, -0x1c(%rbp)
jge 0x40dab7
movslq -0x1c(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp,%rax,4)
movl $0x0, -0x20(%rbp)
cmpl $0x3, -0x20(%rbp)
jge 0x40daaa
movq -0x10(%rbp), %rax
imull $0x3, -0x1c(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x18(%rbp), %rax
movslq -0x20(%rbp), %rcx
movss (%rax,%rcx,4), %xmm2
movslq -0x1c(%rbp), %rax
movss -0x2c(%rbp,%rax,4), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x2c(%rbp,%rax,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x40da61
jmp 0x40daac
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x40da47
movq -0x8(%rbp), %rax
movq -0x2c(%rbp), %rcx
movq %rcx, (%rax)
movl -0x24(%rbp), %ecx
movl %ecx, 0x8(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: reflect
void reflect(float *out,const float *II,const float *N) {
  //I - 2.0 * dot(N, I) * N.

  float a=2.0f*vec3_dot(N,II);
  out[0]=II[0]-a*N[0];
  out[1]=II[1]-a*N[1];
  out[2]=II[2]-a*N[2];

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x40c970
movaps %xmm0, %xmm1
movss 0xd6e10(%rip), %xmm0    # 0x4e490c
mulss %xmm1, %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movss (%rax), %xmm1
movss -0x1c(%rbp), %xmm0
movq -0x18(%rbp), %rax
movss (%rax), %xmm2
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, (%rax)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm1
movss -0x1c(%rbp), %xmm0
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm2
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm1
movss -0x1c(%rbp), %xmm0
movq -0x18(%rbp), %rax
movss 0x8(%rax), %xmm2
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: intersectRayPlane
bool intersectRayPlane(const float *P,const float *V,
                       const float *plane,float *t) {
  //ax+by+cz+d=0
  float d, NPd, NV;
  const float *N;

  //
  d=plane[3];
  N=plane;

  //
  NPd=vec3_dot(N,P)+d;

  //origin below plane
  //and on
  if(NPd <= 0.0f) {
    return false;
  }

  //
  NV=vec3_dot(N,V);

  //vector parallel or pointing away from plane
  if(NV >= 0.0f) {
    return false;
  }


  //
  (*t)=-(NPd)/NV;

  //
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x20(%rbp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x40c970
addss -0x2c(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
xorps %xmm0, %xmm0
ucomiss -0x30(%rbp), %xmm0
jb 0x40e0a4
movb $0x0, -0x1(%rbp)
jmp 0x40e0ec
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x40c970
movss %xmm0, -0x34(%rbp)
movss -0x34(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x40e0c9
movb $0x0, -0x1(%rbp)
jmp 0x40e0ec
movss -0x30(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
divss -0x34(%rbp), %xmm0
movq -0x28(%rbp), %rax
movss %xmm0, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: intersectRaySphere
bool intersectRaySphere(const float *P,const float *V,
                        const float *C,float r,
                        float *t) {
  float M[3],b,d,c;

  //
  vec3_sub(M,P,C);
  c=vec3_dot(M,M)-r*r;

  //inside sphere
  if(c<0.0f) {
    return false;
  }

  //
  b=vec3_dot(V,M);

  //ray pointing away from sphere
  // when on or outside sphere (c>=0)
  if(b > 0.0f) {
    return false;
  }

  //
  d=b*b-c;

  //no real roots (ray pointing towards, but misses)
  if(d < 0.0f) {
    return false;
  }

  //
  (*t)=-b-sqrtf(d);

  //
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movss %xmm0, -0x24(%rbp)
movq %rcx, -0x30(%rbp)
leaq -0x3c(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x40cae0
leaq -0x3c(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x40c970
movaps %xmm0, %xmm1
movss -0x24(%rbp), %xmm0
movss -0x24(%rbp), %xmm2
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x48(%rbp)
xorps %xmm0, %xmm0
ucomiss -0x48(%rbp), %xmm0
jbe 0x40e174
movb $0x0, -0x1(%rbp)
jmp 0x40e20a
movq -0x18(%rbp), %rdi
leaq -0x3c(%rbp), %rsi
callq 0x40c970
movss %xmm0, -0x40(%rbp)
movss -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x40e199
movb $0x0, -0x1(%rbp)
jmp 0x40e20a
movss -0x40(%rbp), %xmm0
movss -0x40(%rbp), %xmm2
movss -0x48(%rbp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x44(%rbp)
xorps %xmm0, %xmm0
ucomiss -0x44(%rbp), %xmm0
jbe 0x40e1d1
movb $0x0, -0x1(%rbp)
jmp 0x40e20a
movss -0x40(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x44(%rbp), %xmm0
callq 0x4267b0
movaps %xmm0, %xmm1
movss -0x4c(%rbp), %xmm0
subss %xmm1, %xmm0
movq -0x30(%rbp), %rax
movss %xmm0, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: planeFromPointNormal
void planeFromPointNormal(const float *pt,
                          const float *nor,
                          bool norm,
                          float *plane) {

  //ax+by+cz+d=0

  plane[0]=nor[0]; //a
  plane[1]=nor[1]; //b
  plane[2]=nor[2]; //c

  if(norm) {
    vec3_normal(plane,plane);
  }

  plane[3]=-vec3_dot(pt,plane);//d
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, (%rax)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0x8(%rax)
testb $0x1, -0x11(%rbp)
je 0x40e9b2
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x40ca00
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x40c970
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movq -0x20(%rbp), %rax
movss %xmm0, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: planeFromTriangle
void planeFromTriangle(const float *pt0,const float *pt1,
                       const float *pt2,bool cw,
                       float *plane) {

  float E0[3],E1[3],N[3];
  vec3_sub(E0,pt1,pt0);
  vec3_sub(E1,pt2,pt0);
  vec3_cross(N,E0,E1);
  vec3_normal(N,N);

  if(!cw) {
    vec3_mulScalar(N,N,-1.0f);
  }

  planeFromPointNormal(pt0,N,false,plane);


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq %r8, -0x28(%rbp)
leaq -0x34(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rdx
callq 0x40cae0
leaq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rdx
callq 0x40cae0
leaq -0x4c(%rbp), %rdi
leaq -0x34(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x40c890
leaq -0x4c(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
callq 0x40ca00
testb $0x1, -0x19(%rbp)
jne 0x40ea5a
leaq -0x4c(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
movss 0xd61af(%rip), %xmm0    # 0x4e4c04
callq 0x40cb40
movq -0x8(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
movq -0x28(%rbp), %rcx
xorl %edx, %edx
callq 0x40e950
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: triangleBoundingBox
void triangleBoundingBox(const float *pt0,
                         const float *pt1,
                         const float *pt2,
                         float *start,float *end) {
  int i;

  start[0]=end[0]=pt0[0];
  start[1]=end[1]=pt0[1];
  start[2]=end[2]=pt0[2];

  for(i=0;i<3;i++) {
    if(pt1[i] < start[i]) {
      start[i]=pt1[i];
    }

    if(pt1[i] > end[i]) {
      end[i]=pt1[i];
    }

    if(pt2[i] < start[i]) {
      start[i]=pt2[i];
    }

    if(pt2[i] > end[i]) {
      end[i]=pt2[i];
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movss (%rax), %xmm0
movq -0x28(%rbp), %rax
movss %xmm0, (%rax)
movq -0x20(%rbp), %rax
movss %xmm0, (%rax)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x28(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x20(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x28(%rbp), %rax
movss %xmm0, 0x8(%rax)
movq -0x20(%rbp), %rax
movss %xmm0, 0x8(%rax)
movl $0x0, -0x2c(%rbp)
cmpl $0x3, -0x2c(%rbp)
jge 0x40ebe3
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x40eb30
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
ucomiss (%rax,%rcx,4), %xmm0
jbe 0x40eb65
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm1
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x40eb9e
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
ucomiss (%rax,%rcx,4), %xmm0
jbe 0x40ebd3
movq -0x18(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
jmp 0x40ebd5
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x40eaed
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: sphereBoundingBox
void sphereBoundingBox(const float *pos,float radius,
                       float *start,float *end) {
  int i;

  for(i=0;i<3;i++) {
    start[i]=pos[i]-radius;
    end[i]=pos[i]+radius;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0x3, -0x24(%rbp)
jge 0x40ec5b
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
subss -0xc(%rbp), %xmm0
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss (%rax,%rcx,4), %xmm0
addss -0xc(%rbp), %xmm0
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x40ec0c
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_frustum
void mat4_frustum(float *out,
                  float left,float right,
                  float bottom,float top,
                  float zNear,float zFar) {

  memset(out,0,sizeof(float)*16);

  float A=(right+left)/(right-left);
  float B=(top+bottom)/(top-bottom);
  float C=-(zFar+zNear)/(zFar-zNear);
  float D=-(2.0f*zFar*zNear)/(zFar-zNear);

  float x=(2.0f*zNear)/(right-left);
  float y=(2.0f*zNear)/(top-bottom);

  out[0]=x;
  out[2]=A;
  out[5]=y;
  out[6]=B;
  out[10]=C;
  out[11]=D;
  out[14]=-1.0f;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movss %xmm2, -0x14(%rbp)
movss %xmm3, -0x18(%rbp)
movss %xmm4, -0x1c(%rbp)
movss %xmm5, -0x20(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x4010e0
movss -0x10(%rbp), %xmm0
addss -0xc(%rbp), %xmm0
movss -0x10(%rbp), %xmm1
subss -0xc(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x18(%rbp), %xmm0
addss -0x14(%rbp), %xmm0
movss -0x18(%rbp), %xmm1
subss -0x14(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x28(%rbp)
movss -0x20(%rbp), %xmm0
addss -0x1c(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss -0x20(%rbp), %xmm1
subss -0x1c(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x2c(%rbp)
movss 0xd5bb6(%rip), %xmm0    # 0x4e490c
mulss -0x20(%rbp), %xmm0
mulss -0x1c(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss -0x20(%rbp), %xmm1
subss -0x1c(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x30(%rbp)
movss 0xd5b84(%rip), %xmm0    # 0x4e490c
mulss -0x1c(%rbp), %xmm0
movss -0x10(%rbp), %xmm1
subss -0xc(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x34(%rbp)
movss 0xd5b64(%rip), %xmm0    # 0x4e490c
mulss -0x1c(%rbp), %xmm0
movss -0x18(%rbp), %xmm1
subss -0x14(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x38(%rbp)
movss -0x34(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, (%rax)
movss -0x24(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x8(%rax)
movss -0x38(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x14(%rax)
movss -0x28(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x18(%rax)
movss -0x2c(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x28(%rax)
movss -0x30(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x2c(%rax)
movq -0x8(%rbp), %rax
movss 0xd5de5(%rip), %xmm0    # 0x4e4c04
movss %xmm0, 0x38(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_infFrustum
void mat4_infFrustum(float *out,
                     float left,float right,
                     float bottom,float top,
                     float zNear) {

  memset(out,0,sizeof(float)*16);

  float A=(right+left)/(right-left);
  float B=(top+bottom)/(top-bottom);
  float C=-1.0f;
  float D=-2.0f*zNear;

  float x=(2.0f*zNear)/(right-left);
  float y=(2.0f*zNear)/(top-bottom);

  out[0]=x;
  out[2]=A;
  out[5]=y;
  out[6]=B;
  out[10]=C;
  out[11]=D;
  out[14]=-1.0f;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movss %xmm2, -0x14(%rbp)
movss %xmm3, -0x18(%rbp)
movss %xmm4, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x4010e0
movss -0x10(%rbp), %xmm0
addss -0xc(%rbp), %xmm0
movss -0x10(%rbp), %xmm1
subss -0xc(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x18(%rbp), %xmm0
addss -0x14(%rbp), %xmm0
movss -0x18(%rbp), %xmm1
subss -0x14(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x24(%rbp)
movss 0xd5d5d(%rip), %xmm0    # 0x4e4c04
movss %xmm0, -0x28(%rbp)
movss 0xd5d54(%rip), %xmm0    # 0x4e4c08
mulss -0x1c(%rbp), %xmm0
movss %xmm0, -0x2c(%rbp)
movss 0xd5a46(%rip), %xmm0    # 0x4e490c
mulss -0x1c(%rbp), %xmm0
movss -0x10(%rbp), %xmm1
subss -0xc(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x30(%rbp)
movss 0xd5a26(%rip), %xmm0    # 0x4e490c
mulss -0x1c(%rbp), %xmm0
movss -0x18(%rbp), %xmm1
subss -0x14(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x34(%rbp)
movss -0x30(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, (%rax)
movss -0x20(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x8(%rax)
movss -0x34(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x14(%rax)
movss -0x24(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x18(%rax)
movss -0x28(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x28(%rax)
movss -0x2c(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x2c(%rax)
movq -0x8(%rbp), %rax
movss 0xd5ca7(%rip), %xmm0    # 0x4e4c04
movss %xmm0, 0x38(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_perspective_fovx
void mat4_perspective_fovx(float *out,
                        float fovx,float aspect,
                        float znear,float zfar) {
  float right=tan(fovx/2.0f)*znear;
  float left=-right;
  float top=right/aspect;
  float bottom=-top;
  mat4_frustum(out,left,right,bottom,top,znear,zfar);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movss %xmm2, -0x14(%rbp)
movss %xmm3, -0x18(%rbp)
movss -0xc(%rbp), %xmm0
movss 0xd596f(%rip), %xmm1    # 0x4e490c
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x4010f8
movss -0x14(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x1c(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x1c(%rbp), %xmm0
divss -0x10(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movss -0x20(%rbp), %xmm0
movss -0x1c(%rbp), %xmm1
movss -0x28(%rbp), %xmm2
movss -0x24(%rbp), %xmm3
movss -0x14(%rbp), %xmm4
movss -0x18(%rbp), %xmm5
callq 0x40ecb0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_perspective_fovy
void mat4_perspective_fovy(float *out,
                        float fovy,float aspect,
                        float znear,float zfar) {

  float top=tan(fovy/2.0f)*znear;
  float bottom=-top;
  float right=top*aspect;
  float left=-right;
  mat4_frustum(out,left,right,bottom,top,znear,zfar);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movss %xmm2, -0x14(%rbp)
movss %xmm3, -0x18(%rbp)
movss -0xc(%rbp), %xmm0
movss 0xd58af(%rip), %xmm1    # 0x4e490c
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x4010f8
movss -0x14(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x1c(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x1c(%rbp), %xmm0
mulss -0x10(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movss -0x28(%rbp), %xmm0
movss -0x24(%rbp), %xmm1
movss -0x20(%rbp), %xmm2
movss -0x1c(%rbp), %xmm3
movss -0x14(%rbp), %xmm4
movss -0x18(%rbp), %xmm5
callq 0x40ecb0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_infPerspective_fovx
void mat4_infPerspective_fovx(float *out,
                              float fovx,float aspect,
                              float znear) {
  float right=tan(fovx/2.0f)*znear;
  float left=-right;
  float top=right/aspect;
  float bottom=-top;
  mat4_infFrustum(out,left,right,bottom,top,znear);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movss %xmm2, -0x14(%rbp)
movss -0xc(%rbp), %xmm0
movss 0xd57f4(%rip), %xmm1    # 0x4e490c
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x4010f8
movss -0x14(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
movss -0x18(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x18(%rbp), %xmm0
divss -0x10(%rbp), %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x20(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movss -0x1c(%rbp), %xmm0
movss -0x18(%rbp), %xmm1
movss -0x24(%rbp), %xmm2
movss -0x20(%rbp), %xmm3
movss -0x14(%rbp), %xmm4
callq 0x40ee30
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_infPerspective_fovy
void mat4_infPerspective_fovy(float *out,
                              float fovy,float aspect,
                              float znear) {

  float top=tan(fovy/2.0f)*znear;
  float bottom=-top;
  float right=top*aspect;
  float left=-right;
  mat4_infFrustum(out,left,right,bottom,top,znear);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movss %xmm2, -0x14(%rbp)
movss -0xc(%rbp), %xmm0
movss 0xd5744(%rip), %xmm1    # 0x4e490c
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x4010f8
movss -0x14(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
movss -0x18(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x18(%rbp), %xmm0
mulss -0x10(%rbp), %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x20(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
movss -0x24(%rbp), %xmm0
movss -0x20(%rbp), %xmm1
movss -0x1c(%rbp), %xmm2
movss -0x18(%rbp), %xmm3
movss -0x14(%rbp), %xmm4
callq 0x40ee30
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_perspective
void mat4_perspective(float *out,float fov,float aspect,
                      float znear,float zfar) {
  float yScale=1.0f/tanf(fov/2.0f);
  float xScale=yScale/aspect;
  float nearmfar=znear-zfar;

  memset(out,0,sizeof(float)*16);

  out[0]=xScale;
  out[5]=yScale;
  out[10]=(zfar+znear)/nearmfar;
  out[11]=2.0f*zfar*znear/nearmfar;
  out[14]=-1.0f;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movss %xmm2, -0x14(%rbp)
movss %xmm3, -0x18(%rbp)
movss -0xc(%rbp), %xmm0
movss 0xd568f(%rip), %xmm1    # 0x4e490c
divss %xmm1, %xmm0
callq 0x426640
movaps %xmm0, %xmm1
movss 0xd41f3(%rip), %xmm0    # 0x4e3484
divss %xmm1, %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x1c(%rbp), %xmm0
divss -0x10(%rbp), %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x14(%rbp), %xmm0
subss -0x18(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x4010e0
movss -0x20(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, (%rax)
movss -0x1c(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x14(%rax)
movss -0x18(%rbp), %xmm0
addss -0x14(%rbp), %xmm0
divss -0x24(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x28(%rax)
movss 0xd5609(%rip), %xmm0    # 0x4e490c
mulss -0x18(%rbp), %xmm0
mulss -0x14(%rbp), %xmm0
divss -0x24(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x2c(%rax)
movq -0x8(%rbp), %rax
movss 0xd58dd(%rip), %xmm0    # 0x4e4c04
movss %xmm0, 0x38(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)