// File: /workspace/github_c_makefile_star2_O1/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 0x4286
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 0x4578
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 0xdca(%rip)             # 0x50a4
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 0xd81(%rip)             # 0x5098
fldt 0xa0(%rsp)
fmulp %st, %st(1)
fldt 0x94(%rsp)
fdivrp %st, %st(1)
fadds 0xdd1(%rip)             # 0x5100
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 0x4591
fldz
testq %r15, %r15
fldt 0x88(%rsp)
fldz
je 0x44a9
fstp %st(2)
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)
fxch %st(2)
fxch %st(1)
cmpq %rcx, %r8
jl 0x4443
cmpq %rsi, %r8
jge 0x4443
fld %st(3)
fadd %st(1), %st
fabs
fdiv %st(2), %st
fld1
fucompi %st(1), %st
jbe 0x4449
fld %st(0)
fmuls 0xcf7(%rip)             # 0x511c
fmul %st(1), %st
fld %st(1)
fmuls 0xcf1(%rip)             # 0x5120
fmul %st(2), %st
fxch %st(1)
fmulp %st, %st(2)
faddp %st, %st(1)
flds 0xcdb(%rip)             # 0x5118
fadd %st, %st(1)
fdivrp %st, %st(1)
jmp 0x4489
fldz
fstpt (%rdi)
jmp 0x4495
fldz
flds 0xcb3(%rip)             # 0x5104
fucompi %st(2), %st
fxch %st(1)
jbe 0x448b
fstp %st(1)
fld %st(0)
fmuls 0xca7(%rip)             # 0x5108
fmul %st(1), %st
fld %st(1)
fmuls 0xca1(%rip)             # 0x510c
fmul %st(2), %st
fxch %st(1)
fmul %st(2), %st
faddp %st, %st(1)
fxch %st(1)
fmuls 0xc95(%rip)             # 0x5110
faddp %st, %st(1)
fadds 0xc91(%rip)             # 0x5114
fdivs 0xc8f(%rip)             # 0x5118
fldz
fstp %st(0)
fdiv %st(2), %st
fld %st(0)
fstpt (%rdi)
faddp %st, %st(3)
fld1
faddp %st, %st(1)
incq %r8
addq $0x10, %rdi
cmpq %r8, %r15
jne 0x4405
fstp %st(3)
fstp %st(2)
fstp %st(1)
fld1
fchs
testq %r15, %r15
je 0x44e1
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 0x44c2
fstp %st(1)
fld1
fchs
faddp %st, %st(1)
fldz
fxch %st(1)
fstp %st(1)
fabs
fldt 0xcd5(%rip)             # 0x51c0
fucompi %st(1), %st
fstp %st(0)
jbe 0x45b2
testq %r14, %r14
jle 0x456a
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
fstpt (%rsi,%r8)
testq %rdx, %rdx
fldz
jle 0x455c
fstp %st(0)
addq %rsi, %r8
fldt (%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 0x4541
fstp %st(0)
incq %rdi
addq $0x10, %rax
cmpq %r14, %rdi
jne 0x451c
incq %r13
cmpq 0x18(%rsp), %r13
jne 0x4308
movq %rbp, %rdi
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1030
fstp %st(0)
leaq 0xc62(%rip), %rdi       # 0x51fc
leaq 0xc74(%rip), %rsi       # 0x5215
leaq 0xc74(%rip), %rcx       # 0x521c
movl $0x45, %edx
callq 0x10a0
leaq 0xca6(%rip), %rdi       # 0x525f
leaq 0xc55(%rip), %rsi       # 0x5215
leaq 0xc55(%rip), %rcx       # 0x521c
movl $0x56, %edx
callq 0x10a0