#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 */
int /*<<< orphan*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
void panel_utils_note_to_name(char *tempstr, int note, int octdisp,
                              int padding) {
  int oct, degree;
  if (note < 0 || note > 0x7f) {
    sprintf(tempstr, "--");
  }
  oct = (note / 12) - 1;
  degree = note % 12;
  if (octdisp) {
    switch (degree) {
    case 0:
      sprintf(tempstr, "C%d", oct);
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 1:
      sprintf(tempstr, "C#%d", oct);
      break;
    case 2:
      sprintf(tempstr, "D%d", oct);
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 3:
      sprintf(tempstr, "D#%d", oct);
      break;
    case 4:
      sprintf(tempstr, "E%d", oct);
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 5:
      sprintf(tempstr, "F%d", oct);
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 6:
      sprintf(tempstr, "F#%d", oct);
      break;
    case 7:
      sprintf(tempstr, "G%d", oct);
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 8:
      sprintf(tempstr, "G#%d", oct);
      break;
    case 9:
      sprintf(tempstr, "A%d", oct);
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 10:
      sprintf(tempstr, "A#%d", oct);
      break;
    case 11:
      sprintf(tempstr, "B%d", oct);
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    }
  } else {
    switch (degree) {
    case 0:
      sprintf(tempstr, "C");
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 1:
      sprintf(tempstr, "C#");
      break;
    case 2:
      sprintf(tempstr, "D");
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 3:
      sprintf(tempstr, "D#");
      break;
    case 4:
      sprintf(tempstr, "E");
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 5:
      sprintf(tempstr, "F");
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 6:
      sprintf(tempstr, "F#");
      break;
    case 7:
      sprintf(tempstr, "G");
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 8:
      sprintf(tempstr, "G#");
      break;
    case 9:
      sprintf(tempstr, "A");
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    case 10:
      sprintf(tempstr, "A#");
      break;
    case 11:
      sprintf(tempstr, "B");
      if (padding) {
        strcat(tempstr, " ");
      }
      break;
    }
  }
}


x86 assembly (clang, -O0):
<panel_utils_note_to_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1149 <panel_utils_note_to_name+0x29>
cmpl   $0x7f,-0xc(%rbp)
jle    115b <panel_utils_note_to_name+0x3b>
mov    -0x8(%rbp),%rdi
lea    0xf0c(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0xc(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     139c <panel_utils_note_to_name+0x27c>
mov    -0x1c(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0xb,%rax
ja     1397 <panel_utils_note_to_name+0x277>
mov    -0x28(%rbp),%rax
lea    0xe90(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     11d8 <panel_utils_note_to_name+0xb8>
mov    -0x8(%rbp),%rdi
lea    0xe94(%rip),%rsi
call   1030 <strcat@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xe7e(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     1226 <panel_utils_note_to_name+0x106>
mov    -0x8(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   1030 <strcat@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xe39(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xe24(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     1274 <panel_utils_note_to_name+0x154>
mov    -0x8(%rbp),%rdi
lea    0xdf8(%rip),%rsi
call   1030 <strcat@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xdf4(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     12a8 <panel_utils_note_to_name+0x188>
mov    -0x8(%rbp),%rdi
lea    0xdc4(%rip),%rsi
call   1030 <strcat@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xdc4(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xdaf(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     12f6 <panel_utils_note_to_name+0x1d6>
mov    -0x8(%rbp),%rdi
lea    0xd76(%rip),%rsi
call   1030 <strcat@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xd7f(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xd6a(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     1344 <panel_utils_note_to_name+0x224>
mov    -0x8(%rbp),%rdi
lea    0xd28(%rip),%rsi
call   1030 <strcat@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xd3a(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xd25(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     1392 <panel_utils_note_to_name+0x272>
mov    -0x8(%rbp),%rdi
lea    0xcda(%rip),%rsi
call   1030 <strcat@plt>
jmp    1397 <panel_utils_note_to_name+0x277>
jmp    1590 <panel_utils_note_to_name+0x470>
mov    -0x1c(%rbp),%eax
mov    %rax,-0x30(%rbp)
sub    $0xb,%rax
ja     158b <panel_utils_note_to_name+0x46b>
mov    -0x30(%rbp),%rax
lea    0xc48(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    0xcce(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     13ed <panel_utils_note_to_name+0x2cd>
mov    -0x8(%rbp),%rdi
lea    0xc7f(%rip),%rsi
call   1030 <strcat@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xc9f(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xc8b(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     1435 <panel_utils_note_to_name+0x315>
mov    -0x8(%rbp),%rdi
lea    0xc37(%rip),%rsi
call   1030 <strcat@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xc5c(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xc48(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     147d <panel_utils_note_to_name+0x35d>
mov    -0x8(%rbp),%rdi
lea    0xbef(%rip),%rsi
call   1030 <strcat@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xc19(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     14ae <panel_utils_note_to_name+0x38e>
mov    -0x8(%rbp),%rdi
lea    0xbbe(%rip),%rsi
call   1030 <strcat@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xbea(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xbd6(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     14f6 <panel_utils_note_to_name+0x3d6>
mov    -0x8(%rbp),%rdi
lea    0xb76(%rip),%rsi
call   1030 <strcat@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xba7(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xb93(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     153e <panel_utils_note_to_name+0x41e>
mov    -0x8(%rbp),%rdi
lea    0xb2e(%rip),%rsi
call   1030 <strcat@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xb64(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
mov    -0x8(%rbp),%rdi
lea    0xb50(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     1586 <panel_utils_note_to_name+0x466>
mov    -0x8(%rbp),%rdi
lea    0xae6(%rip),%rsi
call   1030 <strcat@plt>
jmp    158b <panel_utils_note_to_name+0x46b>
jmp    1590 <panel_utils_note_to_name+0x470>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panel_utils_note_to_name>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdi,%rbx
cmp    $0x80,%esi
jb     1139 <panel_utils_note_to_name+0x19>
movb   $0x0,0x2(%rbx)
movw   $0x2d2d,(%rbx)
movslq %esi,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
lea    (%rax,%rcx,1),%edi
shl    $0x2,%edi
lea    (%rdi,%rdi,2),%edi
sub    %edi,%esi
test   %edx,%edx
je     118a <panel_utils_note_to_name+0x6a>
cmp    $0xb,%esi
ja     1296 <panel_utils_note_to_name+0x176>
lea    (%rax,%rcx,1),%edx
add    $0xffffffff,%edx
mov    %esi,%eax
lea    0xe8b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xede(%rip),%rsi
jmp    121b <panel_utils_note_to_name+0xfb>
cmp    $0xb,%esi
ja     1296 <panel_utils_note_to_name+0x176>
mov    %esi,%eax
lea    0xe94(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movw   $0x43,(%rbx)
jmp    1225 <panel_utils_note_to_name+0x105>
lea    0xeb6(%rip),%rsi
jmp    1204 <panel_utils_note_to_name+0xe4>
lea    0xeb2(%rip),%rsi
jmp    121b <panel_utils_note_to_name+0xfb>
lea    0xead(%rip),%rsi
jmp    1204 <panel_utils_note_to_name+0xe4>
lea    0xea9(%rip),%rsi
jmp    121b <panel_utils_note_to_name+0xfb>
lea    0xea4(%rip),%rsi
jmp    121b <panel_utils_note_to_name+0xfb>
lea    0xe9f(%rip),%rsi
jmp    1204 <panel_utils_note_to_name+0xe4>
lea    0xe9b(%rip),%rsi
jmp    121b <panel_utils_note_to_name+0xfb>
lea    0xe96(%rip),%rsi
jmp    1204 <panel_utils_note_to_name+0xe4>
lea    0xe92(%rip),%rsi
jmp    121b <panel_utils_note_to_name+0xfb>
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sprintf@plt>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
test   %ebp,%ebp
je     1296 <panel_utils_note_to_name+0x176>
lea    0xe37(%rip),%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strcat@plt>
movb   $0x0,0x2(%rbx)
movw   $0x2343,(%rbx)
jmp    1296 <panel_utils_note_to_name+0x176>
movw   $0x44,(%rbx)
jmp    1225 <panel_utils_note_to_name+0x105>
movb   $0x0,0x2(%rbx)
movw   $0x2344,(%rbx)
jmp    1296 <panel_utils_note_to_name+0x176>
movw   $0x45,(%rbx)
jmp    1225 <panel_utils_note_to_name+0x105>
movw   $0x46,(%rbx)
jmp    1225 <panel_utils_note_to_name+0x105>
movb   $0x0,0x2(%rbx)
movw   $0x2346,(%rbx)
jmp    1296 <panel_utils_note_to_name+0x176>
movw   $0x47,(%rbx)
jmp    1225 <panel_utils_note_to_name+0x105>
movb   $0x0,0x2(%rbx)
movw   $0x2347,(%rbx)
jmp    1296 <panel_utils_note_to_name+0x176>
movw   $0x41,(%rbx)
jmp    1225 <panel_utils_note_to_name+0x105>
movb   $0x0,0x2(%rbx)
movw   $0x2341,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
movw   $0x42,(%rbx)
jmp    1225 <panel_utils_note_to_name+0x105>

LLVM IR (-O0):
@.str = [3 x i8] c"--\00"
@.str.1 = [4 x i8] c"C%d\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [5 x i8] c"C#%d\00"
@.str.4 = [4 x i8] c"D%d\00"
@.str.5 = [5 x i8] c"D#%d\00"
@.str.6 = [4 x i8] c"E%d\00"
@.str.7 = [4 x i8] c"F%d\00"
@.str.8 = [5 x i8] c"F#%d\00"
@.str.9 = [4 x i8] c"G%d\00"
@.str.10 = [5 x i8] c"G#%d\00"
@.str.11 = [4 x i8] c"A%d\00"
@.str.12 = [5 x i8] c"A#%d\00"
@.str.13 = [4 x i8] c"B%d\00"
@.str.14 = [2 x i8] c"C\00"
@.str.15 = [3 x i8] c"C#\00"
@.str.16 = [2 x i8] c"D\00"
@.str.17 = [3 x i8] c"D#\00"
@.str.18 = [2 x i8] c"E\00"
@.str.19 = [2 x i8] c"F\00"
@.str.20 = [3 x i8] c"F#\00"
@.str.21 = [2 x i8] c"G\00"
@.str.22 = [3 x i8] c"G#\00"
@.str.23 = [2 x i8] c"A\00"
@.str.24 = [3 x i8] c"A#\00"
@.str.25 = [2 x i8] c"B\00"
define void @panel_utils_note_to_name(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %4
%14 = load i32, i32* %6
%15 = icmp sgt i32 %14, 127
br i1 %15, label %16, label %19
16: ; preds = %13, %4
%17 = load i8*, i8** %5
%18 = call i32 (i8*, i8*, ...) @sprintf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %16, %13
%20 = load i32, i32* %6
%21 = sdiv i32 %20, 12
%22 = sub nsw i32 %21, 1
store i32 %22, i32* %9
%23 = load i32, i32* %6
%24 = srem i32 %23, 12
store i32 %24, i32* %10
%25 = load i32, i32* %7
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %120
27: ; preds = %19
%28 = load i32, i32* %10
switch i32 %28, label %119 [
i32 0, label %29
i32 1, label %39
i32 2, label %43
i32 3, label %53
i32 4, label %57
i32 5, label %67
i32 6, label %77
i32 7, label %81
i32 8, label %91
i32 9, label %95
i32 10, label %105
i32 11, label %109
]
29: ; preds = %27
%30 = load i8*, i8** %5
%31 = load i32, i32* %9
%32 = call i32 (i8*, i8*, ...) @sprintf(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %8
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %29
%36 = load i8*, i8** %5
%37 = call i32 @strcat(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %38
38: ; preds = %35, %29
br label %119
39: ; preds = %27
%40 = load i8*, i8** %5
%41 = load i32, i32* %9
%42 = call i32 (i8*, i8*, ...) @sprintf(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %41)
br label %119
43: ; preds = %27
%44 = load i8*, i8** %5
%45 = load i32, i32* %9
%46 = call i32 (i8*, i8*, ...) @sprintf(i8* %44, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %8
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %52
49: ; preds = %43
%50 = load i8*, i8** %5
%51 = call i32 @strcat(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %52
52: ; preds = %49, %43
br label %119
53: ; preds = %27
%54 = load i8*, i8** %5
%55 = load i32, i32* %9
%56 = call i32 (i8*, i8*, ...) @sprintf(i8* %54, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %55)
br label %119
57: ; preds = %27
%58 = load i8*, i8** %5
%59 = load i32, i32* %9
%60 = call i32 (i8*, i8*, ...) @sprintf(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %59)
%61 = load i32, i32* %8
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %57
%64 = load i8*, i8** %5
%65 = call i32 @strcat(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %66
66: ; preds = %63, %57
br label %119
67: ; preds = %27
%68 = load i8*, i8** %5
%69 = load i32, i32* %9
%70 = call i32 (i8*, i8*, ...) @sprintf(i8* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %69)
%71 = load i32, i32* %8
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %67
%74 = load i8*, i8** %5
%75 = call i32 @strcat(i8* %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %76
76: ; preds = %73, %67
br label %119
77: ; preds = %27
%78 = load i8*, i8** %5
%79 = load i32, i32* %9
%80 = call i32 (i8*, i8*, ...) @sprintf(i8* %78, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %79)
br label %119
81: ; preds = %27
%82 = load i8*, i8** %5
%83 = load i32, i32* %9
%84 = call i32 (i8*, i8*, ...) @sprintf(i8* %82, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %83)
%85 = load i32, i32* %8
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %90
87: ; preds = %81
%88 = load i8*, i8** %5
%89 = call i32 @strcat(i8* %88, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %90
90: ; preds = %87, %81
br label %119
91: ; preds = %27
%92 = load i8*, i8** %5
%93 = load i32, i32* %9
%94 = call i32 (i8*, i8*, ...) @sprintf(i8* %92, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %93)
br label %119
95: ; preds = %27
%96 = load i8*, i8** %5
%97 = load i32, i32* %9
%98 = call i32 (i8*, i8*, ...) @sprintf(i8* %96, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 %97)
%99 = load i32, i32* %8
%100 = icmp ne i32 %99, 0
br i1 %100, label %101, label %104
101: ; preds = %95
%102 = load i8*, i8** %5
%103 = call i32 @strcat(i8* %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %104
104: ; preds = %101, %95
br label %119
105: ; preds = %27
%106 = load i8*, i8** %5
%107 = load i32, i32* %9
%108 = call i32 (i8*, i8*, ...) @sprintf(i8* %106, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 %107)
br label %119
109: ; preds = %27
%110 = load i8*, i8** %5
%111 = load i32, i32* %9
%112 = call i32 (i8*, i8*, ...) @sprintf(i8* %110, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i32 %111)
%113 = load i32, i32* %8
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %118
115: ; preds = %109
%116 = load i8*, i8** %5
%117 = call i32 @strcat(i8* %116, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %118
118: ; preds = %115, %109
br label %119
119: ; preds = %27, %118, %105, %104, %91, %90, %77, %76, %66, %53, %52, %39, %38
br label %201
120: ; preds = %19
%121 = load i32, i32* %10
switch i32 %121, label %200 [
i32 0, label %122
i32 1, label %131
i32 2, label %134
i32 3, label %143
i32 4, label %146
i32 5, label %155
i32 6, label %164
i32 7, label %167
i32 8, label %176
i32 9, label %179
i32 10, label %188
i32 11, label %191
]
122: ; preds = %120
%123 = load i8*, i8** %5
%124 = call i32 (i8*, i8*, ...) @sprintf(i8* %123, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0))
%125 = load i32, i32* %8
%126 = icmp ne i32 %125, 0
br i1 %126, label %127, label %130
127: ; preds = %122
%128 = load i8*, i8** %5
%129 = call i32 @strcat(i8* %128, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %130
130: ; preds = %127, %122
br label %200
131: ; preds = %120
%132 = load i8*, i8** %5
%133 = call i32 (i8*, i8*, ...) @sprintf(i8* %132, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
br label %200
134: ; preds = %120
%135 = load i8*, i8** %5
%136 = call i32 (i8*, i8*, ...) @sprintf(i8* %135, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.16, i64 0, i64 0))
%137 = load i32, i32* %8
%138 = icmp ne i32 %137, 0
br i1 %138, label %139, label %142
139: ; preds = %134
%140 = load i8*, i8** %5
%141 = call i32 @strcat(i8* %140, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %142
142: ; preds = %139, %134
br label %200
143: ; preds = %120
%144 = load i8*, i8** %5
%145 = call i32 (i8*, i8*, ...) @sprintf(i8* %144, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0))
br label %200
146: ; preds = %120
%147 = load i8*, i8** %5
%148 = call i32 (i8*, i8*, ...) @sprintf(i8* %147, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
%149 = load i32, i32* %8
%150 = icmp ne i32 %149, 0
br i1 %150, label %151, label %154
151: ; preds = %146
%152 = load i8*, i8** %5
%153 = call i32 @strcat(i8* %152, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %154
154: ; preds = %151, %146
br label %200
155: ; preds = %120
%156 = load i8*, i8** %5
%157 = call i32 (i8*, i8*, ...) @sprintf(i8* %156, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.19, i64 0, i64 0))
%158 = load i32, i32* %8
%159 = icmp ne i32 %158, 0
br i1 %159, label %160, label %163
160: ; preds = %155
%161 = load i8*, i8** %5
%162 = call i32 @strcat(i8* %161, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %163
163: ; preds = %160, %155
br label %200
164: ; preds = %120
%165 = load i8*, i8** %5
%166 = call i32 (i8*, i8*, ...) @sprintf(i8* %165, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0))
br label %200
167: ; preds = %120
%168 = load i8*, i8** %5
%169 = call i32 (i8*, i8*, ...) @sprintf(i8* %168, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
%170 = load i32, i32* %8
%171 = icmp ne i32 %170, 0
br i1 %171, label %172, label %175
172: ; preds = %167
%173 = load i8*, i8** %5
%174 = call i32 @strcat(i8* %173, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %175
175: ; preds = %172, %167
br label %200
176: ; preds = %120
%177 = load i8*, i8** %5
%178 = call i32 (i8*, i8*, ...) @sprintf(i8* %177, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0))
br label %200
179: ; preds = %120
%180 = load i8*, i8** %5
%181 = call i32 (i8*, i8*, ...) @sprintf(i8* %180, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%182 = load i32, i32* %8
%183 = icmp ne i32 %182, 0
br i1 %183, label %184, label %187
184: ; preds = %179
%185 = load i8*, i8** %5
%186 = call i32 @strcat(i8* %185, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %187
187: ; preds = %184, %179
br label %200
188: ; preds = %120
%189 = load i8*, i8** %5
%190 = call i32 (i8*, i8*, ...) @sprintf(i8* %189, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0))
br label %200
191: ; preds = %120
%192 = load i8*, i8** %5
%193 = call i32 (i8*, i8*, ...) @sprintf(i8* %192, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0))
%194 = load i32, i32* %8
%195 = icmp ne i32 %194, 0
br i1 %195, label %196, label %199
196: ; preds = %191
%197 = load i8*, i8** %5
%198 = call i32 @strcat(i8* %197, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %199
199: ; preds = %196, %191
br label %200
200: ; preds = %120, %199, %188, %187, %176, %175, %164, %163, %154, %143, %142, %131, %130
br label %201
201: ; preds = %200, %119
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"--\00"
@.str.1 = [4 x i8] c"C%d\00"
@.str.2 = [2 x i8] c" \00"
@.str.3 = [5 x i8] c"C#%d\00"
@.str.4 = [4 x i8] c"D%d\00"
@.str.5 = [5 x i8] c"D#%d\00"
@.str.6 = [4 x i8] c"E%d\00"
@.str.7 = [4 x i8] c"F%d\00"
@.str.8 = [5 x i8] c"F#%d\00"
@.str.9 = [4 x i8] c"G%d\00"
@.str.10 = [5 x i8] c"G#%d\00"
@.str.11 = [4 x i8] c"A%d\00"
@.str.12 = [5 x i8] c"A#%d\00"
@.str.13 = [4 x i8] c"B%d\00"
@.str.15 = [3 x i8] c"C#\00"
@.str.17 = [3 x i8] c"D#\00"
@.str.20 = [3 x i8] c"F#\00"
@.str.22 = [3 x i8] c"G#\00"
@.str.24 = [3 x i8] c"A#\00"
define void @panel_utils_note_to_name(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ugt i32 %1, 127
br i1 %5, label %6, label %7
6: ; preds = %4
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 3, i1 false)
br label %7
7: ; preds = %4, %6
%8 = sdiv i32 %1, 12
%9 = add nsw i32 %8, -1
%10 = srem i32 %1, 12
%11 = icmp eq i32 %2, 0
br i1 %11, label %58, label %12
12: ; preds = %7
switch i32 %10, label %99 [
i32 0, label %13
i32 1, label %18
i32 2, label %20
i32 3, label %25
i32 4, label %27
i32 5, label %32
i32 6, label %37
i32 7, label %39
i32 8, label %44
i32 9, label %46
i32 10, label %51
i32 11, label %53
]
13: ; preds = %12
%14 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%15 = icmp eq i32 %3, 0
br i1 %15, label %99, label %16
16: ; preds = %13
%17 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
18: ; preds = %12
%19 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %9)
br label %99
20: ; preds = %12
%21 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%22 = icmp eq i32 %3, 0
br i1 %22, label %99, label %23
23: ; preds = %20
%24 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
25: ; preds = %12
%26 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %9)
br label %99
27: ; preds = %12
%28 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 %9)
%29 = icmp eq i32 %3, 0
br i1 %29, label %99, label %30
30: ; preds = %27
%31 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
32: ; preds = %12
%33 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 %9)
%34 = icmp eq i32 %3, 0
br i1 %34, label %99, label %35
35: ; preds = %32
%36 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
37: ; preds = %12
%38 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %9)
br label %99
39: ; preds = %12
%40 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %9)
%41 = icmp eq i32 %3, 0
br i1 %41, label %99, label %42
42: ; preds = %39
%43 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
44: ; preds = %12
%45 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 %9)
br label %99
46: ; preds = %12
%47 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 %9)
%48 = icmp eq i32 %3, 0
br i1 %48, label %99, label %49
49: ; preds = %46
%50 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
51: ; preds = %12
%52 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i32 %9)
br label %99
53: ; preds = %12
%54 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i32 %9)
%55 = icmp eq i32 %3, 0
br i1 %55, label %99, label %56
56: ; preds = %53
%57 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
58: ; preds = %7
switch i32 %10, label %99 [
i32 0, label %59
i32 1, label %64
i32 2, label %65
i32 3, label %70
i32 4, label %71
i32 5, label %76
i32 6, label %81
i32 7, label %82
i32 8, label %87
i32 9, label %88
i32 10, label %93
i32 11, label %94
]
59: ; preds = %58
%60 = bitcast i8* %0 to i16*
store i16 67, i16* %60
%61 = icmp eq i32 %3, 0
br i1 %61, label %99, label %62
62: ; preds = %59
%63 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
64: ; preds = %58
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i64 3, i1 false)
br label %99
65: ; preds = %58
%66 = bitcast i8* %0 to i16*
store i16 68, i16* %66
%67 = icmp eq i32 %3, 0
br i1 %67, label %99, label %68
68: ; preds = %65
%69 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
70: ; preds = %58
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.17, i64 0, i64 0), i64 3, i1 false)
br label %99
71: ; preds = %58
%72 = bitcast i8* %0 to i16*
store i16 69, i16* %72
%73 = icmp eq i32 %3, 0
br i1 %73, label %99, label %74
74: ; preds = %71
%75 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
76: ; preds = %58
%77 = bitcast i8* %0 to i16*
store i16 70, i16* %77
%78 = icmp eq i32 %3, 0
br i1 %78, label %99, label %79
79: ; preds = %76
%80 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
81: ; preds = %58
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.20, i64 0, i64 0), i64 3, i1 false)
br label %99
82: ; preds = %58
%83 = bitcast i8* %0 to i16*
store i16 71, i16* %83
%84 = icmp eq i32 %3, 0
br i1 %84, label %99, label %85
85: ; preds = %82
%86 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
87: ; preds = %58
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.22, i64 0, i64 0), i64 3, i1 false)
br label %99
88: ; preds = %58
%89 = bitcast i8* %0 to i16*
store i16 65, i16* %89
%90 = icmp eq i32 %3, 0
br i1 %90, label %99, label %91
91: ; preds = %88
%92 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
93: ; preds = %58
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i64 0, i64 0), i64 3, i1 false)
br label %99
94: ; preds = %58
%95 = bitcast i8* %0 to i16*
store i16 66, i16* %95
%96 = icmp eq i32 %3, 0
br i1 %96, label %99, label %97
97: ; preds = %94
%98 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %99
99: ; preds = %64, %70, %81, %87, %93, %58, %62, %59, %68, %65, %74, %71, %79, %76, %85, %82, %91, %88, %97, %94, %18, %25, %37, %44, %51, %12, %16, %13, %23, %20, %30, %27, %35, %32, %42, %39, %49, %46, %56, %53
ret void
}