// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movss 0x3d96(%rip), %xmm0     # 0x5004
movss %xmm0, -0x24(%rbp)
movss 0x3d89(%rip), %xmm0     # 0x5004
movss %xmm0, -0x28(%rbp)
movss 0x3d7c(%rip), %xmm0     # 0x5004
movss %xmm0, -0x2c(%rbp)
movss 0x3d6f(%rip), %xmm0     # 0x5004
movss %xmm0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x1, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movl -0x40(%rbp), %ecx
xorl %eax, %eax
cmpl -0x8(%rbp), %ecx
movb %al, -0x4d(%rbp)
jge 0x12f0
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
sete %al
movb %al, -0x4d(%rbp)
movb -0x4d(%rbp), %al
testb $0x1, %al
jne 0x12fc
jmp 0x157a
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3cf9(%rip), %rsi      # 0x5008
callq 0x10b0
cmpl $0x0, %eax
jne 0x1333
movl $0x1, -0x38(%rbp)
leaq 0x3ce4(%rip), %rdi      # 0x500b
movb $0x0, %al
callq 0x1080
jmp 0x156c
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3cde(%rip), %rsi      # 0x5024
callq 0x10b0
cmpl $0x0, %eax
jne 0x138b
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1386
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1120
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %esi
leaq 0x3ca8(%rip), %rdi      # 0x5027
movb $0x0, %al
callq 0x1080
jmp 0x156a
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3cab(%rip), %rsi      # 0x5049
callq 0x10b0
cmpl $0x0, %eax
jne 0x13ef
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x13ea
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1050
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x28(%rbp)
movss -0x28(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3c69(%rip), %rdi      # 0x504c
movb $0x1, %al
callq 0x1080
jmp 0x1568
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3c63(%rip), %rsi      # 0x5065
callq 0x10b0
cmpl $0x0, %eax
jne 0x1426
movl $0x1, -0x3c(%rbp)
leaq 0x3c4e(%rip), %rdi      # 0x5068
movb $0x0, %al
callq 0x1080
jmp 0x1566
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3c4e(%rip), %rsi      # 0x5087
callq 0x10b0
cmpl $0x0, %eax
jne 0x149e
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1499
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1050
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp)
movss -0x2c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x1482
jp 0x1482
callq 0x1600
movss -0x2c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3bf8(%rip), %rdi      # 0x508a
movb $0x1, %al
callq 0x1080
jmp 0x1564
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3bf1(%rip), %rsi      # 0x50a2
callq 0x10b0
cmpl $0x0, %eax
jne 0x14ff
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x14fd
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1050
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x24(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3baf(%rip), %rdi      # 0x50a5
movb $0x1, %al
callq 0x1080
jmp 0x1562
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x3bac(%rip), %rsi      # 0x50be
callq 0x10b0
cmpl $0x0, %eax
jne 0x1560
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x155e
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1050
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x30(%rbp)
movss -0x30(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3b6a(%rip), %rdi      # 0x50c1
movb $0x1, %al
callq 0x1080
jmp 0x1560
jmp 0x1562
jmp 0x1564
jmp 0x1566
jmp 0x1568
jmp 0x156a
jmp 0x156c
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x12cb
movl -0x8(%rbp), %eax
subl -0x40(%rbp), %eax
cmpl $0x2, %eax
je 0x158a
callq 0x1600
movq -0x10(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl -0x40(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movss -0x24(%rbp), %xmm0
movss -0x28(%rbp), %xmm1
movss -0x2c(%rbp), %xmm2
movss -0x30(%rbp), %xmm3
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
movl -0x3c(%rbp), %r8d
movl -0x44(%rbp), %r9d
movl -0x48(%rbp), %r10d
movl -0x4c(%rbp), %eax
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
callq 0x1630
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)