// File: /workspace/github_c_makefile_star2_O0/pipde[P]deos-songlib/utils/correct/correct.c
// Function: processData
static void
processData(FILE *in,FILE *out,RRA *h)
    {
    int i,amp;
    int more = 1;
    int maxAmplitude = 0;
    static int windowcount = 0;

    if ((Window = malloc(sizeof(int) * WindowSize)) == 0)
        Fatal("correct: out of memory\n");

    WindowStart = 0;
    while (more)
        {
        maxAmplitude = 0;
        /* fill the window */
        fprintf(stderr,"window %d: ",windowcount++);
        amp = readRRAAmplitude(in,out,h->bitsPerSample,outputComment);
        if (amp > maxAmplitude) maxAmplitude = amp;
        for (i = WindowStart; i < WindowSize; ++i)
            {
            if (feof(in))
                {
                Window[i] = 0;
                more = 0;
                }
            else
                {
                Window[i] = amp;
                }
            amp = readRRAAmplitude(in,out,h->bitsPerSample,outputComment);
            if (amp > maxAmplitude) maxAmplitude = amp;
            }
        ExtraSamples += WindowSize;
        int cycle = findCycleLength();
        if (cycle < 25)
            {
            fprintf(stderr,"no matching cycle: ");
            repitch(out,1.0);
            }
        else
            {
            repitch(out,findFactor(cycle,h));
            }
        }

    free(Window);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x1, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movslq 0xfda7(%rip), %rdi      # 0x12910
shlq $0x2, %rdi
callq 0x21f0
movq %rax, 0x1185f(%rip)     # 0x143d8
cmpq $0x0, %rax
jne 0x2b8d
leaq 0xa825(%rip), %rdi      # 0xd3ab
movb $0x0, %al
callq 0x9670
movl $0x0, 0x11849(%rip)     # 0x143e0
cmpl $0x0, -0x24(%rbp)
je 0x2cf1
movl $0x0, -0x28(%rbp)
movq 0xf449(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movl 0x11818(%rip), %edx     # 0x143d0
movl %edx, %eax
addl $0x1, %eax
movl %eax, 0x1180d(%rip)     # 0x143d0
leaq 0xa7f9(%rip), %rsi      # 0xd3c3
movb $0x0, %al
callq 0x21a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x8999(%rip), %rcx      # 0xb580
callq 0xa8d0
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0x2bfd
movl -0x20(%rbp), %eax
movl %eax, -0x28(%rbp)
movl 0x117dd(%rip), %eax     # 0x143e0
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0xfd01(%rip), %eax      # 0x12910
jge 0x2c84
movq -0x8(%rbp), %rdi
callq 0x21c0
cmpl $0x0, %eax
je 0x2c3a
movq 0x117b2(%rip), %rax     # 0x143d8
movslq -0x1c(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl $0x0, -0x24(%rbp)
jmp 0x2c4b
movl -0x20(%rbp), %edx
movq 0x11794(%rip), %rax     # 0x143d8
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edx
leaq 0x891f(%rip), %rcx      # 0xb580
callq 0xa8d0
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0x2c77
movl -0x20(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x2c79
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2c06
movl 0xfc86(%rip), %eax      # 0x12910
addl 0xff24(%rip), %eax      # 0x12bb4
movl %eax, 0xff1e(%rip)      # 0x12bb4
callq 0x2d10
movl %eax, -0x2c(%rbp)
cmpl $0x19, -0x2c(%rbp)
jge 0x2ccf
movq 0xf34d(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
leaq 0xa71a(%rip), %rsi      # 0xd3cf
movb $0x0, %al
callq 0x21a0
movq -0x10(%rbp), %rdi
movsd 0xa398(%rip), %xmm0     # 0xd060
callq 0x3020
jmp 0x2cec
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movl -0x2c(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x3280
movq -0x38(%rbp), %rdi
callq 0x3020
jmp 0x2b97
movq 0x116e0(%rip), %rdi     # 0x143d8
callq 0x2030
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)