// File: /workspace/github_c_makefile_star2_O3/pipde[P]deos-songlib/utils/extract/extract.c
// Function: main
int
main(int argc,char **argv)
    {
    int argIndex = 1;
    char *source = 0;

    argIndex = processOptions(argc,argv);

    if (argc-argIndex == 1)
        {
        source = argv[argIndex];
        }
    else
        {
        printf("usage: %s [OPTIONS] <input wav file>\n",argv[0]);
        exit(-1);
        }

    if (TimingData)
        {
        char buffer[512];
        snprintf(buffer,sizeof(buffer)-1,"%s%d_timings",Base,TakeNumber);
        Timings = OpenFile(buffer,"w");
        printf("note timings are stored in %s\n",buffer);
        }

    Note = StartingNote;
    processData(readWave(source));
    printf("%d notes extracted.\n",Note);

    if (TimingData) fclose(Timings);

    return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rsi, %rbx
movl %edi, %r14d
movl $0x1, %r12d
cmpl $0x2, %edi
jl 0x1ac8
movl $0x1, %r12d
movslq %r12d, %rax
movq (%rbx,%rax,8), %rsi
cmpb $0x2d, (%rsi)
jne 0x1ac8
movb 0x2(%rsi), %r15b
testb %r15b, %r15b
je 0x1a0a
leaq 0x2(%rsi), %rdi
jmp 0x1a0f
movq 0x8(%rbx,%rax,8), %rdi
movzbl 0x1(%rsi), %eax
leal -0x62(%rax), %ecx
cmpl $0x14, %ecx
ja 0x1a34
leaq 0x161e(%rip), %rdx      # 0x3040
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq %rdi, 0x46c6(%rip)      # 0x60f8
jmp 0x1aaa
cmpl $0x54, %eax
jne 0x1a48
callq 0x1080
movsd %xmm0, 0x46c2(%rip)     # 0x6108
jmp 0x1aaa
xorl %r13d, %r13d
leaq 0x17ad(%rip), %rdi      # 0x31ff
xorl %eax, %eax
callq 0x2090
jmp 0x1aad
callq 0x1080
movsd %xmm0, 0x46a8(%rip)     # 0x6110
jmp 0x1aaa
movb $0x1, 0x46b7(%rip)      # 0x6128
xorl %r13d, %r13d
jmp 0x1aad
callq 0x1180
movl %eax, 0x4697(%rip)      # 0x6118
jmp 0x1aaa
callq 0x1080
movsd %xmm0, 0x4670(%rip)     # 0x6100
jmp 0x1aaa
callq 0x1180
movl %eax, 0x469b(%rip)      # 0x6138
jmp 0x1aaa
callq 0x1180
movl %eax, 0x4682(%rip)      # 0x612c
movb $0x1, %r13b
testb %r15b, %r15b
sete %al
andb %r13b, %al
movzbl %al, %eax
addl %eax, %r12d
incl %r12d
cmpl %r14d, %r12d
jl 0x19eb
subl %r12d, %r14d
cmpl $0x1, %r14d
jne 0x1ef6
movslq %r12d, %rax
movq (%rbx,%rax,8), %rbx
cmpb $0x0, 0x4645(%rip)      # 0x6128
jne 0x1b37
movq 0x460c(%rip), %rcx      # 0x60f8
movl 0x4639(%rip), %r8d      # 0x612c
leaq 0x15cd(%rip), %rdx      # 0x30c7
leaq -0x250(%rbp), %r14
movl $0x1ff, %esi            # imm = 0x1FF
movq %r14, %rdi
xorl %eax, %eax
callq 0x10d0
leaq 0x15bd(%rip), %rsi      # 0x30d4
movq %r14, %rdi
callq 0x212a
movq %rax, 0x460a(%rip)      # 0x6130
leaq 0x15a9(%rip), %rdi      # 0x30d6
movq %r14, %rsi
xorl %eax, %eax
callq 0x10c0
movl 0x45fb(%rip), %eax      # 0x6138
movl %eax, 0x45f9(%rip)      # 0x613c
movq %rbx, %rdi
callq 0x1294
movq %rax, %rbx
movq 0x50(%rax), %r14
movl 0x78(%rax), %eax
movl %eax, -0x2c(%rbp)
leaq 0x1921(%rip), %rdi      # 0x3480
callq 0x1060
xorps %xmm0, %xmm0
cvtsi2sdl 0x38(%rbx), %xmm0
mulsd 0x458c(%rip), %xmm0     # 0x6100
movsd %xmm0, 0x4584(%rip)     # 0x6100
movsd 0x4584(%rip), %xmm1     # 0x6108
xorpd %xmm0, %xmm0
ucomisd %xmm0, %xmm1
jne 0x1be0
jp 0x1be0
movl 0x78(%rbx), %eax
cmpl $0x65, %eax
jl 0x1bd6
addl $-0x65, %eax
movl $0x3e7, %ecx            # imm = 0x3E7
cmpl %ecx, %eax
cmovael %ecx, %eax
movq 0x50(%rbx), %rcx
incl %eax
xorl %edx, %edx
movl 0x190(%rcx,%rdx,4), %esi
movl %esi, %edi
negl %edi
cmovsl %esi, %edi
xorps %xmm1, %xmm1
cvtsi2sd %edi, %xmm1
addsd %xmm1, %xmm0
incq %rdx
cmpq %rdx, %rax
jne 0x1bad
mulsd 0x1452(%rip), %xmm0     # 0x3028
divsd 0x1452(%rip), %xmm0     # 0x3030
jmp 0x1c21
movl 0x44(%rbx), %edi
decl %edi
movsd 0x141b(%rip), %xmm0     # 0x3008
callq 0x1040
addsd 0x1416(%rip), %xmm0     # 0x3010
movsd %xmm0, -0x38(%rbp)
movsd 0x4501(%rip), %xmm1     # 0x6108
divsd 0x1409(%rip), %xmm1     # 0x3018
movsd 0x1409(%rip), %xmm0     # 0x3020
callq 0x1090
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x44df(%rip)     # 0x6108
cmpl $0x0, -0x2c(%rbp)
jle 0x1eb9
xorl %ecx, %ecx
movq %rbx, -0x48(%rbp)
movq %r14, -0x50(%rbp)
movslq %ecx, %rax
xorps %xmm1, %xmm1
cvtsi2sdl (%r14,%rax,4), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x1ead
xorps %xmm1, %xmm1
cvtsi2sdl 0x38(%rbx), %xmm1
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd 0x44a6(%rip), %xmm2     # 0x6110
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
cvttsd2si %xmm0, %ebx
xorl %r12d, %r12d
testl %ebx, %ebx
cmovlel %r12d, %ebx
movq 0x44aa(%rip), %rdi      # 0x6130
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
divsd %xmm1, %xmm0
leaq 0x1477(%rip), %rsi      # 0x310f
movb $0x1, %al
callq 0x1100
movl $0xfa0, %edi            # imm = 0xFA0
callq 0x21af
movq %rax, %r15
movl -0x2c(%rbp), %eax
cmpl %eax, %ebx
cmovgl %ebx, %eax
movl %eax, -0x3c(%rbp)
movl %eax, %r13d
subl %ebx, %r13d
movq %rbx, -0x38(%rbp)
leaq (%r14,%rbx,4), %rdx
movl $0x3e8, %esi            # imm = 0x3E8
xorl %ebx, %ebx
cmpq %r12, %r13
je 0x1d46
movl %esi, %eax
cmpq %rax, %r12
jne 0x1cf9
movq %r13, %r14
leal (%rsi,%rsi), %r13d
shll $0x3, %esi
movq %r15, %rdi
movq %rdx, %r15
callq 0x2232
movq %r15, %rdx
movq %rax, %r15
movl %r13d, %esi
movq %r14, %r13
movl (%rdx,%r12,4), %eax
movl %eax, (%r15,%r12,4)
incq %r12
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
movsd 0x43ee(%rip), %xmm1     # 0x6108
incl %ebx
ucomisd %xmm0, %xmm1
movl $0x0, %eax
cmovbel %eax, %ebx
xorps %xmm0, %xmm0
cvtsi2sd %ebx, %xmm0
ucomisd 0x43c9(%rip), %xmm0     # 0x6100
jbe 0x1ccc
movq -0x38(%rbp), %rax
addl %r12d, %eax
movl %eax, -0x3c(%rbp)
movl %r12d, %r13d
movl 0x43cc(%rip), %esi      # 0x6118
movq 0x43a5(%rip), %rcx      # 0x60f8
movl 0x43d2(%rip), %r8d      # 0x612c
movl 0x43dc(%rip), %eax      # 0x613c
cmpl $0x1, %esi
movq -0x48(%rbp), %rbx
leaq -0x250(%rbp), %r14
je 0x1d76
cltd
idivl %esi
addl %edx, %r8d
movl $0x200, %esi            # imm = 0x200
movq %r14, %rdi
leaq 0x1390(%rip), %rdx      # 0x3115
movl %eax, %r9d
xorl %eax, %eax
callq 0x10d0
movq %r14, %rdi
leaq 0x133b(%rip), %rsi      # 0x30d4
callq 0x212a
movq %rax, %r12
movl $0x8, %esi
movl $0x1, %edx
leaq 0x136f(%rip), %rdi      # 0x3121
movq %rax, %rcx
callq 0x11a0
movl $0xc, %esi
movl $0x1, %edx
leaq 0x135f(%rip), %rdi      # 0x312a
movq %r12, %rcx
callq 0x11a0
movl 0x38(%rbx), %edx
movq %r12, %rdi
leaq 0x1357(%rip), %rsi      # 0x3137
xorl %eax, %eax
callq 0x1100
movl 0x44(%rbx), %edx
movq %r12, %rdi
leaq 0x1353(%rip), %rsi      # 0x3147
xorl %eax, %eax
callq 0x1100
movq %r12, %rdi
leaq 0x1355(%rip), %rsi      # 0x315a
movl %r13d, %edx
xorl %eax, %eax
callq 0x1100
movq %r12, %rdi
leaq 0x134e(%rip), %rsi      # 0x3167
xorl %eax, %eax
callq 0x1100
testl %r13d, %r13d
movq %r13, %rax
leaq 0x17cb(%rip), %r13      # 0x35f8
jle 0x1e84
movl %eax, %ebx
xorl %r14d, %r14d
movsd 0x11cc(%rip), %xmm2     # 0x3008
movsd %xmm2, -0x38(%rbp)
movsd 0x11bf(%rip), %xmm0     # 0x3008
xorps %xmm1, %xmm1
cvtsi2sdl (%r15,%r14,4), %xmm1
subsd %xmm2, %xmm0
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
movq %r12, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1100
movsd -0x38(%rbp), %xmm2
movsd 0x11c0(%rip), %xmm0     # 0x3038
mulsd %xmm0, %xmm2
incq %r14
cmpq %r14, %rbx
jne 0x1e3c
movq %r12, %rdi
callq 0x10a0
incl 0x42aa(%rip)            # 0x613c
movq %r15, %rdi
callq 0x1030
movsd 0x4266(%rip), %xmm0     # 0x6108
movq -0x48(%rbp), %rbx
movq -0x50(%rbp), %r14
movl -0x3c(%rbp), %ecx
addl $0x2, %ecx
cmpl -0x2c(%rbp), %ecx
jl 0x1c3d
movl 0x427d(%rip), %esi      # 0x613c
leaq 0x122f(%rip), %rdi      # 0x30f5
xorl %eax, %eax
callq 0x10c0
cmpb $0x0, 0x4254(%rip)      # 0x6128
jne 0x1ee2
movq 0x4253(%rip), %rdi      # 0x6130
callq 0x10a0
xorl %eax, %eax
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rbx), %rsi
leaq 0x11a1(%rip), %rdi      # 0x30a1
xorl %eax, %eax
callq 0x10c0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x1190
movq 0x41d0(%rip), %rsi      # 0x60e8
movq 0x41d1(%rip), %rdx      # 0x60f0
leaq 0x1247(%rip), %rdi      # 0x316d
xorl %eax, %eax
callq 0x10c0
jmp 0x2088
leaq 0x12e0(%rip), %rdi      # 0x3219
callq 0x1060
movq 0x41a3(%rip), %rsi      # 0x60e8
leaq 0x1230(%rip), %rdi      # 0x317c
xorl %eax, %eax
callq 0x10c0
leaq 0x12c6(%rip), %rdi      # 0x3220
callq 0x1060
leaq 0x12c3(%rip), %rdi      # 0x3229
callq 0x1060
movq 0x4186(%rip), %rsi      # 0x60f8
leaq 0x121c(%rip), %rdi      # 0x3195
xorl %eax, %eax
callq 0x10c0
leaq 0x12d8(%rip), %rdi      # 0x325f
callq 0x1060
leaq 0x12ee(%rip), %rdi      # 0x3281
callq 0x1060
leaq 0x130b(%rip), %rdi      # 0x32aa
callq 0x1060
movsd 0x4154(%rip), %xmm0     # 0x6100
leaq 0x11fa(%rip), %rbx      # 0x31ad
movq %rbx, %rdi
movb $0x1, %al
callq 0x10c0
leaq 0x131e(%rip), %rdi      # 0x32e2
callq 0x1060
movsd 0x413f(%rip), %xmm0     # 0x6110
movq %rbx, %rdi
movb $0x1, %al
callq 0x10c0
leaq 0x132f(%rip), %rdi      # 0x3311
callq 0x1060
movl 0x412b(%rip), %esi      # 0x6118
leaq 0x11d9(%rip), %rbx      # 0x31cd
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10c0
leaq 0x1343(%rip), %rdi      # 0x3348
callq 0x1060
movl 0x4128(%rip), %esi      # 0x6138
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10c0
leaq 0x135b(%rip), %rdi      # 0x337c
callq 0x1060
movl 0x4100(%rip), %esi      # 0x612c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10c0
leaq 0x1361(%rip), %rdi      # 0x339e
callq 0x1060
leaq 0x138c(%rip), %rdi      # 0x33d5
callq 0x1060
leaq 0x13b6(%rip), %rdi      # 0x340b
callq 0x1060
movsd 0x40a6(%rip), %xmm0     # 0x6108
leaq 0x117c(%rip), %rdi      # 0x31e5
movb $0x1, %al
callq 0x10c0
leaq 0x13d7(%rip), %rdi      # 0x344e
callq 0x1060
leaq 0x13ef(%rip), %rdi      # 0x3472
callq 0x1060
xorl %edi, %edi
callq 0x1190
nop