// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movl %esi, 0x4c(%rsp)
movl %edx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
movl %r8d, 0x3c(%rsp)
movl 0x4c(%rsp), %ecx
subl $0x1, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, 0x38(%rsp)
movl 0x3c(%rsp), %eax
movl 0x48(%rsp), %edx
movl 0x4c(%rsp), %ecx
shrl %cl, %edx
movl %edx, %ecx
imull %ecx, %eax
movl %eax, 0x1c(%rsp)
movl 0x38(%rsp), %eax
movl %eax, 0x34(%rsp)
movl $0x0, 0x18(%rsp)
movl 0x18(%rsp), %eax
movl 0x48(%rsp), %edx
movl 0x4c(%rsp), %ecx
shrl %cl, %edx
movl %edx, %ecx
cmpl %ecx, %eax
jae 0x2bae
movl $0x0, 0x14(%rsp)
movl $0x0, 0x10(%rsp)
movl 0x10(%rsp), %eax
cmpl 0x38(%rsp), %eax
jge 0x2b92
movq 0x50(%rsp), %rdi
movslq 0x34(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movq 0x50(%rsp), %rsi
movslq 0x34(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movq 0x40(%rsp), %rdx
movslq 0x14(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdx
callq 0x3280
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
movl 0x1c(%rsp), %eax
addl 0x14(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x10(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x2b2c
movl 0x38(%rsp), %eax
addl 0x34(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x2b04
movl $0x0, 0x34(%rsp)
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl 0x48(%rsp), %edx
movl 0x4c(%rsp), %ecx
shrl %cl, %edx
movl %edx, %ecx
cmpl %ecx, %eax
jae 0x2cb1
movl $0x0, 0x8(%rsp)
movl 0x8(%rsp), %eax
cmpl 0x38(%rsp), %eax
jge 0x2c95
leaq 0x20(%rsp), %rdi
movq 0x50(%rsp), %rsi
movslq 0x34(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movq 0x50(%rsp), %rdx
movl 0x34(%rsp), %eax
addl 0x38(%rsp), %eax
cltq
shlq $0x4, %rax
addq %rax, %rdx
callq 0x3310
movq 0x50(%rsp), %rdi
movl 0x34(%rsp), %eax
addl 0x38(%rsp), %eax
cltq
shlq $0x4, %rax
addq %rax, %rdi
movq 0x50(%rsp), %rsi
movslq 0x34(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rsi
movq 0x50(%rsp), %rdx
movl 0x34(%rsp), %eax
addl 0x38(%rsp), %eax
cltq
shlq $0x4, %rax
addq %rax, %rdx
callq 0x3360
movq 0x50(%rsp), %rdi
movslq 0x34(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rdi
leaq 0x20(%rsp), %rsi
callq 0x3240
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
movl 0x8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x2bde
movl 0x38(%rsp), %eax
addl 0x34(%rsp), %eax
movl %eax, 0x34(%rsp)
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x2bbe
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)