LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: ApplyMatrixOnPlane(matrix_t const&, float const*, float, float (&) [3], float&)
void ApplyMatrixOnPlane (const matrix_t &m_inverse, const vec3_t in_normal, vec_t in_dist, vec3_t &out_normal, vec_t &out_dist)
	// out_normal is not normalized
{
	int i;
	
	hlassume (&in_normal[0] != &out_normal[0], assume_first);
	for (i = 0; i < 3; i++)
	{
		out_normal[i] = DotProduct (in_normal, m_inverse.v[i]);
	}
	out_dist = - (DotProduct (in_normal, m_inverse.v[3]) - in_dist);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movss %xmm0, 0xc(%rsp)
movq %rsi, %r12
movq %rdi, %r14
xorl %edi, %edi
cmpq %rdx, %rsi
setne %dil
xorl %r13d, %r13d
xorl %esi, %esi
callq 0x92cb
leaq 0x8(%r14), %rax
movss (%r12), %xmm1
movss 0x4(%r12), %xmm2
movss 0x8(%r12), %xmm0
cmpq $0x3, %r13
je 0x2bcb2
mulss -0x4(%rax), %xmm2
mulss -0x8(%rax), %xmm1
addss %xmm2, %xmm1
mulss (%rax), %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%r15,%r13,4)
incq %r13
addq $0xc, %rax
jmp 0x2bc73
mulss 0x28(%r14), %xmm2
mulss 0x24(%r14), %xmm1
addss %xmm2, %xmm1
mulss 0x2c(%r14), %xmm0
addss %xmm1, %xmm0
subss 0xc(%rsp), %xmm0
xorps 0x95b7(%rip), %xmm0     # 0x35290
movss %xmm0, (%rbx)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: MultiplyMatrix(matrix_t const&, matrix_t const&, matrix_t&)
void MultiplyMatrix (const matrix_t &m_left, const matrix_t &m_right, matrix_t &m)
	// The following two processes are equivalent:
	//  1) ApplyMatrix (m1, v_in, v_temp), ApplyMatrix (m2, v_temp, v_out);
	//  2) MultiplyMatrix (m2, m1, m), ApplyMatrix (m, v_in, v_out);
{
	int i, j;
	const vec_t lastrow[4] = {0, 0, 0, 1};
	
	hlassume (&m != &m_left && &m != &m_right, assume_first);
	for (i = 0; i < 3; i++)
	{
		for (j = 0; j < 4; j++)
		{
			m.v[j][i] = m_left.v[0][i] * m_right.v[j][0]
					  + m_left.v[1][i] * m_right.v[j][1]
					  + m_left.v[2][i] * m_right.v[j][2]
					  + m_left.v[3][i] * lastrow[j];
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq %rdi, %rdx
setne %al
cmpq %rsi, %rdx
setne %cl
andb %al, %cl
movzbl %cl, %edi
xorl %r12d, %r12d
xorl %esi, %esi
callq 0x92cb
leaq 0xdb22(%rip), %rax      # 0x39840
cmpq $0x3, %r12
je 0x2bd86
movq %rax, %rcx
xorl %edx, %edx
cmpq $0xc, %rdx
je 0x2bd7d
movss (%r15,%r12,4), %xmm0
movss 0xc(%r15,%r12,4), %xmm1
mulss 0x4(%r14,%rdx,4), %xmm1
mulss (%r14,%rdx,4), %xmm0
addss %xmm1, %xmm0
movss 0x18(%r15,%r12,4), %xmm1
mulss 0x8(%r14,%rdx,4), %xmm1
addss %xmm0, %xmm1
movss 0x24(%r15,%r12,4), %xmm0
mulss (%rcx), %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rbx,%rdx,4)
addq $0x3, %rdx
addq $0x4, %rcx
jmp 0x2bd29
incq %r12
addq $0x4, %rbx
jmp 0x2bd1e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: MatrixForScale(float const*, float, matrix_t&)
void MatrixForScale (const vec3_t center, vec_t scale, matrix_t &m)
{
	int i;

	for (i = 0; i < 3; i++)
	{
		VectorClear (m.v[i]);
		m.v[i][i] = scale;
	}
	VectorScale (center, 1 - scale, m.v[3]);
}

// Assembly:
leaq 0x8(%rsi), %rax
xorl %ecx, %ecx
cmpq $0x30, %rcx
je 0x2bdcc
andl $0x0, (%rax)
andq $0x0, -0x8(%rax)
movss %xmm0, (%rsi,%rcx)
addq $0x10, %rcx
addq $0xc, %rax
jmp 0x2bdaf
movss 0x6290(%rip), %xmm1     # 0x32064
subss %xmm0, %xmm1
movss (%rdi), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x24(%rsi)
movss 0x4(%rdi), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x28(%rsi)
mulss 0x8(%rdi), %xmm1
movss %xmm1, 0x2c(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/qradutil.cpp
// Function: TranslateWorldToTex(int, matrix_t&)
void TranslateWorldToTex (int facenum, matrix_t &m)
	// without g_face_offset
{
	dface_t *f;
	texinfo_t *ti;
	const dplane_t *fp;
	int i;

	f = &g_dfaces[facenum];
	ti = &g_texinfo[f->texinfo];
	fp = getPlaneFromFace (f);
	for (i = 0; i < 3; i++)
	{
		m.v[i][0] = ti->vecs[0][i];
		m.v[i][1] = ti->vecs[1][i];
		m.v[i][2] = fp->normal[i];
	}
	m.v[3][0] = ti->vecs[0][3];
	m.v[3][1] = ti->vecs[1][i];
	m.v[3][2] = -fp->dist;
}

// Assembly:
movslq %edi, %rax
imulq $0x14, %rax, %rcx
leaq 0x1b81594(%rip), %rdi   # 0x1bad410
movswq 0xa(%rdi,%rcx), %rax
imulq $0x28, %rax, %rax
movzwl (%rdi,%rcx), %edx
imulq $0x14, %rdx, %rdx
cmpw $0x0, 0x2(%rdi,%rcx)
jne 0x2be9f
leaq 0xb01563(%rip), %rcx    # 0xb2d400
jmp 0x2bea6
leaq 0x552ad3a(%rip), %rcx   # 0x5556be0
addq %rdx, %rcx
addq 0x180c0(%rip), %rax     # 0x43f70
leaq 0x8(%rsi), %rdx
xorl %edi, %edi
cmpq $0x3, %rdi
je 0x2bee3
movss (%rax,%rdi,4), %xmm0
movss %xmm0, -0x8(%rdx)
movss 0x10(%rax,%rdi,4), %xmm0
movss %xmm0, -0x4(%rdx)
movss (%rcx,%rdi,4), %xmm0
movss %xmm0, (%rdx)
incq %rdi
addq $0xc, %rdx
jmp 0x2beb6
movss 0xc(%rax), %xmm0
movss %xmm0, 0x24(%rsi)
movss 0x1c(%rax), %xmm0
movss %xmm0, 0x28(%rsi)
movss 0xc(%rcx), %xmm0
xorps 0x938d(%rip), %xmm0     # 0x35290
movss %xmm0, 0x2c(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/sparse.cpp
// Function: CheckVisBitSparse(unsigned int, unsigned int, float (&) [3], unsigned int&)
static bool     CheckVisBitSparse(unsigned x, unsigned y
#ifdef HLRAD_HULLU
								  , vec3_t &transparency_out
								  , unsigned int &next_index
#endif
								  )
{
#ifdef HLRAD_HULLU
    int                offset;
#else
    unsigned        offset;
#endif

#ifdef HLRAD_HULLU
    	VectorFill(transparency_out, 1.0);
#endif

    if (x == y)
    {
        return 1;
    }

#ifdef HLRAD_HULLU
    const unsigned a = x;
    const unsigned b = y;
#endif

    if (x > y)
    {
#ifndef HLRAD_HULLU
        const unsigned a = x;
        const unsigned b = y;
#endif
        x = b;
        y = a;
    }

    if (x > g_num_patches)
    {
        Warning("in CheckVisBit(), x > num_patches");
    }
    if (y > g_num_patches)
    {
        Warning("in CheckVisBit(), y > num_patches");
    }

    if ((offset = IsVisbitInArray(x, y)) != -1)
    {
#ifdef HLRAD_HULLU
    	if(g_customshadow_with_bouncelight)
    	{
    	     GetTransparency(a, b, transparency_out, next_index);
    	}
#endif
        return s_vismatrix[x].row[offset].values & (1 << (y & 7));
    }

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movsd 0x93c5(%rip), %xmm0     # 0x36ad0
movsd %xmm0, (%rdx)
movl $0x3f800000, 0x8(%rdx)  # imm = 0x3F800000
movb $0x1, %r12b
cmpl %esi, %edi
je 0x2d7e0
movq %rdx, %r14
movl %esi, %ebp
movl %edi, %r15d
movq %rcx, (%rsp)
movl %esi, %ecx
cmoval %edi, %ecx
movl %esi, %r13d
cmovbl %edi, %r13d
leaq 0x54072b8(%rip), %rbx   # 0x54349f8
movl (%rbx), %eax
cmpl %eax, %r13d
jbe 0x2d75d
leaq 0xc3a3(%rip), %rdi      # 0x39af1
xorl %eax, %eax
movl %ecx, %r12d
callq 0x8ea5
movl %r12d, %ecx
movl (%rbx), %eax
cmpl %eax, %ecx
jbe 0x2d773
leaq 0xc3ab(%rip), %rdi      # 0x39b13
xorl %eax, %eax
movl %ecx, %ebx
callq 0x8ea5
movl %ebx, %ecx
movq 0x66c9356(%rip), %rax   # 0x66f6ad0
movl %r13d, %r13d
shlq $0x4, %r13
movl 0x8(%rax,%r13), %r8d
xorl %r12d, %r12d
testl %r8d, %r8d
je 0x2d7e0
movl %ecx, %edi
shrl $0x3, %edi
addq %r13, %rax
decl %r8d
movq (%rax), %r9
pushq $0x2
popq %r10
leal (%r12,%r8), %esi
movl %esi, %eax
cltd
idivl %r10d
movslq %eax, %rbx
movl (%r9,%rbx,4), %edx
movl %edx, %r11d
andl $0xffffff, %r11d        # imm = 0xFFFFFF
cmpl %edi, %r11d
jae 0x2d7c7
incl %eax
movl %eax, %r12d
jmp 0x2d7ce
jbe 0x2d7d5
decl %eax
movl %eax, %r8d
cmpl %r8d, %r12d
jle 0x2d7a0
jmp 0x2d7dd
addl $0x3, %esi
cmpl $0x2, %esi
jae 0x2d7f2
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x54c923f(%rip), %rax   # 0x54f6a38
cmpb $0x1, (%rax)
jne 0x2d821
movl %r15d, %edi
movl %ebp, %esi
movq %r14, %rdx
movl %ecx, %ebp
movq (%rsp), %rcx
callq 0x2fff1
movl %ebp, %ecx
movq 0x66c92b6(%rip), %rax   # 0x66f6ad0
movq (%rax,%r13), %rax
movl (%rax,%rbx,4), %edx
shrl $0x18, %edx
andl $0x7, %ecx
btl %ecx, %edx
setb %r12b
jmp 0x2d7e0
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: MakeTnode(int)
static void     MakeTnode(const int nodenum)
{
    tnode_t*        t;
    dplane_t*       plane;
    int             i;
    dnode_t*        node;

    t = tnode_p++;

    node = g_dnodes + nodenum;
    plane = g_dplanes + node->planenum;

    t->type = plane->type;
    VectorCopy(plane->normal, t->normal);
#ifdef ZHLT_PLANETYPE_FIX //debug
	if (plane->normal[(plane->type)%3] < 0)
		if (plane->type < 3)
			Warning ("MakeTnode: negative plane");
		else
			Developer (DEVELOPER_LEVEL_MESSAGE, "Warning: MakeTnode: negative plane\n");
#endif
    t->dist = plane->dist;

    for (i = 0; i < 2; i++)
    {
        if (node->children[i] < 0)
            t->children[i] = g_dleafs[-node->children[i] - 1].contents;
        else
        {
            t->children[i] = tnode_p - tnodes;
            MakeTnode(node->children[i]);
        }
    }

}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x66c8c06(%rip), %rbx   # 0x66f6ae0
leaq 0x20(%rbx), %rax
movq %rax, 0x66c8bfb(%rip)   # 0x66f6ae0
movslq %edi, %rax
imulq $0x18, %rax, %r15
leaq 0x10bf51d(%rip), %r14   # 0x10ed410
movslq (%r14,%r15), %rax
imulq $0x14, %rax, %rax
leaq 0xaff4fe(%rip), %rcx    # 0xb2d400
leaq (%rcx,%rax), %r12
movl 0x10(%rcx,%rax), %edx
movl %edx, (%rbx)
movss (%rcx,%rax), %xmm0
movss %xmm0, 0x4(%rbx)
movss 0x4(%rcx,%rax), %xmm0
movss %xmm0, 0x8(%rbx)
movss 0x8(%rcx,%rax), %xmm0
movss %xmm0, 0xc(%rbx)
movl 0x10(%rcx,%rax), %ecx
pushq $0x3
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
movslq %edx, %rax
xorps %xmm0, %xmm0
ucomiss (%r12,%rax,4), %xmm0
jbe 0x2df6b
cmpl $0x2, %ecx
jg 0x2df5a
leaq 0xbcae(%rip), %rdi      # 0x39bff
xorl %eax, %eax
callq 0x8ea5
jmp 0x2df6b
leaq 0xbcb8(%rip), %rsi      # 0x39c19
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x9045
addq %r15, %r14
movss 0xc(%r12), %xmm0
movss %xmm0, 0x10(%rbx)
xorl %r15d, %r15d
leaq 0xa1f54c(%rip), %r12    # 0xa4d4d0
cmpq $0x2, %r15
je 0x2dfd0
movzwl 0x4(%r14,%r15,2), %eax
testw %ax, %ax
js 0x2dfb9
movq 0x66c8b44(%rip), %rax   # 0x66f6ae0
subq 0x66c8b35(%rip), %rax   # 0x66f6ad8
shrq $0x5, %rax
movl %eax, 0x14(%rbx,%r15,4)
movswl 0x4(%r14,%r15,2), %edi
callq 0x2decb
jmp 0x2dfcb
notl %eax
movzwl %ax, %eax
imulq $0x1c, %rax, %rax
movl (%r12,%rax), %eax
movl %eax, 0x14(%rbx,%r15,4)
incq %r15
jmp 0x2df84
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: MergeOpaqueFaces(int, int)
int MergeOpaqueFaces (int firstface, int numfaces)
{
	int i, j, newnum;
	opaqueface_t *faces = &opaquefaces[firstface];
	for (i = 0; i < numfaces; i++)
	{
		for (j = 0; j < i; j++)
		{
			if (TryMerge (&faces[i], &faces[j]))
			{
				delete faces[j].winding;
				faces[j].winding = NULL;
				j = -1;
				continue;
			}
		}
	}
	for (i = 0, j = 0; i < numfaces; i++)
	{
		if (faces[i].winding)
		{
			faces[j] = faces[i];
			j++;
		}
	}
	newnum = j;
	for (; j < numfaces; j++)
	{
		memset (&faces[j], 0, sizeof(opaqueface_t));
	}
	return newnum;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movslq %edi, %rax
imulq $0x60, %rax, %r12
addq 0x66c811d(%rip), %r12   # 0x66f6ae8
xorl %r13d, %r13d
testl %esi, %esi
movl $0x0, %eax
movl %esi, 0xc(%rsp)
cmovgl %esi, %eax
movq %rax, 0x10(%rsp)
pushq $-0x1
popq %rbp
cmpq 0x10(%rsp), %r13
je 0x2ea2f
imulq $0x60, %r13, %r14
addq %r12, %r14
xorl %ebx, %ebx
movslq %ebx, %rax
cmpq %rax, %r13
jle 0x2ea2a
imulq $0x60, %rax, %r15
addq %r12, %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2e2e0
testb %al, %al
je 0x2ea26
movq (%r15), %rdi
testq %rdi, %rdi
je 0x2ea20
movq (%rdi), %rax
callq *0x8(%rax)
andq $0x0, (%r15)
movl %ebp, %ebx
incl %ebx
jmp 0x2e9f4
incq %r13
jmp 0x2e9e4
imulq $0x60, 0x10(%rsp), %r9
xorl %r10d, %r10d
pushq $0xc
popq %rdx
xorl %eax, %eax
movslq %eax, %r8
cmpq %r10, %r9
je 0x2ea69
cmpq $0x0, (%r12,%r10)
je 0x2ea63
leaq (%r12,%r10), %rsi
imulq $0x60, %r8, %rdi
addq %r12, %rdi
movq %rdx, %rcx
rep  movsq (%rsi), %es:(%rdi)
incl %r8d
movl %r8d, %eax
addq $0x60, %r10
jmp 0x2ea3d
movslq 0xc(%rsp), %rcx
imulq $0x60, %r8, %rdx
addq %rdx, %r12
xorps %xmm0, %xmm0
cmpq %rcx, %r8
jge 0x2eaa9
movups %xmm0, 0x50(%r12)
movups %xmm0, 0x40(%r12)
movups %xmm0, 0x30(%r12)
movups %xmm0, 0x20(%r12)
movups %xmm0, 0x10(%r12)
movups %xmm0, (%r12)
incq %r8
addq $0x60, %r12
jmp 0x2ea78
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: BuildFaceEdges(opaqueface_t*)
void BuildFaceEdges (opaqueface_t *f)
{
	if (!f->winding)
		return;
	f->numedges = f->winding->m_NumPoints;
	f->edges = (dplane_t *)calloc (f->numedges, sizeof (dplane_t));
	const vec_t *p1, *p2;
	const vec_t *n = f->plane.normal;
	vec3_t e;
	dplane_t *pl;
	int x;
	for (x = 0; x < f->winding->m_NumPoints; x++)
	{
		p1 = f->winding->m_Points[x];
		p2 = f->winding->m_Points[(x+1)%f->winding->m_NumPoints];
		pl = &f->edges[x];
		VectorSubtract (p2, p1, e);
		CrossProduct (n, e, pl->normal);
		if (VectorNormalize (pl->normal) == 0.0)
		{
			Developer (DEVELOPER_LEVEL_WARNING, "Warning: BuildFaceEdges: Empty edge.\n");
			VectorClear (pl->normal);
			pl->dist = -1;
			continue;
		}
		pl->dist = DotProduct (pl->normal, p1);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r14
testq %r14, %r14
je 0x2ec0a
movq %rdi, %rbx
movslq 0x8(%r14), %rdi
movl %edi, 0x1c(%rbx)
pushq $0x14
popq %rsi
callq 0x41f0
movq %rax, 0x20(%rbx)
pushq $0x8
popq %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
movl 0x8(%r14), %eax
cmpq %rax, %r13
jae 0x2ec0a
movq 0x10(%r14), %rbp
incq %r13
cmpq %rax, %r13
movl $0x0, %eax
cmovneq %r13, %rax
imulq $0xc, %rax, %rax
movq 0x20(%rbx), %r14
leaq (%r14,%r12), %rdi
movss (%rbp,%rax), %xmm0
subss -0x8(%rbp,%r15), %xmm0
movss 0x4(%rbp,%rax), %xmm1
subss -0x4(%rbp,%r15), %xmm1
movss 0x8(%rbp,%rax), %xmm2
subss (%rbp,%r15), %xmm2
movss 0x10(%rbx), %xmm3
mulss %xmm1, %xmm3
movss 0xc(%rbx), %xmm4
mulss %xmm2, %xmm4
subss %xmm3, %xmm4
movss %xmm4, (%r14,%r12)
mulss 0x8(%rbx), %xmm2
movss 0x10(%rbx), %xmm3
mulss %xmm0, %xmm3
subss %xmm2, %xmm3
movss %xmm3, 0x4(%r14,%r12)
mulss 0xc(%rbx), %xmm0
mulss 0x8(%rbx), %xmm1
subss %xmm0, %xmm1
movss %xmm1, 0x8(%r14,%r12)
callq 0xc021
ucomiss 0x34d8(%rip), %xmm0     # 0x32070
jne 0x2ebc2
jp 0x2ebc2
pushq $0x2
popq %rdi
leaq 0xb00d(%rip), %rsi      # 0x39bb3
xorl %eax, %eax
callq 0x9045
andl $0x0, 0x8(%r14,%r12)
andq $0x0, (%r14,%r12)
movss 0x6708(%rip), %xmm0     # 0x352c8
jmp 0x2ebf3
movss 0x4(%r14,%r12), %xmm0
mulss -0x4(%rbp,%r15), %xmm0
movss (%r14,%r12), %xmm1
mulss -0x8(%rbp,%r15), %xmm1
addss %xmm0, %xmm1
movss 0x8(%r14,%r12), %xmm0
mulss (%rbp,%r15), %xmm0
addss %xmm1, %xmm0
movss %xmm0, 0xc(%r14,%r12)
movq (%rbx), %r14
addq $0x14, %r12
addq $0xc, %r15
jmp 0x2eaef
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: DeleteOpaqueNodes()
void DeleteOpaqueNodes ()
{
	int i;
	for (i = 0; i < g_numfaces; i++)
	{
		opaqueface_t *of = &opaquefaces[i];
		if (of->winding)
			delete of->winding;
		if (of->edges)
			free (of->edges);
	}
	free (opaquefaces);
	free (opaquenodes);
	free (opaquemodels);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
pushq $0x20
popq %r14
xorl %r15d, %r15d
leaq 0x1b7e497(%rip), %r12   # 0x1bad404
movslq (%r12), %rax
movq 0x66c7b70(%rip), %rbx   # 0x66f6ae8
cmpq %rax, %r15
jge 0x2ef9f
movq -0x20(%rbx,%r14), %rdi
testq %rdi, %rdi
je 0x2ef8d
movq (%rdi), %rax
callq *0x8(%rax)
movq (%rbx,%r14), %rdi
callq 0x4380
incq %r15
addq $0x60, %r14
jmp 0x2ef6d
movq %rbx, %rdi
callq 0x4380
movq 0x66c7b42(%rip), %rdi   # 0x66f6af0
callq 0x4380
movq 0x66c7b3e(%rip), %rdi   # 0x66f6af8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4380
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: CountOpaqueFaces_r(opaquenode_s*)
int CountOpaqueFaces_r (opaquenode_t *node)
{
	int count;
	count = node->numfaces;
	if (node->children[0] >= 0)
	{
		count += CountOpaqueFaces_r (&opaquenodes[node->children[0]]);
	}
	if (node->children[1] >= 0)
	{
		count += CountOpaqueFaces_r (&opaquenodes[node->children[1]]);
	}
	return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x66c745d(%rip), %r15   # 0x66f6af0
movl 0x20(%rbx), %ebp
movslq 0x14(%rbx), %rax
testq %rax, %rax
js 0x2f6ad
imulq $0x24, %rax, %rdi
addq %r15, %rdi
callq 0x2f67f
addl %eax, %ebp
movslq 0x18(%rbx), %rax
testq %rax, %rax
js 0x2f6c2
imulq $0x24, %rax, %rbx
addq %r15, %rbx
addl %ebp, %r14d
jmp 0x2f693
addl %r14d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/trace.cpp
// Function: TestPointOpaque_r(int, bool, float const*)
int TestPointOpaque_r (int nodenum, bool solid, const vec3_t point)
{
	opaquenode_t *thisnode;
	vec_t dist;
	while (1)
	{
		if (nodenum < 0)
		{
			if (solid && g_dleafs[-nodenum-1].contents == CONTENTS_SOLID)
				return 1;
			else
				return 0;
		}
		thisnode = &opaquenodes[nodenum];
		switch (thisnode->type)
		{
		case plane_x:
			dist = point[0] - thisnode->dist;
			break;
		case plane_y:
			dist = point[1] - thisnode->dist;
			break;
		case plane_z:
			dist = point[2] - thisnode->dist;
			break;
		default:
			dist = DotProduct (point, thisnode->normal) - thisnode->dist;
		}
		if (dist > HUNT_WALL_EPSILON)
		{
			nodenum = thisnode->children[0];
		}
		else if (dist < -HUNT_WALL_EPSILON)
		{
			nodenum = thisnode->children[1];
		}
		else
		{
			break;
		}
	}
	{
		int facenum;
		for (facenum = thisnode->firstface; facenum < thisnode->firstface + thisnode->numfaces; facenum++)
		{
			if (TestLineOpaque_face (facenum, point))
			{
				return 1;
			}
		}
	}
	return TestPointOpaque_r (thisnode->children[0], solid, point)
		|| TestPointOpaque_r (thisnode->children[1], solid, point);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebp
pushq $0x14
popq %r13
movsd 0xa0e7(%rip), %xmm2     # 0x397f8
pushq $0x18
popq %r15
movsd 0xa0e3(%rip), %xmm3     # 0x39800
pushq $0x1
popq %rax
movzbl %bpl, %r12d
movq 0x66c73c5(%rip), %rdx   # 0x66f6af0
testl %edi, %edi
js 0x2f80a
movl %edi, %ecx
imulq $0x24, %rcx, %rcx
leaq (%rdx,%rcx), %rbx
movl (%rdx,%rcx), %ecx
cmpl $0x2, %ecx
je 0x2f75d
cmpl $0x1, %ecx
je 0x2f755
testl %ecx, %ecx
jne 0x2f765
movss (%r14), %xmm0
jmp 0x2f78d
movss 0x4(%r14), %xmm0
jmp 0x2f78d
movss 0x8(%r14), %xmm0
jmp 0x2f78d
movss 0x4(%r14), %xmm0
mulss 0x8(%rbx), %xmm0
movss (%r14), %xmm1
mulss 0x4(%rbx), %xmm1
addss %xmm0, %xmm1
movss 0x8(%r14), %xmm0
mulss 0xc(%rbx), %xmm0
addss %xmm1, %xmm0
subss 0x10(%rbx), %xmm0
cvtss2sd %xmm0, %xmm0
ucomisd %xmm2, %xmm0
movq %r13, %rcx
ja 0x2f7a8
ucomisd %xmm0, %xmm3
movq %r15, %rcx
jbe 0x2f7b0
movl (%rbx,%rcx), %edi
jmp 0x2f72b
movl %r12d, 0x4(%rsp)
movl 0x1c(%rbx), %r12d
movl 0x20(%rbx), %eax
addl 0x1c(%rbx), %eax
cmpl %eax, %r12d
jge 0x2f7d8
movl %r12d, %edi
movq %r14, %rsi
callq 0x2efca
incl %r12d
testl %eax, %eax
je 0x2f7b9
jmp 0x2f826
movl 0x14(%rbx), %edi
movl 0x4(%rsp), %r12d
movl %r12d, %esi
movq %r14, %rdx
callq 0x2f6f5
testl %eax, %eax
pushq $0x1
popq %rax
jne 0x2f829
movl 0x18(%rbx), %edi
movsd 0x9ffb(%rip), %xmm2     # 0x397f8
movsd 0x9ffb(%rip), %xmm3     # 0x39800
jmp 0x2f724
testb %bpl, %bpl
je 0x2f822
notl %edi
imulq $0x1c, %rdi, %rdx
leaq 0xa1dcb4(%rip), %rcx    # 0xa4d4d0
cmpl $-0x2, (%rcx,%rdx)
je 0x2f829
xorl %eax, %eax
jmp 0x2f829
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/transparency.cpp
// Function: FreeTransparencyArrays()
void	FreeTransparencyArrays( )
{
	if (s_sorted_list) free(s_sorted_list);
	if (s_trans_list)  free(s_trans_list);
	
	s_trans_list = NULL;
	s_sorted_list = NULL;
	
	s_max_trans_count = s_trans_count = s_sorted_count = 0;
}

// Assembly:
pushq %rax
movq 0x66c6b5f(%rip), %rdi   # 0x66f6b18
callq 0x4380
movq 0x66c6b63(%rip), %rdi   # 0x66f6b28
callq 0x4380
andq $0x0, 0x66c6b56(%rip)   # 0x66f6b28
andq $0x0, 0x66c6b3e(%rip)   # 0x66f6b18
andl $0x0, 0x66c6b2f(%rip)   # 0x66f6b10
andl $0x0, 0x66c6b3c(%rip)   # 0x66f6b24
andl $0x0, 0x66c6b31(%rip)   # 0x66f6b20
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/transparency.cpp
// Function: AddStyleToStyleArray(unsigned int, unsigned int, int)
void	AddStyleToStyleArray(const unsigned p1, const unsigned p2, const int style)
{
	if (style == -1)
		return;
	//make thread safe
	ThreadLock();
	
	//realloc if needed
	while( s_style_count >= s_max_style_count )
	{
		unsigned int old_max_count = s_max_style_count;
#ifdef HLRAD_TRANSPARENCY_FAST
		s_max_style_count = qmax (64u, (unsigned int)((double)s_max_style_count * 1.41));
#else
		s_max_style_count += STYLE_LIST_GROWTH;
#endif
#ifdef ZHLT_64BIT_FIX
		if (s_max_style_count >= (unsigned int)INT_MAX)
		{
			Error ("AddStyleToStyleArray: array size exceeded INT_MAX");
		}
#endif
		
		s_style_list = (styleList_t *)realloc( s_style_list, sizeof(styleList_t) * s_max_style_count );
#ifdef HLRAD_HLASSUMENOMEMORY
		hlassume (s_style_list != NULL, assume_NoMemory);
#endif
		
#ifdef HLRAD_TRANSPARENCY_FAST
		memset( &s_style_list[old_max_count], 0, sizeof(styleList_t) * (s_max_style_count - old_max_count) );
#else
		memset( &s_style_list[old_max_count], 0, sizeof(styleList_t) * STYLE_LIST_GROWTH );
#endif
	}
	
	s_style_list[s_style_count].p1 = p1;
	s_style_list[s_style_count].p2 = p2;
	s_style_list[s_style_count].style = (char)style;
	
	s_style_count++;
	
	//unlock list
	ThreadUnlock();
}

// Assembly:
cmpl $-0x1, %edx
je 0x3018e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %edi, (%rsp)
movl %esi, 0x4(%rsp)
callq 0x9e0c
movl 0x66c6a8b(%rip), %ebp   # 0x66f6b34
pushq $0x40
popq %r13
leaq 0x9d48(%rip), %r15      # 0x39dfc
pushq $0x1
popq %r12
movl 0x66c6a72(%rip), %eax   # 0x66f6b30
cmpl %ebp, %eax
jb 0x30156
movl %ebp, %r14d
cvtsi2sd %r14, %xmm0
mulsd 0x9c72(%rip), %xmm0     # 0x39d48
cvttsd2si %xmm0, %rcx
cmpl $0x41, %ecx
movl %r13d, %eax
cmovael %ecx, %eax
movl %eax, 0x66c6a4a(%rip)   # 0x66f6b34
cmpl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
jb 0x30102
movq %r15, %rdi
xorl %eax, %eax
callq 0x8b2f
movl 0x66c6a32(%rip), %eax   # 0x66f6b34
movq 0x66c6a2f(%rip), %rdi   # 0x66f6b38
movl %eax, %eax
imulq $0xc, %rax, %rsi
callq 0x4580
movq %rax, 0x66c6a1d(%rip)   # 0x66f6b38
xorl %edi, %edi
testq %rax, %rax
setne %dil
movl %r12d, %esi
callq 0x92cb
imulq $0xc, %r14, %rdi
addq 0x66c6a01(%rip), %rdi   # 0x66f6b38
movl 0x66c69f6(%rip), %r14d  # 0x66f6b34
movl %r14d, %eax
subl %ebp, %eax
imulq $0xc, %rax, %rdx
xorl %esi, %esi
callq 0x41a0
movl %r14d, %ebp
jmp 0x300b8
movq 0x66c69db(%rip), %rcx   # 0x66f6b38
imulq $0xc, %rax, %rdx
movl (%rsp), %esi
movl %esi, (%rcx,%rdx)
movl 0x4(%rsp), %esi
movl %esi, 0x4(%rcx,%rdx)
movb %bl, 0x8(%rcx,%rdx)
incl %eax
movl %eax, 0x66c69b5(%rip)   # 0x66f6b30
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9e1d
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/transparency.cpp
// Function: CreateFinalStyleArrays(char const*)
void	CreateFinalStyleArrays(const char *print_name)
{
	if( s_style_count == 0 )
	{
		return;
	}
	//need to sorted for fast search function
	qsort( s_style_list, s_style_count, sizeof(styleList_t), SortStyleList );
	
#ifdef ZHLT_64BIT_FIX
	size_t size = s_max_style_count * sizeof(styleList_t);
#else
	unsigned size = s_max_style_count * sizeof(styleList_t);
#endif
	if ( size > 1024 * 1024 )
        	Log("%-20s: %5.1f megs \n", print_name, (double)size / (1024.0 * 1024.0));
        else if ( size > 1024 )
        	Log("%-20s: %5.1f kilos\n", print_name, (double)size / 1024.0);
        else
        	Log("%-20s: %5.1f bytes\n", print_name, (double)size); //--vluzacn
}

// Assembly:
pushq %rbx
movl 0x66c699a(%rip), %esi   # 0x66f6b30
testq %rsi, %rsi
je 0x301dc
movq %rdi, %rbx
movq 0x66c6993(%rip), %rdi   # 0x66f6b38
leaq 0x5a(%rip), %rcx        # 0x30206
pushq $0xc
popq %rdx
callq 0x4610
movl 0x66c697a(%rip), %eax   # 0x66f6b34
imulq $0xc, %rax, %rcx
cvtsi2sd %rcx, %xmm0
cmpq $0x15556, %rax          # imm = 0x15556
jb 0x301de
mulsd 0x369d(%rip), %xmm0     # 0x33870
leaq 0x9bc1(%rip), %rdi      # 0x39d9b
jmp 0x301fb
popq %rbx
retq
cmpl $0x56, %eax
jb 0x301f4
mulsd 0x9b65(%rip), %xmm0     # 0x39d50
leaq 0x9bbd(%rip), %rdi      # 0x39daf
jmp 0x301fb
leaq 0x9bc8(%rip), %rdi      # 0x39dc3
movq %rbx, %rsi
movb $0x1, %al
popq %rbx
jmp 0x8790
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/vismatrix.cpp
// Function: CheckVisBitVismatrix(unsigned int, unsigned int, float (&) [3], unsigned int&)
static bool     CheckVisBitVismatrix(unsigned p1, unsigned p2
#ifdef HLRAD_HULLU
									 , vec3_t &transparency_out
									 , unsigned int &next_index
#endif
									 )
{
    unsigned        bitpos;

#ifdef HLRAD_HULLU
    const unsigned a = p1;
    const unsigned b = p2;

    VectorFill(transparency_out, 1.0);
#endif

    if (p1 > p2)
    {
#ifndef HLRAD_HULLU
        const unsigned a = p1;
        const unsigned b = p2;
#endif
        p1 = b;
        p2 = a;
    }

    if (p1 > g_num_patches)
    {
        Warning("in CheckVisBit(), p1 > num_patches");
    }
    if (p2 > g_num_patches)
    {
        Warning("in CheckVisBit(), p2 > num_patches");
    }

#ifdef HALFBIT
    bitpos = p1 * g_num_patches - (p1 * (p1 + 1)) / 2 + p2;
#else
    bitpos = p1 * g_num_patches + p2;
#endif

    if (s_vismatrix[bitpos >> 3] & (1 << (bitpos & 7)))
    {
#ifdef HLRAD_HULLU    	
    	if(g_customshadow_with_bouncelight)
    	{
    	    GetTransparency( a, b, transparency_out, next_index );
    	}
#endif
        return true;
    }

    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, (%rsp)
movq %rdx, %r14
movl %esi, %ebp
movl %edi, %r15d
movsd 0x6635(%rip), %xmm0     # 0x36ad0
cmpl %esi, %edi
movl %esi, %r12d
cmoval %edi, %r12d
movsd %xmm0, (%rdx)
movl %esi, %r13d
cmovbl %edi, %r13d
movl $0x3f800000, 0x8(%rdx)  # imm = 0x3F800000
leaq 0x540453b(%rip), %rbx   # 0x54349f8
movl (%rbx), %ecx
cmpl %ecx, %r13d
jbe 0x304d4
leaq 0x99b9(%rip), %rdi      # 0x39e84
xorl %eax, %eax
callq 0x8ea5
movl (%rbx), %ecx
cmpl %ecx, %r12d
jbe 0x304e9
leaq 0x99c7(%rip), %rdi      # 0x39ea7
xorl %eax, %eax
callq 0x8ea5
movl (%rbx), %ecx
imull %r13d, %ecx
leal 0x1(%r13), %eax
imull %r13d, %eax
shrl %eax
subl %eax, %ecx
addl %r12d, %ecx
movq 0x66c663d(%rip), %rax   # 0x66f6b40
movl %ecx, %edx
shrl $0x3, %edx
movzbl (%rax,%rdx), %eax
andb $0x7, %cl
pushq $0x1
popq %rbx
shll %cl, %ebx
andl %eax, %ebx
je 0x30535
leaq 0x54c6519(%rip), %rax   # 0x54f6a38
cmpb $0x1, (%rax)
jne 0x30535
movl %r15d, %edi
movl %ebp, %esi
movq %r14, %rdx
movq (%rsp), %rcx
callq 0x2fff1
testl %ebx, %ebx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/vismatrixutil.cpp
// Function: FindTransferOffsetPatchnum(transfer_index_t*, patch_s const*, unsigned int)
int             FindTransferOffsetPatchnum(transfer_index_t* tIndex, const patch_t* const patch, const unsigned patchnum)
{
    //
    // binary search for match
    //
    int             low = 0;
    int             high = patch->iIndex - 1;
    int             offset;

    while (1)
    {
        offset = (low + high) / 2;

        if ((tIndex[offset].index + tIndex[offset].size) < patchnum)
        {
            low = offset + 1;
        }
        else if (tIndex[offset].index > patchnum)
        {
            high = offset - 1;
        }
        else
        {
            unsigned        x;
            unsigned int    rval = 0;
            transfer_index_t* pIndex = tIndex;

            for (x = 0; x < offset; x++, pIndex++)
            {
                rval += pIndex->size + 1;
            }
            rval += patchnum - tIndex[offset].index;
            return rval;
        }
        if (low > high)
        {
            return -1;
        }
    }
}

// Assembly:
movl %edx, %ecx
movl 0x38(%rsi), %r10d
decl %r10d
xorl %r9d, %r9d
pushq $0x2
popq %r8
pushq $-0x1
popq %rsi
leal (%r10,%r9), %eax
cltd
idivl %r8d
movslq %eax, %rdx
movl (%rdi,%rdx,4), %edx
movl %edx, %r11d
shrl $0xc, %r11d
andl $0xfff, %edx            # imm = 0xFFF
addl %r11d, %edx
cmpl %ecx, %edx
jae 0x30a78
incl %eax
movl %eax, %r9d
jmp 0x30a84
movl %ecx, %edx
subl %r11d, %edx
jae 0x30a8b
decl %eax
movl %eax, %r10d
cmpl %r10d, %r9d
jle 0x30a4f
jmp 0x30ab0
movl %eax, %eax
xorl %ecx, %ecx
movl $0xfff, %r8d            # imm = 0xFFF
xorl %esi, %esi
cmpl %ecx, %eax
je 0x30aac
movl (%rdi,%rcx,4), %r9d
andl %r8d, %r9d
addl %r9d, %esi
incl %esi
incq %rcx
jmp 0x30a97
addl %esi, %edx
movl %edx, %esi
movl %esi, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/connection.cpp
// Function: Connection::PeerReadCallback(bufferevent*, void*)
void Connection::PeerReadCallback(struct bufferevent* bev, void* arg){
    Connection* item = (Connection*)arg;
    if(item->recv_raw_mode_){
        item->OnPeerRead();
    }else{
        struct evbuffer* input = bufferevent_get_input(bev);
        if(item->buffer_len_ < 0){
            evbuffer_remove(input, (void*)&item->buffer_len_, 4);   
            item->buffer_len_ = ntohl(item->buffer_len_);
        }
        if(item->buffer_len_ > 0 && item->buffer_len_ <= evbuffer_get_length(input)){
            evbuffer_remove(input, (void*)item->buffer_, item->buffer_len_); 
            item->buffer_[item->buffer_len_] = '\0';
            //process the data received
            item->OnPeerRead();
            //cleared the buffer
            item->buffer_len_ = -1;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpb $0x1, 0x10090(%rsi)
jne 0x25c7
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *0x10(%rax)
callq 0x21b0
movq %rax, %r14
movl 0x1008c(%rbx), %eax
testl %eax, %eax
jns 0x25f6
leaq 0x1008c(%rbx), %r15
pushq $0x4
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22d0
movl (%r15), %eax
bswapl %eax
movl %eax, (%r15)
testl %eax, %eax
jle 0x263f
movl %eax, %r15d
movq %r14, %rdi
callq 0x22a0
cmpq %r15, %rax
jb 0x263f
leaq 0x8d(%rbx), %rsi
movslq 0x1008c(%rbx), %rdx
movq %r14, %rdi
callq 0x22d0
movslq 0x1008c(%rbx), %rax
movb $0x0, 0x8d(%rbx,%rax)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
orl $-0x1, 0x1008c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/connection.cpp
// Function: Connection::Connection(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned short, unsigned short, unsigned short)
Connection:: Connection(
    std::string peer_ip
    ,uint16_t peer_port
    ,uint16_t local_port
    ,uint16_t index 
    ):
    peer_ip_(peer_ip)
    ,peer_port_(peer_port)
    ,local_port_(local_port)
    ,index_(index)
    ,fd_(-1)
    ,connected_(false)
    ,buffer_len_(-1)
    ,recv_raw_mode_(false)
    ,send_raw_mode_(false)
    ,delconn_cb_(NULL)
{
  printf("local port : %u\n", local_port_);
  printf("peer port : %u\n", peer_port_);
  peer_event_ = NULL;
  conn_2_server_pair_[0] = conn_2_server_pair_[1] = NULL;
  server_2_conn_pair_[0] = server_2_conn_pair_[1] = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %r15d
movl %ecx, %r14d
movl %edx, %r12d
movq %rdi, %rbx
leaq 0x45e5(%rip), %rax      # 0x6c70
movq %rax, (%rdi)
leaq 0x8(%rdi), %r13
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movups %xmm0, 0x18(%rdi)
orl $-0x1, 0x58(%rdi)
addq $0x60, %rdi
callq 0x2300
movw %r12w, 0x80(%rbx)
movw %r14w, 0x82(%rbx)
movw %r15w, 0x84(%rbx)
movb $0x0, 0x8c(%rbx)
orl $-0x1, 0x1008c(%rbx)
andw $0x0, 0x10090(%rbx)
movzwl %r14w, %esi
leaq 0x1921(%rip), %rdi      # 0x4004
xorl %eax, %eax
callq 0x2040
movzwl 0x80(%rbx), %esi
leaq 0x191d(%rip), %rdi      # 0x4015
xorl %eax, %eax
callq 0x2040
andq $0x0, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rbx)
movups %xmm0, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r13, %rdi
callq 0x29ce
movq %rbx, %rdi
callq 0x23c0
nop
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/connection.cpp
// Function: Connection::~Connection()
Connection:: ~Connection(){
  printf("connection %u destroyed\n", index_);
  bufferevent_free(peer_event_);
  if(conn_2_server_pair_[0]){
    bufferevent_free(conn_2_server_pair_[0]);
    bufferevent_free(conn_2_server_pair_[1]);
  }
  if(server_2_conn_pair_[0]){
    bufferevent_free(server_2_conn_pair_[0]);
    bufferevent_free(server_2_conn_pair_[1]);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x452e(%rip), %rax      # 0x6c70
movq %rax, (%rdi)
movzwl 0x84(%rdi), %esi
leaq 0x18d2(%rip), %rdi      # 0x4025
xorl %eax, %eax
callq 0x2040
movq 0x28(%rbx), %rdi
callq 0x20c0
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x277a
callq 0x20c0
movq 0x40(%rbx), %rdi
callq 0x20c0
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x2791
callq 0x20c0
movq 0x50(%rbx), %rdi
callq 0x20c0
leaq 0x60(%rbx), %rdi
callq 0x2150
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x29ce
movq %rax, %rdi
callq 0x29ed
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/connection.cpp
// Function: Connection::Start()
bool Connection::Start(){
    if (SetKeepLive(fd_, 20, 5, 3) < 0)
       return false;
    if (SetRecvSendBufSize(fd_, 0xfffff) < 0)
       return false;
    if(SetReuseAddr(fd_) < 0)
       return false;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x58(%rdi), %edi
pushq $0x14
popq %rsi
pushq $0x5
popq %rdx
pushq $0x3
popq %rcx
callq 0x3cbe
testl %eax, %eax
js 0x280e
movl 0x58(%rbx), %edi
movl $0xfffff, %esi          # imm = 0xFFFFF
callq 0x3c5f
testl %eax, %eax
js 0x280e
movl 0x58(%rbx), %edi
callq 0x3c1e
testl %eax, %eax
setns %al
jmp 0x2810
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/connection.cpp
// Function: Connection::Initialize(event_base*, int, bool)
void Connection::Initialize(struct event_base* base, evutil_socket_t fd, bool write_callback_on){
    fd_ = fd;
    base_ = base;
    peer_event_ = bufferevent_socket_new(base, fd_, BEV_OPT_CLOSE_ON_FREE);
    if(!peer_event_){
        printf("create bufferevent failed in %s:%s!\n", __FILE__, __func__);
        fd_ = -1;
        return;
    }
    bufferevent_setcb(peer_event_, PeerReadCallback, write_callback_on? PeerWriteCallback: NULL, PeerEventCallback, this);
    bufferevent_enable(peer_event_, EV_WRITE|EV_READ);
    //for TCP packet, we have 4 bytes-len head
    bufferevent_setwatermark(peer_event_, EV_READ, 4, 0xfffff);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %ecx, %r14d
movq %rdi, %rbx
movl %edx, 0x58(%rdi)
movq %rsi, 0x30(%rdi)
pushq $0x1
popq %rax
movq %rsi, %rdi
movl %edx, %esi
movl %eax, %edx
callq 0x2390
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x2891
leaq -0x201(%rip), %rcx      # 0x264a
xorl %edx, %edx
testb %r14b, %r14b
cmovneq %rcx, %rdx
leaq -0x2bd(%rip), %rsi      # 0x259e
leaq -0x20a(%rip), %rcx      # 0x2658
movq %rax, %rdi
movq %rbx, %r8
callq 0x2280
movq 0x28(%rbx), %rdi
pushq $0x6
popq %rsi
callq 0x23e0
movq 0x28(%rbx), %rdi
pushq $0x2
popq %rsi
pushq $0x4
popq %rdx
movl $0xfffff, %ecx          # imm = 0xFFFFF
popq %rbx
popq %r14
popq %rbp
jmp 0x20a0
leaq 0x17a6(%rip), %rdi      # 0x403e
leaq 0x17c4(%rip), %rsi      # 0x4063
leaq 0x17cc(%rip), %rdx      # 0x4072
xorl %eax, %eax
callq 0x2040
orl $-0x1, 0x58(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/connection.cpp
// Function: Connection::OnPeerEvent(short)
void Connection::OnPeerEvent(short events){
   if (events & BEV_EVENT_CONNECTED){
        connected_ = true;
        printf("connected!\n");
   }else if (events & BEV_EVENT_EOF){
        evutil_closesocket(fd_);
        fd_ = -1;
        bufferevent_setfd(peer_event_, -1);
        connected_ = false;
        printf("connection closed!\n");
        if(delconn_cb_)
          delconn_cb_(this->index_);
   }else if (events & BEV_EVENT_ERROR){
        printf("got an error on connection in %s\n", strerror(errno));
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testb %sil, %sil
js 0x2956
movzwl %si, %eax
testb $0x10, %al
jne 0x296f
testb $0x20, %al
je 0x29ba
callq 0x2030
movl (%rax), %edi
callq 0x20e0
leaq 0x1737(%rip), %rdi      # 0x407d
movq %rax, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2040
movb $0x1, 0x8c(%rbx)
leaq 0x174e(%rip), %rdi      # 0x40b2
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2340
movl 0x58(%rbx), %edi
callq 0x2190
orl $-0x1, 0x58(%rbx)
movq 0x28(%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x23b0
movb $0x0, 0x8c(%rbx)
leaq 0x170a(%rip), %rdi      # 0x409f
callq 0x2340
cmpq $0x0, 0x18(%rbx)
je 0x29ba
movzwl 0x84(%rbx), %esi
addq $0x8, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x29fc
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/tcp_client.cpp
// Function: TcpClient::KeepAliveCallback(int, short, void*)
void TcpClient::KeepAliveCallback(evutil_socket_t fd, short event, void* arg){
    printf("in %s:%s\n", __FILE__, __func__);
    TcpClient* client = (TcpClient*)arg;
    //reconnect
    if(!client->connected_){
        client->DoConnect();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
leaq 0x16c9(%rip), %rdi      # 0x4111
leaq 0x168b(%rip), %rsi      # 0x40da
leaq 0x1693(%rip), %rdx      # 0x40e9
xorl %eax, %eax
callq 0x2040
cmpb $0x0, 0x8c(%rbx)
je 0x2a6d
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2a7c
nop
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/tcp_client.cpp
// Function: TcpClient::DoConnect()
bool TcpClient::DoConnect(){
    if(fd_ < 0){
        fd_ = socket(AF_INET, SOCK_STREAM, 0);
        if(fd_ < 0){
            printf("create socket failed in %s:%s\n", __FILE__, __func__);
            return false;
        }
        bufferevent_setfd(peer_event_, fd_);
    }

    struct sockaddr_in peer_addr;
    peer_addr.sin_family = AF_INET;
    peer_addr.sin_addr.s_addr = inet_addr(peer_ip_.c_str());
    peer_addr.sin_port = htons(peer_port_);
    int ret = bufferevent_socket_connect(peer_event_, (const sockaddr*)&peer_addr, sizeof(peer_addr));
    if (ret < 0){
        printf("bufferevent socket connect failed in %s:%s!\n", __FILE__, __func__);
        return false;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x58(%rdi)
jns 0x2aaf
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x2090
movl %eax, 0x58(%rbx)
testl %eax, %eax
js 0x2b03
movq 0x28(%rbx), %rdi
movl %eax, %esi
callq 0x23b0
leaq -0x20(%rbp), %r14
movw $0x2, (%r14)
movq 0x60(%rbx), %rdi
callq 0x2290
movl %eax, 0x4(%r14)
movzwl 0x80(%rbx), %eax
rolw $0x8, %ax
movw %ax, 0x2(%r14)
movq 0x28(%rbx), %rdi
pushq $0x10
popq %rdx
movq %r14, %rsi
callq 0x22b0
testl %eax, %eax
setns %bl
jns 0x2b21
leaq 0x16fc(%rip), %rdi      # 0x41ef
leaq 0x15e0(%rip), %rsi      # 0x40da
leaq 0x16e4(%rip), %rdx      # 0x41e5
jmp 0x2b1a
leaq 0x16bc(%rip), %rdi      # 0x41c6
leaq 0x15c9(%rip), %rsi      # 0x40da
leaq 0x16cd(%rip), %rdx      # 0x41e5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2040
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/tcp_client.cpp
// Function: TcpClient::Start()
bool TcpClient::Start(){
    
    if(!DoConnect())
        return false;    

    if(SetKeepLive(fd_, 20, 5, 3) < 0){
        printf("set keep alive failed in %s:%s\n", __FILE__, __func__);
        return false;
    }
    if(SetRecvSendBufSize(fd_, 0xfffff) < 0){
        printf("set recv sned bufsize failed in %s:%s\n", __FILE__, __func__);
        return false;
    }

    //create a timer to keep connection alive
    keepalive_event_ = event_new(base_, -1, EV_PERSIST, TcpClient::KeepAliveCallback, this);
    if(!keepalive_event_){
        printf("create event failed in %s:%s!\n", __FILE__, __func__);
        return false;
    }
     
    struct timeval tv = {10, 0};
    evtimer_add(keepalive_event_, &tv);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x2a7c
testb %al, %al
je 0x2c40
movl 0x58(%rbx), %edi
pushq $0x14
popq %rsi
pushq $0x5
popq %rdx
pushq $0x3
popq %rcx
callq 0x3cbe
testl %eax, %eax
js 0x2c44
movl 0x58(%rbx), %edi
movl $0xfffff, %esi          # imm = 0xFFFFF
callq 0x3c5f
testl %eax, %eax
js 0x2c4d
movq 0x30(%rbx), %rdi
leaq -0x1d4(%rip), %rcx      # 0x2a38
pushq $-0x1
popq %rsi
pushq $0x10
popq %rdx
movq %rbx, %r8
callq 0x2200
movq %rax, 0x10098(%rbx)
testq %rax, %rax
je 0x2c56
movups 0x15f3(%rip), %xmm0     # 0x4220
leaq -0x20(%rbp), %rsi
movaps %xmm0, (%rsi)
movq %rax, %rdi
callq 0x2130
movb $0x1, %bl
jmp 0x2c74
xorl %ebx, %ebx
jmp 0x2c74
leaq 0x14b0(%rip), %rdi      # 0x40fb
jmp 0x2c5d
leaq 0x14cd(%rip), %rdi      # 0x4121
jmp 0x2c5d
leaq 0x14eb(%rip), %rdi      # 0x4148
leaq 0x1476(%rip), %rsi      # 0x40da
leaq 0x14b0(%rip), %rdx      # 0x411b
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x2040
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/tcp_client.cpp
// Function: TcpClient::OnPeerRead()
void TcpClient::OnPeerRead(){
    //this is for test
    printf("received data from peer, length = %d, data = %s\n", buffer_len_, buffer_);
    usleep(1000000);
    
    char *msg = "hello server!\n";
    Write(msg, strlen(msg));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x1008c(%rdi), %esi
leaq 0x8d(%rdi), %rdx
leaq 0x14cc(%rip), %rdi      # 0x4167
xorl %eax, %eax
callq 0x2040
movl $0xf4240, %edi          # imm = 0xF4240
callq 0x2310
leaq 0x14e5(%rip), %rsi      # 0x4198
pushq $0xe
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x28b6
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/tcp_client.cpp
// Function: TcpClient::OnPeerEvent(short)
void TcpClient::OnPeerEvent(short events){
   if (events == BEV_EVENT_CONNECTED){
        printf("connected!\n");
        connected_ = true;

        //this is for test
        usleep(1000000);
        char *msg = "hello server!\n";
        Write(msg, strlen(msg));

   }else if (events & BEV_EVENT_EOF){
        evutil_closesocket(fd_);
        fd_ = -1;
        bufferevent_setfd(peer_event_, -1);
        connected_ = false;
        printf("connection closed!\n");
   }else if (events & BEV_EVENT_ERROR){
        printf("got an error on TcpClient: %s\n", strerror(errno));
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpw $0x80, %si
jne 0x2d09
leaq 0x13d7(%rip), %rdi      # 0x40b2
callq 0x2340
movb $0x1, 0x8c(%rbx)
movl $0xf4240, %edi          # imm = 0xF4240
callq 0x2310
leaq 0x14a0(%rip), %rsi      # 0x4198
pushq $0xe
popq %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x28b6
movzwl %si, %eax
testb $0x10, %al
jne 0x2d1b
testb $0x20, %al
jne 0x2d4c
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl 0x58(%rbx), %edi
callq 0x2190
orl $-0x1, 0x58(%rbx)
movq 0x28(%rbx), %rdi
pushq $-0x1
popq %rsi
callq 0x23b0
movb $0x0, 0x8c(%rbx)
leaq 0x135e(%rip), %rdi      # 0x409f
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2340
callq 0x2030
movl (%rax), %edi
callq 0x20e0
leaq 0x1448(%rip), %rdi      # 0x41a7
movq %rax, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2040
nop
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/tcp_server.cpp
// Function: TcpServer::Bind(char const*, unsigned short, event_base*)
void TcpServer::Bind(const char* ip, uint16_t port, struct event_base* base){
    base_ = base;
    listen_addr_.sin_family = AF_INET;
    listen_addr_.sin_addr.s_addr = inet_addr(ip);
    listen_addr_.sin_port = htons(port);
    listener_ = evconnlistener_new_bind(
                base_, 
                ListenCallback,
                this, 
                LEV_OPT_REUSEABLE|LEV_OPT_CLOSE_ON_FREE,
                -1,
                (const sockaddr*)&listen_addr_, 
                sizeof(listen_addr_));
    if (!listener_){
        printf("evconnlistener create failed in %s:%s!\n", __FILE__, __func__);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rdi, %rbx
movq %rcx, 0x8(%rdi)
leaq 0x18(%rdi), %r15
movw $0x2, 0x18(%rdi)
movq %rsi, %rdi
callq 0x2290
movl %eax, 0x1c(%rbx)
rolw $0x8, %r14w
movw %r14w, 0x1a(%rbx)
movq 0x8(%rbx), %rdi
movl $0x10, (%rsp)
leaq -0x133(%rip), %rsi      # 0x2d70
pushq $0xa
popq %rcx
pushq $-0x1
popq %r8
movq %rbx, %rdx
movq %r15, %r9
callq 0x2220
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x2ec9
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x136b(%rip), %rdi      # 0x423b
leaq 0x138c(%rip), %rsi      # 0x4263
leaq 0x1394(%rip), %rdx      # 0x4272
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2040
nop
// File: /workspace/github_cpp_makefile_star2_O2/gtarcoder[P]libevent_utils/tcp_server.cpp
// Function: TcpServer::OnListen(evconnlistener*, int, sockaddr*, int)
void TcpServer::OnListen(struct evconnlistener* listener, evutil_socket_t sock, struct sockaddr* addr, int socklen){
    string client_ip = string(inet_ntoa(((struct sockaddr_in*)addr)->sin_addr));
    uint16_t client_port = ntohs(((struct sockaddr_in*)addr)->sin_port);
    printf("receive connection from %s:%d\n", client_ip.c_str(), client_port);
    Connection* conn = new Connection(client_ip, client_port, 0, next_client_index_);
    connections_[next_client_index_++] = conn;
    conn->Initialize(base_, sock);
    conn->Start();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rcx, %r15
movl %edx, %ebx
movq %rdi, %r14
movl 0x4(%rcx), %edi
callq 0x2140
leaq -0x68(%rbp), %r12
leaq -0x22(%rbp), %rdx
movq %r12, %rdi
movq %rax, %rsi
callq 0x2110
movzwl 0x2(%r15), %eax
rolw $0x8, %ax
movq (%r12), %rsi
movzwl %ax, %r12d
leaq 0x133d(%rip), %rdi      # 0x4277
movl %r12d, %edx
xorl %eax, %eax
callq 0x2040
movl $0x10098, %edi          # imm = 0x10098
callq 0x2270
movq %rax, %r15
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x2300
movzwl 0x68(%r14), %r8d
leaq -0x48(%rbp), %rsi
movq %r15, %rdi
movl %r12d, %edx
xorl %ecx, %ecx
callq 0x266a
leaq -0x48(%rbp), %rdi
callq 0x2150
leaq 0x30(%r14), %rdi
movl 0x68(%r14), %eax
movl %eax, %ecx
incl %ecx
movw %cx, 0x68(%r14)
leaq -0x22(%rbp), %rsi
movw %ax, (%rsi)
callq 0x30ac
movq %r15, (%rax)
movq 0x8(%r14), %rsi
movq %r15, %rdi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x2818
movq (%r15), %rax
movq %r15, %rdi
callq *0x38(%rax)
leaq -0x68(%rbp), %rdi
callq 0x2150
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2fe9
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x2150
jmp 0x2fdf
movq %rax, %rbx
movq %r15, %rdi
callq 0x2240
jmp 0x2fec
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x2150
movq %rbx, %rdi
callq 0x23c0
nop