// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x28f8
jmp 0x2b3a
movq -0x8(%rbp), %rdi
leaq 0xb6c3(%rip), %rsi      # 0xdfc6
callq 0x97c0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xaa4e(%rip), %rsi      # 0xd365
leaq -0x18(%rbp), %rdx
movb $0x0, %al
callq 0x2070
movl $0x0, 0x1028c(%rip)     # 0x12bb8
movq -0x10(%rbp), %rdi
callq 0x21c0
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x2943
jmp 0x299a
movq 0xf6ae(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0xaa11(%rip), %rsi      # 0xd369
movb $0x0, %al
callq 0x21a0
movq -0x18(%rbp), %rdx
movl 0x1024f(%rip), %eax     # 0x12bb8
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x10244(%rip)     # 0x12bb8
movslq %eax, %rcx
leaq 0x10242(%rip), %rax     # 0x12bc0
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rdi
leaq 0xa9d8(%rip), %rsi      # 0xd365
leaq -0x18(%rbp), %rdx
movb $0x0, %al
callq 0x2070
jmp 0x292c
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x1020e(%rip), %eax     # 0x12bb8
jge 0x2b3a
movl $0x0, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x24(%rbp)
movb %al, -0x25(%rbp)
jne 0x29d7
movslq -0x20(%rbp), %rax
cmpq $0x6c, %rax
setb %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0x29e3
jmp 0x2b07
movq 0xf60e(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movslq -0x1c(%rbp), %rcx
leaq 0x101c8(%rip), %rax     # 0x12bc0
movq (%rax,%rcx,8), %rdx
movslq -0x20(%rbp), %rcx
leaq 0xfae9(%rip), %rax      # 0x124f0
movq (%rax,%rcx,8), %rcx
leaq 0xa966(%rip), %rsi      # 0xd378
movb $0x0, %al
callq 0x21a0
movslq -0x1c(%rbp), %rcx
leaq 0x1019c(%rip), %rax     # 0x12bc0
movq (%rax,%rcx,8), %rdi
movslq -0x20(%rbp), %rcx
leaq 0xfabd(%rip), %rax      # 0x124f0
movq (%rax,%rcx,8), %rsi
callq 0x2180
cmpl $0x0, %eax
jne 0x2af7
movl -0x20(%rbp), %eax
movl $0xc, %ecx
cltd
idivl %ecx
movslq -0x1c(%rbp), %rcx
leaq 0x11165(%rip), %rax     # 0x13bc0
movl %edx, (%rax,%rcx,4)
movsd 0x1195a(%rip), %xmm0    # 0x143c0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2a73
jp 0x2a73
jmp 0x2a91
movslq -0x20(%rbp), %rcx
leaq 0xf712(%rip), %rax      # 0x12190
movsd (%rax,%rcx,8), %xmm1
movsd 0x11935(%rip), %xmm0    # 0x143c0
ucomisd %xmm1, %xmm0
jbe 0x2aa9
movslq -0x20(%rbp), %rcx
leaq 0xf6f4(%rip), %rax      # 0x12190
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x11917(%rip)    # 0x143c0
movsd 0x11917(%rip), %xmm0    # 0x143c8
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2abe
jp 0x2abe
jmp 0x2ad8
movslq -0x20(%rbp), %rcx
leaq 0xf6c7(%rip), %rax      # 0x12190
movsd (%rax,%rcx,8), %xmm0
ucomisd 0x118f2(%rip), %xmm0    # 0x143c8
jbe 0x2af0
movslq -0x20(%rbp), %rcx
leaq 0xf6ad(%rip), %rax      # 0x12190
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, 0x118d8(%rip)    # 0x143c8
movl $0x1, -0x24(%rbp)
jmp 0x2af9
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x29be
cmpl $0x0, -0x24(%rbp)
jne 0x2b2a
movslq -0x1c(%rbp), %rcx
leaq 0x100a8(%rip), %rax     # 0x12bc0
movq (%rax,%rcx,8), %rsi
leaq 0xa86b(%rip), %rdi      # 0xd38e
movb $0x0, %al
callq 0x9670
jmp 0x2b2c
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x29a1
addq $0x30, %rsp
popq %rbp
retq