LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x30, %rsp
movaps %xmm3, 0x20(%rsp)
movaps %xmm2, 0x10(%rsp)
movss %xmm1, 0xc(%rsp)
movq %rdi, %rbx
mulss 0xcd416(%rip), %xmm0    # 0x4d6488
cvtss2sd %xmm0, %xmm0
callq 0x4010f8
movaps 0x10(%rsp), %xmm6
xorps %xmm1, %xmm1
cvtss2sd %xmm6, %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movaps %xmm0, %xmm3
divss 0xc(%rsp), %xmm3
xorps %xmm1, %xmm1
movups %xmm1, 0x4(%rbx)
movups %xmm1, 0x14(%rbx)
movups %xmm1, 0x24(%rbx)
movups %xmm1, 0x30(%rbx)
movaps %xmm0, %xmm4
subss %xmm0, %xmm4
addss %xmm0, %xmm0
divss %xmm0, %xmm4
movaps %xmm6, %xmm1
movaps 0x20(%rsp), %xmm5
addss %xmm5, %xmm1
movaps %xmm5, %xmm2
mulss 0xcebb0(%rip), %xmm5    # 0x4d7c84
subss %xmm6, %xmm2
mulss %xmm6, %xmm5
movaps %xmm5, %xmm7
movaps 0xcec1a(%rip), %xmm5    # 0x4d7d00
unpcklps %xmm3, %xmm5            # xmm5 = xmm5[0],xmm3[0],xmm5[1],xmm3[1]
unpcklps %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0],xmm6[1],xmm3[1]
xorps 0xce85d(%rip), %xmm1    # 0x4d7950
addss %xmm3, %xmm3
unpcklps %xmm7, %xmm1            # xmm1 = xmm1[0],xmm7[0],xmm1[1],xmm7[1]
movss %xmm4, 0x8(%rbx)
mulps %xmm5, %xmm6
subps %xmm5, %xmm5
shufps $0x1, %xmm6, %xmm5      # xmm5 = xmm5[1,0],xmm6[0,0]
shufps $0xe2, %xmm6, %xmm5     # xmm5 = xmm5[2,0],xmm6[2,3]
divss %xmm0, %xmm6
unpcklps %xmm3, %xmm3            # xmm3 = xmm3[0,0,1,1]
divps %xmm3, %xmm5
movss %xmm6, (%rbx)
movlps %xmm5, 0x14(%rbx)
unpcklps %xmm2, %xmm2            # xmm2 = xmm2[0,0,1,1]
divps %xmm2, %xmm1
movlps %xmm1, 0x28(%rbx)
movl $0xbf800000, 0x38(%rbx) # imm = 0xBF800000
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x30, %rsp
movaps %xmm3, 0x20(%rsp)
movaps %xmm2, 0x10(%rsp)
movss %xmm1, 0xc(%rsp)
movq %rdi, %rbx
mulss 0xcd332(%rip), %xmm0    # 0x4d6488
cvtss2sd %xmm0, %xmm0
callq 0x4010f8
movaps 0x10(%rsp), %xmm5
xorps %xmm1, %xmm1
cvtss2sd %xmm5, %xmm1
mulsd %xmm0, %xmm1
xorps %xmm2, %xmm2
cvtsd2ss %xmm1, %xmm2
movss 0xc(%rsp), %xmm1
mulss %xmm2, %xmm1
xorps %xmm0, %xmm0
movups %xmm0, 0x4(%rbx)
movups %xmm0, 0x14(%rbx)
movups %xmm0, 0x24(%rbx)
movups %xmm0, 0x30(%rbx)
movaps %xmm1, %xmm3
subss %xmm1, %xmm3
addss %xmm1, %xmm1
divss %xmm1, %xmm3
movaps %xmm1, %xmm6
movaps %xmm5, %xmm0
movaps 0x20(%rsp), %xmm4
addss %xmm4, %xmm0
movaps %xmm4, %xmm1
mulss 0xceac8(%rip), %xmm4    # 0x4d7c84
subss %xmm5, %xmm1
mulss %xmm5, %xmm4
movaps %xmm4, %xmm7
movaps 0xceb32(%rip), %xmm4    # 0x4d7d00
unpcklps %xmm2, %xmm4            # xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
unpcklps %xmm2, %xmm5            # xmm5 = xmm5[0],xmm2[0],xmm5[1],xmm2[1]
xorps 0xce775(%rip), %xmm0    # 0x4d7950
addss %xmm2, %xmm2
unpcklps %xmm7, %xmm0            # xmm0 = xmm0[0],xmm7[0],xmm0[1],xmm7[1]
movss %xmm3, 0x8(%rbx)
mulps %xmm4, %xmm5
subps %xmm4, %xmm4
shufps $0x1, %xmm5, %xmm4      # xmm4 = xmm4[1,0],xmm5[0,0]
shufps $0xe2, %xmm5, %xmm4     # xmm4 = xmm4[2,0],xmm5[2,3]
divss %xmm6, %xmm5
unpcklps %xmm2, %xmm2            # xmm2 = xmm2[0,0,1,1]
divps %xmm2, %xmm4
movss %xmm5, (%rbx)
movlps %xmm4, 0x14(%rbx)
unpcklps %xmm1, %xmm1            # xmm1 = xmm1[0,0,1,1]
divps %xmm1, %xmm0
movlps %xmm0, 0x28(%rbx)
movl $0xbf800000, 0x38(%rbx) # imm = 0xBF800000
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x20, %rsp
movaps %xmm2, 0x10(%rsp)
movss %xmm1, 0xc(%rsp)
movq %rdi, %rbx
mulss 0xcd24f(%rip), %xmm0    # 0x4d6488
cvtss2sd %xmm0, %xmm0
callq 0x4010f8
movaps 0x10(%rsp), %xmm5
xorps %xmm1, %xmm1
cvtss2sd %xmm5, %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movaps %xmm0, %xmm1
divss 0xc(%rsp), %xmm1
xorps %xmm2, %xmm2
movups %xmm2, 0x4(%rbx)
movups %xmm2, 0x14(%rbx)
movups %xmm2, 0x24(%rbx)
movups %xmm2, 0x30(%rbx)
movaps %xmm0, %xmm2
subss %xmm0, %xmm2
addss %xmm0, %xmm0
divss %xmm0, %xmm2
movss 0xce9f8(%rip), %xmm3    # 0x4d7c84
mulss %xmm5, %xmm3
movaps 0xcea69(%rip), %xmm4    # 0x4d7d00
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
unpcklps %xmm1, %xmm5            # xmm5 = xmm5[0],xmm1[0],xmm5[1],xmm1[1]
addss %xmm1, %xmm1
movss %xmm2, 0x8(%rbx)
movaps %xmm5, %xmm2
mulps %xmm4, %xmm2
subps %xmm4, %xmm4
shufps $0x1, %xmm2, %xmm4      # xmm4 = xmm4[1,0],xmm2[0,0]
shufps $0xe2, %xmm2, %xmm4     # xmm4 = xmm4[2,0],xmm2[2,3]
divss %xmm0, %xmm2
unpcklps %xmm1, %xmm1            # xmm1 = xmm1[0,0,1,1]
divps %xmm1, %xmm4
movss %xmm2, (%rbx)
movlps %xmm4, 0x14(%rbx)
movl $0xbf800000, %eax       # imm = 0xBF800000
movl %eax, 0x28(%rbx)
movss %xmm3, 0x2c(%rbx)
movl %eax, 0x38(%rbx)
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x20, %rsp
movaps %xmm2, 0x10(%rsp)
movss %xmm1, 0xc(%rsp)
movq %rdi, %rbx
mulss 0xcd18e(%rip), %xmm0    # 0x4d6488
cvtss2sd %xmm0, %xmm0
callq 0x4010f8
movaps 0x10(%rsp), %xmm5
xorps %xmm1, %xmm1
cvtss2sd %xmm5, %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss 0xc(%rsp), %xmm2
mulss %xmm0, %xmm2
xorps %xmm1, %xmm1
movups %xmm1, 0x4(%rbx)
movups %xmm1, 0x14(%rbx)
movups %xmm1, 0x24(%rbx)
movups %xmm1, 0x30(%rbx)
movaps %xmm2, %xmm1
subss %xmm2, %xmm1
addss %xmm2, %xmm2
divss %xmm2, %xmm1
movaps %xmm2, %xmm4
movss 0xce933(%rip), %xmm2    # 0x4d7c84
mulss %xmm5, %xmm2
movaps 0xce9a4(%rip), %xmm3    # 0x4d7d00
unpcklps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0],xmm3[1],xmm0[1]
unpcklps %xmm0, %xmm5            # xmm5 = xmm5[0],xmm0[0],xmm5[1],xmm0[1]
addss %xmm0, %xmm0
movss %xmm1, 0x8(%rbx)
movaps %xmm5, %xmm1
mulps %xmm3, %xmm1
subps %xmm3, %xmm3
shufps $0x1, %xmm1, %xmm3      # xmm3 = xmm3[1,0],xmm1[0,0]
shufps $0xe2, %xmm1, %xmm3     # xmm3 = xmm3[2,0],xmm1[2,3]
divss %xmm4, %xmm1
unpcklps %xmm0, %xmm0            # xmm0 = xmm0[0,0,1,1]
divps %xmm0, %xmm3
movss %xmm1, (%rbx)
movlps %xmm3, 0x14(%rbx)
movl $0xbf800000, %eax       # imm = 0xBF800000
movl %eax, 0x28(%rbx)
movss %xmm2, 0x2c(%rbx)
movl %eax, 0x38(%rbx)
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
subq $0x20, %rsp
movaps %xmm3, 0x10(%rsp)
movss %xmm2, 0xc(%rsp)
movss %xmm1, 0x8(%rsp)
movq %rdi, %rbx
mulss 0xcd0c3(%rip), %xmm0    # 0x4d6488
callq 0x419040
movss 0xce54e(%rip), %xmm1    # 0x4d7920
divss %xmm0, %xmm1
movaps %xmm1, %xmm0
divss 0x8(%rsp), %xmm0
movss 0xc(%rsp), %xmm4
movaps %xmm4, %xmm2
movaps 0x10(%rsp), %xmm5
subss %xmm5, %xmm2
xorps %xmm3, %xmm3
movups %xmm3, 0x14(%rbx)
movups %xmm3, 0x24(%rbx)
movups %xmm3, 0x30(%rbx)
movups %xmm3, 0x4(%rbx)
movss %xmm0, (%rbx)
movss %xmm1, 0x14(%rbx)
movaps %xmm4, %xmm0
movaps %xmm5, %xmm1
addss %xmm5, %xmm0
addss %xmm5, %xmm1
mulss %xmm4, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
unpcklps %xmm2, %xmm2            # xmm2 = xmm2[0,0,1,1]
divps %xmm2, %xmm0
movlps %xmm0, 0x28(%rbx)
movl $0xbf800000, 0x38(%rbx) # imm = 0xBF800000
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_perspectiveInf
void mat4_perspectiveInf(float *out,float fov,float aspect,float znear) {
  float yScale=1.0f/tanf(fov/2.0f);
  float xScale=yScale/aspect;

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

  out[0]=xScale;
  out[5]=yScale;
  out[10]=-1.0f;
  out[11]=-2.0f*znear;
  out[14]=-1.0f;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movss %xmm2, 0xc(%rsp)
movss %xmm1, 0x8(%rsp)
movq %rdi, %rbx
mulss 0xcd033(%rip), %xmm0    # 0x4d6488
callq 0x419040
movss 0xce4be(%rip), %xmm1    # 0x4d7920
divss %xmm0, %xmm1
movaps %xmm1, %xmm0
divss 0x8(%rsp), %xmm0
xorps %xmm2, %xmm2
movups %xmm2, 0x14(%rbx)
movups %xmm2, 0x24(%rbx)
movups %xmm2, 0x30(%rbx)
movups %xmm2, 0x4(%rbx)
movss %xmm0, (%rbx)
movss %xmm1, 0x14(%rbx)
movl $0xbf800000, %eax       # imm = 0xBF800000
movl %eax, 0x28(%rbx)
movss 0xc(%rsp), %xmm0
mulss 0xce7e3(%rip), %xmm0    # 0x4d7c84
movss %xmm0, 0x2c(%rbx)
movl %eax, 0x38(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/math.c
// Function: mat4_ortho
void mat4_ortho(float *out,float left,float right,
                float bottom,float top,float nearVal,
                float farVal) {

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

  float tx = -(right+left)/(right-left);
  float ty = -(top+bottom)/(top-bottom);
  float tz = -(farVal+nearVal)/(farVal-nearVal);

  out[0]=2.0f/(right-left);
  out[3]=tx;
  out[5]=2.0f/(top-bottom);
  out[7]=ty;
  out[10]=-2.0f/(nearVal-farVal);
  out[11]=tz;
  out[15]=1.0f;
}

// Assembly:
xorps %xmm6, %xmm6
movups %xmm6, 0x4(%rdi)
movups %xmm6, 0x14(%rdi)
movups %xmm6, 0x24(%rdi)
movq $0x0, 0x34(%rdi)
movaps %xmm0, %xmm6
addss %xmm1, %xmm6
movaps 0xce47c(%rip), %xmm7    # 0x4d7950
xorps %xmm7, %xmm6
subss %xmm0, %xmm1
divss %xmm1, %xmm6
movaps %xmm2, %xmm0
addss %xmm3, %xmm0
xorps %xmm7, %xmm0
subss %xmm2, %xmm3
divss %xmm3, %xmm0
movaps %xmm4, %xmm2
addss %xmm5, %xmm2
xorps %xmm7, %xmm2
movaps %xmm5, %xmm7
unpcklps %xmm4, %xmm7            # xmm7 = xmm7[0],xmm4[0],xmm7[1],xmm4[1]
unpcklps %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0],xmm4[1],xmm5[1]
subps %xmm7, %xmm4
movss 0xce77d(%rip), %xmm5    # 0x4d7c8c
movaps %xmm5, %xmm7
divss %xmm1, %xmm7
movss %xmm7, (%rdi)
movss %xmm6, 0xc(%rdi)
divss %xmm3, %xmm5
movss %xmm5, 0x14(%rdi)
movss %xmm0, 0x1c(%rdi)
movaps 0xce7dc(%rip), %xmm0    # 0x4d7d10
movss %xmm2, %xmm0            # xmm0 = xmm2[0],xmm0[1,2,3]
shufps $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
divps %xmm4, %xmm0
movlps %xmm0, 0x28(%rdi)
movl $0x3f800000, 0x3c(%rdi) # imm = 0x3F800000
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/redblack.c
// Function: rbdestroy
RB_STATIC void
RB_ENTRY(destroy)(struct RB_ENTRY(tree) *rbinfo)
{
	if (rbinfo==NULL)
		return;

	if (rbinfo->rb_root!=RBNULL)
		RB_ENTRY(_destroy)(rbinfo->rb_root);
	
	free(rbinfo);
}

// Assembly:
testq %rdi, %rdi
je 0x409856
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
leaq 0x10f9a5(%rip), %rax    # 0x5191e8
cmpq %rax, %rdi
je 0x40984d
callq 0x409857
movq %rbx, %rdi
popq %rbx
jmp 0x445c00
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/redblack.c
// Function: rb_destroy
static void
RB_ENTRY(_destroy)(struct RB_ENTRY(node) *x)
{
	if (x!=RBNULL)
	{
		if (x->left!=RBNULL)
			RB_ENTRY(_destroy)(x->left);
		if (x->right!=RBNULL)
			RB_ENTRY(_destroy)(x->right);
		RB_ENTRY(_free)(x);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x10f980(%rip), %r14    # 0x5191e8
cmpq %r14, %rdi
je 0x409872
callq 0x409857
movq 0x8(%rbx), %rdi
cmpq %r14, %rdi
je 0x409880
callq 0x409857
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x445c00
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/redblack.c
// Function: rbfind
RB_STATIC const RB_ENTRY(data_t) * 
RB_ENTRY(find)(const RB_ENTRY(data_t) *key, struct RB_ENTRY(tree) *rbinfo)
{
	struct RB_ENTRY(node) *x;

	if (rbinfo==NULL)
		return(NULL);

	/* If we have a NULL root (empty tree) then just return */
	if (rbinfo->rb_root==RBNULL)
		return(NULL);

	x=RB_ENTRY(_traverse)(0, key, rbinfo);

	return((x==RBNULL) ? NULL : RB_GET(x, key));
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rsi, %rsi
je 0x409ba1
movq %rsi, %r14
movq 0x10(%rsi), %r12
leaq 0x10f675(%rip), %r13    # 0x5191e8
cmpq %r13, %r12
je 0x409ba1
movq %rdi, %r15
xorl %ebx, %ebx
movq 0x20(%r12), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq *(%r14)
testl %eax, %eax
js 0x409b96
je 0x409bb0
addq $0x8, %r12
movq (%r12), %r12
cmpq %r13, %r12
jne 0x409b7d
jmp 0x409ba3
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x20(%r12), %rbx
jmp 0x409ba3
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/redblack.c
// Function: rb_walk
static void
RB_ENTRY(_walk)(const struct RB_ENTRY(node) *x, void (*action)(const RB_ENTRY(data_t) *, const VISIT, const int, void *), void *arg, int level)
{
	if (x==RBNULL)
		return;

	if (x->left==RBNULL && x->right==RBNULL)
	{
		/* leaf */
		(*action)(RB_GET(x, key), leaf, level, arg);
	}
	else
	{
		(*action)(RB_GET(x, key), preorder, level, arg);

		RB_ENTRY(_walk)(x->left, action, arg, level+1);

		(*action)(RB_GET(x, key), postorder, level, arg);

		RB_ENTRY(_walk)(x->right, action, arg, level+1);

		(*action)(RB_GET(x, key), endorder, level, arg);
	}
}

// Assembly:
leaq 0x10f2d7(%rip), %rax    # 0x5191e8
cmpq %rax, %rdi
je 0x409fac
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdx, %rbx
movq %rsi, %r8
movq %rdi, %r15
cmpq %rax, (%rdi)
jne 0x409f3c
cmpq %rax, 0x8(%r15)
je 0x409fad
leaq 0x20(%r15), %r12
movq 0x20(%r15), %rdi
xorl %esi, %esi
movl %r14d, %edx
movq %rbx, %rcx
movq %r8, %r13
callq *%r8
movq (%r15), %rdi
leal 0x1(%r14), %ebp
movq %r13, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x409f0a
movq 0x20(%r15), %rdi
movl $0x1, %esi
movl %r14d, %edx
movq %rbx, %rcx
callq *%r13
movq 0x8(%r15), %rdi
movq %r13, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x409f0a
movq %r13, %r8
movl $0x2, %esi
movq (%r12), %rdi
movl %r14d, %edx
movq %rbx, %rcx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%r8
retq
addq $0x20, %r15
movl $0x3, %esi
movq %r15, %r12
jmp 0x409f91
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/sobol.c
// Function: sobol_get
int sobol_get(void * state, unsigned int dimension, double * v)
{
  sobol_state_t * s_state = (sobol_state_t *) state;

  unsigned int i_dimension;

  /* Find the position of the least-significant zero in count. */
  int ell = 0;
  int c = s_state->sequence_count;
  while(1) {
    ++ell;
    if((c % 2) == 1) c /= 2;
    else break;
  }

  /* Check for exhaustion. */
  if(ell > SOBOL_BIT_COUNT) {
    // return GSL_EFAILED; /* FIXME: good return code here */
    /////////////////
    sobol_init(state, dimension);

    /* Find the position of the least-significant zero in count. */
    int ell = 0;
    int c = s_state->sequence_count;
    while(1) {
      ++ell;
      if((c % 2) == 1) c /= 2;
      else break;
    }
    /////////////////
  }

  for(i_dimension=0; i_dimension<dimension; i_dimension++) {
    const int direction_i     = s_state->v_direction[ell-1][i_dimension];
    const int old_numerator_i = s_state->last_numerator_vec[i_dimension];
    const int new_numerator_i = old_numerator_i ^ direction_i;
    s_state->last_numerator_vec[i_dimension] = new_numerator_i;
    v[i_dimension] = new_numerator_i * s_state->last_denominator_inv;
  }

  s_state->sequence_count++;

  return GSL_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %rbx
movl (%rdi), %eax
movl %eax, %ecx
andl $0x80000001, %ecx       # imm = 0x80000001
xorl %r15d, %r15d
cmpl $0x1, %ecx
jne 0x40a5f6
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %eax, %esi
movl %eax, %edx
shrl %edx
incl %ecx
testb $0x2, %sil
movl %edx, %esi
jne 0x40a5c4
leal 0x1(%rcx), %r15d
cmpl $0x1d, %ecx
jb 0x40a5f6
movq %rbx, %rdi
movl %ebp, %esi
callq 0x40a294
movl (%rbx), %eax
movl %eax, %ecx
movl %ecx, %edx
andl $0x80000001, %edx       # imm = 0x80000001
shrl %ecx
cmpl $0x1, %edx
je 0x40a5e7
testl %ebp, %ebp
je 0x40a638
movl %r15d, %edx
movl %ebp, %ecx
leaq (%rdx,%rdx,4), %rdx
shlq $0x5, %rdx
addq %rbx, %rdx
addq $0xb0, %rdx
xorl %esi, %esi
movl 0x10(%rbx,%rsi,4), %edi
xorl (%rdx,%rsi,4), %edi
movl %edi, 0x10(%rbx,%rsi,4)
xorps %xmm0, %xmm0
cvtsi2sd %edi, %xmm0
mulsd 0x8(%rbx), %xmm0
movsd %xmm0, (%r14,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x40a613
incl %eax
movl %eax, (%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi_loadf_main
float *stbi_loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
{
   unsigned char *data;
   #ifndef STBI_NO_HDR
   if (stbi__hdr_test(s))
      return stbi__hdr_load(s,x,y,comp,req_comp);
   #endif
   data = stbi_load_main(s, x, y, comp, req_comp);
   if (data)
      return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);
   return stbi__errpf("unknown image type", "Image not of any known type, or corrupt");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %ebp
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
callq 0x40cb2d
movq %r14, %rdi
testl %eax, %eax
je 0x40c99c
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movl %ebp, %r8d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x40cb89
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movl %ebp, %r8d
callq 0x40a7a0
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x40cafb
movl (%r13), %eax
movl (%r12), %ebx
testl %ebp, %ebp
movq %rbp, %r12
jne 0x40c9cd
movl (%r15), %r12d
imull %eax, %ebx
movl %r12d, %eax
imull %ebx, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x4458c0
testq %rax, %rax
je 0x40cb04
movq %rax, 0x10(%rsp)
testl %ebx, %ebx
jle 0x40caea
movl %r12d, %eax
andl $0x1, %eax
leal (%r12,%rax), %ebp
decl %ebp
movslq %r12d, %rsi
movl %ebx, %eax
movq %rax, 0x30(%rsp)
movl %ebp, %r14d
leaq (,%rsi,4), %rax
movq %rax, 0x28(%rsp)
xorl %r13d, %r13d
movss 0xcb977(%rip), %xmm1    # 0x4d83a0
movq 0x8(%rsp), %r15
movq 0x10(%rsp), %rbx
movq %r12, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movl $0x0, %eax
testl %ebp, %ebp
jle 0x40caa5
xorl %r12d, %r12d
movzbl (%r15,%r12), %eax
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x10c7b0(%rip), %xmm1   # 0x519218
callq 0x418960
xorps %xmm1, %xmm1
cvtss2sd 0x10c7a4(%rip), %xmm1   # 0x51921c
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss 0xcb915(%rip), %xmm1    # 0x4d83a0
movss %xmm0, (%rbx,%r12,4)
incq %r12
cmpq %r12, %r14
jne 0x40ca49
movl %ebp, %eax
movq 0x20(%rsp), %r12
movq 0x18(%rsp), %rsi
cmpl %r12d, %eax
jge 0x40cad4
movq %r13, %rcx
imulq %rsi, %rcx
movl %eax, %eax
addq %rcx, %rax
movq 0x8(%rsp), %rcx
movzbl (%rcx,%rax), %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
divss %xmm1, %xmm0
movq 0x10(%rsp), %rcx
movss %xmm0, (%rcx,%rax,4)
incq %r13
addq 0x28(%rsp), %rbx
addq %rsi, %r15
cmpq 0x30(%rsp), %r13
jne 0x40ca3d
movq 0x8(%rsp), %rdi
callq 0x445c00
movq 0x10(%rsp), %rax
jmp 0x40cb1e
leaq 0xcbdca(%rip), %rax     # 0x4d88cc
jmp 0x40cb15
movq 0x8(%rsp), %rdi
callq 0x445c00
leaq 0xcbeba(%rip), %rax     # 0x4d89cf
movq %rax, 0x10fa04(%rip)    # 0x51c520
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/stb_image.c
// Function: decode_jpeg_header
static int decode_jpeg_header(stbi__jpeg *z, int scan)
{
   int m;
   z->marker = STBI__MARKER_none; // initialize cached marker to empty
   m = stbi__get_marker(z);
   if (!stbi__SOI(m)) return stbi__err("no stbi__SOI","Corrupt JPEG");
   if (scan == SCAN_type) return 1;
   m = stbi__get_marker(z);
   while (!stbi__SOF(m)) {
      if (!stbi__process_marker(z,m)) return 0;
      m = stbi__get_marker(z);
      while (m == STBI__MARKER_none) {
         // some files have extra padding after their blocks, so ok, we'll scan
         if (stbi__at_eof(z->s)) return stbi__err("no stbi__SOF", "Corrupt JPEG");
         m = stbi__get_marker(z);
      }
   }
   if (!stbi__process_frame_header(z, scan)) return 0;
   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movb $-0x1, 0x36c8(%rdi)
callq 0x40fd6a
cmpb $-0x28, %al
jne 0x40fce0
movl $0x1, %ebp
cmpl $0x1, %ebx
je 0x40fcf0
movq %r14, %rdi
callq 0x40fd6a
movzbl %al, %esi
movl %esi, %eax
andl $-0x2, %eax
cmpl $0xc0, %eax
jne 0x40fcfd
movq %r14, %rdi
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x41008a
leaq 0xc8bf8(%rip), %rax     # 0x4d88df
movq %rax, 0x10c832(%rip)    # 0x51c520
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x40fda0
testl %eax, %eax
je 0x40fcf0
movq %r14, %rdi
callq 0x40fd6a
cmpb $-0x1, %al
jne 0x40fd46
movq (%r14), %r15
cmpq $0x0, 0x10(%r15)
je 0x40fd34
movq 0x28(%r15), %rdi
callq *0x20(%r15)
testl %eax, %eax
je 0x40fd0b
cmpl $0x0, 0x30(%r15)
je 0x40fd5a
movq 0xb8(%r15), %rax
cmpq 0xc0(%r15), %rax
jb 0x40fd0b
jmp 0x40fd5a
movzbl %al, %esi
movl %esi, %eax
andl $-0x2, %eax
cmpl $0xc0, %eax
jne 0x40fcff
jmp 0x40fccc
leaq 0xc8b8b(%rip), %rax     # 0x4d88ec
movq %rax, 0x10c7b8(%rip)    # 0x51c520
jmp 0x40fcf0
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__cleanup_jpeg
static void stbi__cleanup_jpeg(stbi__jpeg *j)
{
   int i;
   for (i=0; i < j->s->img_n; ++i) {
      if (j->img_comp[i].raw_data) {
         free(j->img_comp[i].raw_data);
         j->img_comp[i].raw_data = NULL;
         j->img_comp[i].data = NULL;
      }
      if (j->img_comp[i].linebuf) {
         free(j->img_comp[i].linebuf);
         j->img_comp[i].linebuf = NULL;
      }
   }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq (%rdi), %rax
cmpl $0x0, 0x8(%rax)
jle 0x4106b0
movq %rdi, %rbx
leaq 0x35e0(%rdi), %r14
xorl %r15d, %r15d
movq -0x8(%r14), %rdi
testq %rdi, %rdi
je 0x410689
callq 0x445c00
xorps %xmm0, %xmm0
movups %xmm0, -0x10(%r14)
movq (%r14), %rdi
testq %rdi, %rdi
je 0x41069d
callq 0x445c00
movq $0x0, (%r14)
incq %r15
movq (%rbx), %rax
movslq 0x8(%rax), %rax
addq $0x48, %r14
cmpq %rax, %r15
jl 0x410673
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__jpeg_decode_block
static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, int b)
{
   int diff,dc,k;
   int t = stbi__jpeg_huff_decode(j, hdc);
   if (t < 0) return stbi__err("bad huffman code","Corrupt JPEG");

   // 0 all the ac values now so we can do it 32-bits at a time
   memset(data,0,64*sizeof(data[0]));

   diff = t ? stbi__extend_receive(j, t) : 0;
   dc = j->img_comp[b].dc_pred + diff;
   j->img_comp[b].dc_pred = dc;
   data[0] = (short) dc;

   // decode AC components, see JPEG spec
   k = 1;
   do {
      int r,s;
      int rs = stbi__jpeg_huff_decode(j, hac);
      if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
      s = rs & 15;
      r = rs >> 4;
      if (s == 0) {
         if (rs != 0xf0) break; // end block
         k += 16;
      } else {
         k += r;
         // decode into unzigzag'd location
         data[stbi__jpeg_dezigzag[k++]] = (short) stbi__extend_receive(j,s);
      }
   } while (k < 64);
   return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rsi
callq 0x41134a
testl %eax, %eax
js 0x410e61
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%r14)
movups %xmm0, 0x60(%r14)
movups %xmm0, 0x50(%r14)
movups %xmm0, 0x40(%r14)
movups %xmm0, 0x30(%r14)
movups %xmm0, 0x20(%r14)
movups %xmm0, 0x10(%r14)
movups %xmm0, (%r14)
je 0x410deb
movq %r15, %rdi
movl %eax, %esi
callq 0x411482
jmp 0x410ded
xorl %eax, %eax
movslq %ebp, %rcx
leaq (%rcx,%rcx,8), %rcx
addl 0x35b8(%r15,%rcx,8), %eax
movl %eax, 0x35b8(%r15,%rcx,8)
movw %ax, (%r14)
movl $0x1, %ebp
leaq 0xc774c(%rip), %r12     # 0x4d8560
movq %r15, %rdi
movq %rbx, %rsi
callq 0x41134a
testl %eax, %eax
js 0x410e61
movl %eax, %esi
andl $0xf, %esi
je 0x410e4b
shrl $0x4, %eax
movslq %ebp, %r13
addq %rax, %r13
movq %r15, %rdi
callq 0x411482
leal 0x1(%r13), %ebp
movzbl (%r12,%r13), %ecx
movw %ax, (%r14,%rcx,2)
jmp 0x410e55
cmpl $0xf0, %eax
jne 0x410e5a
addl $0x10, %ebp
cmpl $0x40, %ebp
jl 0x410e14
movl $0x1, %eax
jmp 0x410e71
leaq 0xc7bd3(%rip), %rax     # 0x4d8a3b
movq %rax, 0x10b6b1(%rip)    # 0x51c520
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__extend_receive
stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n)
{
   unsigned int m = 1 << (n-1);
   unsigned int k;
   if (j->code_bits < n) stbi__grow_buffer_unsafe(j);

   #if 1
   k = stbi_lrot(j->code_buffer, n);
   j->code_buffer = k & ~stbi__bmask[n];
   k &= stbi__bmask[n];
   j->code_bits -= n;
   #else
   k = (j->code_buffer >> (32 - n)) & stbi__bmask[n];
   j->code_bits -= n;
   j->code_buffer <<= n;
   #endif
   // the following test is probably a random branch that won't
   // predict well. I tried to table accelerate it but failed.
   // maybe it's compiling as a conditional move?
   if (k < m)
      return (-1 << n) + k + 1;
   else
      return k;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movl 0x36c4(%rdi), %eax
cmpl %esi, %eax
jge 0x4114a4
movq %rbx, %rdi
callq 0x4112e5
movl 0x36c4(%rbx), %eax
movl 0x36c0(%rbx), %edx
movl %r14d, %ecx
roll %cl, %edx
movl %r14d, %ecx
leaq 0xc70f7(%rip), %rsi     # 0x4d85b0
movl (%rsi,%rcx,4), %ecx
movl %ecx, %esi
notl %esi
andl %edx, %esi
movl %esi, 0x36c0(%rbx)
andl %ecx, %edx
subl %r14d, %eax
leal -0x1(%r14), %ecx
movl %edx, %esi
shrl %cl, %esi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
movl %r14d, %ecx
shll %cl, %edi
movl %eax, 0x36c4(%rbx)
incl %edi
xorl %eax, %eax
testl %esi, %esi
cmovel %edi, %eax
addl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__zexpand
static int stbi__zexpand(stbi__zbuf *z, int n)  // need to make room for n bytes
{
   char *q;
   int cur, limit;
   if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG");
   cur   = (int) (z->zout     - z->zout_start);
   limit = (int) (z->zout_end - z->zout_start);
   while (cur + n > limit)
      limit *= 2;
   q = (char *) realloc(z->zout_start, limit);
   if (q == NULL) return stbi__err("outofmem", "Out of memory");
   z->zout_start = q;
   z->zout       = q + cur;
   z->zout_end   = q + limit;
   return 1;
}

// Assembly:
cmpl $0x0, 0x30(%rdi)
je 0x413665
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %r15
movq 0x20(%rdi), %rdi
subq %rdi, %r15
movl 0x28(%rbx), %eax
subl %edi, %eax
addl %r15d, %esi
movl %eax, %ecx
leal (%rcx,%rcx), %eax
cmpl %ecx, %esi
jg 0x413630
movslq %ecx, %r14
movq %r14, %rsi
callq 0x445f50
testq %rax, %rax
je 0x413676
movq %rax, 0x20(%rbx)
movslq %r15d, %rcx
addq %rax, %rcx
movq %rcx, 0x18(%rbx)
addq %rax, %r14
movq %r14, 0x28(%rbx)
movl $0x1, %eax
jmp 0x413686
leaq 0xc5993(%rip), %rax     # 0x4d8fff
movq %rax, 0x108ead(%rip)    # 0x51c520
xorl %eax, %eax
retq
leaq 0xc5352(%rip), %rax     # 0x4d89cf
movq %rax, 0x108e9c(%rip)    # 0x51c520
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/stb_image.c
// Function: stbi__zhuffman_decode
stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)
{
   int b,s,k;
   if (a->num_bits < 16) stbi__fill_bits(a);
   b = z->fast[a->code_buffer & STBI__ZFAST_MASK];
   if (b < 0xffff) {
      s = z->size[b];
      a->code_buffer >>= s;
      a->num_bits -= s;
      return z->value[b];
   }

   // not resolved by fast table, so compute it the slow way
   // use jpeg approach, which requires MSbits at top
   k = stbi__bit_reverse(a->code_buffer, 16);
   for (s=STBI__ZFAST_BITS+1; ; ++s)
      if (k < z->maxcode[s])
         break;
   if (s == 16) return -1; // invalid code!
   // code size is s, so:
   b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];
   STBI_ASSERT(z->size[b] == s);
   a->code_buffer >>= s;
   a->num_bits -= s;
   return z->value[b];
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0xf, 0x10(%rdi)
jg 0x4136a4
movq %r14, %rdi
callq 0x4135b6
movl 0x14(%r14), %esi
movl %esi, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movzwl (%rbx,%rax,2), %eax
cmpq $0xffff, %rax           # imm = 0xFFFF
je 0x4136c8
movzbl 0x484(%rbx,%rax), %edx
jmp 0x41374f
movl %esi, %eax
rolw $0x8, %ax
movl %eax, %ecx
shrl $0x4, %ecx
movl $0xf0f, %edx            # imm = 0xF0F
andl %edx, %ecx
andl %edx, %eax
shll $0x4, %eax
orl %ecx, %eax
movl $0x3333, %ecx           # imm = 0x3333
movl %eax, %edx
andl %ecx, %edx
shrl $0x2, %eax
andl %ecx, %eax
leal (%rax,%rdx,4), %eax
movl $0x5555, %ecx           # imm = 0x5555
movl %eax, %edx
andl %ecx, %edx
shrl %eax
andl %ecx, %eax
leal (%rax,%rdx,2), %edi
xorl %edx, %edx
movq %rdx, %rax
incq %rdx
cmpl %edi, 0x448(%rbx,%rax,4)
jle 0x413704
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x7, %rdx
je 0x413763
movb $0x7, %cl
subb %dl, %cl
shrl %cl, %edi
movzwl 0x412(%rbx,%rdx,2), %eax
subq %rax, %rdi
movzwl 0x476(%rbx,%rdx,2), %eax
addq %rdi, %rax
movzbl 0x484(%rbx,%rax), %ecx
addq $-0x9, %rcx
cmpq %rdx, %rcx
jne 0x41376b
addq $0x9, %rdx
movl %edx, %ecx
shrl %cl, %esi
movl %esi, 0x14(%r14)
subl %edx, 0x10(%r14)
movzwl 0x5a4(%rbx,%rax,2), %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0xc5940(%rip), %rdi     # 0x4d90b2
leaq 0xc5325(%rip), %rsi     # 0x4d8a9e
leaq 0xc5942(%rip), %rcx     # 0x4d90c2
movl $0x70a, %edx            # imm = 0x70A
callq 0x4209d0
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/stb_image_write.c
// Function: stbiw__sbgrowf
static void *stbiw__sbgrowf(void **arr, int increment, int itemsize)
{
   int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1;
   void *p = realloc(*arr ? stbiw__sbraw(*arr) : 0, itemsize * m + sizeof(int)*2);
   assert(p);
   if (p) {
      if (!*arr) ((int *) p)[1] = 0;
      *arr = (void *) ((int *) p + 2);
      stbiw__sbm(*arr) = m;
   }
   return *arr;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
testq %rax, %rax
je 0x414b84
movl -0x8(%rax), %ecx
leal 0x1(,%rcx,2), %ebp
jmp 0x414b89
movl $0x2, %ebp
leaq -0x8(%rax), %rdi
testq %rax, %rax
cmoveq %rax, %rdi
imull %ebp, %esi
movslq %esi, %rsi
addq $0x8, %rsi
callq 0x445f50
testq %rax, %rax
je 0x414bc8
cmpq $0x0, (%rbx)
jne 0x414bb5
movl $0x0, 0x4(%rax)
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, (%rbx)
movl %ebp, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0xe4bbf(%rip), %rdi     # 0x4f978e
leaq 0xc4753(%rip), %rsi     # 0x4d9329
leaq 0xc4842(%rip), %rcx     # 0x4d941f
movl $0x8c, %edx
callq 0x4209d0
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/stb_image_write.c
// Function: stbi_write_png
int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes)
{
   FILE *f;
   int len;
   unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len);
   if (!png) return 0;
   f = fopen(filename, "wb");
   if (!f) { free(png); return 0; }
   fwrite(png, 1, len, f);
   fclose(f);
   free(png);
   return 1;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %r9d, %r10d
movl %ecx, %eax
movl %edx, %ecx
movl %esi, %edx
movq %rdi, %r14
leaq 0xc(%rsp), %r9
movq %r8, %rdi
movl %r10d, %esi
movl %eax, %r8d
callq 0x414cce
testq %rax, %rax
je 0x4152d4
movq %rax, %rbx
leaq 0xc1072(%rip), %rsi     # 0x4d6312
movq %r14, %rdi
callq 0x42f2a0
testq %rax, %rax
je 0x4152d8
movq %rax, %r14
movslq 0xc(%rsp), %rdx
movl $0x1, %esi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x42f5f0
movq %r14, %rdi
callq 0x42eb70
movl $0x1, %ebp
jmp 0x4152da
xorl %ebp, %ebp
jmp 0x4152e2
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x445c00
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/timer.c
// Function: timer
double timer() {
  static bool inited=false;
  static uint64_t start;
  uint64_t stop, dif;

  if(!inited) {
    start=getRawTime();
    inited=true;
  }

  stop=getRawTime();
  dif=stop-start;
  return dif/1000000.0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
cmpb $0x0, 0x107749(%rip)    # 0x51ca70
jne 0x415354
xorl %ebx, %ebx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x4814d0
testl %eax, %eax
jne 0x415346
imulq $0xf4240, (%rsp), %rbx  # imm = 0xF4240
addq 0x8(%rsp), %rbx
movq %rbx, 0x10772b(%rip)    # 0x51ca78
movb $0x1, 0x10771c(%rip)    # 0x51ca70
xorl %ebx, %ebx
movq %rsp, %rdi
xorl %esi, %esi
callq 0x4814d0
testl %eax, %eax
jne 0x415371
imulq $0xf4240, (%rsp), %rbx  # imm = 0xF4240
addq 0x8(%rsp), %rbx
subq 0x107700(%rip), %rbx    # 0x51ca78
movq %rbx, %xmm1
punpckldq 0xc40cb(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xc40d3(%rip), %xmm1    # 0x4d9460
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
divsd 0xc0c6f(%rip), %xmm0    # 0x4d6010
addq $0x10, %rsp
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/tinycthread.c
// Function: thrd_create
int thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
{
  /* Fill out the thread startup information (passed to the thread wrapper,
     which will eventually free it) */
  _thread_start_info* ti = (_thread_start_info*)malloc(sizeof(_thread_start_info));
  if (ti == NULL)
  {
    return thrd_nomem;
  }
  ti->mFunction = func;
  ti->mArg = arg;

  /* Create the thread */
#if defined(_TTHREAD_WIN32_)
  *thr = CreateThread(NULL, 0, _thrd_wrapper_function, (LPVOID) ti, 0, NULL);
#elif defined(_TTHREAD_POSIX_)
  if(pthread_create(thr, NULL, _thrd_wrapper_function, (void *)ti) != 0)
  {
    *thr = 0;
  }
#endif

  /* Did we fail to create the thread? */
  if(!*thr)
  {
    free(ti);
    return thrd_error;
  }

  return thrd_success;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movl $0x10, %edi
callq 0x4458c0
testq %rax, %rax
je 0x415511
movq %rax, %rbx
movq %r12, (%rax)
movq %r15, 0x8(%rax)
leaq 0x42(%rip), %rdx        # 0x41552f
movq %r14, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x43bc90
testl %eax, %eax
je 0x415518
movq $0x0, (%r14)
movq %rbx, %rdi
callq 0x445c00
xorl %eax, %eax
jmp 0x415523
movl $0x4, %eax
jmp 0x415523
movl $0x1, %eax
cmpq $0x0, (%r14)
je 0x415505
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/tinydir.c
// Function: tinydir_open_sorted
_TINYDIR_FUNC
int tinydir_open_sorted(tinydir_dir *dir, const char *path)
{
	/* Count the number of files first, to pre-allocate the files array */
	size_t n_files = 0;
	if (tinydir_open(dir, path) == -1)
	{
		return -1;
	}
	while (dir->has_next)
	{
		n_files++;
		if (tinydir_next(dir) == -1)
		{
			goto bail;
		}
	}
	tinydir_close(dir);

	if (tinydir_open(dir, path) == -1)
	{
		return -1;
	}

	dir->n_files = 0;
	dir->_files = (tinydir_file *)malloc(sizeof *dir->_files * n_files);
	if (dir->_files == NULL)
	{
		errno = ENOMEM;
		goto bail;
	}
	while (dir->has_next)
	{
		tinydir_file *p_file;
		dir->n_files++;

		p_file = &dir->_files[dir->n_files - 1];
		if (tinydir_readfile(dir, p_file) == -1)
		{
			goto bail;
		}

		if (tinydir_next(dir) == -1)
		{
			goto bail;
		}

		/* Just in case the number of files has changed between the first and
		second reads, terminate without writing into unallocated memory */
		if (dir->n_files == n_files)
		{
			break;
		}
	}

	qsort(dir->_files, dir->n_files, sizeof(tinydir_file), _tinydir_file_cmp);

	return 0;

bail:
	tinydir_close(dir);
	return -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %r14
callq 0x41560c
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x41584c
xorl %r13d, %r13d
xorl %r15d, %r15d
cmpl $0x0, 0x1000(%r14)
je 0x41578a
incq %r15
movq %r14, %rdi
callq 0x415858
addq $0x11a0, %r13           # imm = 0x11A0
cmpl $-0x1, %eax
jne 0x41575c
movq %r14, %rdi
callq 0x4156d8
jmp 0x41584c
movq %r14, %rdi
callq 0x4156d8
movq %r14, %rdi
movq %r12, %rsi
callq 0x41560c
cmpl $-0x1, %eax
je 0x41584c
movq $0x0, 0x1008(%r14)
movq %r13, %rdi
callq 0x4458c0
movq %rax, 0x1010(%r14)
testq %rax, %rax
je 0x415820
xorl %eax, %eax
cmpl $0x0, 0x1000(%r14)
movq 0x1010(%r14), %rsi
je 0x415830
leaq 0x1(%rax), %rcx
movq %rcx, 0x1008(%r14)
imulq $0x11a0, %rax, %rax     # imm = 0x11A0
addq %rax, %rsi
movq %r14, %rdi
callq 0x4158b2
cmpl $-0x1, %eax
je 0x41577d
movq %r14, %rdi
callq 0x415858
cmpl $-0x1, %eax
je 0x41577d
movq 0x1008(%r14), %rax
cmpq %r15, %rax
jne 0x4157c7
movq 0x1010(%r14), %rsi
jmp 0x415833
callq 0x420860
movl $0xc, (%rax)
jmp 0x41577d
movq %rax, %r15
leaq 0x195(%rip), %rcx       # 0x4159cf
movl $0x11a0, %edx           # imm = 0x11A0
movq %rsi, %rdi
movq %r15, %rsi
callq 0x426db0
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/tinydir.c
// Function: tinydir_get_ext
_TINYDIR_FUNC
void _tinydir_get_ext(tinydir_file *file)
{
	char *period = strrchr(file->name, '.');
	if (period == NULL)
	{
		file->extension = &(file->name[strlen(file->name)]);
	}
	else
	{
		file->extension = period + 1;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1000(%rdi), %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x401080
testq %rax, %rax
je 0x415a18
incq %rax
jmp 0x415a23
movq %r14, %rdi
callq 0x401138
addq %r14, %rax
movq %rax, 0x1100(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/tinydir.c
// Function: tinydir_readfile_n
_TINYDIR_FUNC
int tinydir_readfile_n(const tinydir_dir *dir, tinydir_file *file, size_t i)
{
	if (dir == NULL || file == NULL)
	{
		errno = EINVAL;
		return -1;
	}
	if (i >= dir->n_files)
	{
		errno = ENOENT;
		return -1;
	}

	memcpy(file, &dir->_files[i], sizeof(tinydir_file));
	_tinydir_get_ext(file);

	return 0;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
jne 0x415a50
callq 0x420860
movl $0x16, (%rax)
jmp 0x415a8e
cmpq %rdx, 0x1008(%rdi)
jbe 0x415a83
movq %rsi, %rbx
imulq $0x11a0, %rdx, %rsi     # imm = 0x11A0
addq 0x1010(%rdi), %rsi
movl $0x11a0, %edx           # imm = 0x11A0
movq %rbx, %rdi
callq 0x401058
movq %rbx, %rdi
callq 0x4159f3
xorl %eax, %eax
jmp 0x415a93
callq 0x420860
movl $0x2, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/tinydir.c
// Function: tinydir_open_subdir_n
_TINYDIR_FUNC
int tinydir_open_subdir_n(tinydir_dir *dir, size_t i)
{
	char path[_TINYDIR_PATH_MAX];
	if (dir == NULL)
	{
		errno = EINVAL;
		return -1;
	}
	if (i >= dir->n_files || !dir->_files[i].is_dir)
	{
		errno = ENOENT;
		return -1;
	}

	strcpy(path, dir->_files[i].path);
	tinydir_close(dir);
	if (tinydir_open_sorted(dir, path) == -1)
	{
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
testq %rdi, %rdi
je 0x415b07
movq %rsi, %rax
movq %rdi, %rbx
cmpq %rsi, 0x1008(%rdi)
jbe 0x415afa
movq 0x1010(%rbx), %rsi
imulq $0x11a0, %rax, %rax     # imm = 0x11A0
cmpl $0x0, 0x1108(%rsi,%rax)
je 0x415afa
addq %rax, %rsi
movq %rsp, %r14
movq %r14, %rdi
callq 0x401020
movq %rbx, %rdi
callq 0x4156d8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x415734
movl %eax, %ecx
xorl %eax, %eax
cmpl $-0x1, %ecx
sete %al
negl %eax
jmp 0x415b17
callq 0x420860
movl $0x2, (%rax)
jmp 0x415b12
callq 0x420860
movl $0x16, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/utils.c
// Function: calcBounds
void calcBounds(struct Triangle *triangles,int trianglesNum,
                struct Sphere *spheres,int spheresNum,
                float *minBound,float *maxBound,
                struct BoundingBox *bounds) {
  int i,j;

  //triangle bounds
  for(i=0;i<trianglesNum;i++) {
    triangleBoundingBox(triangles[i].pt0,
                        triangles[i].pt1,
                        triangles[i].pt2,
                        bounds[i].start,
                        bounds[i].end);
  }

  //sphere bounds
  for(i=0;i<spheresNum;i++) {
    sphereBoundingBox(spheres[i].pos,spheres[i].radius,
                      bounds[trianglesNum+i].start,
                      bounds[trianglesNum+i].end);
  }

  //insert primitives here

  //min,max bounds
  if(trianglesNum+spheresNum > 0) {
    for(i=0;i<3;i++) {
      minBound[i]=bounds[0].start[i];
      maxBound[i]=bounds[0].end[i];

      for(j=1;j<trianglesNum+spheresNum;j++) {
        if(bounds[j].start[i] < minBound[i]) {
          minBound[i]=bounds[j].start[i];
        }

        if(bounds[j].end[i] > maxBound[i]) {
          maxBound[i]=bounds[j].end[i];
        }
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbx
movq %r8, %r14
movl %ecx, 0x4(%rsp)
movq %rdx, %r12
movl %esi, (%rsp)
testl %esi, %esi
jle 0x416459
movq %rdi, %r13
movl (%rsp), %ebp
addq $0x34, %r13
movq 0x40(%rsp), %r15
leaq -0x18(%r13), %rdi
leaq -0xc(%r13), %rsi
leaq 0xc(%r15), %r8
movq %r13, %rdx
movq %r15, %rcx
callq 0x408e52
addq $0x18, %r15
addq $0x74, %r13
decq %rbp
jne 0x416435
movl 0x4(%rsp), %ebp
testl %ebp, %ebp
jle 0x41649c
movslq (%rsp), %rax
movl %ebp, %r15d
leaq (%rax,%rax,2), %rax
movq 0x40(%rsp), %rcx
leaq (%rcx,%rax,8), %r13
addq $0x1c, %r12
movss 0xc(%r12), %xmm0
leaq 0xc(%r13), %rdx
movq %r12, %rdi
movq %r13, %rsi
callq 0x408ee5
addq $0x18, %r13
addq $0x2c, %r12
decq %r15
jne 0x416479
addl (%rsp), %ebp
movq 0x40(%rsp), %r8
jle 0x416516
movl %ebp, %eax
leaq 0x24(%r8), %rcx
decq %rax
xorl %edx, %edx
movss (%r8,%rdx,4), %xmm0
movss %xmm0, (%r14,%rdx,4)
movss 0xc(%r8,%rdx,4), %xmm0
movss %xmm0, (%rbx,%rdx,4)
cmpl $0x1, %ebp
je 0x416509
movq %rax, %rsi
movq %rcx, %rdi
movss -0xc(%rdi), %xmm1
movss (%r14,%rdx,4), %xmm2
ucomiss %xmm1, %xmm2
jbe 0x4164ef
movss %xmm1, (%r14,%rdx,4)
movss (%rbx,%rdx,4), %xmm0
movss (%rdi), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x416500
movss %xmm1, (%rbx,%rdx,4)
movaps %xmm1, %xmm0
addq $0x18, %rdi
decq %rsi
jne 0x4164d4
incq %rdx
addq $0x4, %rcx
cmpq $0x3, %rdx
jne 0x4164b1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/archer1357[P]Offline-Raytracer/utils.c
// Function: calc_pointLight
void calc_pointLight(const struct PointLight *pointLight,
                     const float *toLightDir,
                     float lightDist,
                     const float *rayDir,
                     float shininess,float intensity,
                     const float *nor,
                     float *outCol,float *outSpec) {

  float fromLightDir[3],atten,eyeDir[3],reflectVec[3],NdotL,spec,diffuse;

  //
  vec3_mulScalar(fromLightDir,toLightDir,-1.0f);

  atten = 1.0f/(pointLight->constAtten+
                pointLight->linAtten*lightDist+
                pointLight->quadAtten*lightDist*lightDist);

  vec3_mulScalar(eyeDir,rayDir,-1.0f);

  reflect(reflectVec,fromLightDir,nor);

  NdotL = maxOf(0.0f, vec3_dot(nor, toLightDir));

  spec=0.0f;

  if(NdotL > 0.0f) {
    float EdotR;

    EdotR=maxOf(0.0f, vec3_dot(eyeDir, reflectVec));
    spec+=powf(EdotR,shininess*128.0f) *intensity;
    spec*=atten;
  }

  diffuse=NdotL*atten;

  outCol[0]=pointLight->col[0]*diffuse;
  outCol[1]=pointLight->col[1]*diffuse;
  outCol[2]=pointLight->col[2]*diffuse;

  *outSpec=spec;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r9, 0x18(%rsp)
movq %r8, %r14
movq %rcx, %r12
movss %xmm2, 0x14(%rsp)
movss %xmm1, 0x10(%rsp)
movq %rdx, %rbx
movss %xmm0, 0x8(%rsp)
movq %rsi, %r13
movq %rdi, %r15
leaq 0x3c(%rsp), %rbp
movss 0xc2f1e(%rip), %xmm0    # 0x4d9484
movq %rbp, %rdi
callq 0x4076c7
movss 0x1c(%r15), %xmm0
movss 0x8(%rsp), %xmm2
mulss %xmm2, %xmm0
addss 0x18(%r15), %xmm0
movss 0x20(%r15), %xmm1
mulss %xmm2, %xmm1
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss 0xc1382(%rip), %xmm0    # 0x4d7920
divss %xmm1, %xmm0
movss %xmm0, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
movss 0xc2ecc(%rip), %xmm0    # 0x4d9484
callq 0x4076c7
leaq 0x24(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x40869b
movq %r12, %rdi
movq %r13, %rsi
callq 0x4075cc
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
callq 0x408705
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm0
jbe 0x41663b
leaq 0x30(%rsp), %rdi
leaq 0x24(%rsp), %rsi
movss %xmm0, 0xc(%rsp)
callq 0x4075cc
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
callq 0x408705
movss 0x10(%rsp), %xmm1
mulss 0xc2e6f(%rip), %xmm1    # 0x4d9488
callq 0x401038
movaps %xmm0, %xmm2
movss 0xc(%rsp), %xmm0
mulss 0x14(%rsp), %xmm2
addss 0xbfe63(%rip), %xmm2    # 0x4d6498
mulss 0x8(%rsp), %xmm2
movss 0x8(%rsp), %xmm1
mulss %xmm0, %xmm1
movss (%r15), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, (%r14)
movss 0x4(%r15), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x4(%r14)
mulss 0x8(%r15), %xmm1
movss %xmm1, 0x8(%r14)
movq 0x18(%rsp), %rax
movss %xmm2, (%rax)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq