// File: /workspace/github_c_makefile_star2_O0/ender672[P]liboil/test.c
// Function: ref_scale
static void ref_scale(unsigned char **in, long in_width, long in_height,
	long double **out, long out_width, long out_height,
	enum oil_colorspace cs)
{
	long i, j, cmp, stride;
	long double *pre_line, **intermediate;

	cmp = OIL_CMP(cs);
	stride = cmp * in_width;

	// horizontal scaling
	pre_line = malloc(stride * sizeof(long double));
	intermediate = alloc_2d_ld(out_width * cmp, in_height);
	for (i=0; i<in_height; i++) {
		// Convert chars to floats
		for (j=0; j<stride; j++) {
			pre_line[j] = in[i][j] / 255.0F;
		}

		// Preprocess
		for (j=0; j<in_width; j++) {
			preprocess(pre_line + j * cmp, cs);
		}

		// xscale
		ref_xscale(pre_line, in_width, intermediate[i], out_width, cmp);
	}

	// vertical scaling
	ref_yscale(intermediate, out_width, in_height, out, out_height, cmp);
	for (i=0; i<out_height; i++) {
		for (j=0; j<out_width; j++) {
			postprocess(out[i] + j * cmp, cs);
		}
	}

	free(pre_line);
	free_2d_ld(intermediate, in_height);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl 0x10(%rbp), %eax
andl $0xff, %eax
movl %eax, %eax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
imulq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
shlq $0x4, %rdi
callq 0x10e0
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rdi
imulq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x45f0
movq %rax, -0x60(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x47a0
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x50(%rbp), %rax
jge 0x4732
movq -0x8(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x40(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cvtsi2ss %eax, %xmm0
movss 0x196b(%rip), %xmm1     # 0x6078
divss %xmm1, %xmm0
movss %xmm0, -0x64(%rbp)
flds -0x64(%rbp)
movq -0x58(%rbp), %rax
shlq $0x4, %rcx
fstpt (%rax,%rcx)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x46e3
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x10(%rbp), %rax
jge 0x476e
movq -0x58(%rbp), %rdi
movq -0x40(%rbp), %rax
imulq -0x48(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movl 0x10(%rbp), %esi
callq 0x49c0
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x473a
movq -0x58(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x60(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x28(%rbp), %rcx
movq -0x48(%rbp), %r8
callq 0x4b40
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x46cd
movq -0x60(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x48(%rbp), %r9
callq 0x4e00
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jge 0x4823
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x28(%rbp), %rax
jge 0x4813
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x40(%rbp), %rax
imulq -0x48(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rdi
movl 0x10(%rbp), %esi
callq 0x4ee0
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x47d7
jmp 0x4815
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x47c5
movq -0x58(%rbp), %rdi
callq 0x1030
movq -0x60(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4970
addq $0x70, %rsp
popq %rbp
retq
nop