// File: /workspace/github_c_makefile_star2_O3/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 $0xb8, %rsp
movq %r8, %r14
movq %rdx, 0x28(%rsp)
movq %rsi, %r12
movq %rdi, 0x20(%rsp)
movl $0x4, %r15d
cmpq %rcx, %rsi
jl 0x43c1
leaq (,%r12,4), %rax
xorl %edx, %edx
divq %rcx
movabsq $0x7ffffffffffffffe, %r15 # imm = 0x7FFFFFFFFFFFFFFE
andq %rax, %r15
movq %r15, %rdi
shlq $0x4, %rdi
movq %rcx, 0x18(%rsp)
callq 0x1100
movq 0x18(%rsp), %rcx
movq %rax, %rbp
testq %rcx, %rcx
jle 0x46a5
movq %r12, 0x58(%rsp)
fildll 0x58(%rsp)
fstpt 0xa0(%rsp)
movq %rcx, 0x60(%rsp)
fildll 0x60(%rsp)
fstpt 0x94(%rsp)
movq %r15, %rax
movq %r15, 0x68(%rsp)
fildll 0x68(%rsp)
fmuls 0xd47(%rip)             # 0x515c
shrq %rax
movq %rax, 0x70(%rsp)
fildll 0x70(%rsp)
fstpt 0x7c(%rsp)
movq %r14, %rbx
shlq $0x4, %rbx
xorl %r13d, %r13d
movq %rax, 0x38(%rsp)
negq %rax
movq %rax, 0x30(%rsp)
fstpt 0x88(%rsp)
movq %r13, 0x40(%rsp)
fildll 0x40(%rsp)
fadds 0xcfe(%rip)             # 0x5150
fldt 0xa0(%rsp)
fmulp %st, %st(1)
fldt 0x94(%rsp)
fdivrp %st, %st(1)
fadds 0xd3a(%rip)             # 0x51a4
fld %st(0)
fstpt 0xac(%rsp)
fstpt (%rsp)
callq 0x1060
fnstcw 0x14(%rsp)
movzwl 0x14(%rsp), %eax
orl $0xc00, %eax            # imm = 0xC00
movw %ax, 0x16(%rsp)
fldcw 0x16(%rsp)
fistpll 0x48(%rsp)
fldcw 0x14(%rsp)
movq 0x48(%rsp), %rsi
movq %rsi, 0x50(%rsp)
movq 0x30(%rsp), %rax
leaq (%rsi,%rax), %rdx
incq %rdx
subq 0x38(%rsp), %rsi
testq %rdx, %rdx
movl $0x0, %eax
cmovgq %rdx, %rax
movq %rax, %rcx
subq %rdx, %rcx
movq %r15, %rdi
subq %rcx, %rdi
leaq (%rdi,%rax), %r8
movq %r12, %rdx
subq %rax, %rdx
cmpq %r12, %r8
cmovlq %rdi, %rdx
fildll 0x50(%rsp)
leaq (%r15,%rsi), %rdi
incq %rdi
subq %rax, %rdi
subq %rdx, %rdi
movq %r15, %r8
subq %rcx, %r8
subq %rdi, %r8
testq %r8, %r8
jle 0x46be
fld1
fchs
testq %r15, %r15
fldt 0x88(%rsp)
je 0x4611
fstp %st(1)
movq %r15, %rsi
subq %rdi, %rsi
fldt 0xac(%rsp)
fsubrp %st, %st(2)
fld1
faddp %st, %st(2)
fldt 0x7c(%rsp)
fsubrp %st, %st(2)
fldz
movq %rbp, %rdi
xorl %r8d, %r8d
fld %st(0)
cmpq %rcx, %r8
jl 0x4578
cmpq %rsi, %r8
jge 0x4578
fld %st(3)
fadd %st(2), %st
fabs
fdiv %st(3), %st
fld1
fucompi %st(1), %st
jbe 0x457e
fld %st(0)
fmuls 0xc66(%rip)             # 0x51c0
fmul %st(1), %st
fld %st(1)
fmuls 0xc60(%rip)             # 0x51c4
fmul %st(2), %st
fxch %st(1)
fmulp %st, %st(2)
faddp %st, %st(1)
flds 0xc4a(%rip)             # 0x51bc
fadd %st, %st(1)
fdivrp %st, %st(1)
jmp 0x45be
fldz
fstpt (%rdi)
jmp 0x45ca
fldz
flds 0xc22(%rip)             # 0x51a8
fucompi %st(2), %st
fxch %st(1)
jbe 0x45c0
fstp %st(1)
fld %st(0)
fmuls 0xc16(%rip)             # 0x51ac
fmul %st(1), %st
fld %st(1)
fmuls 0xc10(%rip)             # 0x51b0
fmul %st(2), %st
fxch %st(1)
fmul %st(2), %st
faddp %st, %st(1)
fxch %st(1)
fmuls 0xc04(%rip)             # 0x51b4
faddp %st, %st(1)
fadds 0xc00(%rip)             # 0x51b8
fdivs 0xbfe(%rip)             # 0x51bc
fldz
fstp %st(0)
fdiv %st(3), %st
fld %st(0)
fstpt (%rdi)
faddp %st, %st(1)
fld1
faddp %st, %st(2)
incq %r8
addq $0x10, %rdi
cmpq %r8, %r15
jne 0x453a
fstp %st(3)
fstp %st(0)
fstp %st(0)
fldz
movq %rbp, %rsi
movq %r15, %rdi
fldt (%rsi)
fdiv %st(2), %st
fld %st(0)
fstpt (%rsi)
faddp %st, %st(1)
addq $0x10, %rsi
decq %rdi
jne 0x45ec
fstp %st(1)
fld1
fchs
faddp %st, %st(1)
fldz
fldz
fxch %st(1)
fxch %st(2)
fxch %st(1)
fstp %st(2)
fstp %st(1)
fabs
fldt 0xc43(%rip)             # 0x5260
fucompi %st(1), %st
fstp %st(0)
jbe 0x46df
testq %r14, %r14
jle 0x4697
movq %r13, %rsi
imulq %r14, %rsi
shlq $0x4, %rsi
addq 0x28(%rsp), %rsi
shlq $0x4, %rcx
addq %rbp, %rcx
imulq %rbx, %rax
addq 0x20(%rsp), %rax
xorl %edi, %edi
movq %rdi, %r8
shlq $0x4, %r8
fldz
fld %st(0)
fstpt (%rsi,%r8)
testq %rdx, %rdx
jle 0x4689
addq %rsi, %r8
movq %rcx, %r9
movq %rax, %r10
movq %rdx, %r11
fldt (%r10)
fldt (%r9)
fmulp %st, %st(1)
faddp %st, %st(1)
fld %st(0)
fstpt (%r8)
addq %rbx, %r10
addq $0x10, %r9
decq %r11
jne 0x466e
fstp %st(0)
incq %rdi
addq $0x10, %rax
cmpq %r14, %rdi
jne 0x464e
incq %r13
cmpq 0x18(%rsp), %r13
jne 0x4443
movq %rbp, %rdi
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
fstp %st(0)
leaq 0xbd5(%rip), %rdi       # 0x529c
leaq 0xbe7(%rip), %rsi       # 0x52b5
leaq 0xbe7(%rip), %rcx       # 0x52bc
movl $0x45, %edx
callq 0x10a0
leaq 0xc19(%rip), %rdi       # 0x52ff
leaq 0xbc8(%rip), %rsi       # 0x52b5
leaq 0xbc8(%rip), %rcx       # 0x52bc
movl $0x56, %edx
callq 0x10a0