LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/dft.c
// Function: tt_dft
int tt_dft(double (*out)[2], double (*in)[2], uint N)
{
	tt_assert(N);

	double em = 0;
	double edelta = 2 * _TT_PI / N;
	for (uint m = 0; m < N; m++) {
		out[m][0] = out[m][1] = 0;

		double emn = 0;
		for (uint n = 0; n < N; n++) {
			double e[2] = { cos(emn), -sin(emn) };
			double t[2];
			tt_complex_mul(t, in[n], e);
			out[m][0] += t[0];
			out[m][1] += t[1];

			emn += em;
		}

		em += edelta;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
testl %edx, %edx
je 0x1b33
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r12d
cvtsi2sd %r12, %xmm0
movsd 0x391c(%rip), %xmm1     # 0x5368
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movq %r12, 0x18(%rsp)
shlq $0x4, %r12
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r13d, %r13d
cmpq 0x18(%rsp), %r13
je 0x1b22
movq %r13, %rax
shlq $0x4, %rax
leaq (%r14,%rax), %rbp
xorpd %xmm0, %xmm0
movupd %xmm0, (%r14,%rax)
xorpd %xmm0, %xmm0
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x1b0a
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x10d0
movaps %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1130
movsd (%rbx,%r15), %xmm1
movsd 0x8(%rbx,%r15), %xmm2
movapd 0x20(%rsp), %xmm4
movapd %xmm4, %xmm3
mulsd %xmm1, %xmm3
mulsd %xmm2, %xmm4
mulsd %xmm0, %xmm1
subsd %xmm1, %xmm4
mulsd %xmm2, %xmm0
addsd %xmm3, %xmm0
unpcklpd %xmm4, %xmm0            # xmm0 = xmm0[0],xmm4[0]
movupd (%rbp), %xmm1
addpd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
movupd %xmm1, (%rbp)
addsd (%rsp), %xmm0
addq $0x10, %r15
jmp 0x1a92
movsd (%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
incq %r13
jmp 0x1a6b
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x36df(%rip), %rsi      # 0x5219
leaq 0x364b(%rip), %rdx      # 0x518c
leaq 0x36d8(%rip), %rcx      # 0x5220
pushq $0x18
popq %r8
xorl %edi, %edi
xorl %eax, %eax
callq 0x258c
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/dft.c
// Function: tt_idft
int tt_idft(double (*out)[2], double (*in)[2], uint N)
{
	tt_assert(N);

	double en = 0;
	double edelta = 2 * _TT_PI / N;
	for (uint n = 0; n < N; n++) {
		out[n][0] = out[n][1] = 0;

		double enm = 0;
		for (uint m = 0; m < N; m++) {
			double e[2] = { cos(enm), sin(enm) };
			double t[2];
			tt_complex_mul(t, in[m], e);
			out[n][0] += t[0];
			out[n][1] += t[1];

			enm += en;
		}
		out[n][0] /= N;
		out[n][1] /= N;

		en += edelta;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
testl %edx, %edx
je 0x1c81
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r12d
cvtsi2sd %r12, %xmm0
movsd 0x37e2(%rip), %xmm1     # 0x5368
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
movapd %xmm0, 0x20(%rsp)
movq %r12, 0x18(%rsp)
shlq $0x4, %r12
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r13d, %r13d
cmpq 0x18(%rsp), %r13
je 0x1c70
movq %r13, %rax
shlq $0x4, %rax
leaq (%r14,%rax), %rbp
xorpd %xmm0, %xmm0
movupd %xmm0, (%r14,%rax)
xorpd %xmm1, %xmm1
xorl %r15d, %r15d
cmpq %r15, %r12
je 0x1c4d
movapd %xmm1, %xmm0
movsd %xmm1, 0x8(%rsp)
callq 0x10d0
movapd %xmm0, 0x30(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x1130
movsd (%rbx,%r15), %xmm1
movsd 0x8(%rbx,%r15), %xmm2
movapd 0x30(%rsp), %xmm4
movapd %xmm4, %xmm3
mulsd %xmm1, %xmm3
mulsd %xmm0, %xmm1
mulsd %xmm2, %xmm0
mulsd %xmm2, %xmm4
addsd %xmm1, %xmm4
movsd 0x8(%rsp), %xmm1
subsd %xmm0, %xmm3
unpcklpd %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0]
movupd (%rbp), %xmm0
addpd %xmm3, %xmm0
movupd %xmm0, (%rbp)
addsd (%rsp), %xmm1
addq $0x10, %r15
jmp 0x1bd6
divpd 0x20(%rsp), %xmm0
movupd %xmm0, (%rbp)
movsd (%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
incq %r13
jmp 0x1baf
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x35a6(%rip), %rsi      # 0x522e
leaq 0x34fd(%rip), %rdx      # 0x518c
leaq 0x358a(%rip), %rcx      # 0x5220
pushq $0x3c
popq %r8
xorl %edi, %edi
xorl %eax, %eax
callq 0x258c
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/dft.c
// Function: tt_dft_real
int tt_dft_real(double (*out)[2], const double *in, uint N)
{
	tt_assert(N);

	double em = 0;
	double edelta = 2 * _TT_PI / N;
	for (uint m = 0; m < N; m++) {
		out[m][0] = out[m][1] = 0;

		double emn = 0;
		for (uint n = 0; n < N; n++) {
			out[m][0] += cos(emn) * in[n];
			out[m][1] += -sin(emn) * in[n];

			emn += em;
		}

		em += edelta;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testl %edx, %edx
je 0x1d8e
movq %rsi, %rbx
movq %rdi, %r14
movl %edx, %r15d
cvtsi2sd %r15, %xmm0
movsd 0x3694(%rip), %xmm1     # 0x5368
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r12d, %r12d
cmpq %r15, %r12
je 0x1d7d
movq %r12, %rax
shlq $0x4, %rax
leaq (%r14,%rax), %r13
xorpd %xmm0, %xmm0
movupd %xmm0, (%r14,%rax)
xorpd %xmm0, %xmm0
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0x1d65
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x10d0
mulsd (%rbx,%rbp,8), %xmm0
addsd (%r13), %xmm0
movsd %xmm0, (%r13)
movsd 0x8(%rsp), %xmm0
callq 0x1130
movsd 0x8(%r13), %xmm1
mulsd (%rbx,%rbp,8), %xmm0
subsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
movsd %xmm1, 0x8(%r13)
addsd (%rsp), %xmm0
incq %rbp
jmp 0x1d0e
movsd (%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
incq %r12
jmp 0x1cea
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x34a1(%rip), %rsi      # 0x5236
leaq 0x33f0(%rip), %rdx      # 0x518c
leaq 0x347d(%rip), %rcx      # 0x5220
pushq $0x59
popq %r8
xorl %edi, %edi
xorl %eax, %eax
callq 0x258c
callq 0x1050
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/fft.c
// Function: gen_wn_tbl
static double (*gen_wn_tbl(int N))[2]
{
	double wn = 0;
	const double step = 2 * _TT_PI / N;
	double (*tbl)[2] = malloc(N / 2 * sizeof(*tbl));

	if (tbl == NULL) {
		tt_error("Out of memory");
		return NULL;
	}

	for (int i = 0; i < N / 4; i++) {
		tbl[i][0] = cos(wn);
		tbl[i][1] = -sin(wn);
		tbl[i+N/4][0] = tbl[i][1];
		tbl[i+N/4][1] = -tbl[i][0];
		wn += step;
	}

	return tbl;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, %r14d
shrl %edi
shlq $0x4, %rdi
callq 0x1120
movq %rax, %rbx
testq %rax, %rax
je 0x1ea3
cvtsi2sd %r14d, %xmm0
movsd 0x3549(%rip), %xmm1     # 0x5368
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
shrl $0x2, %r14d
shlq $0x4, %r14
leaq (%r14,%rbx), %r15
addq $0x8, %r15
xorpd %xmm0, %xmm0
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x1eba
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x10d0
movsd %xmm0, (%rbx,%r12)
movsd 0x8(%rsp), %xmm0
callq 0x1130
movapd 0x34c1(%rip), %xmm1     # 0x5330
xorpd %xmm1, %xmm0
movlpd %xmm0, 0x8(%rbx,%r12)
movlpd %xmm0, -0x8(%r15,%r12)
movsd (%rbx,%r12), %xmm0
xorpd %xmm1, %xmm0
movlpd %xmm0, (%r15,%r12)
movsd 0x8(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
addq $0x10, %r12
jmp 0x1e40
leaq 0x3434(%rip), %rsi      # 0x52de
leaq 0x3438(%rip), %rdx      # 0x52e9
xorl %edi, %edi
xorl %eax, %eax
callq 0x258c
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/fft.c
// Function: tt_fft
int tt_fft(double (*out)[2], double (*in)[2], uint N)
{
	/* Check if N is 2^n */
	if (N <= 1 || (N & (N-1))) {
		tt_warn("%d is not power of 2, fallback to DFT", N);
		return tt_dft(out, in, N);
	}

	return do_stage(out, in, N, fft_stage);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
cmpl $0x2, %edx
jb 0x1f34
movl %ebx, %eax
shrl %eax
andl $0x55555555, %eax       # imm = 0x55555555
movl %ebx, %ecx
subl %eax, %ecx
movl $0x33333333, %eax       # imm = 0x33333333
movl %ecx, %edx
andl %eax, %edx
shrl $0x2, %ecx
andl %eax, %ecx
addl %edx, %ecx
movl %ecx, %eax
shrl $0x4, %eax
addl %ecx, %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
imull $0x1010101, %eax, %eax  # imm = 0x1010101
shrl $0x18, %eax
cmpl $0x2, %eax
jae 0x1f34
leaq 0x105(%rip), %rcx       # 0x202a
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x1f60
leaq 0x333b(%rip), %rsi      # 0x5276
leaq 0x333b(%rip), %rdx      # 0x527d
pushq $0x1
popq %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x258c
movq %r15, %rdi
movq %r14, %rsi
movl %ebx, %edx
popq %rbx
popq %r14
popq %r15
jmp 0x1a20
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/fft.c
// Function: do_stage
static int do_stage(double (*out)[2], double (*in)[2], uint N,
		void (*stage)(double (*)[2], int, uint, double (*)[2], int))
{
	double (*tbl)[2];
	int delta;

	tbl = get_wn_tbl(N, &delta);
	if (!tbl)
		return TT_ENOMEM;

	/* Bit reversal */
	const int nb = __builtin_ctz(N);
	for (int i = 0; i < N ; i++)
		tt_complex_set(out[i], in[_tt_bitrev(i, nb)]);

	for (int i = 1; i <= nb; i++)
		stage(out, i, N, tbl, delta);

	put_wn_tbl(tbl);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movl %edx, %ebx
movq %rsi, %rbp
movq %rdi, %r15
leaq 0x4(%rsp), %rsi
movl %edx, %edi
callq 0x241f
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x2018
movq %r14, 0x10(%rsp)
movl %ebx, %r12d
bsfl %ebx, %r13d
leaq 0x8(%r15), %r14
xorl %ebx, %ebx
cmpq %rbx, %r12
je 0x1fda
movl %ebx, %edi
movl %r13d, %esi
callq 0x2532
movl %eax, %eax
shlq $0x4, %rax
movsd (%rbp,%rax), %xmm0
movsd %xmm0, -0x8(%r14)
movsd 0x8(%rbp,%rax), %xmm0
movsd %xmm0, (%r14)
incq %rbx
addq $0x10, %r14
jmp 0x1fa5
movl 0x4(%rsp), %ebx
negl %r13d
pushq $0x1
popq %rbp
movq 0x10(%rsp), %r14
leal (%r13,%rbp), %eax
cmpl $0x1, %eax
je 0x200a
movq %r15, %rdi
movl %ebp, %esi
movl %r12d, %edx
movq 0x8(%rsp), %rcx
movl %ebx, %r8d
callq *%r14
incl %ebp
jmp 0x1fe9
movq 0x8(%rsp), %rdi
callq 0x2478
xorl %eax, %eax
jmp 0x201b
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/fft.c
// Function: fft_stage
static void fft_stage(double (*x)[2], int stage, uint N,
		double (*tbl)[2], int delta)
{
	const int idx_step = 1 << (stage - 1);
	int idx;
	double tmp[2];

	/* Multiply W(N,k) */
	const int tbl_step = delta * (N >> stage);
	idx = idx_step;
	for (int i = 0; i < (N >> stage); i++) {
		int tbl_idx = 0;
		for (int j = 0; j < idx_step; j++) {
			tt_complex_mul(x[idx], x[idx], tbl[tbl_idx]);
			idx++;
			tbl_idx += tbl_step;
		}
		idx += idx_step;
	}

	/* Cross add/sub */
	idx = 0;
	for (int i = 0; i < (N >> stage); i++) {
		for (int j = 0; j < idx_step; j++) {
			tt_complex_add(tmp, x[idx], x[idx+idx_step]);
			tt_complex_sub(x[idx+idx_step], x[idx], x[idx+idx_step]);
			tt_complex_set(x[idx], tmp);
			idx++;
		}
		idx += idx_step;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x18(%rsp)
leal -0x1(%rsi), %ecx
pushq $0x1
popq %r9
shll %cl, %r9d
movl %esi, %ecx
shrl %cl, %edx
imull %edx, %r8d
xorl %eax, %eax
testl %r9d, %r9d
movl $0x0, %r15d
cmovgl %r9d, %r15d
movslq %r8d, %r14
shlq $0x4, %r14
negl %r15d
movl %r9d, %ebp
movl %edx, 0x10(%rsp)
movl %r9d, 0xc(%rsp)
movq %rdi, 0x20(%rsp)
cmpl %edx, %eax
je 0x20cb
movl %eax, 0x14(%rsp)
movslq %ebp, %r12
shlq $0x4, %r12
addq %rdi, %r12
xorl %ebx, %ebx
movq 0x18(%rsp), %r13
cmpl %ebx, %r15d
je 0x20b0
movq %r12, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x2486
addq %r14, %r13
decl %ebx
addq $0x10, %r12
jmp 0x2092
movl 0xc(%rsp), %r9d
addl %r9d, %ebp
subl %ebx, %ebp
movl 0x14(%rsp), %eax
incl %eax
movl 0x10(%rsp), %edx
movq 0x20(%rsp), %rdi
jmp 0x2079
movslq %r9d, %rax
shlq $0x4, %rax
xorl %ecx, %ecx
xorl %r8d, %r8d
cmpl %edx, %r8d
je 0x2120
movslq %ecx, %rsi
shlq $0x4, %rsi
addq %rdi, %rsi
xorl %r10d, %r10d
cmpl %r10d, %r15d
je 0x2115
movupd (%rsi), %xmm0
movupd (%rsi,%rax), %xmm1
movapd %xmm0, %xmm2
addpd %xmm1, %xmm2
subpd %xmm1, %xmm0
movupd %xmm0, (%rsi,%rax)
movupd %xmm2, (%rsi)
decl %r10d
addq $0x10, %rsi
jmp 0x20e9
addl %r9d, %ecx
subl %r10d, %ecx
incl %r8d
jmp 0x20d7
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/fft.c
// Function: tt_ifft
int tt_ifft(double (*out)[2], double (*in)[2], uint N)
{
	if (N <= 1 || (N & (N-1))) {
		tt_warn("%d is not power of 2, fallback to IDFT", N);
		return tt_idft(out, in, N);
	}

	int ret = do_stage(out, in, N, ifft_stage);
	if (ret)
		return ret;

	/* Divide N */
	for (int i = 0; i < N; i++) {
		out[i][0] /= N;
		out[i][1] /= N;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x2, %edx
jb 0x2197
movl %ebp, %eax
shrl %eax
andl $0x55555555, %eax       # imm = 0x55555555
movl %ebp, %ecx
subl %eax, %ecx
movl $0x33333333, %eax       # imm = 0x33333333
movl %ecx, %edx
andl %eax, %edx
shrl $0x2, %ecx
andl %eax, %ecx
addl %edx, %ecx
movl %ecx, %eax
shrl $0x4, %eax
addl %ecx, %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
imull $0x1010101, %eax, %eax  # imm = 0x1010101
shrl $0x18, %eax
cmpl $0x2, %eax
jae 0x2197
leaq 0x70(%rip), %rcx        # 0x21ee
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x1f60
testl %eax, %eax
je 0x21c2
pushq $-0x1
popq %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3105(%rip), %rsi      # 0x52a3
leaq 0x3106(%rip), %rdx      # 0x52ab
pushq $0x1
popq %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x258c
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
popq %rbx
popq %r14
popq %rbp
jmp 0x1b5a
movl %ebp, %ecx
cvtsi2sd %rcx, %xmm0
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
shlq $0x4, %rcx
xorl %eax, %eax
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x2192
movupd (%rbx,%rdx), %xmm1
divpd %xmm0, %xmm1
movupd %xmm1, (%rbx,%rdx)
addq $0x10, %rdx
jmp 0x21d5
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/fft.c
// Function: ifft_stage
static void ifft_stage(double (*x)[2], int stage, uint N,
		double (*tbl)[2], int delta)
{
	const int idx_step = 1 << (stage - 1);
	int idx;
	double tmp[2];

	const int tbl_step = delta * (N >> stage);
	idx = idx_step;
	for (int i = 0; i < (N >> stage); i++) {
		int tbl_idx = 0;
		for (int j = 0; j < idx_step; j++) {
			tmp[0] = tbl[tbl_idx][0];
			tmp[1] = -tbl[tbl_idx][1];
			tt_complex_mul(x[idx], x[idx], tmp);
			idx++;
			tbl_idx += tbl_step;
		}
		idx += idx_step;
	}

	idx = 0;
	for (int i = 0; i < (N >> stage); i++) {
		for (int j = 0; j < idx_step; j++) {
			tt_complex_add(tmp, x[idx], x[idx+idx_step]);
			tt_complex_sub(x[idx+idx_step], x[idx], x[idx+idx_step]);
			tt_complex_set(x[idx], tmp);
			idx++;
		}
		idx += idx_step;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %rax
leal -0x1(%rsi), %ecx
movl $0x1, %r9d
shll %cl, %r9d
movl %esi, %ecx
shrl %cl, %edx
imull %edx, %r8d
movslq %r8d, %rsi
xorl %r8d, %r8d
testl %r9d, %r9d
movl $0x0, %ecx
cmovgl %r9d, %ecx
addq $0x8, %rax
shlq $0x4, %rsi
leaq 0x8(%rdi), %r10
negl %ecx
movl %r9d, %r11d
cmpl %edx, %r8d
je 0x2293
movslq %r11d, %rbx
shlq $0x4, %rbx
addq %r10, %rbx
xorl %ebp, %ebp
movq %rax, %r14
cmpl %ebp, %ecx
je 0x2288
movsd -0x8(%r14), %xmm0
movsd (%r14), %xmm1
movsd -0x8(%rbx), %xmm2
movsd (%rbx), %xmm3
movapd %xmm0, %xmm4
mulsd %xmm2, %xmm4
mulsd %xmm3, %xmm0
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
movsd %xmm0, (%rbx)
mulsd %xmm3, %xmm1
addsd %xmm4, %xmm1
movsd %xmm1, -0x8(%rbx)
addq %rsi, %r14
decl %ebp
addq $0x10, %rbx
jmp 0x2240
addl %r9d, %r11d
subl %ebp, %r11d
incl %r8d
jmp 0x222c
movslq %r9d, %rax
shlq $0x4, %rax
xorl %esi, %esi
xorl %r8d, %r8d
cmpl %edx, %r8d
je 0x22ec
movslq %esi, %r10
shlq $0x4, %r10
addq %rdi, %r10
xorl %r11d, %r11d
cmpl %r11d, %ecx
je 0x22e1
movupd (%r10), %xmm0
movupd (%r10,%rax), %xmm1
movapd %xmm0, %xmm2
addpd %xmm1, %xmm2
subpd %xmm1, %xmm0
movupd %xmm0, (%r10,%rax)
movupd %xmm2, (%r10)
decl %r11d
addq $0x10, %r10
jmp 0x22b1
addl %r9d, %esi
subl %r11d, %esi
incl %r8d
jmp 0x229f
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/fft.c
// Function: tt_fft_real
int tt_fft_real(double (*out)[2], const double *in, uint N)
{
	if (N <= 1 || (N & (N-1))) {
		tt_warn("%d is not power of 2, fallback to DFT", N);
		return tt_dft_real(out, in, N);
	}

	double (*tbl)[2];
	int delta;

	tbl = get_wn_tbl(N, &delta);
	if (!tbl)
		return TT_ENOMEM;

	const int nb = __builtin_ctz(N);
	for (int i = 0; i < N ; i++) {
		out[i][0] = in[_tt_bitrev(i, nb)];
		out[i][1] = 0;
	}

	for (int i = 1; i <= nb; i++)
		fft_stage(out, i, N, tbl, delta);

	put_wn_tbl(tbl);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
cmpl $0x2, %edx
jb 0x239a
movl %ebp, %eax
shrl %eax
andl $0x55555555, %eax       # imm = 0x55555555
movl %ebp, %ecx
subl %eax, %ecx
movl $0x33333333, %eax       # imm = 0x33333333
movl %ecx, %edx
andl %eax, %edx
shrl $0x2, %ecx
andl %eax, %ecx
addl %edx, %ecx
movl %ecx, %eax
shrl $0x4, %eax
addl %ecx, %eax
andl $0xf0f0f0f, %eax        # imm = 0xF0F0F0F
imull $0x1010101, %eax, %eax  # imm = 0x1010101
shrl $0x18, %eax
cmpl $0x2, %eax
jae 0x239a
leaq 0xc(%rsp), %rsi
movl %ebp, %edi
callq 0x241f
testq %rax, %rax
je 0x240d
movq %rax, %r15
movl %ebp, %r12d
bsfl %ebp, %r13d
movq %rbx, 0x10(%rsp)
addq $0x8, %rbx
xorl %ebp, %ebp
cmpq %rbp, %r12
je 0x23cf
movl %ebp, %edi
movl %r13d, %esi
callq 0x2532
movl %eax, %eax
movsd (%r14,%rax,8), %xmm0
movsd %xmm0, -0x8(%rbx)
andq $0x0, (%rbx)
incq %rbp
addq $0x10, %rbx
jmp 0x2371
leaq 0x2f31(%rip), %rsi      # 0x52d2
leaq 0x2ed5(%rip), %rdx      # 0x527d
pushq $0x1
popq %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x258c
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1ca8
movl 0xc(%rsp), %ebp
negl %r13d
pushq $0x1
popq %r14
movq 0x10(%rsp), %rbx
leal (%r14,%r13), %eax
cmpl $0x1, %eax
je 0x2401
movq %rbx, %rdi
movl %r14d, %esi
movl %r12d, %edx
movq %r15, %rcx
movl %ebp, %r8d
callq 0x202a
incl %r14d
jmp 0x23df
movq %r15, %rdi
callq 0x2478
xorl %eax, %eax
jmp 0x2410
pushq $-0x1
popq %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/num/fft.c
// Function: get_wn_tbl
static double (*get_wn_tbl(int N, int *delta))[2]
{
	if (N > WN_PTS) {
		tt_info("Points > %d, new lookup table created.", WN_PTS);
		*delta = 1;
		return gen_wn_tbl(N);
	} else {
		*delta = WN_PTS / N;
		return wn_ftbl;
	}
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
cmpl $0x2001, %edi           # imm = 0x2001
jl 0x245f
leaq 0x2ec1(%rip), %rsi      # 0x52f7
leaq 0x2ec5(%rip), %rdx      # 0x5302
pushq $0x2
popq %rdi
movl $0x2000, %ecx           # imm = 0x2000
xorl %eax, %eax
callq 0x258c
movl $0x1, (%rbx)
movl %ebp, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1ded
movl $0x2000, %eax           # imm = 0x2000
xorl %edx, %edx
idivl %ebp
movl %eax, (%rbx)
movq 0x5ca7(%rip), %rax      # 0x8118
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/include/tt/num/complex.h
// Function: tt_complex_mul
static inline void tt_complex_mul(double *out,
		const double *in1, const double *in2)
{
	/* (a+bi)(c+di) */
	double ac = in1[0] * in2[0];
	double bd = in1[1] * in2[1];

#if 0
	/* This "smart" way is in fact slower than naive implementation */
	out[1] = (in1[0] + in1[1]) * (in2[0] + in2[1]) - ac - bd;
#else
	out[1] = in1[0] * in2[1] + in2[0] * in1[1];
#endif
	out[0] = ac - bd;
}

// Assembly:
movsd (%rsi), %xmm0
movsd 0x8(%rsi), %xmm1
movsd (%rdx), %xmm2
movsd 0x8(%rdx), %xmm3
movapd %xmm0, %xmm4
mulsd %xmm2, %xmm4
mulsd %xmm1, %xmm2
mulsd %xmm3, %xmm1
subsd %xmm1, %xmm4
mulsd %xmm3, %xmm0
addsd %xmm2, %xmm0
movsd %xmm0, 0x8(%rdi)
movsd %xmm4, (%rdi)
retq
nop
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/lib.c
// Function: tt_digits
int _tt_digits(int n)
{
	int d = 1;
	n /= 10;

	while (n) {
		n /= 10;
		d++;
	}

	return d;
}

// Assembly:
movl %edi, %eax
pushq $0x1
popq %rcx
pushq $0xa
popq %rsi
leal 0x9(%rax), %edx
cmpl $0x13, %edx
jb 0x24d7
cltd
idivl %esi
incl %ecx
jmp 0x24c8
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/lib.c
// Function: tt_digits_ll
int _tt_digits_ll(long long int n)
{
	int d = 1;
	n /= 10;

	while (n) {
		n /= 10;
		d++;
	}

	return d;
}

// Assembly:
movq %rdi, %rax
pushq $0x1
popq %rcx
pushq $0xa
popq %rsi
leaq 0x9(%rax), %rdx
cmpq $0x13, %rdx
jb 0x24f6
cqto
idivq %rsi
incl %ecx
jmp 0x24e3
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/lib.c
// Function: tt_atoi
int _tt_atoi(const char *str, int *i)
{
	const char *s = str;

	/* Check syntax */
	if (*s == '+' || *s == '-')
		s++;
	while (*s) {
		if (*s < '0' || *s > '9')
			return TT_EINVAL;
		s++;
	}

	/* XXX: check overflow/underflow */
	*i = atoi(str);
	return 0;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movzbl (%rdi), %eax
cmpl $0x2d, %eax
je 0x250d
movq %rdi, %rcx
cmpl $0x2b, %eax
jne 0x2511
leaq 0x1(%rdi), %rcx
pushq $-0x2
popq %rax
movb (%rcx), %dl
testb %dl, %dl
je 0x2527
addb $-0x3a, %dl
incq %rcx
cmpb $-0xa, %dl
jae 0x2514
jmp 0x2530
callq 0x1140
movl %eax, (%rbx)
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/lib.c
// Function: tt_bitrev
uint _tt_bitrev(uint n, int bits)
{
	uint rev = n;
	uint cnt = bits - 1;
	uint N = 1 << bits;

	for (n >>= 1; n; n >>= 1) {
		rev <<= 1;
		rev |= (n & 1);
		cnt--;
	}

	rev <<= cnt;
	rev &= (N - 1);

	return rev;
}

// Assembly:
leal -0x1(%rsi), %ecx
movl %edi, %eax
cmpl $0x2, %eax
jb 0x254a
shrl %eax
movl %eax, %edx
andl $0x1, %edx
leal (%rdx,%rdi,2), %edi
decl %ecx
jmp 0x2537
shll %cl, %edi
pushq $-0x1
popq %rax
movl %esi, %ecx
shll %cl, %eax
notl %eax
andl %edi, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/log.c
// Function: tt_log_set_level
int tt_log_set_level(int level)
{
	tt_assert(level >= 0 && level < TT_LOG_MAX);

	int old_level = __level;
	__level = level;

	return old_level;
}

// Assembly:
cmpl $0x4, %edi
jae 0x27c6
movl 0x5909(%rip), %eax      # 0x80c8
movl %edi, 0x5903(%rip)      # 0x80c8
retq
pushq %rax
leaq 0x2c11(%rip), %rsi      # 0x53df
leaq 0x29b7(%rip), %rdx      # 0x518c
leaq 0x2bf2(%rip), %rcx      # 0x53ce
pushq $0x1d
popq %r8
xorl %edi, %edi
xorl %eax, %eax
callq 0x258c
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/log.c
// Function: tt_log_set_fd
void tt_log_set_fd(int fd)
{
	if (fd >= 0) {
		__fd = fd;
	} else if (__fd >= 0) {
		tt_log_set_target(TT_LOG_TARGET_STDERR);
		close(__fd);
		__fd = -1;
	}
}

// Assembly:
testl %edi, %edi
jns 0x2810
movl 0x58d4(%rip), %edi      # 0x80cc
testl %edi, %edi
js 0x2816
pushq %rax
andl $0x0, 0x591c(%rip)      # 0x8120
callq 0x10c0
pushq $-0x1
popq %rdi
addq $0x8, %rsp
movl %edi, 0x58b6(%rip)      # 0x80cc
retq
nop
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/key.c
// Function: tt_key_select
int _tt_key_select(struct tt_key *num)
{
	if (!num->swap)
		num->swap = tt_swap_select(num->size);
	if (!num->cmp) {
		tt_error("No compare routine");
		return TT_EINVAL;
	}
	num->_set = tt_set_select(num->size);

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpq $0x0, 0x10(%rdi)
jne 0x286f
movl (%rbx), %eax
decl %eax
cmpl $0x7, %eax
ja 0x284c
movl %eax, %eax
leaq 0x2b64(%rip), %rcx      # 0x539c
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
leaq 0x553a(%rip), %rcx      # 0x7d80
movq (%rcx,%rax,8), %r14
jmp 0x285a
leaq 0x13f(%rip), %r14       # 0x2992
leaq 0x2c85(%rip), %rdx      # 0x54df
leaq 0x2c40(%rip), %rsi      # 0x54a1
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
movq %r14, 0x10(%rbx)
cmpq $0x0, 0x8(%rbx)
je 0x28b7
movl (%rbx), %eax
decl %eax
cmpl $0x7, %eax
ja 0x2939
leaq 0x2af2(%rip), %rcx      # 0x537c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x2c52(%rip), %rsi      # 0x54ec
leaq 0x2c59(%rip), %rdx      # 0x54fa
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
leaq 0x122(%rip), %rax       # 0x29d4
jmp 0x2958
leaq 0x2bc1(%rip), %rsi      # 0x547f
leaq 0x2bc9(%rip), %rdx      # 0x548e
xorl %edi, %edi
xorl %eax, %eax
callq 0x258c
pushq $-0x2
popq %rax
jmp 0x295e
leaq 0x2c0f(%rip), %rsi      # 0x54ec
leaq 0x2c2b(%rip), %rdx      # 0x550f
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
leaq 0xeb(%rip), %rax        # 0x29e0
jmp 0x2958
leaq 0x2bee(%rip), %rsi      # 0x54ec
leaq 0x2bff(%rip), %rdx      # 0x5504
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
leaq 0xc3(%rip), %rax        # 0x29d9
jmp 0x2958
leaq 0x2bcd(%rip), %rsi      # 0x54ec
leaq 0x2bf4(%rip), %rdx      # 0x551a
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
leaq 0xae(%rip), %rax        # 0x29e5
jmp 0x2958
leaq 0x2bac(%rip), %rsi      # 0x54ec
leaq 0x2bde(%rip), %rdx      # 0x5525
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x258c
leaq 0x94(%rip), %rax        # 0x29ec
movq %rax, 0x18(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/key.c
// Function: tt_swap_general
static void tt_swap_general(const struct tt_key *num, void *v1, void *v2)
{
	int size4 = num->size / 4;
	int size1 = num->size % 4;

	while (size4--) {
		int32_t tmp = *(int32_t *)v1;
		*(int32_t *)v1 = *(int32_t *)v2;
		*(int32_t *)v2 = tmp;
		v1 += 4;
		v2 += 4;
	}

	while (size1--) {
		int8_t tmp = *(int8_t *)v1;
		*(int8_t *)v1 = *(int8_t *)v2;
		*(int8_t *)v2 = tmp;
		v1++;
		v2++;
	}
}

// Assembly:
movq %rdx, %rcx
movl (%rdi), %eax
pushq $0x4
popq %rdi
cltd
idivl %edi
subl $0x1, %eax
jb 0x29b6
movl (%rsi), %edi
movl (%rcx), %r8d
movl %r8d, (%rsi)
movl %edi, (%rcx)
addq $0x4, %rsi
addq $0x4, %rcx
jmp 0x299d
movl %edx, %eax
xorl %edx, %edx
cmpl %edx, %eax
je 0x29d3
movb (%rsi,%rdx), %dil
movb (%rcx,%rdx), %r8b
movb %r8b, (%rsi,%rdx)
movb %dil, (%rcx,%rdx)
incq %rdx
jmp 0x29ba
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/round.c
// Function: tt_set_rounding
int tt_set_rounding(uint rnd)
{
	tt_assert(rnd < TT_ROUND_MAX);

	int r = _rounding;

	if (rnd == 0)
		_rounding = TT_ROUND_HALF_EVEN;
	else
		_rounding = rnd;

	return r;
}

// Assembly:
cmpl $0x4, %edi
jae 0x2a18
movl 0x56c5(%rip), %eax      # 0x80d0
cmpl $0x1, %edi
adcl $0x0, %edi
movl %edi, 0x56b9(%rip)      # 0x80d0
retq
pushq %rax
leaq 0x2b11(%rip), %rsi      # 0x5531
leaq 0x2765(%rip), %rdx      # 0x518c
leaq 0x2b13(%rip), %rcx      # 0x5541
pushq $0xd
popq %r8
xorl %edi, %edi
xorl %eax, %eax
callq 0x258c
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/rand.c
// Function: _tt_srand
static void __tt_srand(uint seed)
{
	_sv[0] = seed;
	for (int i = 1; i < MT_CNT; i++)
		_sv[i] = 1812433253ULL * (_sv[i-1] ^ (_sv[i-1] >> 30)) + i;
	_si = MT_CNT;
}

// Assembly:
movl %edi, 0x56c7(%rip)      # 0x8160
pushq $0x1
popq %rax
leaq 0x56bd(%rip), %rcx      # 0x8160
cmpq $0x270, %rax            # imm = 0x270
je 0x2ac3
movl %edi, %edx
shrl $0x1e, %edx
xorl %edi, %edx
imull $0x6c078965, %edx, %edx # imm = 0x6C078965
leal (%rax,%rdx), %edi
movl %edi, (%rcx,%rax,4)
incq %rax
jmp 0x2aa3
movl $0x270, 0x5607(%rip)    # imm = 0x270
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/rand.c
// Function: tt_rand
uint _tt_rand(void)
{
	uint r;

	pthread_mutex_lock(&_mtx);
	if (_si == -1)
		__tt_srand(clock());
	r = __tt_rand();
	pthread_mutex_unlock(&_mtx);

	return r;
}

// Assembly:
pushq %rbx
leaq 0x565a(%rip), %rdi      # 0x8130
callq 0x1160
movl 0x55f3(%rip), %eax      # 0x80d4
cmpl $-0x1, %eax
jne 0x2af8
callq 0x1080
movl %eax, %edi
callq 0x2a93
movl 0x55dc(%rip), %eax      # 0x80d4
cmpl $0x270, %eax            # imm = 0x270
jne 0x2b51
xorl %edx, %edx
leaq 0x5658(%rip), %rcx      # 0x8160
movl $0x80000000, %esi       # imm = 0x80000000
leaq 0x2c98(%rip), %rax      # 0x57ac
cmpq $0xe3, %rdx
je 0x2b65
movl (%rcx,%rdx,4), %edi
andl %esi, %edi
movl 0x4(%rcx,%rdx,4), %r8d
movl %r8d, %r9d
andl $0x7ffffffe, %r9d       # imm = 0x7FFFFFFE
orl %edi, %r9d
shrl %r9d
andl $0x1, %r8d
movl (%rax,%r8,4), %edi
xorl 0x634(%rcx,%rdx,4), %edi
xorl %r9d, %edi
movl %edi, (%rcx,%rdx,4)
incq %rdx
jmp 0x2b14
movslq %eax, %rcx
leaq 0x5605(%rip), %rdx      # 0x8160
movl (%rdx,%rcx,4), %ecx
incl %eax
jmp 0x2be6
xorl %edx, %edx
movl $0x80000000, %esi       # imm = 0x80000000
cmpq $0x18c, %rdx            # imm = 0x18C
je 0x2bb0
movl 0x38c(%rcx,%rdx,4), %edi
andl %esi, %edi
movl 0x390(%rcx,%rdx,4), %r8d
movl %r8d, %r9d
andl $0x7ffffffe, %r9d       # imm = 0x7FFFFFFE
orl %edi, %r9d
andl $0x1, %r8d
movl (%rax,%r8,4), %edi
xorl (%rcx,%rdx,4), %edi
shrl %r9d
xorl %r9d, %edi
movl %edi, 0x38c(%rcx,%rdx,4)
incq %rdx
jmp 0x2b6c
movl $0x80000000, %edx       # imm = 0x80000000
andl 0x5f61(%rip), %edx      # 0x8b1c
movl 0x559f(%rip), %ecx      # 0x8160
movl %ecx, %esi
andl $0x7ffffffe, %esi       # imm = 0x7FFFFFFE
orl %edx, %esi
movl %ecx, %edx
andl $0x1, %edx
movl (%rax,%rdx,4), %eax
xorl 0x5bb7(%rip), %eax      # 0x8790
shrl %esi
xorl %esi, %eax
movl %eax, 0x5f39(%rip)      # 0x8b1c
pushq $0x1
popq %rax
movl %eax, 0x54e8(%rip)      # 0x80d4
movl %ecx, %eax
shrl $0xb, %eax
xorl %ecx, %eax
movl %eax, %ecx
shll $0x7, %ecx
andl $0x9d2c5680, %ecx       # imm = 0x9D2C5680
xorl %eax, %ecx
movl %ecx, %eax
shll $0xf, %eax
andl $0xefc60000, %eax       # imm = 0xEFC60000
xorl %ecx, %eax
movl %eax, %ebx
shrl $0x12, %ebx
xorl %eax, %ebx
leaq 0x5516(%rip), %rdi      # 0x8130
callq 0x1110
movl %ebx, %eax
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/sort.c
// Function: tt_sort
int tt_sort(struct tt_sort_input *input)
{
	tt_assert(input->alg >= 0 && input->alg < TT_SORT_MAX);

	_tt_key_select(&input->num);

	struct tt_sort_stat stat;
	memset(&stat, 0, sizeof(struct tt_sort_stat));
	stat.tail = input->count - 1;	/* Only for quick sort */
	int ret = tt_sort_internal[input->alg](input, &stat);

	tt_debug("time: %u, space: %u", stat.time, stat.space);

	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
cmpl $0x4, 0x2c(%rdi)
jae 0x2c8a
movq %rdi, %rbx
callq 0x2818
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movl 0x28(%rbx), %eax
decl %eax
movl %eax, 0x10(%r14)
movl 0x2c(%rbx), %eax
leaq 0x516a(%rip), %rcx      # 0x7dc0
movq %rbx, %rdi
movq %r14, %rsi
callq *(%rcx,%rax,8)
movl %eax, %ebx
movl (%r14), %ecx
movl 0x4(%r14), %r8d
leaq 0x28e5(%rip), %rsi      # 0x5554
leaq 0x28f8(%rip), %rdx      # 0x556e
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x28c3(%rip), %rsi      # 0x5554
leaq 0x24f4(%rip), %rdx      # 0x518c
leaq 0x28bd(%rip), %rcx      # 0x555c
xorl %edi, %edi
movl $0x131, %r8d            # imm = 0x131
xorl %eax, %eax
callq 0x258c
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/sort.c
// Function: tt_sort_insert
static int tt_sort_insert(struct tt_sort_input *in, struct tt_sort_stat *stat)
{
	/* Allocate buffer for one temporary element */
	char tmp[in->num.size] _tt_align(8);
	stat->space += 1;

	void *p = in->data;
	for (int i = 1; i < in->count; i++) {
		p += in->num.size;
		/* tmp = data[i] */
		in->num._set(&in->num, tmp, p);
		/* Insert data[i] into sorted list data[0] ~ data[i-1] */
		void *q = p - in->num.size;
		for (int j = i - 1; j >= 0; q -= in->num.size, j--) {
			stat->time++;	/* Compare */
			/* if (tmp < data[j]) */
			if (in->num.cmp(&in->num, tmp, q) < 0) {
				/* data[j+1] = data[j] */
				in->num._set(&in->num, q + in->num.size, q);
				stat->time++;	/* Set */
			} else {
				break;
			}
		}
		/* data[j+1] = tmp */
		in->num._set(&in->num, q + in->num.size, tmp);
		stat->time++;	/* Set */
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %eax
movq %rsp, %r15
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
incl 0x4(%rsi)
movq 0x20(%rdi), %r13
pushq $0x1
popq %rax
cmpl 0x28(%r14), %eax
jae 0x2d63
movl %eax, -0x2c(%rbp)
movslq (%r14), %rax
addq %rax, %r13
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *0x18(%r14)
movq %r13, -0x38(%rbp)
movl -0x2c(%rbp), %r12d
movslq (%r14), %rcx
subq %rcx, %r13
testl %r12d, %r12d
jle 0x2d43
incl (%rbx)
movq %r14, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq *0x8(%r14)
movl (%r14), %ecx
testl %eax, %eax
jns 0x2d43
movslq %ecx, %rsi
addq %r13, %rsi
movq %r14, %rdi
movq %r13, %rdx
callq *0x18(%r14)
incl (%rbx)
decl %r12d
jmp 0x2d0b
movslq %ecx, %rax
addq %rax, %r13
movq %r14, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq *0x18(%r14)
incl (%rbx)
movl -0x2c(%rbp), %eax
incl %eax
movq -0x38(%rbp), %r13
jmp 0x2ce7
xorl %eax, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/sort.c
// Function: tt_sort_heap
static int tt_sort_heap(struct tt_sort_input *in, struct tt_sort_stat *stat)
{
	struct tt_heap heap = {
		.num	= in->num,
		.data	= in->data,
		.cap	= in->count,
		.htype	= TT_HEAP_MAX,
	};

	int ret = tt_heap_init(&heap);
	if (ret)
		return ret;

	/* Build heap */
	tt_heap_build(&heap, heap.cap);

	void *head = heap.data;
	heap.__heaplen--;
	void *end = sort_ptr(&heap, heap.__heaplen);
	for (; heap.__heaplen >= 1; heap.__heaplen--) {
		/* NOTE: Heap length is __heaplen+1 */
		/* Swap [0] with [__heaplen] */
		heap.num.swap(&heap.num, head, end);
		end -= heap.num.size;
		/* [__heaplen] is OK, let's heapify [0] ~ [__heaplen-1] */
		tt_heap_heapify(&heap, 0);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movq %rsp, %rax
movaps %xmm1, 0x10(%rax)
movaps %xmm0, (%rax)
movq 0x20(%rdi), %rcx
movq %rcx, 0x20(%rax)
movl 0x28(%rdi), %ecx
movl %ecx, 0x28(%rax)
andq $0x0, 0x2c(%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rax)
movq %rax, %rdi
callq 0x3861
movl %eax, %ebp
testl %eax, %eax
je 0x2f63
movl %ebp, %eax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rsp, %rbx
movl 0x28(%rbx), %ebp
movl %ebp, 0x30(%rbx)
shrl %ebp
testl %ebp, %ebp
jle 0x2f7f
decl %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq *0x38(%rsp)
jmp 0x2f6e
movq %rsp, %rbx
movq 0x20(%rbx), %r14
movl 0x30(%rbx), %eax
decl %eax
movl %eax, 0x30(%rbx)
movl (%rbx), %r15d
imull %eax, %r15d
addq %r14, %r15
xorl %ebp, %ebp
testl %eax, %eax
je 0x2f56
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq *0x10(%rsp)
movslq (%rsp), %rax
subq %rax, %r15
movq %rbx, %rdi
xorl %esi, %esi
callq *0x38(%rsp)
movl 0x30(%rsp), %eax
decl %eax
movl %eax, 0x30(%rsp)
jmp 0x2f9a
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_init
int tt_stack_init(struct tt_stack *stack)
{
	if (stack->cap) {
		/* Allocate fixed array */
		stack->_data = malloc(stack->esize * stack->cap);
		if (!stack->_data)
			return TT_ENOMEM;
		stack->_top = stack->_data;
		stack->_push = tt_stack_push_array;
		stack->_pop = tt_stack_pop_array;
		tt_debug("Stack created, max elements = %u", stack->cap);
	} else {
		/* XXX: Allocate tt_list struct before element,
		 * the stack element only ensures 8-bytes alignment
		 */
		tt_assert(sizeof(struct tt_list) % 8 == 0);
		/* Initialize list head */
		tt_list_init(&stack->_head);
		stack->_push = tt_stack_push_list;
		stack->_pop = tt_stack_pop_list;
		tt_debug("Dynamic stack created");
	}

	stack->_count = 0;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %ebp
testl %ebp, %ebp
je 0x330e
movl 0x4(%rbx), %edi
imull %ebp, %edi
callq 0x1120
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x3350
movq %rax, 0x18(%rbx)
leaq 0x77(%rip), %rax        # 0x335a
movq %rax, 0x20(%rbx)
leaq 0xae(%rip), %rax        # 0x339c
movq %rax, 0x28(%rbx)
leaq 0x2289(%rip), %rsi      # 0x5582
leaq 0x2290(%rip), %rdx      # 0x5590
pushq $0x3
popq %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x258c
jmp 0x3348
leaq 0x10(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %rax, 0x18(%rbx)
leaq 0xc2(%rip), %rax        # 0x33e3
movq %rax, 0x20(%rbx)
leaq 0x11a(%rip), %rax       # 0x3446
movq %rax, 0x28(%rbx)
leaq 0x224b(%rip), %rsi      # 0x5582
leaq 0x2273(%rip), %rdx      # 0x55b1
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
andl $0x0, 0x8(%rbx)
xorl %eax, %eax
jmp 0x3353
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_push_array
static int tt_stack_push_array(struct tt_stack *stack, const void *e)
{
	if (stack->_count >= stack->cap) {
		tt_debug("Overflow");
		return TT_EOVERFLOW;
	}
	memcpy(stack->_top, e, stack->esize);
	stack->_top += stack->esize;

	stack->_count++;
	return 0;
}

// Assembly:
pushq %rbx
movl 0x8(%rdi), %eax
cmpl (%rdi), %eax
jae 0x337f
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movl 0x4(%rbx), %edx
callq 0x1100
movl 0x4(%rbx), %eax
addq %rax, 0x18(%rbx)
incl 0x8(%rbx)
xorl %eax, %eax
jmp 0x339a
leaq 0x225f(%rip), %rsi      # 0x55e5
leaq 0x226c(%rip), %rdx      # 0x55f9
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
pushq $-0x3
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_pop_array
static int tt_stack_pop_array(struct tt_stack *stack, void *e)
{
	if (stack->_count == 0) {
		tt_debug("Underflow");
		return TT_EUNDERFLOW;
	}
	stack->_top -= stack->esize;
	memcpy(e, stack->_top, stack->esize);

	stack->_count--;
	return 0;
}

// Assembly:
pushq %rbx
cmpl $0x0, 0x8(%rdi)
je 0x33c6
movq %rdi, %rbx
movl 0x4(%rdi), %edx
movq 0x18(%rdi), %rax
subq %rdx, %rax
movq %rax, 0x18(%rdi)
movq %rsi, %rdi
movq %rax, %rsi
callq 0x1100
decl 0x8(%rbx)
xorl %eax, %eax
jmp 0x33e1
leaq 0x2235(%rip), %rsi      # 0x5602
leaq 0x2241(%rip), %rdx      # 0x5615
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
pushq $-0x4
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_push_list
static int tt_stack_push_list(struct tt_stack *stack, const void *e)
{
	void *se = malloc(sizeof(struct tt_list) + stack->esize);
	if (!se)
		return TT_EOVERFLOW;
	memcpy(se + sizeof(struct tt_list), e, stack->esize);
	tt_list_add(se, &stack->_head);

	stack->_count++;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %r12d
leaq 0x10(%r12), %rdi
callq 0x1120
testq %rax, %rax
je 0x3437
movq %rax, %r15
movq %rax, %rdi
addq $0x10, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1100
leaq 0x10(%rbx), %rax
movq 0x10(%rbx), %rcx
movq %r15, 0x10(%rbx)
movq %rax, 0x8(%r15)
movq %rcx, (%r15)
movq %r15, 0x8(%rcx)
incl 0x8(%rbx)
xorl %eax, %eax
jmp 0x343a
pushq $-0x3
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_pop_list
static int tt_stack_pop_list(struct tt_stack *stack, void *e)
{
	if (stack->_count == 0) {
		tt_debug("Underflow");
		return TT_EUNDERFLOW;
	}
	void *top = stack->_head.prev;
	memcpy(e, top + sizeof(struct tt_list), stack->esize);
	tt_list_del(top);
	free(top);

	stack->_count--;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x8(%rdi)
je 0x3486
movq %rdi, %rbx
movq 0x10(%rdi), %r14
leaq 0x10(%r14), %rax
movl 0x4(%rdi), %edx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x1100
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r14, %rdi
callq 0x1030
decl 0x8(%rbx)
xorl %eax, %eax
jmp 0x34a1
leaq 0x2192(%rip), %rsi      # 0x561f
leaq 0x2181(%rip), %rdx      # 0x5615
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
pushq $-0x4
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/stack.c
// Function: tt_stack_free
void tt_stack_free(struct tt_stack *stack)
{
	if (stack->cap) {
		/* Free the array */
		free(stack->_data);
		stack->_data = NULL;
	} else {
		/* Free the list */
		struct tt_list *pos, *tmp;
		tt_list_for_each_safe(pos, tmp, &stack->_head)
			free(pos);
	}

	tt_debug("Stack destroyed");
	stack->_count = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
cmpl $0x0, (%rdi)
je 0x34e8
movq (%r14), %rdi
callq 0x1030
andq $0x0, (%r14)
leaq 0x20fa(%rip), %rsi      # 0x55c7
leaq 0x2101(%rip), %rdx      # 0x55d5
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
andl $0x0, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq 0x18(%rbx), %rdi
cmpq %r14, %rdi
je 0x34c6
movq 0x8(%rdi), %r15
callq 0x1030
movq %r15, %rdi
jmp 0x34ec
nop
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_init
int tt_queue_init(struct tt_queue *queue)
{
	if (queue->cap) {
		/* Allocate fixed array */
		queue->_data = malloc(queue->esize * queue->cap);
		if (!queue->_data)
			return TT_ENOMEM;
		queue->_qhead = queue->_qtail = queue->_data;
		queue->_enque = tt_queue_enque_array;
		queue->_deque = tt_queue_deque_array;
		tt_debug("Queue created, max elements = %u", queue->cap);
	} else {
		/* XXX: Allocate tt_list struct before element,
		 * the queue element only ensures 8-bytes alignment
		 */
		tt_assert(sizeof(struct tt_list) % 8 == 0);
		/* Initialize list head */
		tt_list_init(&queue->_head);
		queue->_enque = tt_queue_enque_list;
		queue->_deque = tt_queue_deque_list;
		tt_debug("Dynamic queue created");
	}

	queue->_count = 0;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %ebp
testl %ebp, %ebp
je 0x355a
movl 0x4(%rbx), %edi
imull %ebp, %edi
callq 0x1120
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x359c
movq %rax, 0x20(%rbx)
movq %rax, 0x18(%rbx)
leaq 0x77(%rip), %rax        # 0x35a6
movq %rax, 0x28(%rbx)
leaq 0xc5(%rip), %rax        # 0x35ff
movq %rax, 0x30(%rbx)
leaq 0x20ec(%rip), %rsi      # 0x5631
leaq 0x20f3(%rip), %rdx      # 0x563f
pushq $0x3
popq %rdi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x258c
jmp 0x3594
leaq 0x10(%rbx), %rax
movq %rax, 0x10(%rbx)
movq %rax, 0x18(%rbx)
leaq 0xf0(%rip), %rax        # 0x365d
movq %rax, 0x28(%rbx)
leaq 0x148(%rip), %rax       # 0x36c0
movq %rax, 0x30(%rbx)
leaq 0x20ae(%rip), %rsi      # 0x5631
leaq 0x20d6(%rip), %rdx      # 0x5660
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
andl $0x0, 0x8(%rbx)
xorl %eax, %eax
jmp 0x359f
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_enque_array
static int tt_queue_enque_array(struct tt_queue *queue, const void *e)
{
	if (queue->_count >= queue->cap) {
		tt_debug("Overflow");
		return TT_EOVERFLOW;
	}
	memcpy(queue->_qtail, e, queue->esize);
	queue->_qtail += queue->esize;
	/* Wrap to head */
	if (queue->_qtail >= queue->_data + queue->cap * queue->esize)
		queue->_qtail = queue->_data;

	queue->_count++;
	return 0;
}

// Assembly:
pushq %rbx
movl 0x8(%rdi), %eax
cmpl (%rdi), %eax
jae 0x35e2
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
movl 0x4(%rbx), %edx
callq 0x1100
movl 0x4(%rbx), %eax
movl (%rbx), %ecx
imull %eax, %ecx
addq 0x20(%rbx), %rax
movq 0x10(%rbx), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
cmovaeq %rdx, %rax
movq %rax, 0x20(%rbx)
incl 0x8(%rbx)
xorl %eax, %eax
jmp 0x35fd
leaq 0x20ab(%rip), %rsi      # 0x5694
leaq 0x2009(%rip), %rdx      # 0x55f9
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
pushq $-0x3
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_deque_array
static int tt_queue_deque_array(struct tt_queue *queue, void *e)
{
	if (queue->_count == 0) {
		tt_debug("Underflow");
		return TT_EUNDERFLOW;
	}
	memcpy(e, queue->_qhead, queue->esize);
	queue->_qhead += queue->esize;
	/* Wrap to head */
	if (queue->_qhead >= queue->_data + queue->cap * queue->esize)
		queue->_qhead = queue->_data;

	queue->_count--;
	return 0;
}

// Assembly:
pushq %rbx
cmpl $0x0, 0x8(%rdi)
je 0x3640
movq %rdi, %rbx
movq 0x18(%rdi), %rax
movl 0x4(%rdi), %edx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x1100
movl 0x4(%rbx), %eax
movl (%rbx), %ecx
imull %eax, %ecx
addq 0x18(%rbx), %rax
movq 0x10(%rbx), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
cmovaeq %rdx, %rax
movq %rax, 0x18(%rbx)
decl 0x8(%rbx)
xorl %eax, %eax
jmp 0x365b
leaq 0x2062(%rip), %rsi      # 0x56a9
leaq 0x1fc7(%rip), %rdx      # 0x5615
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
pushq $-0x4
popq %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_deque_list
static int tt_queue_deque_list(struct tt_queue *queue, void *e)
{
	if (queue->_count == 0) {
		tt_debug("Underflow");
		return TT_EUNDERFLOW;
	}
	void *qe = queue->_head.next;
	memcpy(e, qe + sizeof(struct tt_list), queue->esize);
	tt_list_del(qe);
	free(qe);

	queue->_count--;
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, 0x8(%rdi)
je 0x3700
movq %rdi, %rbx
movq 0x18(%rdi), %r14
leaq 0x10(%r14), %rax
movl 0x4(%rdi), %edx
movq %rsi, %rdi
movq %rax, %rsi
callq 0x1100
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r14, %rdi
callq 0x1030
decl 0x8(%rbx)
xorl %eax, %eax
jmp 0x371b
leaq 0x1fb7(%rip), %rsi      # 0x56be
leaq 0x1f07(%rip), %rdx      # 0x5615
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
pushq $-0x4
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/queue.c
// Function: tt_queue_free
void tt_queue_free(struct tt_queue *queue)
{
	if (queue->cap) {
		/* Free the array */
		free(queue->_data);
		queue->_data = NULL;
	} else {
		/* Free the list */
		struct tt_list *pos, *tmp;
		tt_list_for_each_safe(pos, tmp, &queue->_head)
			free(pos);
	}

	tt_debug("Queue destroyed");
	queue->_count = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %r14
cmpl $0x0, (%rdi)
je 0x3762
movq (%r14), %rdi
callq 0x1030
andq $0x0, (%r14)
leaq 0x1f2f(%rip), %rsi      # 0x5676
leaq 0x1f36(%rip), %rdx      # 0x5684
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x258c
andl $0x0, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
movq 0x18(%rbx), %rdi
cmpq %r14, %rdi
je 0x3740
movq 0x8(%rdi), %r15
callq 0x1030
movq %r15, %rdi
jmp 0x3766
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/heap.c
// Function: tt_heap_adjust
int tt_heap_adjust(struct tt_heap *heap, int index, const void *v)
{
	tt_assert(index < heap->__heaplen);
	/* Verify new value
	 * max-heap: increase, min-heap: decrease
	 */
	int d = heap->num.cmp(&heap->num, heap_ptr(heap, index), v);
	if (d == 0)
		return 0;
	if ((heap->htype == TT_HEAP_MAX && d > 0) ||
			(heap->htype == TT_HEAP_MIN && d < 0)) {
		tt_error("Invalid new value");
		return TT_EINVAL;
	}

	heap->_adjust(heap, index);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl %esi, 0x30(%rdi)
jbe 0x37f1
movl %esi, %ebp
movq %rdi, %rbx
movslq (%rdi), %rax
movslq %esi, %rsi
imulq %rax, %rsi
addq 0x20(%rdi), %rsi
callq *0x8(%rdi)
xorl %r14d, %r14d
testl %eax, %eax
je 0x37e9
movl 0x2c(%rbx), %ecx
testl %ecx, %ecx
sete %dl
testl %eax, %eax
setg %sil
testb %dl, %sil
jne 0x37c4
cmpl $0x1, %ecx
setne %cl
testl %eax, %eax
setns %al
orb %cl, %al
jne 0x37e1
leaq 0x1f07(%rip), %rsi      # 0x56d2
leaq 0x1f21(%rip), %rdx      # 0x56f3
xorl %edi, %edi
xorl %eax, %eax
callq 0x258c
pushq $-0x2
popq %r14
jmp 0x37e9
movq %rbx, %rdi
movl %ebp, %esi
callq *0x40(%rbx)
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1eda(%rip), %rsi      # 0x56d2
leaq 0x198d(%rip), %rdx      # 0x518c
leaq 0x1edb(%rip), %rcx      # 0x56e1
pushq $0x5f
popq %r8
xorl %edi, %edi
xorl %eax, %eax
callq 0x258c
callq 0x1050
// File: /workspace/github_c_makefile_star2_O2/cyb70289[P]tt/src/common/heap.c
// Function: tt_heap_extract
int tt_heap_extract(struct tt_heap *heap, void *v)
{
	if (heap->__heaplen == 0)
		return TT_EUNDERFLOW;
	heap->num._set(&heap->num, v, heap->data);

	heap->__heaplen--;
	if (heap->__heaplen) {
		heap->num._set(&heap->num, heap->data,
				heap_ptr(heap, heap->__heaplen));
		tt_heap_heapify(heap, 0);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpl $0x0, 0x30(%rdi)
je 0x3851
movq %rdi, %rbx
movq 0x20(%rdi), %rdx
callq *0x18(%rdi)
movl 0x30(%rbx), %edx
decl %edx
movl %edx, 0x30(%rbx)
je 0x3856
movq 0x20(%rbx), %rsi
imull (%rbx), %edx
addq %rsi, %rdx
movq %rbx, %rdi
callq *0x18(%rbx)
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq *0x38(%rbx)
jmp 0x3858
pushq $-0x4
popq %rbp
jmp 0x3858
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq