LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/avilib.c
// Function: AVI_get_video_position
long AVI_get_video_position(avi_t *AVI, long frame)
{
   if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; }
   if(!AVI->video_index)         { AVI_errno = AVI_ERR_NO_IDX;   return -1; }

   if(frame < 0 || frame >= AVI->video_frames) return 0;
   return(AVI->video_index[frame].pos);
}

// Assembly:
cmpq $0x0, 0x8(%rdi)
je 0x403fd1
movq 0x410(%rdi), %rax
testq %rax, %rax
je 0x403fe1
testq %rsi, %rsi
js 0x403fde
cmpq %rsi, 0x40(%rdi)
jle 0x403fde
leaq (%rsi,%rsi,2), %rcx
movq 0x8(%rax,%rcx,8), %rax
retq
movq $0x7, 0x117534(%rip) # 0x51b510
jmp 0x403fec
xorl %eax, %eax
retq
movq $0xd, 0x117524(%rip) # 0x51b510
movq $-0x1, %rax
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/avilib.c
// Function: AVI_seek_start
int AVI_seek_start(avi_t *AVI)
{
   if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; }

   lseek(AVI->fdes,AVI->movi_start,SEEK_SET);
   AVI->video_pos = 0;
   return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpq $0x0, 0x8(%rdi)
je 0x40401d
movq %rdi, %rbx
movl (%rdi), %edi
movq 0x430(%rbx), %rsi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x482720
movq $0x0, 0x50(%rbx)
jmp 0x40402d
movq $0x7, 0x1174e8(%rip) # 0x51b510
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/avilib.c
// Function: AVI_set_video_position
int AVI_set_video_position(avi_t *AVI, long frame)
{
   if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; }
   if(!AVI->video_index)         { AVI_errno = AVI_ERR_NO_IDX;   return -1; }

   if (frame < 0 ) frame = 0;
   AVI->video_pos = frame;
   return 0;
}

// Assembly:
cmpq $0x0, 0x8(%rdi)
je 0x404055
cmpq $0x0, 0x410(%rdi)
je 0x404062
xorl %eax, %eax
testq %rsi, %rsi
cmovleq %rax, %rsi
movq %rsi, 0x50(%rdi)
retq
movq $0x7, 0x1174b0(%rip) # 0x51b510
jmp 0x40406d
movq $0xd, 0x1174a3(%rip) # 0x51b510
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/avilib.c
// Function: AVI_read_frame
long AVI_read_frame(avi_t *AVI, char *vidbuf, int *keyframe)
{
   long n;

   if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; }
   if(!AVI->video_index)         { AVI_errno = AVI_ERR_NO_IDX;   return -1; }

   if(AVI->video_pos < 0 || AVI->video_pos >= AVI->video_frames) return -1;
   n = AVI->video_index[AVI->video_pos].len;

   *keyframe = (AVI->video_index[AVI->video_pos].key==0x10) ? 1:0;

   lseek(AVI->fdes, AVI->video_index[AVI->video_pos].pos, SEEK_SET);

   if (avi_read(AVI->fdes,vidbuf,n) != n)
   {
      AVI_errno = AVI_ERR_READ;
      return -1;
   }

   AVI->video_pos++;

   return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x8(%rdi)
je 0x40414a
movq %rdi, %r14
movq 0x410(%rdi), %rax
testq %rax, %rax
je 0x404157
movq 0x50(%r14), %rcx
movq $-0x1, %rbx
testq %rcx, %rcx
js 0x404169
cmpq 0x40(%r14), %rcx
jge 0x404169
movq %rsi, %r15
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rax,%rcx,8), %r12
xorl %esi, %esi
cmpq $0x10, (%rax,%rcx,8)
sete %sil
movl %esi, (%rdx)
movl (%r14), %edi
movq 0x8(%rax,%rcx,8), %rsi
xorl %r13d, %r13d
xorl %edx, %edx
callq 0x482720
testq %r12, %r12
je 0x40413c
movl (%r14), %ebp
xorl %r13d, %r13d
leaq (%r15,%r13), %rsi
movq %r12, %rdx
subq %r13, %rdx
movl %ebp, %edi
callq 0x4825e0
testq %rax, %rax
jle 0x40413c
addq %rax, %r13
cmpq %r12, %r13
jb 0x40411e
cmpq %r12, %r13
jne 0x40417b
incq 0x50(%r14)
movq %r12, %rbx
jmp 0x404169
movq $0x7, 0x1173bb(%rip) # 0x51b510
jmp 0x404162
movq $0xd, 0x1173ae(%rip) # 0x51b510
movq $-0x1, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x3, 0x11738a(%rip) # 0x51b510
jmp 0x404169
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/avilib.c
// Function: AVI_set_audio_position
int AVI_set_audio_position(avi_t *AVI, long byte)
{
   long n0, n1, n;

   if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; }
   if(!AVI->track[AVI->aptr].audio_index)         { AVI_errno = AVI_ERR_NO_IDX;   return -1; }

   if(byte < 0) byte = 0;

   /* Binary search in the audio chunks */

   n0 = 0;
   n1 = AVI->track[AVI->aptr].audio_chunks;

   while(n0<n1-1)
   {
      n = (n0+n1)/2;
      if(AVI->track[AVI->aptr].audio_index[n].tot>byte)
         n1 = n;
      else
         n0 = n;
   }

   AVI->track[AVI->aptr].audio_posc = n0;
   AVI->track[AVI->aptr].audio_posb = byte - AVI->track[AVI->aptr].audio_index[n0].tot;

   return 0;
}

// Assembly:
cmpq $0x0, 0x8(%rdi)
je 0x404215
movslq 0x43c(%rdi), %rax
imulq $0x70, %rax, %rdx
movq 0xc8(%rdi,%rdx), %rcx
testq %rcx, %rcx
je 0x404222
pushq %rbx
leaq (%rdi,%rdx), %r8
addq $0x60, %r8
addq $0x60, %rdi
xorl %eax, %eax
testq %rsi, %rsi
cmovleq %rax, %rsi
movq 0x38(%r8), %r10
movl $0x0, %r9d
cmpq $0x2, %r10
jl 0x404201
xorl %r9d, %r9d
leaq (%r10,%r9), %rbx
movq %rbx, %r11
shrq $0x3f, %r11
addq %rbx, %r11
sarq %r11
leaq (%r11,%r11,2), %rbx
cmpq %rsi, 0x10(%rcx,%rbx,8)
jg 0x4041f5
movq %r11, %r9
jmp 0x4041f8
movq %r11, %r10
leaq -0x1(%r10), %r11
cmpq %r11, %r9
jl 0x4041d4
movq %r9, 0x48(%rdi,%rdx)
leaq (%r9,%r9,2), %rdx
subq 0x10(%rcx,%rdx,8), %rsi
movq %rsi, 0x50(%r8)
popq %rbx
retq
movq $0x7, 0x1172f0(%rip) # 0x51b510
jmp 0x40422d
movq $0xd, 0x1172e3(%rip) # 0x51b510
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/avilib.c
// Function: AVI_read_audio
long AVI_read_audio(avi_t *AVI, char *audbuf, long bytes)
{
   long nr, pos, left, todo;

   if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; }
   if(!AVI->track[AVI->aptr].audio_index)         { AVI_errno = AVI_ERR_NO_IDX;   return -1; }

   nr = 0; /* total number of bytes read */

   while(bytes>0)
   {
      left = AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].len - AVI->track[AVI->aptr].audio_posb;
      if(left==0)
      {
         if(AVI->track[AVI->aptr].audio_posc>=AVI->track[AVI->aptr].audio_chunks-1) return nr;
         AVI->track[AVI->aptr].audio_posc++;
         AVI->track[AVI->aptr].audio_posb = 0;
         continue;
      }
      if(bytes<left)
         todo = bytes;
      else
         todo = left;
      pos = AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].pos + AVI->track[AVI->aptr].audio_posb;
      lseek(AVI->fdes, pos, SEEK_SET);
      if (avi_read(AVI->fdes,audbuf+nr,todo) != todo)
      {
         AVI_errno = AVI_ERR_READ;
         return -1;
      }
      bytes -= todo;
      nr    += todo;
      AVI->track[AVI->aptr].audio_posb += todo;
   }

   return nr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x0, 0x8(%rdi)
je 0x404366
movq %rdi, %r13
movslq 0x43c(%rdi), %rax
imulq $0x70, %rax, %rcx
cmpq $0x0, 0xc8(%rdi,%rcx)
je 0x40436d
movq %rdx, %rbx
testq %rdx, %rdx
jle 0x404392
movq %rsi, %r15
leaq 0x60(%r13), %r9
xorl %r12d, %r12d
movq %r9, (%rsp)
movq %rsi, 0x10(%rsp)
movq %r13, 0x8(%rsp)
cltq
imulq $0x70, %rax, %rdi
movq 0x68(%r9,%rdi), %rax
movq 0x48(%r9,%rdi), %rcx
movq 0x50(%r9,%rdi), %rsi
leaq (%rcx,%rcx,2), %r8
movq 0x8(%rax,%r8,8), %r14
cmpq %rsi, %r14
jne 0x4042f0
leaq (%r9,%rdi), %rdx
leaq (%r9,%rdi), %rsi
addq $0x50, %rsi
movq 0x38(%rdx), %rdi
decq %rdi
leaq (%rax,%r8,8), %r8
addq $0x20, %r8
cmpq %rdi, %rcx
jge 0x404380
incq %rcx
movq %rcx, 0x48(%rdx)
movq $0x0, (%rsi)
movq (%r8), %r14
addq $0x18, %r8
testq %r14, %r14
je 0x4042cb
xorl %esi, %esi
subq %rsi, %r14
cmpq %r14, %rbx
cmovlq %rbx, %r14
leaq (%rcx,%rcx,2), %rcx
addq (%rax,%rcx,8), %rsi
movl (%r13), %edi
xorl %edx, %edx
callq 0x482720
movl (%r13), %ebp
addq %r12, %r15
xorl %r13d, %r13d
leaq (%r15,%r13), %rsi
movq %r14, %rdx
subq %r13, %rdx
movl %ebp, %edi
callq 0x4825e0
testq %rax, %rax
jle 0x404335
addq %rax, %r13
cmpq %r14, %r13
jb 0x404317
cmpq %r14, %r13
jne 0x404397
addq %r14, %r12
movq 0x8(%rsp), %r13
movslq 0x43c(%r13), %rax
imulq $0x70, %rax, %rcx
movq (%rsp), %r9
addq %r14, 0x50(%r9,%rcx)
subq %r14, %rbx
movq 0x10(%rsp), %r15
jg 0x40428d
jmp 0x404380
movl $0x7, %eax
jmp 0x404372
movl $0xd, %eax
movq %rax, 0x117197(%rip)    # 0x51b510
movq $-0x1, %r12
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
jmp 0x404380
movl $0x3, %eax
jmp 0x404372
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/avilib.c
// Function: AVI_read_audio_chunk
long AVI_read_audio_chunk(avi_t *AVI, char *audbuf)
{
   long pos, left;

   if(AVI->mode==AVI_MODE_WRITE) { AVI_errno = AVI_ERR_NOT_PERM; return -1; }
   if(!AVI->track[AVI->aptr].audio_index)         { AVI_errno = AVI_ERR_NO_IDX;   return -1; }

   if (AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].len == 0) return 0;
   left = AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].len - AVI->track[AVI->aptr].audio_posb;

   if (audbuf == NULL) return left;

   if(left==0) return 0;

   pos = AVI->track[AVI->aptr].audio_index[AVI->track[AVI->aptr].audio_posc].pos + AVI->track[AVI->aptr].audio_posb;
   lseek(AVI->fdes, pos, SEEK_SET);
   if (avi_read(AVI->fdes,audbuf,left) != left)
   {
      AVI_errno = AVI_ERR_READ;
      return -1;
   }
   AVI->track[AVI->aptr].audio_posc++;
   AVI->track[AVI->aptr].audio_posb = 0;

   return left;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x8(%rdi)
je 0x404462
movq %rdi, %r14
movslq 0x43c(%rdi), %rax
imulq $0x70, %rax, %rcx
movq 0xc8(%rdi,%rcx), %rax
testq %rax, %rax
je 0x40446f
leaq (%r14,%rcx), %rdx
addq $0x60, %rdx
movq 0x48(%rdx), %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x8(%rax,%rcx,8), %rbx
testq %rbx, %rbx
je 0x404483
movq %rsi, %r15
movq 0x50(%rdx), %rsi
subq %rsi, %rbx
testq %r15, %r15
je 0x404485
testq %rbx, %rbx
je 0x404483
leaq 0x60(%r14), %r12
leaq (%rax,%rcx,8), %rax
addq (%rax), %rsi
movl (%r14), %edi
xorl %r13d, %r13d
xorl %edx, %edx
callq 0x482720
movl (%r14), %ebp
leaq (%r15,%r13), %rsi
movq %rbx, %rdx
subq %r13, %rdx
movl %ebp, %edi
callq 0x4825e0
testq %rax, %rax
jle 0x404442
addq %rax, %r13
cmpq %rbx, %r13
jb 0x404424
cmpq %rbx, %r13
jne 0x404497
movslq 0x43c(%r14), %rax
imulq $0x70, %rax, %rax
incq 0x48(%r12,%rax)
movq $0x0, 0x50(%r12,%rax)
jmp 0x404485
movq $0x7, 0x1170a3(%rip) # 0x51b510
jmp 0x40447a
movq $0xd, 0x117096(%rip) # 0x51b510
movq $-0x1, %rbx
jmp 0x404485
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq $0x3, 0x11706e(%rip) # 0x51b510
jmp 0x40447a
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/avilib.c
// Function: AVI_strerror
const char *AVI_strerror()
{
   int aerrno;

   aerrno = (AVI_errno>=0 && AVI_errno<num_avi_errors) ? AVI_errno : num_avi_errors-1;

   if(AVI_errno == AVI_ERR_OPEN ||
      AVI_errno == AVI_ERR_READ ||
      AVI_errno == AVI_ERR_WRITE ||
      AVI_errno == AVI_ERR_WRITE_INDEX ||
      AVI_errno == AVI_ERR_CLOSE )
   {
      sprintf(error_string,"%s - %s",avi_errors[aerrno],strerror(errno));
      return error_string;
   }
   else
   {
      return avi_errors[aerrno];
   }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x116e67(%rip), %rcx    # 0x51b510
movl %ecx, %eax
leaq -0x2(%rcx), %rdx
cmpq $0x4, %rdx
ja 0x4046ec
leaq 0x114ab4(%rip), %rcx    # 0x519170
movq (%rcx,%rax,8), %r14
callq 0x420860
movl (%rax), %edi
callq 0x448060
leaq 0x116e4d(%rip), %rbx    # 0x51b520
leaq 0xd1c2c(%rip), %rsi     # 0x4d6306
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x4284c0
jmp 0x404704
cmpq $0xf, %rcx
movl $0xe, %ecx
cmovaeq %rcx, %rax
leaq 0x114a70(%rip), %rcx    # 0x519170
movq (%rcx,%rax,8), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/avilib.c
// Function: avi_add_chunk
static int avi_add_chunk(avi_t *AVI, unsigned char *tag, unsigned char *data, int length)
{
   unsigned char c[8];

   /* Copy tag and length int c, so that we need only 1 write system call
      for these two values */

   memcpy(c,tag,4);
   long2str(c+4,length);

   /* Output tag, length and data, restore previous position
      if the write fails */

   length = PAD_EVEN(length);

   if( avi_write(AVI->fdes,(char *)c,8) != 8 ||
       avi_write(AVI->fdes,(char *)data,length) != length )
   {
      lseek(AVI->fdes,AVI->pos,SEEK_SET);
      AVI_errno = AVI_ERR_WRITE;
      return -1;
   }

   /* Update file position */

   AVI->pos += 8 + length;

   //fprintf(stderr, "pos=%lu %s\n", AVI->pos, tag);

   return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rdi, %r15
movl %esi, (%rsp)
movb %bl, 0x4(%rsp)
movb %bh, 0x5(%rsp)
movl %ecx, %eax
shrl $0x10, %eax
movb %al, 0x6(%rsp)
movl %ecx, %eax
shrl $0x18, %eax
movb %al, 0x7(%rsp)
incl %ebx
andl $-0x2, %ebx
movl (%rdi), %ebp
xorl %r12d, %r12d
leaq (%rsp,%r12), %rsi
movl $0x8, %edx
subq %r12, %rdx
movl %ebp, %edi
callq 0x482680
testq %rax, %rax
js 0x4047c6
addq %rax, %r12
cmpq $0x8, %r12
jb 0x40474f
jne 0x4047c6
movslq %ebx, %r12
testl %r12d, %r12d
je 0x4047a0
movl (%r15), %ebx
xorl %r13d, %r13d
leaq (%r14,%r13), %rsi
movq %r12, %rdx
subq %r13, %rdx
movl %ebx, %edi
callq 0x482680
testq %rax, %rax
js 0x4047a5
addq %rax, %r13
cmpq %r12, %r13
jb 0x404780
jmp 0x4047a8
xorl %r13d, %r13d
jmp 0x4047a8
movq %rax, %r13
cmpq %r12, %r13
jne 0x4047c6
movq 0x3e0(%r15), %rax
addq %r12, %rax
addq $0x8, %rax
movq %rax, 0x3e0(%r15)
xorl %eax, %eax
jmp 0x4047e7
movl (%r15), %edi
movq 0x3e0(%r15), %rsi
xorl %edx, %edx
callq 0x482720
movq $0x4, 0x116d2e(%rip) # 0x51b510
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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:
movl %ecx, %eax
movl $0xffff, %ecx           # imm = 0xFFFF
andl %ecx, %r8d
addl (%rdx), %r8d
andl %ecx, %eax
movb $0x18, %cl
subb %r8b, %cl
shll %cl, %eax
movl %r8d, (%rdx)
orl %eax, (%rsi)
cmpl $0x8, (%rdx)
jl 0x405784
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movzbl 0x2(%r14), %ebp
movl %ebp, %edi
movq %r15, %rsi
callq 0x433600
cmpl $0xff, %ebp
jne 0x40576a
xorl %edi, %edi
movq %r15, %rsi
callq 0x433600
shll $0x8, (%r14)
movl (%rbx), %eax
leal -0x8(%rax), %ecx
movl %ecx, (%rbx)
cmpl $0xf, %eax
jg 0x405749
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/jo_jpeg.c
// Function: jo_DCT
static void jo_DCT(float *d0, float *d1, float *d2,
                   float *d3, float *d4, float *d5,
                   float *d6, float *d7) {

  float tmp0 = (*d0) + (*d7);
  float tmp7 = (*d0) - (*d7);
  float tmp1 = (*d1) + (*d6);
  float tmp6 = (*d1) - (*d6);
  float tmp2 = (*d2) + (*d5);
  float tmp5 = (*d2) - (*d5);
  float tmp3 = (*d3) + (*d4);
  float tmp4 = (*d3) - (*d4);

  // Even part
  float tmp10 = tmp0 + tmp3;	// phase 2
  float tmp13 = tmp0 - tmp3;
  float tmp11 = tmp1 + tmp2;
  float tmp12 = tmp1 - tmp2;

  (*d0) = tmp10 + tmp11; 		// phase 3
  (*d4) = tmp10 - tmp11;

  float z1 = (tmp12 + tmp13) * 0.707106781f; // c4
  (*d2) = tmp13 + z1; 		// phase 5
  (*d6) = tmp13 - z1;

  // Odd part
  tmp10 = tmp4 + tmp5; 		// phase 2
  tmp11 = tmp5 + tmp6;
  tmp12 = tmp6 + tmp7;

  // The rotator is modified from fig 4-8 to avoid extra negations.
  float z5 = (tmp10 - tmp12) * 0.382683433f; // c6
  float z2 = tmp10 * 0.541196100f + z5; // c2-c6
  float z4 = tmp12 * 1.306562965f + z5; // c2+c6
  float z3 = tmp11 * 0.707106781f; // c4

  float z11 = tmp7 + z3;		// phase 5
  float z13 = tmp7 - z3;

  (*d5) = z13 + z2;			// phase 6
  (*d3) = z13 - z2;
  (*d1) = z11 + z4;
  (*d7) = z11 - z4;
}

// Assembly:
movq 0x8(%rsp), %r10
movq 0x10(%rsp), %rax
movss (%rdi), %xmm0
movss (%rax), %xmm1
movaps %xmm0, %xmm4
addss %xmm1, %xmm4
subss %xmm1, %xmm0
movss (%rsi), %xmm1
movss (%r10), %xmm2
movaps %xmm1, %xmm5
addss %xmm2, %xmm5
subss %xmm2, %xmm1
movss (%rdx), %xmm2
movss (%r9), %xmm3
movaps %xmm2, %xmm6
addss %xmm3, %xmm6
subss %xmm3, %xmm2
movss (%rcx), %xmm3
movss (%r8), %xmm7
movaps %xmm3, %xmm8
addss %xmm7, %xmm8
subss %xmm7, %xmm3
movaps %xmm4, %xmm7
addss %xmm8, %xmm7
subss %xmm8, %xmm4
movaps %xmm5, %xmm8
addss %xmm6, %xmm8
subss %xmm6, %xmm5
movaps %xmm8, %xmm6
addss %xmm7, %xmm6
movss %xmm6, (%rdi)
subss %xmm8, %xmm7
movss %xmm7, (%r8)
addss %xmm4, %xmm5
movss 0xd0c80(%rip), %xmm6    # 0x4d649c
mulss %xmm6, %xmm5
movaps %xmm4, %xmm7
addss %xmm5, %xmm7
movss %xmm7, (%rdx)
subss %xmm5, %xmm4
movss %xmm4, (%r10)
addss %xmm2, %xmm3
addss %xmm1, %xmm2
addss %xmm0, %xmm1
movaps %xmm3, %xmm4
subss %xmm1, %xmm4
mulss 0xd0c51(%rip), %xmm4    # 0x4d64a0
mulss 0xd0c4d(%rip), %xmm3    # 0x4d64a4
mulss 0xd0c49(%rip), %xmm1    # 0x4d64a8
addss %xmm4, %xmm3
addss %xmm4, %xmm1
mulss %xmm6, %xmm2
movaps %xmm0, %xmm4
addss %xmm2, %xmm4
subss %xmm2, %xmm0
movaps %xmm0, %xmm2
addss %xmm3, %xmm2
movss %xmm2, (%r9)
subss %xmm3, %xmm0
movss %xmm0, (%rcx)
movaps %xmm4, %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rsi)
subss %xmm1, %xmm4
movss %xmm4, (%rax)
retq
nop
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/kdtree.c
// Function: calcSaCost
bool calcSaCost(int axis,float edget,int nAbove,int nBelow,
                float invTotalSa,const float *minBound,const float *maxBound,
                float emptyBonus,float traversalCost,float isectCost,
                float *cost) {

  float belowSa,aboveSa,pBelow,pAbove,eb,diag[3];
  int otherAxis0,otherAxis1;

  if(!(edget > minBound[axis] && edget < maxBound[axis])) {
    return false;
  }

  diag[0]=maxBound[0]-minBound[0];
  diag[1]=maxBound[1]-minBound[1];
  diag[2]=maxBound[2]-minBound[2];

  otherAxis0=(axis+1)%3;
  otherAxis1=(axis+2)%3;

  belowSa=2.0f*(diag[otherAxis0]*diag[otherAxis1]+
                (edget-minBound[axis])*
                (diag[otherAxis0]+diag[otherAxis1]));
  aboveSa=2.0f*(diag[otherAxis0]*diag[otherAxis1]+
                (maxBound[axis]-edget)*
                (diag[otherAxis0]+diag[otherAxis1]));

  pBelow=belowSa*invTotalSa;
  pAbove=aboveSa*invTotalSa;

  eb=(nAbove==0 || nBelow==0)?emptyBonus:0.0f;
  *cost=traversalCost+isectCost*(1.0f-eb)*
    (pBelow*(float)nBelow+pAbove*(float)nAbove);

  return true;
}

// Assembly:
movslq %edi, %rax
movss (%rcx,%rax,4), %xmm6
ucomiss %xmm6, %xmm0
jbe 0x405a61
movss (%r8,%rax,4), %xmm5
ucomiss %xmm0, %xmm5
jbe 0x405a61
movsd (%r8), %xmm7
movsd (%rcx), %xmm8
subps %xmm8, %xmm7
movlps %xmm7, -0x10(%rsp)
movss 0x8(%r8), %xmm7
subss 0x8(%rcx), %xmm7
movss %xmm7, -0x8(%rsp)
leal 0x1(%rdi), %eax
cltq
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
leal (%rax,%rax,2), %eax
negl %eax
addl %edi, %eax
incl %eax
movl %edi, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
imulq $0x55555556, %rcx, %rcx # imm = 0x55555556
movq %rcx, %r8
shrq $0x3f, %r8
shrq $0x20, %rcx
addl %r8d, %ecx
leal (%rcx,%rcx,2), %ecx
negl %ecx
addl %edi, %ecx
addl $0x2, %ecx
cltq
movss -0x10(%rsp,%rax,4), %xmm7
movslq %ecx, %rax
movss -0x10(%rsp,%rax,4), %xmm8
subss %xmm0, %xmm5
subss %xmm6, %xmm0
movaps %xmm7, %xmm6
addss %xmm8, %xmm6
mulss %xmm6, %xmm0
mulss %xmm8, %xmm7
addss %xmm7, %xmm0
addss %xmm0, %xmm0
mulss %xmm5, %xmm6
addss %xmm7, %xmm6
addss %xmm6, %xmm6
movss 0xd1f0d(%rip), %xmm7    # 0x4d7920
movaps %xmm7, %xmm5
subss %xmm2, %xmm5
movaps %xmm5, %xmm2
testl %edx, %edx
je 0x405a24
movaps %xmm7, %xmm2
mulss %xmm1, %xmm0
mulss %xmm1, %xmm6
testl %esi, %esi
je 0x405a33
movaps %xmm2, %xmm5
xorps %xmm1, %xmm1
cvtsi2ss %edx, %xmm1
xorps %xmm2, %xmm2
cvtsi2ss %esi, %xmm2
mulss %xmm4, %xmm5
mulss %xmm1, %xmm0
mulss %xmm2, %xmm6
addss %xmm0, %xmm6
mulss %xmm5, %xmm6
addss %xmm3, %xmm6
movss %xmm6, (%r9)
movb $0x1, %al
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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:
testl %esi, %esi
je 0x405f97
movl $0x1, %ecx
movl $0x1, %eax
movl %esi, %edx
testb $0x1, %sil
movl %edi, %r8d
cmovel %ecx, %r8d
imull %r8d, %eax
sarl %edx
imull %edi, %edi
cmpl $0x1, %esi
movl %edx, %esi
ja 0x405f7b
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movd %xmm0, %eax
sarl %eax
movl $0x5f3759df, %ecx       # imm = 0x5F3759DF
subl %eax, %ecx
movd %ecx, %xmm1
mulss 0xcef23(%rip), %xmm0    # 0x4d6494
mulss %xmm1, %xmm0
mulss %xmm1, %xmm0
addss 0xd06ff(%rip), %xmm0    # 0x4d7c80
mulss %xmm1, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movss (%rsi), %xmm0
movss 0x4(%rsi), %xmm1
mulss %xmm1, %xmm1
movaps %xmm0, %xmm2
mulss %xmm0, %xmm2
addss %xmm1, %xmm2
movss 0x8(%rsi), %xmm1
mulss %xmm1, %xmm1
addss %xmm2, %xmm1
sqrtss %xmm1, %xmm1
movss 0xd02d4(%rip), %xmm2    # 0x4d7920
divss %xmm1, %xmm2
mulss %xmm2, %xmm0
movss %xmm0, (%rdi)
movss 0x4(%rsi), %xmm0
mulss %xmm2, %xmm0
movss %xmm0, 0x4(%rdi)
mulss 0x8(%rsi), %xmm2
movss %xmm2, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
leaq 0x10(%rdi), %rax
leaq 0x10(%rsi), %rcx
addq $0x4, %rdi
addq $0x4, %rsi
movl $0x3, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpq $0x2, %r9
ja 0x4077c0
movq %rdx, %r10
movq %rsi, %r11
movq %rdi, %rbx
movq %rcx, %r14
movq %rax, %r15
movss (%r11,%r8), %xmm0
movss (%r14,%r8), %xmm1
movss %xmm1, (%rbx,%r8)
movss %xmm0, (%r15,%r8)
addq $0x10, %r15
addq $0x10, %r14
addq $0x4, %rbx
addq $0x4, %r11
decq %r10
jne 0x407793
incq %r9
addq $0x14, %r8
decq %rdx
cmpq $0x4, %r9
jne 0x40777e
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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:
xorl %eax, %eax
leaq (,%rax,4), %rcx
movq %rdx, %r8
xorl %r9d, %r9d
xorps %xmm0, %xmm0
xorl %r10d, %r10d
movss (%rsi,%r10), %xmm1
mulss (%r8,%r10,4), %xmm1
addss %xmm1, %xmm0
addq $0x4, %r10
cmpq $0x10, %r10
jne 0x4077ec
leaq (%r9,%rcx), %r10
movss %xmm0, -0x48(%rsp,%r10,4)
incq %r9
addq $0x4, %r8
cmpq $0x4, %r9
jne 0x4077e6
incq %rax
addq $0x10, %rsi
cmpq $0x4, %rax
jne 0x4077d8
movaps -0x48(%rsp), %xmm0
movaps -0x38(%rsp), %xmm1
movaps -0x28(%rsp), %xmm2
movaps -0x18(%rsp), %xmm3
movups %xmm3, 0x30(%rdi)
movups %xmm2, 0x20(%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm0, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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:
xorl %eax, %eax
xorps %xmm0, %xmm0
xorl %ecx, %ecx
movss (%rsi,%rcx,4), %xmm1
mulss (%rdx,%rcx,4), %xmm1
addss %xmm1, %xmm0
incq %rcx
cmpq $0x4, %rcx
jne 0x407856
movss %xmm0, -0x18(%rsp,%rax,4)
incq %rax
addq $0x10, %rsi
cmpq $0x4, %rax
jne 0x407851
movaps -0x18(%rsp), %xmm0
movups %xmm0, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
movd 0xd03fe(%rip), %xmm0    # 0x4d7c90
xorl %eax, %eax
movdqa 0xd0404(%rip), %xmm1    # 0x4d7ca0
movdqa 0xd040c(%rip), %xmm2    # 0x4d7cb0
movdqa 0xd0414(%rip), %xmm3    # 0x4d7cc0
movdqa 0xcebac(%rip), %xmm4    # 0x4d6460
movdqa 0xd0414(%rip), %xmm5    # 0x4d7cd0
movdqa %xmm0, %xmm6
punpcklbw %xmm6, %xmm6    # xmm6 = xmm6[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pmullw %xmm1, %xmm6
pand %xmm2, %xmm6
packuswb %xmm6, %xmm6
movdqa %xmm6, %xmm7
pminub %xmm3, %xmm7
pcmpeqb %xmm6, %xmm7
punpcklbw %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3]
pand %xmm4, %xmm7
movdqa %xmm7, -0x80(%rsp,%rax,4)
addq $0x4, %rax
paddb %xmm5, %xmm0
cmpq $0x10, %rax
jne 0x4078bc
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
movups 0x20(%rsi), %xmm2
movups 0x30(%rsi), %xmm3
leaq -0x40(%rsp), %rax
movaps %xmm3, 0x30(%rax)
movaps %xmm2, 0x20(%rax)
movaps %xmm1, 0x10(%rax)
movaps %xmm0, (%rax)
leaq -0x80(%rsp), %rcx
xorl %edx, %edx
movaps 0xd0023(%rip), %xmm0    # 0x4d7950
movq %rax, %rsi
movq %rcx, %r8
leaq (%rdx,%rdx,4), %r9
movss -0x40(%rsp,%r9,4), %xmm1
shufps $0x0, %xmm1, %xmm1      # xmm1 = xmm1[0,0,0,0]
movq %rdx, %r9
shlq $0x4, %r9
movaps -0x40(%rsp,%r9), %xmm2
divps %xmm1, %xmm2
movaps %xmm2, -0x40(%rsp,%r9)
movaps -0x80(%rsp,%r9), %xmm2
divps %xmm1, %xmm2
movaps %xmm2, -0x80(%rsp,%r9)
movq %rax, %r9
movq %rcx, %r10
xorl %r11d, %r11d
cmpq %r11, %rdx
je 0x4079bf
movq %r11, %rbx
shlq $0x4, %rbx
leaq (%rbx,%rdx,4), %rbx
movss -0x40(%rsp,%rbx), %xmm1
xorps %xmm0, %xmm1
xorl %ebx, %ebx
movss (%rsi,%rbx,4), %xmm2
mulss %xmm1, %xmm2
addss (%r9,%rbx,4), %xmm2
movss (%r8,%rbx,4), %xmm3
mulss %xmm1, %xmm3
addss (%r10,%rbx,4), %xmm3
movss %xmm2, (%r9,%rbx,4)
movss %xmm3, (%r10,%rbx,4)
incq %rbx
cmpq $0x4, %rbx
jne 0x40798b
incq %r11
addq $0x10, %r10
addq $0x10, %r9
cmpq $0x4, %r11
jne 0x407970
incq %rdx
addq $0x10, %r8
addq $0x10, %rsi
cmpq $0x4, %rdx
jne 0x407933
movaps -0x80(%rsp), %xmm0
movaps -0x70(%rsp), %xmm1
movaps -0x60(%rsp), %xmm2
movaps -0x50(%rsp), %xmm3
movups %xmm3, 0x30(%rdi)
movups %xmm2, 0x20(%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm0, (%rdi)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
callq 0x407889
movl $0x3, %eax
xorl %ecx, %ecx
cmpq $0x2, %rcx
ja 0x407a55
movl $0x4, %edx
movq %rax, %rsi
movss (%r14,%rdx), %xmm0
movss (%r14,%rdx,4), %xmm1
movss %xmm1, (%r14,%rdx)
movss %xmm0, (%r14,%rdx,4)
addq $0x4, %rdx
decq %rsi
jne 0x407a34
incq %rcx
addq $0x14, %r14
decq %rax
cmpq $0x4, %rcx
jne 0x407a26
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movaps 0x20(%rsp), %xmm2
movaps 0x30(%rsp), %xmm3
movups %xmm3, 0x30(%rbx)
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rax
movd 0xd01cb(%rip), %xmm0    # 0x4d7c90
xorl %eax, %eax
movdqa 0xd01d1(%rip), %xmm1    # 0x4d7ca0
movdqa 0xd01d9(%rip), %xmm2    # 0x4d7cb0
movdqa 0xd01e1(%rip), %xmm3    # 0x4d7cc0
movdqa 0xce979(%rip), %xmm4    # 0x4d6460
movdqa 0xd01e1(%rip), %xmm5    # 0x4d7cd0
movdqa %xmm0, %xmm6
punpcklbw %xmm6, %xmm6    # xmm6 = xmm6[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pmullw %xmm1, %xmm6
pand %xmm2, %xmm6
packuswb %xmm6, %xmm6
movdqa %xmm6, %xmm7
pminub %xmm3, %xmm7
pcmpeqb %xmm6, %xmm7
punpcklbw %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3]
pand %xmm4, %xmm7
movdqa %xmm7, -0x80(%rsp,%rax,4)
addq $0x4, %rax
paddb %xmm5, %xmm0
cmpq $0x10, %rax
jne 0x407aef
movl $0x3, %eax
movd -0x3(%rsi,%rax), %xmm0
movd %xmm0, -0x80(%rsp,%rax,4)
addq $0x4, %rax
cmpq $0xf, %rax
jne 0x407b34
testb %dl, %dl
je 0x407bc2
xorl %eax, %eax
leaq -0x80(%rsp), %rcx
movq %rdi, %rdx
leaq (,%rax,4), %rsi
movq %rcx, %r8
xorl %r9d, %r9d
pxor %xmm0, %xmm0
xorl %r10d, %r10d
movss (%rdx,%r10), %xmm1
mulss (%r8,%r10,4), %xmm1
addss %xmm1, %xmm0
addq $0x4, %r10
cmpq $0x10, %r10
jne 0x407b6d
leaq (%r9,%rsi), %r10
movss %xmm0, -0x40(%rsp,%r10,4)
incq %r9
addq $0x4, %r8
cmpq $0x4, %r9
jne 0x407b66
incq %rax
addq $0x10, %rdx
cmpq $0x4, %rax
jne 0x407b58
movaps -0x40(%rsp), %xmm0
movaps -0x30(%rsp), %xmm1
movaps -0x20(%rsp), %xmm2
movaps -0x10(%rsp), %xmm3
jmp 0x407bd6
movaps -0x80(%rsp), %xmm0
movaps -0x70(%rsp), %xmm1
movaps -0x60(%rsp), %xmm2
movaps -0x50(%rsp), %xmm3
movups %xmm3, 0x30(%rdi)
movups %xmm2, 0x20(%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm0, (%rdi)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rax
movd 0xd00a0(%rip), %xmm0    # 0x4d7c90
xorl %eax, %eax
movdqa 0xd00a6(%rip), %xmm1    # 0x4d7ca0
movdqa 0xd00ae(%rip), %xmm2    # 0x4d7cb0
movdqa 0xd00b6(%rip), %xmm3    # 0x4d7cc0
movdqa 0xce84e(%rip), %xmm4    # 0x4d6460
movdqa 0xd00b6(%rip), %xmm5    # 0x4d7cd0
movdqa %xmm0, %xmm6
punpcklbw %xmm6, %xmm6    # xmm6 = xmm6[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pmullw %xmm1, %xmm6
pand %xmm2, %xmm6
packuswb %xmm6, %xmm6
movdqa %xmm6, %xmm7
pminub %xmm3, %xmm7
pcmpeqb %xmm6, %xmm7
punpcklbw %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3]
pand %xmm4, %xmm7
movdqa %xmm7, -0x80(%rsp,%rax,4)
addq $0x4, %rax
paddb %xmm5, %xmm0
cmpq $0x10, %rax
jne 0x407c1a
xorl %eax, %eax
movd (%rsi), %xmm0
movd %xmm0, -0x80(%rsp,%rax,4)
addq $0x5, %rax
addq $0x4, %rsi
cmpq $0xf, %rax
jne 0x407c5c
testb %dl, %dl
je 0x407cec
xorl %eax, %eax
leaq -0x80(%rsp), %rcx
movq %rdi, %rdx
leaq (,%rax,4), %rsi
movq %rcx, %r8
xorl %r9d, %r9d
pxor %xmm0, %xmm0
xorl %r10d, %r10d
movss (%rdx,%r10), %xmm1
mulss (%r8,%r10,4), %xmm1
addss %xmm1, %xmm0
addq $0x4, %r10
cmpq $0x10, %r10
jne 0x407c97
leaq (%r9,%rsi), %r10
movss %xmm0, -0x40(%rsp,%r10,4)
incq %r9
addq $0x4, %r8
cmpq $0x4, %r9
jne 0x407c90
incq %rax
addq $0x10, %rdx
cmpq $0x4, %rax
jne 0x407c82
movaps -0x40(%rsp), %xmm0
movaps -0x30(%rsp), %xmm1
movaps -0x20(%rsp), %xmm2
movaps -0x10(%rsp), %xmm3
jmp 0x407d00
movaps -0x80(%rsp), %xmm0
movaps -0x70(%rsp), %xmm1
movaps -0x60(%rsp), %xmm2
movaps -0x50(%rsp), %xmm3
movups %xmm3, 0x30(%rdi)
movups %xmm2, 0x20(%rdi)
movups %xmm1, 0x10(%rdi)
movups %xmm0, (%rdi)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
subq $0x98, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movd 0xcff68(%rip), %xmm8    # 0x4d7c90
xorl %eax, %eax
movdqa 0xcff6e(%rip), %xmm1    # 0x4d7ca0
movdqa 0xcff76(%rip), %xmm2    # 0x4d7cb0
movdqa 0xcff7e(%rip), %xmm3    # 0x4d7cc0
movdqa 0xce716(%rip), %xmm4    # 0x4d6460
movdqa 0xcff7e(%rip), %xmm5    # 0x4d7cd0
movdqa %xmm8, %xmm6
punpcklbw %xmm6, %xmm6    # xmm6 = xmm6[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pmullw %xmm1, %xmm6
pand %xmm2, %xmm6
packuswb %xmm6, %xmm6
movdqa %xmm6, %xmm7
pminub %xmm3, %xmm7
pcmpeqb %xmm6, %xmm7
punpcklbw %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3]
pand %xmm4, %xmm7
movdqa %xmm7, 0x10(%rsp,%rax,4)
addq $0x4, %rax
paddb %xmm5, %xmm8
cmpq $0x10, %rax
jne 0x407d52
movd %xmm0, 0x8(%rsp)
callq 0x401078
movd %xmm0, 0xc(%rsp)
movss 0x8(%rsp), %xmm0
callq 0x401118
movss 0xc(%rsp), %xmm2
movss %xmm2, 0x24(%rsp)
movaps 0xcfb8d(%rip), %xmm1    # 0x4d7950
xorps %xmm0, %xmm1
movss %xmm1, 0x28(%rsp)
movss %xmm0, 0x34(%rsp)
movss %xmm2, 0x38(%rsp)
testb %bpl, %bpl
je 0x407e53
xorl %eax, %eax
leaq 0x10(%rsp), %rcx
movq %rbx, %rdx
leaq (,%rax,4), %rsi
movq %rcx, %rdi
xorl %r8d, %r8d
xorps %xmm0, %xmm0
xorl %r9d, %r9d
movss (%rdx,%r9), %xmm1
mulss (%rdi,%r9,4), %xmm1
addss %xmm1, %xmm0
addq $0x4, %r9
cmpq $0x10, %r9
jne 0x407dfb
leaq (%r8,%rsi), %r9
movss %xmm0, 0x50(%rsp,%r9,4)
incq %r8
addq $0x4, %rdi
cmpq $0x4, %r8
jne 0x407df5
incq %rax
addq $0x10, %rdx
cmpq $0x4, %rax
jne 0x407de7
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movaps 0x70(%rsp), %xmm2
movaps 0x80(%rsp), %xmm3
jmp 0x407e67
movaps 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movaps 0x30(%rsp), %xmm2
movaps 0x40(%rsp), %xmm3
movups %xmm3, 0x30(%rbx)
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
subq $0x98, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movd 0xcfdf9(%rip), %xmm8    # 0x4d7c90
xorl %eax, %eax
movdqa 0xcfdff(%rip), %xmm1    # 0x4d7ca0
movdqa 0xcfe07(%rip), %xmm2    # 0x4d7cb0
movdqa 0xcfe0f(%rip), %xmm3    # 0x4d7cc0
movdqa 0xce5a7(%rip), %xmm4    # 0x4d6460
movdqa 0xcfe0f(%rip), %xmm5    # 0x4d7cd0
movdqa %xmm8, %xmm6
punpcklbw %xmm6, %xmm6    # xmm6 = xmm6[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pmullw %xmm1, %xmm6
pand %xmm2, %xmm6
packuswb %xmm6, %xmm6
movdqa %xmm6, %xmm7
pminub %xmm3, %xmm7
pcmpeqb %xmm6, %xmm7
punpcklbw %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3]
pand %xmm4, %xmm7
movdqa %xmm7, 0x10(%rsp,%rax,4)
addq $0x4, %rax
paddb %xmm5, %xmm8
cmpq $0x10, %rax
jne 0x407ec1
movd %xmm0, 0x8(%rsp)
callq 0x401078
movd %xmm0, 0xc(%rsp)
movss 0x8(%rsp), %xmm0
callq 0x401118
movss 0xc(%rsp), %xmm1
movss %xmm1, 0x10(%rsp)
movss %xmm0, 0x18(%rsp)
xorps 0xcfa18(%rip), %xmm0    # 0x4d7950
movss %xmm0, 0x30(%rsp)
movss %xmm1, 0x38(%rsp)
testb %bpl, %bpl
je 0x407fbf
xorl %eax, %eax
leaq 0x10(%rsp), %rcx
movq %rbx, %rdx
leaq (,%rax,4), %rsi
movq %rcx, %rdi
xorl %r8d, %r8d
xorps %xmm0, %xmm0
xorl %r9d, %r9d
movss (%rdx,%r9), %xmm1
mulss (%rdi,%r9,4), %xmm1
addss %xmm1, %xmm0
addq $0x4, %r9
cmpq $0x10, %r9
jne 0x407f67
leaq (%r8,%rsi), %r9
movss %xmm0, 0x50(%rsp,%r9,4)
incq %r8
addq $0x4, %rdi
cmpq $0x4, %r8
jne 0x407f61
incq %rax
addq $0x10, %rdx
cmpq $0x4, %rax
jne 0x407f53
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movaps 0x70(%rsp), %xmm2
movaps 0x80(%rsp), %xmm3
jmp 0x407fd3
movaps 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movaps 0x30(%rsp), %xmm2
movaps 0x40(%rsp), %xmm3
movups %xmm3, 0x30(%rbx)
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
subq $0x98, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movd 0xcfc8d(%rip), %xmm8    # 0x4d7c90
xorl %eax, %eax
movdqa 0xcfc93(%rip), %xmm1    # 0x4d7ca0
movdqa 0xcfc9b(%rip), %xmm2    # 0x4d7cb0
movdqa 0xcfca3(%rip), %xmm3    # 0x4d7cc0
movdqa 0xce43b(%rip), %xmm4    # 0x4d6460
movdqa 0xcfca3(%rip), %xmm5    # 0x4d7cd0
movdqa %xmm8, %xmm6
punpcklbw %xmm6, %xmm6    # xmm6 = xmm6[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pmullw %xmm1, %xmm6
pand %xmm2, %xmm6
packuswb %xmm6, %xmm6
movdqa %xmm6, %xmm7
pminub %xmm3, %xmm7
pcmpeqb %xmm6, %xmm7
punpcklbw %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
punpcklwd %xmm7, %xmm7    # xmm7 = xmm7[0,0,1,1,2,2,3,3]
pand %xmm4, %xmm7
movdqa %xmm7, 0x10(%rsp,%rax,4)
addq $0x4, %rax
paddb %xmm5, %xmm8
cmpq $0x10, %rax
jne 0x40802d
movd %xmm0, 0x8(%rsp)
callq 0x401078
movd %xmm0, 0xc(%rsp)
movss 0x8(%rsp), %xmm0
callq 0x401118
movss 0xc(%rsp), %xmm2
movss %xmm2, 0x10(%rsp)
movaps 0xcf8b2(%rip), %xmm1    # 0x4d7950
xorps %xmm0, %xmm1
movss %xmm1, 0x14(%rsp)
movss %xmm0, 0x20(%rsp)
movss %xmm2, 0x24(%rsp)
testb %bpl, %bpl
je 0x40812e
xorl %eax, %eax
leaq 0x10(%rsp), %rcx
movq %rbx, %rdx
leaq (,%rax,4), %rsi
movq %rcx, %rdi
xorl %r8d, %r8d
xorps %xmm0, %xmm0
xorl %r9d, %r9d
movss (%rdx,%r9), %xmm1
mulss (%rdi,%r9,4), %xmm1
addss %xmm1, %xmm0
addq $0x4, %r9
cmpq $0x10, %r9
jne 0x4080d6
leaq (%r8,%rsi), %r9
movss %xmm0, 0x50(%rsp,%r9,4)
incq %r8
addq $0x4, %rdi
cmpq $0x4, %r8
jne 0x4080d0
incq %rax
addq $0x10, %rdx
cmpq $0x4, %rax
jne 0x4080c2
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movaps 0x70(%rsp), %xmm2
movaps 0x80(%rsp), %xmm3
jmp 0x408142
movaps 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movaps 0x30(%rsp), %xmm2
movaps 0x40(%rsp), %xmm3
movups %xmm3, 0x30(%rbx)
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm0, (%rbx)
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
xorl %eax, %eax
xorps %xmm0, %xmm0
xorl %ecx, %ecx
movss (%rsi,%rcx,4), %xmm1
mulss (%rdx,%rcx,4), %xmm1
addss %xmm1, %xmm0
incq %rcx
cmpq $0x3, %rcx
jne 0x408661
movss %xmm0, -0xc(%rsp,%rax,4)
incq %rax
addq $0xc, %rsi
cmpq $0x3, %rax
jne 0x40865c
movl -0x4(%rsp), %eax
movl %eax, 0x8(%rdi)
movq -0xc(%rsp), %rax
movq %rax, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movss (%rsi), %xmm0
movss (%rdx), %xmm1
movss 0x4(%rdx), %xmm2
mulss 0x4(%rsi), %xmm2
movaps %xmm1, %xmm3
mulss %xmm0, %xmm3
movss 0x8(%rdx), %xmm4
mulss 0x8(%rsi), %xmm4
addss %xmm2, %xmm3
addss %xmm3, %xmm4
mulss 0xcf5b6(%rip), %xmm4    # 0x4d7c84
mulss %xmm4, %xmm1
addss %xmm0, %xmm1
movss %xmm1, (%rdi)
movss 0x4(%rdx), %xmm0
mulss %xmm4, %xmm0
addss 0x4(%rsi), %xmm0
movss %xmm0, 0x4(%rdi)
mulss 0x8(%rdx), %xmm4
addss 0x8(%rsi), %xmm4
movss %xmm4, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movss (%rdi), %xmm1
movss 0x4(%rdi), %xmm2
subss (%rdx), %xmm1
subss 0x4(%rdx), %xmm2
movss 0x8(%rdi), %xmm5
subss 0x8(%rdx), %xmm5
movaps %xmm2, %xmm3
mulss %xmm2, %xmm3
movaps %xmm1, %xmm4
mulss %xmm1, %xmm4
addss %xmm3, %xmm4
movaps %xmm5, %xmm3
mulss %xmm5, %xmm3
addss %xmm4, %xmm3
mulss %xmm0, %xmm0
subss %xmm0, %xmm3
xorps %xmm0, %xmm0
ucomiss %xmm3, %xmm0
ja 0x4089ef
mulss 0x4(%rsi), %xmm2
mulss (%rsi), %xmm1
mulss 0x8(%rsi), %xmm5
addss %xmm2, %xmm1
addss %xmm1, %xmm5
ucomiss %xmm0, %xmm5
ja 0x4089ef
movaps %xmm5, %xmm0
mulss %xmm5, %xmm0
subss %xmm3, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x4089f2
xorl %eax, %eax
retq
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
xorps 0xcef4f(%rip), %xmm5    # 0x4d7950
ucomiss %xmm1, %xmm0
jb 0x408a0c
sqrtss %xmm0, %xmm0
jmp 0x408a19
movaps %xmm5, (%rsp)
callq 0x4191b0
movaps (%rsp), %xmm5
subss %xmm0, %xmm5
movss %xmm5, (%rbx)
movb $0x1, %al
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movss (%rsi), %xmm1
movss %xmm1, (%rcx)
movss 0x4(%rsi), %xmm2
movss %xmm2, 0x4(%rcx)
movss 0x8(%rsi), %xmm0
movss %xmm0, 0x8(%rcx)
testl %edx, %edx
je 0x408d2d
movaps %xmm2, %xmm3
mulss %xmm2, %xmm3
movaps %xmm1, %xmm4
mulss %xmm1, %xmm4
addss %xmm3, %xmm4
movaps %xmm0, %xmm3
mulss %xmm0, %xmm3
addss %xmm4, %xmm3
sqrtss %xmm3, %xmm3
movss 0xcec11(%rip), %xmm4    # 0x4d7920
divss %xmm3, %xmm4
mulss %xmm4, %xmm1
movss %xmm1, (%rcx)
mulss %xmm4, %xmm2
movss %xmm2, 0x4(%rcx)
mulss %xmm4, %xmm0
movss %xmm0, 0x8(%rcx)
mulss 0x4(%rdi), %xmm2
mulss (%rdi), %xmm1
addss %xmm2, %xmm1
mulss 0x8(%rdi), %xmm0
addss %xmm1, %xmm0
xorps 0xcec06(%rip), %xmm0    # 0x4d7950
movss %xmm0, 0xc(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movss (%rdi), %xmm0
movss %xmm0, (%r8)
movss %xmm0, (%rcx)
movss 0x4(%rdi), %xmm0
movss %xmm0, 0x4(%r8)
movss %xmm0, 0x4(%rcx)
movss 0x8(%rdi), %xmm0
movss %xmm0, 0x8(%r8)
movss %xmm0, 0x8(%rcx)
xorl %eax, %eax
movss (%rsi,%rax,4), %xmm1
movss (%rcx,%rax,4), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x408e9d
movss %xmm1, (%rcx,%rax,4)
movaps %xmm1, %xmm0
movss (%rsi,%rax,4), %xmm1
movss (%r8,%rax,4), %xmm2
ucomiss %xmm2, %xmm1
jbe 0x408eb6
movss %xmm1, (%r8,%rax,4)
movss (%rcx,%rax,4), %xmm0
movaps %xmm1, %xmm2
movss (%rdx,%rax,4), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x408ed0
movss %xmm1, (%rcx,%rax,4)
movss (%rdx,%rax,4), %xmm1
movss (%r8,%rax,4), %xmm2
ucomiss %xmm2, %xmm1
jbe 0x408edb
movss %xmm1, (%r8,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x408e81
retq
// File: /workspace/github_c_makefile_star2_O3/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:
xorl %eax, %eax
movss (%rdi,%rax,4), %xmm1
subss %xmm0, %xmm1
movss %xmm1, (%rsi,%rax,4)
movss (%rdi,%rax,4), %xmm1
addss %xmm0, %xmm1
movss %xmm1, (%rdx,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x408ee7
retq
// File: /workspace/github_c_makefile_star2_O3/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:
xorps %xmm5, %xmm5
movups %xmm5, 0x4(%rdi)
movups %xmm5, 0x14(%rdi)
movups %xmm5, 0x24(%rdi)
movups %xmm5, 0x30(%rdi)
movaps %xmm0, %xmm5
addss %xmm1, %xmm5
subss %xmm0, %xmm1
divss %xmm1, %xmm5
movaps %xmm4, %xmm0
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movaps 0xcecf6(%rip), %xmm6    # 0x4d7d00
unpcklps %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0],xmm6[1],xmm3[1]
movaps %xmm0, %xmm7
mulps %xmm6, %xmm7
addps %xmm0, %xmm6
shufps $0x1, %xmm7, %xmm6      # xmm6 = xmm6[1,0],xmm7[0,0]
shufps $0xe2, %xmm7, %xmm6     # xmm6 = xmm6[2,0],xmm7[2,3]
subss %xmm2, %xmm3
mulss 0xcec5a(%rip), %xmm4    # 0x4d7c84
divss %xmm1, %xmm7
movss %xmm7, (%rdi)
movss %xmm5, 0x8(%rdi)
unpcklps %xmm3, %xmm3            # xmm3 = xmm3[0,0,1,1]
divps %xmm3, %xmm6
movlps %xmm6, 0x14(%rdi)
movl $0xbf800000, %eax       # imm = 0xBF800000
movl %eax, 0x28(%rdi)
movss %xmm4, 0x2c(%rdi)
movl %eax, 0x38(%rdi)
retq