// File: /workspace/github_c_makefile_star2_O2/ender672[P]liboil/test.c
// Function: ref_xscale
static void ref_xscale(long double *in, long in_width, long double *out,
	long out_width, long cmp)
{
	long i, j, k, stride, taps, smp_i, start, ltrim, rtrim, start_safe,
		taps_safe, max_pos, in_pos;
	long double *tmp, *coeffs, in_val, tx;

	stride = cmp * in_width;
	tmp = malloc(stride * sizeof(long double));

	taps = calc_taps_check(in_width, out_width);
	coeffs = malloc(taps * sizeof(long double));
	max_pos = in_width - 1;
	for (i=0; i<out_width; i++) {
		smp_i = split_map_check(in_width, out_width, i, &tx);
		start = smp_i - (taps/2 - 1);

		start_safe = start;
		if (start_safe < 0) {
			start_safe = 0;
		}
		ltrim = start_safe - start;

		taps_safe = taps - ltrim;
		if (start_safe + taps_safe > max_pos) {
			taps_safe = max_pos - start_safe + 1;
		}
		rtrim = (start + taps) - (start_safe + taps_safe);

		ref_calc_coeffs(coeffs, tx, taps, ltrim, rtrim);

		for (j=0; j<cmp; j++) {
			out[i * cmp + j] = 0;
			for(k=0; k<taps_safe; k++) {
				in_pos = start_safe + k;
				in_val = in[in_pos * cmp + j];
				out[i * cmp + j] += coeffs[ltrim + k] * in_val;
			}
		}
	}

	free(tmp);
	free(coeffs);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %r8, 0x20(%rsp)
movq %rcx, %r12
movq %rdx, 0x30(%rsp)
movq %rsi, %rbx
movq %rdi, 0x28(%rsp)
cmpq %rcx, %rsi
jge 0x3c7d
pushq $0x4
popq %r15
jmp 0x3c97
leaq (,%rbx,4), %rax
xorl %edx, %edx
divq %r12
movabsq $0x7ffffffffffffffe, %r15 # imm = 0x7FFFFFFFFFFFFFFE
andq %rax, %r15
movq %r15, %rdi
shlq $0x4, %rdi
callq 0x10f0
movq %rax, %rbp
movq %rbx, 0x48(%rsp)
movq %rbx, 0x68(%rsp)
fildll 0x68(%rsp)
fstpt 0xb0(%rsp)
movq %r12, 0x70(%rsp)
fildll 0x70(%rsp)
fstpt 0xa4(%rsp)
movq %r15, %rax
shrq %rax
movq %r15, 0x78(%rsp)
fildll 0x78(%rsp)
fmuls 0x13bc(%rip)            # 0x509c
movq %rax, 0x80(%rsp)
xorl %ebx, %ebx
movq 0x20(%rsp), %r13
testq %r13, %r13
movl $0x0, %r14d
cmovgq %r13, %r14
fildll 0x80(%rsp)
fstpt 0x8c(%rsp)
testq %r12, %r12
cmovleq %rbx, %r12
shlq $0x4, %r13
movq %rax, 0x40(%rsp)
negq %rax
movq %rax, 0x38(%rsp)
fstpt 0x98(%rsp)
cmpq %r12, %rbx
je 0x3f81
movq %rbx, 0x58(%rsp)
fildll 0x58(%rsp)
fadds 0x134f(%rip)            # 0x5090
fldt 0xb0(%rsp)
fmulp %st, %st(1)
fldt 0xa4(%rsp)
fdivrp %st, %st(1)
fadds 0x13a7(%rip)            # 0x5100
fld %st(0)
fstpt 0xbc(%rsp)
fstpt (%rsp)
callq 0x1060
fnstcw 0x1c(%rsp)
movzwl 0x1c(%rsp), %eax
orl $0xc00, %eax            # imm = 0xC00
movw %ax, 0x1e(%rsp)
fldcw 0x1e(%rsp)
fistpll 0x60(%rsp)
fldcw 0x1c(%rsp)
movq 0x60(%rsp), %rsi
movq %rsi, %rdi
subq 0x40(%rsp), %rdi
movq 0x38(%rsp), %rax
leaq (%rsi,%rax), %rdx
incq %rdx
testq %rdx, %rdx
movl $0x0, %eax
cmovgq %rdx, %rax
movq %rax, %rcx
subq %rdx, %rcx
movq %r15, %r8
subq %rcx, %r8
leaq (%r8,%rax), %r9
movq 0x48(%rsp), %r10
movq %r10, %rdx
subq %rax, %rdx
cmpq %r10, %r9
cmovlq %r8, %rdx
addq %r15, %rdi
incq %rdi
subq %rax, %rdi
subq %rdx, %rdi
movq %r15, %r9
subq %rcx, %r9
subq %rdi, %r9
testq %r9, %r9
jle 0x3fb3
movq %rsi, 0x50(%rsp)
fildll 0x50(%rsp)
movq %r15, %rsi
subq %rdi, %rsi
fldt 0xbc(%rsp)
fsubrp %st, %st(1)
fld1
faddp %st, %st(1)
fldt 0x8c(%rsp)
fsubrp %st, %st(1)
fldz
movq %rbp, %rdi
fld %st(0)
xorl %r8d, %r8d
fldt 0x98(%rsp)
cmpq %r8, %r15
je 0x3ecd
cmpq %rcx, %r8
jl 0x3e6b
cmpq %rsi, %r8
jge 0x3e6b
fld %st(3)
fadd %st(2), %st
fabs
fdiv %st(1), %st
fld1
fucompi %st(1), %st
jbe 0x3e71
fld %st(0)
fmuls 0x12cf(%rip)            # 0x511c
fmul %st(1), %st
fld %st(1)
fmuls 0x12c9(%rip)            # 0x5120
fmul %st(2), %st
fxch %st(1)
fmulp %st, %st(2)
faddp %st, %st(1)
flds 0x12b3(%rip)            # 0x5118
fadd %st, %st(1)
fdivrp %st, %st(1)
jmp 0x3eb1
fldz
fstpt (%rdi)
jmp 0x3ebd
fldz
flds 0x128b(%rip)            # 0x5104
fucompi %st(2), %st
fxch %st(1)
jbe 0x3eb3
fstp %st(1)
fld %st(0)
fmuls 0x127f(%rip)            # 0x5108
fmul %st(1), %st
fld %st(1)
fmuls 0x1279(%rip)            # 0x510c
fmul %st(2), %st
fxch %st(1)
fmul %st(2), %st
faddp %st, %st(1)
fxch %st(1)
fmuls 0x126d(%rip)            # 0x5110
faddp %st, %st(1)
fadds 0x1269(%rip)            # 0x5114
fdivs 0x1267(%rip)            # 0x5118
fldz
fstp %st(0)
fdiv %st(1), %st
fld %st(0)
fstpt (%rdi)
faddp %st, %st(3)
fld1
faddp %st, %st(2)
incq %r8
addq $0x10, %rdi
jmp 0x3e24
fstp %st(3)
fstp %st(0)
fstp %st(1)
fldz
movq %r15, %rsi
movq %rbp, %rdi
subq $0x1, %rsi
jb 0x3ef1
fldt (%rdi)
fdiv %st(2), %st
fld %st(0)
fstpt (%rdi)
faddp %st, %st(1)
addq $0x10, %rdi
jmp 0x3edb
fstp %st(1)
fld1
fchs
faddp %st, %st(1)
fabs
fldt 0x128f(%rip)            # 0x5190
fucompi %st(1), %st
fstp %st(0)
jbe 0x3f9a
movq %rbx, %rsi
imulq 0x20(%rsp), %rsi
shlq $0x4, %rsi
addq 0x30(%rsp), %rsi
shlq $0x4, %rcx
addq %rbp, %rcx
imulq %r13, %rax
addq 0x28(%rsp), %rax
xorl %edi, %edi
cmpq %r14, %rdi
je 0x3f79
movq %rdi, %r9
shlq $0x4, %r9
leaq (%rsi,%r9), %r8
fldz
fld %st(0)
fstpt (%rsi,%r9)
movq %rax, %r9
movq %rcx, %r10
movq %rdx, %r11
subq $0x1, %r11
jb 0x3f6e
fldt (%r9)
fldt (%r10)
fmulp %st, %st(1)
faddp %st, %st(1)
fld %st(0)
fstpt (%r8)
addq $0x10, %r10
addq %r13, %r9
jmp 0x3f50
fstp %st(0)
incq %rdi
addq $0x10, %rax
jmp 0x3f2f
incq %rbx
jmp 0x3d29
movq %rbp, %rdi
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
leaq 0x12be(%rip), %rdi      # 0x525f
leaq 0x126d(%rip), %rsi      # 0x5215
leaq 0x126d(%rip), %rcx      # 0x521c
pushq $0x56
jmp 0x3fca
leaq 0x1242(%rip), %rdi      # 0x51fc
leaq 0x1254(%rip), %rsi      # 0x5215
leaq 0x1254(%rip), %rcx      # 0x521c
pushq $0x45
popq %rdx
callq 0x10a0