// File: /workspace/github_c_makefile_star2_O3/waywardgeek[P]sonic/main.c
// Function: main
int main(int argc, char** argv) {
  char* inFileName;
  char* outFileName;
  float speed = 1.0f;
  float pitch = 1.0f;
  float rate = 1.0f;
  float volume = 1.0f;
  int outputSampleRate = 0;  /* Means use the input file sample rate. */
  int emulateChordPitch = 0;
  int quality = 0;
  int xArg = 1;
  int computeSpectrogram = 0;
  int numRows = 0, numCols = 0;

  while (xArg < argc && *(argv[xArg]) == '-') {
    if (!strcmp(argv[xArg], "-c")) {
      emulateChordPitch = 1;
      printf("Scaling pitch linearly.\n");
    } else if (!strcmp(argv[xArg], "-o")) {
      xArg++;
      if (xArg < argc) {
        outputSampleRate = atoi(argv[xArg]);
        printf("Setting output sample rate to %d\n", outputSampleRate);
      }
    } else if (!strcmp(argv[xArg], "-p")) {
      xArg++;
      if (xArg < argc) {
        pitch = atof(argv[xArg]);
        printf("Setting pitch to %0.2fX\n", pitch);
      }
    } else if (!strcmp(argv[xArg], "-q")) {
      quality = 1;
      printf("Disabling speed-up heuristics\n");
    } else if (!strcmp(argv[xArg], "-r")) {
      xArg++;
      if (xArg < argc) {
        rate = atof(argv[xArg]);
        if (rate == 0.0f) {
          usage();
        }
        printf("Setting rate to %0.2fX\n", rate);
      }
    } else if (!strcmp(argv[xArg], "-s")) {
      xArg++;
      if (xArg < argc) {
        speed = atof(argv[xArg]);
        printf("Setting speed to %0.2fX\n", speed);
      }
#ifdef SONIC_SPECTROGRAM
    } else if (!strcmp(argv[xArg], "-S")) {
      xArg++;
      if (xArg < argc) {
        numCols = atof(argv[xArg]);
      }
      xArg++;
      if (xArg < argc) {
        numRows = atof(argv[xArg]);
        computeSpectrogram = 1;
        printf("Computing spectrogram %d wide and %d tall\n", numCols, numRows);
      }
#endif  /* SONIC_SPECTROGRAM */
    } else if (!strcmp(argv[xArg], "-v")) {
      xArg++;
      if (xArg < argc) {
        volume = atof(argv[xArg]);
        printf("Setting volume to %0.2f\n", volume);
      }
    }
    xArg++;
  }
  if (argc - xArg != 2) {
    usage();
  }
  inFileName = argv[xArg];
  outFileName = argv[xArg + 1];
  runSonic(inFileName, outFileName, speed, pitch, rate, volume,
           outputSampleRate, emulateChordPitch, quality,
           computeSpectrogram, numRows, numCols);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2028, %rsp           # imm = 0x2028
movq %rsi, %r14
movl %edi, %r15d
movl $0x1, %r13d
cmpl $0x2, %edi
jl 0x162f
movss 0x2baa(%rip), %xmm0     # 0x4004
movss %xmm0, 0x18(%rsp)
movss %xmm0, 0x14(%rsp)
xorl %ebx, %ebx
xorl %ebp, %ebp
xorl %r12d, %r12d
movss %xmm0, 0x10(%rsp)
movss %xmm0, 0xc(%rsp)
movslq %r13d, %rax
movq (%r14,%rax,8), %rax
cmpb $0x2d, (%rax)
jne 0x1656
cmpb $0x63, 0x1(%rax)
jne 0x1499
cmpb $0x0, 0x2(%rax)
je 0x152f
cmpb $0x6f, 0x1(%rax)
jne 0x14a9
cmpb $0x0, 0x2(%rax)
je 0x1545
cmpb $0x70, 0x1(%rax)
jne 0x14b9
cmpb $0x0, 0x2(%rax)
je 0x1575
cmpb $0x71, 0x1(%rax)
jne 0x14c9
cmpb $0x0, 0x2(%rax)
je 0x15a4
cmpb $0x72, 0x1(%rax)
jne 0x14d9
cmpb $0x0, 0x2(%rax)
je 0x15b7
cmpb $0x73, 0x1(%rax)
jne 0x14e9
cmpb $0x0, 0x2(%rax)
je 0x15f1
cmpb $0x76, 0x1(%rax)
jne 0x1621
cmpb $0x0, 0x2(%rax)
jne 0x1621
incl %r13d
cmpl %r15d, %r13d
jge 0x1621
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x1060
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xc(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x2b4e(%rip), %rdi      # 0x4078
jmp 0x161a
leaq 0x2e2e(%rip), %rdi      # 0x4364
callq 0x1040
movl $0x1, %ebp
jmp 0x1621
incl %r13d
cmpl %r15d, %r13d
jge 0x1621
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x1130
movl %eax, %r12d
leaq 0x2aa5(%rip), %rdi      # 0x400c
movl %eax, %esi
xorl %eax, %eax
callq 0x1090
jmp 0x1621
incl %r13d
cmpl %r15d, %r13d
jge 0x1621
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x1060
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x2a8c(%rip), %rdi      # 0x402e
jmp 0x161a
leaq 0x2dd1(%rip), %rdi      # 0x437c
callq 0x1040
movl $0x1, %ebx
jmp 0x1621
incl %r13d
cmpl %r15d, %r13d
jge 0x1621
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x1060
cvtsd2ss %xmm0, %xmm0
ucomiss 0x2a32(%rip), %xmm0     # 0x4008
jne 0x15de
jnp 0x17c1
movss %xmm0, 0x14(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x2a58(%rip), %rdi      # 0x4047
jmp 0x161a
incl %r13d
cmpl %r15d, %r13d
jge 0x1621
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
callq 0x1060
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x10(%rsp)
cvtss2sd %xmm0, %xmm0
leaq 0x2a45(%rip), %rdi      # 0x405f
movb $0x1, %al
callq 0x1090
incl %r13d
cmpl %r15d, %r13d
jl 0x1479
jmp 0x1656
xorl %r12d, %r12d
movss 0x29ca(%rip), %xmm0     # 0x4004
xorl %ebp, %ebp
xorl %ebx, %ebx
movss %xmm0, 0x14(%rsp)
movss %xmm0, 0x18(%rsp)
movss %xmm0, 0xc(%rsp)
movss %xmm0, 0x10(%rsp)
subl %r13d, %r15d
cmpl $0x2, %r15d
jne 0x17a9
movslq %r13d, %rax
movq (%r14,%rax,8), %r15
movq 0x8(%r14,%rax,8), %r13
leaq 0x1c(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x2cc8
movq %rax, %r14
testl %r12d, %r12d
je 0x168e
movl %r12d, 0x1c(%rsp)
testq %r14, %r14
je 0x17ae
movl 0x1c(%rsp), %esi
movl 0x8(%rsp), %edx
movq %r13, %rdi
callq 0x2f58
testq %rax, %rax
je 0x17b6
movq %rax, %r15
movl 0x1c(%rsp), %edi
movl 0x8(%rsp), %esi
callq 0x1901
movq %rax, %r12
movq %rax, %rdi
movss 0x10(%rsp), %xmm0
callq 0x17d8
movq %r12, %rdi
movss 0x18(%rsp), %xmm0
callq 0x1809
movq %r12, %rdi
movss 0x14(%rsp), %xmm0
callq 0x183a
movq %r12, %rdi
movss 0xc(%rsp), %xmm0
callq 0x1886
movq %r12, %rdi
movl %ebp, %esi
callq 0x1870
movq %r12, %rdi
movl %ebx, %esi
callq 0x1875
leaq 0x1020(%rsp), %rbx
leaq 0x20(%rsp), %r13
movl $0x800, %eax            # imm = 0x800
xorl %edx, %edx
idivl 0x8(%rsp)
movq %r14, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x322e
movl %eax, %ebp
movq %r12, %rdi
testl %eax, %eax
je 0x1749
movq %rbx, %rsi
movl %ebp, %edx
callq 0x1ddb
jmp 0x175d
callq 0x1cdb
jmp 0x175d
movq %r15, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x32ac
movl $0x800, %eax            # imm = 0x800
xorl %edx, %edx
idivl 0x8(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movl %eax, %edx
callq 0x1be8
testl %eax, %eax
jg 0x1750
testl %ebp, %ebp
jg 0x171c
movq %r12, %rdi
callq 0x18b1
movq %r14, %rdi
callq 0x314c
movq %r15, %rdi
callq 0x314c
xorl %eax, %eax
addq $0x2028, %rsp           # imm = 0x2028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1191
movq %r15, %rdi
callq 0x11de
movq %r14, %rdi
movq %r13, %rsi
callq 0x11b2
callq 0x1170
nop