#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 *);
void panel_utils_clock_ppq_to_str(char *tempstr, int ppq) {
  switch (ppq) {
  case 1:
    sprintf(tempstr, "1 PPQ");
    break;
  case 2:
    sprintf(tempstr, "2 PPQ");
    break;
  case 3:
    sprintf(tempstr, "3 PPQ");
    break;
  case 4:
    sprintf(tempstr, "4 PPQ");
    break;
  case 5:
    sprintf(tempstr, "6 PPQ");
    break;
  case 6:
    sprintf(tempstr, "8 PPQ");
    break;
  case 7:
    sprintf(tempstr, "12 PPQ");
    break;
  case 8:
    sprintf(tempstr, "24 PPQ");
    break;
  default:
    sprintf(tempstr, "OFF");
    break;
  }
}


x86 assembly (clang, -O0):
<panel_utils_clock_ppq_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x7,%eax
ja     11f0 <panel_utils_clock_ppq_to_str+0xe0>
mov    -0x18(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1200 <panel_utils_clock_ppq_to_str+0xf0>
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1200 <panel_utils_clock_ppq_to_str+0xf0>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1200 <panel_utils_clock_ppq_to_str+0xf0>
mov    -0x8(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1200 <panel_utils_clock_ppq_to_str+0xf0>
mov    -0x8(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1200 <panel_utils_clock_ppq_to_str+0xf0>
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1200 <panel_utils_clock_ppq_to_str+0xf0>
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1200 <panel_utils_clock_ppq_to_str+0xf0>
mov    -0x8(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1200 <panel_utils_clock_ppq_to_str+0xf0>
mov    -0x8(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panel_utils_clock_ppq_to_str>:
add    $0xffffffff,%esi
cmp    $0x7,%esi
ja     1125 <panel_utils_clock_ppq_to_str+0x25>
lea    0xef1(%rip),%rax
movslq (%rax,%rsi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movw   $0x51,0x4(%rdi)
movl   $0x50502031,(%rdi)
ret
movl   $0x46464f,(%rdi)
ret
movw   $0x51,0x4(%rdi)
movl   $0x50502032,(%rdi)
ret
movw   $0x51,0x4(%rdi)
movl   $0x50502033,(%rdi)
ret
movw   $0x51,0x4(%rdi)
movl   $0x50502034,(%rdi)
ret
movw   $0x51,0x4(%rdi)
movl   $0x50502036,(%rdi)
ret
movw   $0x51,0x4(%rdi)
movl   $0x50502038,(%rdi)
ret
movl   $0x515050,0x3(%rdi)
movl   $0x50203231,(%rdi)
ret
movl   $0x515050,0x3(%rdi)
movl   $0x50203432,(%rdi)
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1 PPQ\00"
@.str.1 = [6 x i8] c"2 PPQ\00"
@.str.2 = [6 x i8] c"3 PPQ\00"
@.str.3 = [6 x i8] c"4 PPQ\00"
@.str.4 = [6 x i8] c"6 PPQ\00"
@.str.5 = [6 x i8] c"8 PPQ\00"
@.str.6 = [7 x i8] c"12 PPQ\00"
@.str.7 = [7 x i8] c"24 PPQ\00"
@.str.8 = [4 x i8] c"OFF\00"
define void @panel_utils_clock_ppq_to_str(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %30 [
i32 1, label %6
i32 2, label %9
i32 3, label %12
i32 4, label %15
i32 5, label %18
i32 6, label %21
i32 7, label %24
i32 8, label %27
]
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %33
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %33
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %33
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %33
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %33
21: ; preds = %2
%22 = load i8*, i8** %3
%23 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %33
24: ; preds = %2
%25 = load i8*, i8** %3
%26 = call i32 @sprintf(i8* %25, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %33
27: ; preds = %2
%28 = load i8*, i8** %3
%29 = call i32 @sprintf(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %33
30: ; preds = %2
%31 = load i8*, i8** %3
%32 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %33
33: ; preds = %30, %27, %24, %21, %18, %15, %12, %9, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"1 PPQ\00"
@.str.1 = [6 x i8] c"2 PPQ\00"
@.str.2 = [6 x i8] c"3 PPQ\00"
@.str.3 = [6 x i8] c"4 PPQ\00"
@.str.4 = [6 x i8] c"6 PPQ\00"
@.str.5 = [6 x i8] c"8 PPQ\00"
@.str.6 = [7 x i8] c"12 PPQ\00"
@.str.7 = [7 x i8] c"24 PPQ\00"
define void @panel_utils_clock_ppq_to_str(i8* nocapture writeonly %0, i32 %1) {
switch i32 %1, label %11 [
i32 1, label %3
i32 2, label %4
i32 3, label %5
i32 4, label %6
i32 5, label %7
i32 6, label %8
i32 7, label %9
i32 8, label %10
]
3: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(6) %0, i8* align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6, i1 false)
br label %13
4: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(6) %0, i8* align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 6, i1 false)
br label %13
5: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(6) %0, i8* align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 6, i1 false)
br label %13
6: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(6) %0, i8* align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i64 6, i1 false)
br label %13
7: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(6) %0, i8* align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i64 6, i1 false)
br label %13
8: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(6) %0, i8* align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i64 6, i1 false)
br label %13
9: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(7) %0, i8* align 1 dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i64 7, i1 false)
br label %13
10: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(7) %0, i8* align 1 dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i64 7, i1 false)
br label %13
11: ; preds = %2
%12 = bitcast i8* %0 to i32*
store i32 4605519, i32* %12
br label %13
13: ; preds = %11, %10, %9, %8, %7, %6, %5, %4, %3
ret void
}