// File: /workspace/github_c_makefile_star2_O2/pipde[P]deos-songlib/utils/correct/correct.c
// Function: readLegalNotes
static void
readLegalNotes(char *fileName)
    {
    if (fileName == 0) return;

    FILE *fp = OpenFile(fileName,"r");
    char *note;

    fscanf(fp,"%ms",&note);
    LegalNoteCount = 0;
    while (!feof(fp))
        {
        fprintf(stderr,"read note: %s\n",note);
        LegalNotes[LegalNoteCount++] = note;
        fscanf(fp,"%ms",&note);
        }

    int i,j;
    for (i = 0; i < LegalNoteCount; ++i)
        {
        int found = 0;
        for (j = 0; !found && j < sizeof(freqs) / sizeof(double); ++j)
            {
            fprintf(stderr,"comparing %s with %s\n",LegalNotes[i],notes[j]);
            if (strcmp(LegalNotes[i],notes[j]) == 0)
                {
                LegalNoteOffsets[i] = j % 12;
                if (MinFreq == 0 || freqs[j] < MinFreq) MinFreq = freqs[j];
                if (MaxFreq == 0 || freqs[j] > MaxFreq) MaxFreq = freqs[j];
                found = 1;
                }
            }
        if (!found)
            Fatal("note %s is not a legal note\n",LegalNotes[i]);
        }
    }

// Assembly:
testq %rdi, %rdi
je 0x3f90
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x6908(%rip), %rsi      # 0xa6e3
callq 0x7c60
movq %rax, %rbx
leaq 0x6525(%rip), %r12      # 0xa30f
leaq -0x30(%rbp), %r15
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3090
andl $0x0, 0xbdd3(%rip)      # 0xfbd8
leaq 0x6507(%rip), %r14      # 0xa313
movq %rbx, %rdi
callq 0x3200
testl %eax, %eax
jne 0x3e61
movq 0xb1d9(%rip), %rax      # 0xeff8
movq (%rax), %rdi
movq -0x30(%rbp), %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x31e0
movq -0x30(%rbp), %rax
movslq 0xbd9d(%rip), %rcx      # 0xfbd8
leal 0x1(%rcx), %edx
movl %edx, 0xbd94(%rip)      # 0xfbd8
leaq 0xbd95(%rip), %rdx      # 0xfbe0
movq %rax, (%rdx,%rcx,8)
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3090
jmp 0x3e0c
xorl %r13d, %r13d
movslq 0xbd6d(%rip), %rax      # 0xfbd8
cmpq %rax, %r13
jge 0x3f82
xorl %r14d, %r14d
xorl %r15d, %r15d
xorl %ebx, %ebx
movl %r15d, %eax
xorl %edx, %edx
pushq $0xc
popq %rcx
divl %ecx
testl %ebx, %ebx
sete %al
cmpq $0x6c, %r15
setb %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3f5d
movl %edx, %r12d
movq 0xb151(%rip), %rax      # 0xeff8
movq (%rax), %rdi
leaq 0xbd2f(%rip), %rax      # 0xfbe0
movq (%rax,%r13,8), %rdx
leaq 0xb654(%rip), %rax      # 0xf510
movq (%r14,%rax), %rcx
xorl %ebx, %ebx
leaq 0x6459(%rip), %rsi      # 0xa322
xorl %eax, %eax
callq 0x31e0
leaq 0xbd09(%rip), %rax      # 0xfbe0
movq (%rax,%r13,8), %rdi
leaq 0xb62e(%rip), %rax      # 0xf510
movq (%r14,%rax), %rsi
callq 0x31c0
testl %eax, %eax
jne 0x3f51
leaq 0xccea(%rip), %rax      # 0x10be0
movl %r12d, (%rax,%r13,4)
movsd 0xd4de(%rip), %xmm1     # 0x113e0
ucomisd 0x6126(%rip), %xmm1     # 0xa030
leaq 0xb29f(%rip), %rax      # 0xf1b0
movsd (%r14,%rax), %xmm0
jne 0x3f1b
jnp 0x3f21
ucomisd %xmm0, %xmm1
jbe 0x3f29
movsd %xmm0, 0xd4b7(%rip)     # 0x113e0
movsd 0xd4b7(%rip), %xmm1     # 0x113e8
ucomisd 0x60f7(%rip), %xmm1     # 0xa030
jne 0x3f3d
jnp 0x3f46
ucomisd %xmm1, %xmm0
pushq $0x1
popq %rbx
jbe 0x3f51
movsd %xmm0, 0xd49a(%rip)     # 0x113e8
pushq $0x1
popq %rbx
incq %r15
addq $0x8, %r14
jmp 0x3e7c
testl %ebx, %ebx
jne 0x3f7a
leaq 0xbc78(%rip), %rax      # 0xfbe0
movq (%rax,%r13,8), %rsi
leaq 0x63c5(%rip), %rdi      # 0xa338
xorl %eax, %eax
callq 0x7b30
incq %r13
jmp 0x3e64
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)