// File: lunasorcery[P]brailify/./stb/stb_image_resize.h
// Function: stbir__resize_arbitrary(void*, void const*, int, int, int, void*, int, int, int, float, float, float, float, float*, int, int, unsigned int, stbir_datatype, stbir_filter, stbir_filter, stbir_edge, stbir_edge, stbir_colorspace)
static int stbir__resize_arbitrary(
    void *alloc_context,
    const void* input_data, int input_w, int input_h, int input_stride_in_bytes,
    void* output_data, int output_w, int output_h, int output_stride_in_bytes,
    float s0, float t0, float s1, float t1, float *transform,
    int channels, int alpha_channel, stbir_uint32 flags, stbir_datatype type,
    stbir_filter h_filter, stbir_filter v_filter,
    stbir_edge edge_horizontal, stbir_edge edge_vertical, stbir_colorspace colorspace)
{
    stbir__info info;
    int result;
    size_t memory_required;
    void* extra_memory;

    stbir__setup(&info, input_w, input_h, output_w, output_h, channels);
    stbir__calculate_transform(&info, s0,t0,s1,t1,transform);
    stbir__choose_filter(&info, h_filter, v_filter);
    memory_required = stbir__calculate_memory(&info);
    extra_memory = STBIR_MALLOC(memory_required, alloc_context);

    if (!extra_memory)
        return 0;

    result = stbir__resize_allocated(&info, input_data, input_stride_in_bytes,
                                            output_data, output_stride_in_bytes, 
                                            alpha_channel, flags, type,
                                            edge_horizontal, edge_vertical,
                                            colorspace, extra_memory, memory_required);

    STBIR_FREE(extra_memory, alloc_context);

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movl 0x70(%rbp), %eax
movl 0x68(%rbp), %eax
movl 0x60(%rbp), %eax
movl 0x58(%rbp), %eax
movl 0x50(%rbp), %eax
movl 0x48(%rbp), %eax
movl 0x40(%rbp), %eax
movl 0x38(%rbp), %eax
movl 0x30(%rbp), %eax
movq 0x28(%rbp), %rax
movl 0x20(%rbp), %eax
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
movl %edx, -0x3c(%rbp)
movl %ecx, -0x40(%rbp)
movl %r8d, -0x44(%rbp)
movq %r9, -0x50(%rbp)
movss %xmm0, -0x54(%rbp)
movss %xmm1, -0x58(%rbp)
movss %xmm2, -0x5c(%rbp)
movss %xmm3, -0x60(%rbp)
movl -0x3c(%rbp), %esi
movl -0x40(%rbp), %edx
movl 0x10(%rbp), %ecx
movl 0x18(%rbp), %r8d
movl 0x30(%rbp), %r9d
leaq -0x168(%rbp), %rdi
callq 0x19900
movss -0x54(%rbp), %xmm0
movss -0x58(%rbp), %xmm1
movss -0x5c(%rbp), %xmm2
movss -0x60(%rbp), %xmm3
movq 0x28(%rbp), %rsi
leaq -0x168(%rbp), %rdi
callq 0x19950
movl 0x50(%rbp), %esi
movl 0x58(%rbp), %edx
leaq -0x168(%rbp), %rdi
callq 0x19ab0
leaq -0x168(%rbp), %rdi
callq 0x19b30
movl %eax, %eax
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rdi
callq 0x1120
movq %rax, -0x180(%rbp)
cmpq $0x0, -0x180(%rbp)
jne 0x2a02
movl $0x0, -0x24(%rbp)
jmp 0x2a7e
movq -0x38(%rbp), %rsi
movl -0x44(%rbp), %edx
movq -0x50(%rbp), %rcx
movl 0x20(%rbp), %r8d
movl 0x38(%rbp), %r9d
movl 0x40(%rbp), %r12d
movl 0x48(%rbp), %r15d
movl 0x60(%rbp), %r14d
movl 0x68(%rbp), %ebx
movl 0x70(%rbp), %r11d
movq -0x180(%rbp), %r10
movq -0x178(%rbp), %rax
leaq -0x168(%rbp), %rdi
movl %r12d, (%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq %rax, 0x30(%rsp)
callq 0x19e00
movl %eax, -0x16c(%rbp)
movq -0x180(%rbp), %rdi
callq 0x10f0
movl -0x16c(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)