// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/lib/songlib.c
// Function: scoreLeading
static int
scoreLeading(int *prev,int *curr,int *prop,int length,int offset,int goUp)
    {
    int i;
    int total = 0;

    if (goUp)
        {
        for (i = 0; i < length; ++i)
            {
            if (i + offset >= length)
                {
                total += abs(prev[i] - (curr[i+offset-length]+12));
                prop[i] = curr[i+offset-length]+12;
                }
            else
                {
                total += abs(prev[i] - curr[i+offset]);
                prop[i] = curr[i+offset];
                }
            }
        }
    else
        {
        for (i = length-1; i >= 0; --i)
            {
            if (i - offset < 0)
                {
                total += abs(prev[i] - (curr[i-offset+length]-12));
                prop[i] = curr[i-offset+length]-12;
                }
            else
                {
                total += abs(prev[i] - curr[i-offset]);
                prop[i] = curr[i-offset];
                }
            }
        }
    return total;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movl $0x0, -0x2c(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x8115
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x8110
movl -0x28(%rbp), %eax
addl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x80bd
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movl -0x28(%rbp), %edx
addl -0x20(%rbp), %edx
subl -0x1c(%rbp), %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
addl $0xc, %ecx
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
addl -0x20(%rbp), %ecx
subl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0xc, %edx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x8100
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movl -0x28(%rbp), %edx
addl -0x20(%rbp), %edx
movslq %edx, %rdx
subl (%rcx,%rdx,4), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
addl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x8102
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x8053
jmp 0x81db
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, -0x28(%rbp)
jl 0x81d9
movl -0x28(%rbp), %eax
subl -0x20(%rbp), %eax
cmpl $0x0, %eax
jge 0x8186
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movl -0x28(%rbp), %edx
subl -0x20(%rbp), %edx
addl -0x1c(%rbp), %edx
movslq %edx, %rdx
movl (%rcx,%rdx,4), %ecx
subl $0xc, %ecx
subl %ecx, %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
subl -0x20(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
subl $0xc, %edx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x81c9
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x10(%rbp), %rcx
movl -0x28(%rbp), %edx
subl -0x20(%rbp), %edx
movslq %edx, %rdx
subl (%rcx,%rdx,4), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
subl -0x20(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x81cb
movl -0x28(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x811e
jmp 0x81db
movl -0x2c(%rbp), %eax
popq %rbp
retq