#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double cents2interv(double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ isdigit(char);
scalar_t__ islower(char);
double midi2freq(double, int);
double powl(double, int);
int sscanf(char *, char *, int *, ...);
int /*<<< orphan*/ stderr;
char tolower(char);
char toupper(char);
double abc2freq(char *s) {
  char *p, c, nominal;
  int accidental, num, den, oct, n;
  double f;
  int refA;
  nominal = ' ';
  accidental = 5;
  oct = 0;
  refA = 440.0;
  f = 1.0;
  p = s;
  c = *p;
  if (c == '=' || c == '^' || c == '_') {
    if (c == '=')
      accidental = 2;
    else if (c == '^') {
      if (*(p + 1) == '^') {
        accidental = 4;
        p++;
      } else
        accidental = 3;
    } else if (c == '_') {
      if (*(p + 1) == '_') {
        accidental = 0;
        p++;
      } else
        accidental = 1;
    }
    p++;
    num = 1;
    den = 1;
    if (*(p) == '/' || isdigit(*(p))) {
      if (*p == '/') {
        if ((n = sscanf(p, "/%d", &den)) == 0)
          den = 2;
      } else if ((n = sscanf(p, "%d/%d", &num, &den))) {
        if (n == 1)
          den = 2;
      } else {
        num = 1;
        den = 1;
      }
      while (isdigit(*p) || *p == '/')
        p++;
    }
    c = *p;
  }
  if (tolower(c) >= 'a' && tolower(c) <= 'g') {
    nominal = c;
    p++;
    ;
    while ((c = *(p)) == '\'') {
      oct++;
      p++;
    }
    while ((c = *(p)) == ',') {
      oct--;
      p++;
    }
  }
  if (islower(nominal)) {
    nominal = toupper(nominal);
    oct++;
  }
  switch (nominal) {
  case 'C':
    f = midi2freq(60.0, refA);
    break;
  case 'D':
    f = midi2freq(62.0, refA);
    break;
  case 'E':
    f = midi2freq(64.0, refA);
    break;
  case 'F':
    f = midi2freq(65.0, refA);
    break;
  case 'G':
    f = midi2freq(67.0, refA);
    break;
  case 'A':
    f = midi2freq(69.0, refA);
    break;
  case 'B':
    f = midi2freq(71.0, refA);
    break;
  default:
    fprintf(stderr, "\nERROR: abc2freq() cannot convert '%s'\n\n", s);
    return 1.0;
  }
  if (accidental == 0) {
    f /= cents2interv(200.0);
  } else if (accidental == 4) {
    f *= cents2interv(200.0);
  } else if (accidental == 1) {
    f /= cents2interv(100.0 * num / den);
  } else if (accidental == 3) {
    f *= cents2interv(100.0 * num / den);
  }
  f *= powl(2.0, oct);
  return f;
}


x86 assembly (clang, -O0):
<abc2freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
movb   $0x20,-0x1a(%rbp)
movl   $0x5,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x1b8,-0x3c(%rbp)
movsd  0xe43(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x3d,%eax
je     11fa <abc2freq+0x6a>
movsbl -0x19(%rbp),%eax
cmp    $0x5e,%eax
je     11fa <abc2freq+0x6a>
movsbl -0x19(%rbp),%eax
cmp    $0x5f,%eax
jne    13d0 <abc2freq+0x240>
movsbl -0x19(%rbp),%eax
cmp    $0x3d,%eax
jne    1213 <abc2freq+0x83>
movl   $0x2,-0x20(%rbp)
jmp    12a1 <abc2freq+0x111>
movsbl -0x19(%rbp),%eax
cmp    $0x5e,%eax
jne    1255 <abc2freq+0xc5>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x5e,%eax
jne    1249 <abc2freq+0xb9>
movl   $0x4,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1250 <abc2freq+0xc0>
movl   $0x3,-0x20(%rbp)
jmp    129c <abc2freq+0x10c>
movsbl -0x19(%rbp),%eax
cmp    $0x5f,%eax
jne    1297 <abc2freq+0x107>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x5f,%eax
jne    128b <abc2freq+0xfb>
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1292 <abc2freq+0x102>
movl   $0x1,-0x20(%rbp)
jmp    1297 <abc2freq+0x107>
jmp    129c <abc2freq+0x10c>
jmp    12a1 <abc2freq+0x111>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     12e1 <abc2freq+0x151>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     13c7 <abc2freq+0x237>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    131f <abc2freq+0x18f>
mov    -0x18(%rbp),%rdi
lea    0xd7a(%rip),%rsi
lea    -0x28(%rbp),%rdx
mov    $0x0,%al
call   10b0 <sscanf@plt>
mov    %eax,-0x30(%rbp)
cmp    $0x0,%eax
jne    131a <abc2freq+0x18a>
movl   $0x2,-0x28(%rbp)
jmp    136e <abc2freq+0x1de>
mov    -0x18(%rbp),%rdi
lea    0xd4a(%rip),%rsi
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
mov    $0x0,%al
call   10b0 <sscanf@plt>
mov    %eax,-0x30(%rbp)
cmp    $0x0,%eax
je     135b <abc2freq+0x1cb>
cmpl   $0x1,-0x30(%rbp)
jne    1356 <abc2freq+0x1c6>
movl   $0x2,-0x28(%rbp)
jmp    1369 <abc2freq+0x1d9>
movl   $0x1,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
jmp    136e <abc2freq+0x1de>
jmp    1373 <abc2freq+0x1e3>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x3d(%rbp)
jne    13a1 <abc2freq+0x211>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x3d(%rbp)
mov    -0x3d(%rbp),%al
test   $0x1,%al
jne    13b1 <abc2freq+0x221>
jmp    13c2 <abc2freq+0x232>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1373 <abc2freq+0x1e3>
jmp    13c7 <abc2freq+0x237>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%edi
call   10a0 <tolower@plt>
movsbl %al,%eax
cmp    $0x61,%eax
jl     1474 <abc2freq+0x2e4>
movsbl -0x19(%rbp),%edi
call   10a0 <tolower@plt>
movsbl %al,%eax
cmp    $0x67,%eax
jg     1474 <abc2freq+0x2e4>
mov    -0x19(%rbp),%al
mov    %al,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl %al,%eax
cmp    $0x27,%eax
jne    143b <abc2freq+0x2ab>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    140c <abc2freq+0x27c>
jmp    1440 <abc2freq+0x2b0>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl %al,%eax
cmp    $0x2c,%eax
jne    146f <abc2freq+0x2df>
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1440 <abc2freq+0x2b0>
jmp    1474 <abc2freq+0x2e4>
movsbl -0x1a(%rbp),%edi
call   1040 <islower@plt>
cmp    $0x0,%rax
je     149c <abc2freq+0x30c>
movsbl -0x1a(%rbp),%edi
call   1050 <toupper@plt>
mov    %al,-0x1a(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
movsbl -0x1a(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x6,%eax
ja     157c <abc2freq+0x3ec>
mov    -0x48(%rbp),%rax
lea    0xb9b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x3c(%rbp),%edi
movsd  0xb67(%rip),%xmm0
call   1070 <midi2freq@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    15a7 <abc2freq+0x417>
mov    -0x3c(%rbp),%edi
movsd  0xb45(%rip),%xmm0
call   1070 <midi2freq@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    15a7 <abc2freq+0x417>
mov    -0x3c(%rbp),%edi
movsd  0xb23(%rip),%xmm0
call   1070 <midi2freq@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    15a7 <abc2freq+0x417>
mov    -0x3c(%rbp),%edi
movsd  0xb01(%rip),%xmm0
call   1070 <midi2freq@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    15a7 <abc2freq+0x417>
mov    -0x3c(%rbp),%edi
movsd  0xadf(%rip),%xmm0
call   1070 <midi2freq@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    15a7 <abc2freq+0x417>
mov    -0x3c(%rbp),%edi
movsd  0xabd(%rip),%xmm0
call   1070 <midi2freq@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    15a7 <abc2freq+0x417>
mov    -0x3c(%rbp),%edi
movsd  0xa9b(%rip),%xmm0
call   1070 <midi2freq@plt>
movsd  %xmm0,-0x38(%rbp)
jmp    15a7 <abc2freq+0x417>
mov    0x2a5d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xaea(%rip),%rsi
call   1080 <fprintf@plt>
movsd  0xa63(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    169f <abc2freq+0x50f>
cmpl   $0x0,-0x20(%rbp)
jne    15d4 <abc2freq+0x444>
movsd  0xa8f(%rip),%xmm0
call   1090 <cents2interv@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    167b <abc2freq+0x4eb>
cmpl   $0x4,-0x20(%rbp)
jne    15fa <abc2freq+0x46a>
movsd  0xa62(%rip),%xmm0
call   1090 <cents2interv@plt>
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1676 <abc2freq+0x4e6>
cmpl   $0x1,-0x20(%rbp)
jne    1639 <abc2freq+0x4a9>
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  0xa2f(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1090 <cents2interv@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1671 <abc2freq+0x4e1>
cmpl   $0x3,-0x20(%rbp)
jne    166c <abc2freq+0x4dc>
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  0x9f0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1090 <cents2interv@plt>
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1671 <abc2freq+0x4e1>
jmp    1676 <abc2freq+0x4e6>
jmp    167b <abc2freq+0x4eb>
mov    -0x2c(%rbp),%edi
movsd  0x9ca(%rip),%xmm0
call   1060 <powl@plt>
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abc2freq>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
mov    (%rdi),%r15b
cmp    $0x3d,%r15b
je     11da <abc2freq+0x4a>
cmp    $0x5f,%r15b
je     11e4 <abc2freq+0x54>
mov    $0x5,%ebp
mov    %r14,%rbx
cmp    $0x5e,%r15b
jne    12ab <abc2freq+0x11b>
lea    0x1(%r14),%rbx
xor    %ebp,%ebp
cmpb   $0x5e,0x1(%r14)
sete   %bpl
cmovne %r14,%rbx
add    $0x3,%ebp
jmp    11f7 <abc2freq+0x67>
mov    $0x2,%ebp
mov    %r14,%rbx
jmp    11f7 <abc2freq+0x67>
xor    %ebp,%ebp
cmpb   $0x5f,0x1(%r14)
lea    0x1(%r14),%rbx
setne  %bpl
cmovne %r14,%rbx
movl   $0x1,0x10(%rsp)
movl   $0x1,0x4(%rsp)
mov    0x1(%rbx),%al
add    $0x1,%rbx
cmp    $0x2f,%al
je     122c <abc2freq+0x9c>
movsbl %al,%edi
call   1030 <isdigit@plt>
mov    (%rbx),%r15b
test   %rax,%rax
je     12ab <abc2freq+0x11b>
cmp    $0x2f,%r15b
jne    1250 <abc2freq+0xc0>
lea    0xe3f(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <sscanf@plt>
test   %eax,%eax
jne    1294 <abc2freq+0x104>
movl   $0x2,0x4(%rsp)
jmp    1294 <abc2freq+0x104>
lea    0xe19(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <sscanf@plt>
test   %eax,%eax
je     127e <abc2freq+0xee>
cmp    $0x1,%eax
jne    1294 <abc2freq+0x104>
movl   $0x2,0x4(%rsp)
jmp    1294 <abc2freq+0x104>
movl   $0x1,0x10(%rsp)
movl   $0x1,0x4(%rsp)
jmp    1294 <abc2freq+0x104>
add    $0x1,%rbx
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1290 <abc2freq+0x100>
movzbl (%rbx),%r15d
cmp    $0x2f,%r15b
je     1290 <abc2freq+0x100>
mov    %ebp,0x14(%rsp)
movsbl %r15b,%r12d
mov    %r12d,%edi
call   10a0 <tolower@plt>
xor    %ebp,%ebp
mov    $0x20,%r13b
cmp    $0x61,%al
jl     130f <abc2freq+0x17f>
mov    %r12d,%edi
call   10a0 <tolower@plt>
cmp    $0x67,%al
jg     130f <abc2freq+0x17f>
add    $0x1,%rbx
mov    $0xffffffff,%ebp
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
add    $0x1,%ebp
cmp    $0x27,%al
je     12e0 <abc2freq+0x150>
cmp    $0x2c,%al
jne    130c <abc2freq+0x17c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0xffffffff,%ebp
cmpb   $0x2c,(%rbx)
lea    0x1(%rbx),%rbx
je     1300 <abc2freq+0x170>
mov    %r15d,%r13d
movsbl %r13b,%ebx
mov    %ebx,%edi
call   1040 <islower@plt>
test   %rax,%rax
je     132c <abc2freq+0x19c>
mov    %ebx,%edi
call   1050 <toupper@plt>
mov    %eax,%r13d
add    $0x1,%ebp
movsbl %r13b,%eax
add    $0xffffffbf,%eax
cmp    $0x7,%eax
jae    137f <abc2freq+0x1ef>
cltq
lea    0xcf7(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
mov    $0x1b8,%edi
call   1070 <midi2freq@plt>
mov    0x14(%rsp),%eax
cmp    $0x4,%eax
movsd  %xmm0,0x8(%rsp)
ja     1407 <abc2freq+0x277>
mov    %eax,%eax
lea    0xcb4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsd  0xc93(%rip),%xmm0
jmp    13bc <abc2freq+0x22c>
mov    0x2c5a(%rip),%rax
mov    (%rax),%edi
lea    0xce7(%rip),%rsi
mov    %r14,%rdx
call   1080 <fprintf@plt>
movsd  0xc61(%rip),%xmm0
jmp    141c <abc2freq+0x28c>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xc56(%rip),%xmm0
cvtsi2sdl 0x4(%rsp),%xmm1
divsd  %xmm1,%xmm0
call   1090 <cents2interv@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
jmp    1401 <abc2freq+0x271>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xc2a(%rip),%xmm0
cvtsi2sdl 0x4(%rsp),%xmm1
divsd  %xmm1,%xmm0
jmp    13f2 <abc2freq+0x262>
movsd  0xc1e(%rip),%xmm0
call   1090 <cents2interv@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xc09(%rip),%xmm0
mov    %ebp,%edi
call   1060 <powl@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"/%d\00"
@.str.1 = [6 x i8] c"%d/%d\00"
@stderr = global i32 0
@.str.2 = [41 x i8] c"\0AERROR: abc2freq() cannot convert '%s'\0A\0A\00"
define double @abc2freq(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
%13 = alloca i32
store i8* %0, i8** %3
store i8 32, i8* %6
store i32 5, i32* %7
store i32 0, i32* %10
store i32 440, i32* %13
store double 1.000000e+00, double* %12
%14 = load i8*, i8** %3
store i8* %14, i8** %4
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
store i8 %16, i8* %5
%17 = load i8, i8* %5
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 61
br i1 %19, label %28, label %20
20: ; preds = %1
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 94
br i1 %23, label %28, label %24
24: ; preds = %20
%25 = load i8, i8* %5
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 95
br i1 %27, label %28, label %119
28: ; preds = %24, %20, %1
%29 = load i8, i8* %5
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 61
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 2, i32* %7
br label %65
33: ; preds = %28
%34 = load i8, i8* %5
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 94
br i1 %36, label %37, label %48
37: ; preds = %33
%38 = load i8*, i8** %4
%39 = getelementptr inbounds i8, i8* %38, i64 1
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 94
br i1 %42, label %43, label %46
43: ; preds = %37
store i32 4, i32* %7
%44 = load i8*, i8** %4
%45 = getelementptr inbounds i8, i8* %44, i32 1
store i8* %45, i8** %4
br label %47
46: ; preds = %37
store i32 3, i32* %7
br label %47
47: ; preds = %46, %43
br label %64
48: ; preds = %33
%49 = load i8, i8* %5
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 95
br i1 %51, label %52, label %63
52: ; preds = %48
%53 = load i8*, i8** %4
%54 = getelementptr inbounds i8, i8* %53, i64 1
%55 = load i8, i8* %54
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 95
br i1 %57, label %58, label %61
58: ; preds = %52
store i32 0, i32* %7
%59 = load i8*, i8** %4
%60 = getelementptr inbounds i8, i8* %59, i32 1
store i8* %60, i8** %4
br label %62
61: ; preds = %52
store i32 1, i32* %7
br label %62
62: ; preds = %61, %58
br label %63
63: ; preds = %62, %48
br label %64
64: ; preds = %63, %47
br label %65
65: ; preds = %64, %32
%66 = load i8*, i8** %4
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %4
store i32 1, i32* %8
store i32 1, i32* %9
%68 = load i8*, i8** %4
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 47
br i1 %71, label %77, label %72
72: ; preds = %65
%73 = load i8*, i8** %4
%74 = load i8, i8* %73
%75 = call i64 @isdigit(i8 signext %74)
%76 = icmp ne i64 %75, 0
br i1 %76, label %77, label %116
77: ; preds = %72, %65
%78 = load i8*, i8** %4
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = icmp eq i32 %80, 47
br i1 %81, label %82, label %88
82: ; preds = %77
%83 = load i8*, i8** %4
%84 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %83, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %9)
store i32 %84, i32* %11
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %87
86: ; preds = %82
store i32 2, i32* %9
br label %87
87: ; preds = %86, %82
br label %99
88: ; preds = %77
%89 = load i8*, i8** %4
%90 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %89, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %8, i32* %9)
store i32 %90, i32* %11
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %97
92: ; preds = %88
%93 = load i32, i32* %11
%94 = icmp eq i32 %93, 1
br i1 %94, label %95, label %96
95: ; preds = %92
store i32 2, i32* %9
br label %96
96: ; preds = %95, %92
br label %98
97: ; preds = %88
store i32 1, i32* %8
store i32 1, i32* %9
br label %98
98: ; preds = %97, %96
br label %99
99: ; preds = %98, %87
br label %100
100: ; preds = %112, %99
%101 = load i8*, i8** %4
%102 = load i8, i8* %101
%103 = call i64 @isdigit(i8 signext %102)
%104 = icmp ne i64 %103, 0
br i1 %104, label %110, label %105
105: ; preds = %100
%106 = load i8*, i8** %4
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
%109 = icmp eq i32 %108, 47
br label %110
110: ; preds = %105, %100
%111 = phi i1 [ true, %100 ], [ %109, %105 ]
br i1 %111, label %112, label %115
112: ; preds = %110
%113 = load i8*, i8** %4
%114 = getelementptr inbounds i8, i8* %113, i32 1
store i8* %114, i8** %4
br label %100
115: ; preds = %110
br label %116
116: ; preds = %115, %72
%117 = load i8*, i8** %4
%118 = load i8, i8* %117
store i8 %118, i8* %5
br label %119
119: ; preds = %116, %24
%120 = load i8, i8* %5
%121 = call signext i8 @tolower(i8 signext %120)
%122 = sext i8 %121 to i32
%123 = icmp sge i32 %122, 97
br i1 %123, label %124, label %155
124: ; preds = %119
%125 = load i8, i8* %5
%126 = call signext i8 @tolower(i8 signext %125)
%127 = sext i8 %126 to i32
%128 = icmp sle i32 %127, 103
br i1 %128, label %129, label %155
129: ; preds = %124
%130 = load i8, i8* %5
store i8 %130, i8* %6
%131 = load i8*, i8** %4
%132 = getelementptr inbounds i8, i8* %131, i32 1
store i8* %132, i8** %4
br label %133
133: ; preds = %138, %129
%134 = load i8*, i8** %4
%135 = load i8, i8* %134
store i8 %135, i8* %5
%136 = sext i8 %135 to i32
%137 = icmp eq i32 %136, 39
br i1 %137, label %138, label %143
138: ; preds = %133
%139 = load i32, i32* %10
%140 = add nsw i32 %139, 1
store i32 %140, i32* %10
%141 = load i8*, i8** %4
%142 = getelementptr inbounds i8, i8* %141, i32 1
store i8* %142, i8** %4
br label %133
143: ; preds = %133
br label %144
144: ; preds = %149, %143
%145 = load i8*, i8** %4
%146 = load i8, i8* %145
store i8 %146, i8* %5
%147 = sext i8 %146 to i32
%148 = icmp eq i32 %147, 44
br i1 %148, label %149, label %154
149: ; preds = %144
%150 = load i32, i32* %10
%151 = add nsw i32 %150, -1
store i32 %151, i32* %10
%152 = load i8*, i8** %4
%153 = getelementptr inbounds i8, i8* %152, i32 1
store i8* %153, i8** %4
br label %144
154: ; preds = %144
br label %155
155: ; preds = %154, %124, %119
%156 = load i8, i8* %6
%157 = call i64 @islower(i8 signext %156)
%158 = icmp ne i64 %157, 0
br i1 %158, label %159, label %164
159: ; preds = %155
%160 = load i8, i8* %6
%161 = call signext i8 @toupper(i8 signext %160)
store i8 %161, i8* %6
%162 = load i32, i32* %10
%163 = add nsw i32 %162, 1
store i32 %163, i32* %10
br label %164
164: ; preds = %159, %155
%165 = load i8, i8* %6
%166 = sext i8 %165 to i32
switch i32 %166, label %188 [
i32 67, label %167
i32 68, label %170
i32 69, label %173
i32 70, label %176
i32 71, label %179
i32 65, label %182
i32 66, label %185
]
167: ; preds = %164
%168 = load i32, i32* %13
%169 = call double @midi2freq(double 6.000000e+01, i32 %168)
store double %169, double* %12
br label %192
170: ; preds = %164
%171 = load i32, i32* %13
%172 = call double @midi2freq(double 6.200000e+01, i32 %171)
store double %172, double* %12
br label %192
173: ; preds = %164
%174 = load i32, i32* %13
%175 = call double @midi2freq(double 6.400000e+01, i32 %174)
store double %175, double* %12
br label %192
176: ; preds = %164
%177 = load i32, i32* %13
%178 = call double @midi2freq(double 6.500000e+01, i32 %177)
store double %178, double* %12
br label %192
179: ; preds = %164
%180 = load i32, i32* %13
%181 = call double @midi2freq(double 6.700000e+01, i32 %180)
store double %181, double* %12
br label %192
182: ; preds = %164
%183 = load i32, i32* %13
%184 = call double @midi2freq(double 6.900000e+01, i32 %183)
store double %184, double* %12
br label %192
185: ; preds = %164
%186 = load i32, i32* %13
%187 = call double @midi2freq(double 7.100000e+01, i32 %186)
store double %187, double* %12
br label %192
188: ; preds = %164
%189 = load i32, i32* @stderr
%190 = load i8*, i8** %3
%191 = call i32 @fprintf(i32 %189, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %190)
store double 1.000000e+00, double* %2
br label %241
192: ; preds = %185, %182, %179, %176, %173, %170, %167
%193 = load i32, i32* %7
%194 = icmp eq i32 %193, 0
br i1 %194, label %195, label %199
195: ; preds = %192
%196 = call double @cents2interv(double 2.000000e+02)
%197 = load double, double* %12
%198 = fdiv double %197, %196
store double %198, double* %12
br label %235
199: ; preds = %192
%200 = load i32, i32* %7
%201 = icmp eq i32 %200, 4
br i1 %201, label %202, label %206
202: ; preds = %199
%203 = call double @cents2interv(double 2.000000e+02)
%204 = load double, double* %12
%205 = fmul double %204, %203
store double %205, double* %12
br label %234
206: ; preds = %199
%207 = load i32, i32* %7
%208 = icmp eq i32 %207, 1
br i1 %208, label %209, label %219
209: ; preds = %206
%210 = load i32, i32* %8
%211 = sitofp i32 %210 to double
%212 = fmul double 1.000000e+02, %211
%213 = load i32, i32* %9
%214 = sitofp i32 %213 to double
%215 = fdiv double %212, %214
%216 = call double @cents2interv(double %215)
%217 = load double, double* %12
%218 = fdiv double %217, %216
store double %218, double* %12
br label %233
219: ; preds = %206
%220 = load i32, i32* %7
%221 = icmp eq i32 %220, 3
br i1 %221, label %222, label %232
222: ; preds = %219
%223 = load i32, i32* %8
%224 = sitofp i32 %223 to double
%225 = fmul double 1.000000e+02, %224
%226 = load i32, i32* %9
%227 = sitofp i32 %226 to double
%228 = fdiv double %225, %227
%229 = call double @cents2interv(double %228)
%230 = load double, double* %12
%231 = fmul double %230, %229
store double %231, double* %12
br label %232
232: ; preds = %222, %219
br label %233
233: ; preds = %232, %209
br label %234
234: ; preds = %233, %202
br label %235
235: ; preds = %234, %195
%236 = load i32, i32* %10
%237 = call double @powl(double 2.000000e+00, i32 %236)
%238 = load double, double* %12
%239 = fmul double %238, %237
store double %239, double* %12
%240 = load double, double* %12
store double %240, double* %2
br label %241
241: ; preds = %235, %188
%242 = load double, double* %2
ret double %242
}

LLVM IR (-O2):
@.str = [4 x i8] c"/%d\00"
@.str.1 = [6 x i8] c"%d/%d\00"
@stderr = global i32 0
@.str.2 = [41 x i8] c"\0AERROR: abc2freq() cannot convert '%s'\0A\0A\00"
@switch.table.abc2freq = [7 x double] [double 6.900000e+01, double 7.100000e+01, double 6.000000e+01, double 6.200000e+01, double 6.400000e+01, double 6.500000e+01, double 6.700000e+01]
define double @abc2freq(i8* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = load i8, i8* %0
switch i8 %6, label %51 [
i8 61, label %20
i8 94, label %7
i8 95, label %13
]
7: ; preds = %1
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 94
%11 = select i1 %10, i8* %8, i8* %0
%12 = select i1 %10, i32 4, i32 3
br label %20
13: ; preds = %1
%14 = getelementptr inbounds i8, i8* %0, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 95
%17 = select i1 %16, i8* %14, i8* %0
%18 = xor i1 %16, true
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %13, %7, %1
%21 = phi i8* [ %0, %1 ], [ %11, %7 ], [ %17, %13 ]
%22 = phi i32 [ 2, %1 ], [ %12, %7 ], [ %19, %13 ]
%23 = getelementptr inbounds i8, i8* %21, i64 1
store i32 1, i32* %2
store i32 1, i32* %3
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 47
br i1 %25, label %32, label %26
26: ; preds = %20
%27 = tail call i64 @isdigit(i8 signext %24)
%28 = icmp eq i64 %27, 0
%29 = load i8, i8* %23
br i1 %28, label %51, label %30
30: ; preds = %26
%31 = icmp eq i8 %29, 47
br i1 %31, label %32, label %36
32: ; preds = %20, %30
%33 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %40
35: ; preds = %32
store i32 2, i32* %3
br label %40
36: ; preds = %30
%37 = call i32 (i8*, i8*, i32*, ...) @sscanf(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
switch i32 %37, label %40 [
i32 0, label %39
i32 1, label %38
]
38: ; preds = %36
store i32 2, i32* %3
br label %40
39: ; preds = %36
store i32 1, i32* %2
store i32 1, i32* %3
br label %40
40: ; preds = %36, %39, %38, %32, %35
br label %41
41: ; preds = %40, %49
%42 = phi i8* [ %50, %49 ], [ %23, %40 ]
%43 = load i8, i8* %42
%44 = call i64 @isdigit(i8 signext %43)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %41
%47 = load i8, i8* %42
%48 = icmp eq i8 %47, 47
br i1 %48, label %49, label %51
49: ; preds = %41, %46
%50 = getelementptr inbounds i8, i8* %42, i64 1
br label %41
51: ; preds = %46, %26, %1
%52 = phi i8* [ %0, %1 ], [ %23, %26 ], [ %42, %46 ]
%53 = phi i8 [ %6, %1 ], [ %29, %26 ], [ %47, %46 ]
%54 = phi i32 [ 5, %1 ], [ %22, %26 ], [ %22, %46 ]
%55 = call signext i8 @tolower(i8 signext %53)
%56 = icmp sgt i8 %55, 96
br i1 %56, label %57, label %73
57: ; preds = %51
%58 = call signext i8 @tolower(i8 signext %53)
%59 = icmp slt i8 %58, 104
br i1 %59, label %60, label %73
60: ; preds = %57, %60
%61 = phi i8* [ %63, %60 ], [ %52, %57 ]
%62 = phi i32 [ %65, %60 ], [ 0, %57 ]
%63 = getelementptr inbounds i8, i8* %61, i64 1
%64 = load i8, i8* %63
%65 = add nuw nsw i32 %62, 1
switch i8 %64, label %73 [
i8 39, label %60
i8 44, label %66
]
66: ; preds = %60, %66
%67 = phi i32 [ %69, %66 ], [ %62, %60 ]
%68 = phi i8* [ %70, %66 ], [ %63, %60 ]
%69 = add nsw i32 %67, -1
%70 = getelementptr inbounds i8, i8* %68, i64 1
%71 = load i8, i8* %70
%72 = icmp eq i8 %71, 44
br i1 %72, label %66, label %73
73: ; preds = %60, %66, %57, %51
%74 = phi i8 [ 32, %57 ], [ 32, %51 ], [ %53, %66 ], [ %53, %60 ]
%75 = phi i32 [ 0, %57 ], [ 0, %51 ], [ %69, %66 ], [ %62, %60 ]
%76 = call i64 @islower(i8 signext %74)
%77 = icmp eq i64 %76, 0
br i1 %77, label %81, label %78
78: ; preds = %73
%79 = call signext i8 @toupper(i8 signext %74)
%80 = add nsw i32 %75, 1
br label %81
81: ; preds = %78, %73
%82 = phi i8 [ %79, %78 ], [ %74, %73 ]
%83 = phi i32 [ %80, %78 ], [ %75, %73 ]
%84 = sext i8 %82 to i32
%85 = add nsw i32 %84, -65
%86 = icmp ult i32 %85, 7
br i1 %86, label %90, label %87
87: ; preds = %81
%88 = load i32, i32* @stderr
%89 = call i32 @fprintf(i32 %88, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %123
90: ; preds = %81
%91 = sext i32 %85 to i64
%92 = getelementptr inbounds [7 x double], [7 x double]* @switch.table.abc2freq, i64 0, i64 %91
%93 = load double, double* %92
%94 = call double @midi2freq(double %93, i32 440)
switch i32 %54, label %119 [
i32 0, label %95
i32 4, label %98
i32 1, label %101
i32 3, label %110
]
95: ; preds = %90
%96 = call double @cents2interv(double 2.000000e+02)
%97 = fdiv double %94, %96
br label %119
98: ; preds = %90
%99 = call double @cents2interv(double 2.000000e+02)
%100 = fmul double %94, %99
br label %119
101: ; preds = %90
%102 = load i32, i32* %2
%103 = sitofp i32 %102 to double
%104 = fmul double %103, 1.000000e+02
%105 = load i32, i32* %3
%106 = sitofp i32 %105 to double
%107 = fdiv double %104, %106
%108 = call double @cents2interv(double %107)
%109 = fdiv double %94, %108
br label %119
110: ; preds = %90
%111 = load i32, i32* %2
%112 = sitofp i32 %111 to double
%113 = fmul double %112, 1.000000e+02
%114 = load i32, i32* %3
%115 = sitofp i32 %114 to double
%116 = fdiv double %113, %115
%117 = call double @cents2interv(double %116)
%118 = fmul double %94, %117
br label %119
119: ; preds = %90, %98, %110, %101, %95
%120 = phi double [ %97, %95 ], [ %100, %98 ], [ %109, %101 ], [ %118, %110 ], [ %94, %90 ]
%121 = call double @powl(double 2.000000e+00, i32 %83)
%122 = fmul double %120, %121
br label %123
123: ; preds = %119, %87
%124 = phi double [ 1.000000e+00, %87 ], [ %122, %119 ]
ret double %124
}