// File: /workspace/github_c_makefile_star2_O0/intel[P]pf-bb-config/vrb1/vrb1_cfg_app.c
// Function: vrb_fft_win_check
void
vrb_fft_win_check(int16_t *gTDWinCoff, hw_device *accel_pci_dev)
{
	int16_t i, offset_p = 0, offset_i, fft_sz, lut_sz, wrap1, wrap2, win_start, win_size, win;

	for (fft_sz = 32; fft_sz <= 2048; fft_sz *= 2) {
		/*
		 * Manage FFT wrap for negative and positive halves.
		 * Each table width is fft_sz / 2.
		 */
		lut_sz = fft_sz / 2;
		wrap1 = lut_sz / 2 * 3;
		wrap2 = lut_sz / 2;
		for (win = 0;  win < BB_ACC_MAX_WIN; win++) {
			offset_i = BB_ACC_MAX_WIN * offset_p + win * lut_sz;
			win_size = 0;
			win_start = 0;
			/* Check non null value in LUT for size and start of window shape. */
			for (i = 0; i < lut_sz; i++) {
				if (gTDWinCoff[offset_i + ((wrap1 - i) % lut_sz)] > 0) {
					win_size++;
					win_start = wrap2 - i;
				}
			}
			win_size = MAX(1, win_size);
			if (fft_sz == 2048) {
				accel_pci_dev->fft_win_size[win] = win_size;
				accel_pci_dev->fft_win_start[win] = win_start;
			}
			if ((win == 0) && (fft_sz == 2048))
				LOG(INFO, "  FFT Size %d Window %d Size %d Start %d",
						fft_sz, win, win_size, win_start);
		}
		offset_p += lut_sz;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw $0x0, -0x14(%rbp)
movw $0x20, -0x18(%rbp)
movswl -0x18(%rbp), %eax
cmpl $0x800, %eax            # imm = 0x800
jg 0x13d74
movswl -0x18(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, -0x1a(%rbp)
movswl -0x1a(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
imull $0x3, %eax, %eax
movw %ax, -0x1c(%rbp)
movswl -0x1a(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, -0x1e(%rbp)
movw $0x0, -0x24(%rbp)
movswl -0x24(%rbp), %eax
cmpl $0x10, %eax
jge 0x13d57
movswl -0x14(%rbp), %eax
shll $0x4, %eax
movswl -0x24(%rbp), %ecx
movswl -0x1a(%rbp), %edx
imull %edx, %ecx
addl %ecx, %eax
movw %ax, -0x16(%rbp)
movw $0x0, -0x22(%rbp)
movw $0x0, -0x20(%rbp)
movw $0x0, -0x12(%rbp)
movswl -0x12(%rbp), %eax
movswl -0x1a(%rbp), %ecx
cmpl %ecx, %eax
jge 0x13c90
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movswl -0x16(%rbp), %ecx
movswl -0x1c(%rbp), %eax
movswl -0x12(%rbp), %edx
subl %edx, %eax
movswl -0x1a(%rbp), %esi
cltd
idivl %esi
movq -0x30(%rbp), %rax
addl %edx, %ecx
movslq %ecx, %rcx
movswl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
jle 0x13c80
movw -0x22(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x22(%rbp)
movswl -0x1e(%rbp), %eax
movswl -0x12(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x20(%rbp)
jmp 0x13c82
movw -0x12(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x12(%rbp)
jmp 0x13c2b
movswl -0x22(%rbp), %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jl 0x13ca7
movl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x13cae
movswl -0x22(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movw %ax, -0x22(%rbp)
movswl -0x18(%rbp), %eax
cmpl $0x800, %eax            # imm = 0x800
jne 0x13ce8
movswl -0x22(%rbp), %edx
movq -0x10(%rbp), %rax
movswq -0x24(%rbp), %rcx
movl %edx, 0x540(%rax,%rcx,4)
movswl -0x20(%rbp), %edx
movq -0x10(%rbp), %rax
movswq -0x24(%rbp), %rcx
movl %edx, 0x500(%rax,%rcx,4)
movswl -0x24(%rbp), %eax
cmpl $0x0, %eax
jne 0x13d44
movswl -0x18(%rbp), %eax
cmpl $0x800, %eax            # imm = 0x800
jne 0x13d44
callq 0x16250
movq %rax, %rcx
leaq 0x27bc5(%rip), %rax     # 0x3b8d0
movq 0x10(%rax), %r8
movswl -0x18(%rbp), %r9d
movswl -0x24(%rbp), %r11d
movswl -0x22(%rbp), %r10d
movswl -0x20(%rbp), %eax
movl $0x2, %edi
xorl %esi, %esi
leaq 0x1045e(%rip), %rdx     # 0x2418e
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x216e0
jmp 0x13d46
movw -0x24(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x24(%rbp)
jmp 0x13bf4
movswl -0x1a(%rbp), %ecx
movswl -0x14(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x14(%rbp)
movswl -0x18(%rbp), %eax
shll %eax
movw %ax, -0x18(%rbp)
jmp 0x13bac
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)