#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_step_len_to_str(char *tempstr, int speed) {
  switch (speed) {
  case 0:
    sprintf(tempstr, "1/32T");
    break;
  case 1:
    sprintf(tempstr, "1/32");
    break;
  case 2:
    sprintf(tempstr, "1/16T");
    break;
  case 3:
    sprintf(tempstr, "1/32.");
    break;
  case 4:
    sprintf(tempstr, "1/16");
    break;
  case 5:
    sprintf(tempstr, "1/8T");
    break;
  case 6:
    sprintf(tempstr, "1/16.");
    break;
  case 7:
    sprintf(tempstr, "1/8");
    break;
  case 8:
    sprintf(tempstr, "1/4T");
    break;
  case 9:
    sprintf(tempstr, "1/8.");
    break;
  case 10:
    sprintf(tempstr, "1/4");
    break;
  case 11:
    sprintf(tempstr, "1/2T");
    break;
  case 12:
    sprintf(tempstr, "1/4.");
    break;
  case 13:
    sprintf(tempstr, "1/2");
    break;
  case 14:
    sprintf(tempstr, "1/1T");
    break;
  case 15:
    sprintf(tempstr, "1/2.");
    break;
  case 16:
    sprintf(tempstr, "1/1");
    break;
  }
}


x86 assembly (clang, -O0):
<panel_utils_step_len_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x10,%rax
ja     12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    0xef5(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xee6(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xe98(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xe78(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xe58(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xe47(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xe37(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xe27(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xe16(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xe06(%rip),%rsi
call   1030 <sprintf@plt>
jmp    12a4 <panel_utils_step_len_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xdf6(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panel_utils_step_len_to_str>:
cmp    $0x10,%esi
ja     11cd <panel_utils_step_len_to_str+0xcd>
mov    %esi,%eax
lea    0xeee(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movw   $0x54,0x4(%rdi)
movl   $0x32332f31,(%rdi)
ret
movb   $0x0,0x4(%rdi)
movl   $0x32332f31,(%rdi)
ret
movw   $0x54,0x4(%rdi)
movl   $0x36312f31,(%rdi)
ret
movw   $0x2e,0x4(%rdi)
movl   $0x32332f31,(%rdi)
ret
movb   $0x0,0x4(%rdi)
movl   $0x36312f31,(%rdi)
ret
movb   $0x0,0x4(%rdi)
movl   $0x54382f31,(%rdi)
ret
movw   $0x2e,0x4(%rdi)
movl   $0x36312f31,(%rdi)
ret
movl   $0x382f31,(%rdi)
ret
movb   $0x0,0x4(%rdi)
movl   $0x54342f31,(%rdi)
ret
movb   $0x0,0x4(%rdi)
movl   $0x2e382f31,(%rdi)
ret
movl   $0x342f31,(%rdi)
ret
movb   $0x0,0x4(%rdi)
movl   $0x54322f31,(%rdi)
ret
movb   $0x0,0x4(%rdi)
movl   $0x2e342f31,(%rdi)
ret
movl   $0x322f31,(%rdi)
ret
movb   $0x0,0x4(%rdi)
movl   $0x54312f31,(%rdi)
ret
movb   $0x0,0x4(%rdi)
movl   $0x2e322f31,(%rdi)
ret
movl   $0x312f31,(%rdi)
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1/32T\00"
@.str.1 = [5 x i8] c"1/32\00"
@.str.2 = [6 x i8] c"1/16T\00"
@.str.3 = [6 x i8] c"1/32.\00"
@.str.4 = [5 x i8] c"1/16\00"
@.str.5 = [5 x i8] c"1/8T\00"
@.str.6 = [6 x i8] c"1/16.\00"
@.str.7 = [4 x i8] c"1/8\00"
@.str.8 = [5 x i8] c"1/4T\00"
@.str.9 = [5 x i8] c"1/8.\00"
@.str.10 = [4 x i8] c"1/4\00"
@.str.11 = [5 x i8] c"1/2T\00"
@.str.12 = [5 x i8] c"1/4.\00"
@.str.13 = [4 x i8] c"1/2\00"
@.str.14 = [5 x i8] c"1/1T\00"
@.str.15 = [5 x i8] c"1/2.\00"
@.str.16 = [4 x i8] c"1/1\00"
define void @panel_utils_step_len_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 %57 [
i32 0, label %6
i32 1, label %9
i32 2, label %12
i32 3, label %15
i32 4, label %18
i32 5, label %21
i32 6, label %24
i32 7, label %27
i32 8, label %30
i32 9, label %33
i32 10, label %36
i32 11, label %39
i32 12, label %42
i32 13, label %45
i32 14, label %48
i32 15, label %51
i32 16, label %54
]
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 %57
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %57
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 %57
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 %57
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %57
21: ; preds = %2
%22 = load i8*, i8** %3
%23 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %57
24: ; preds = %2
%25 = load i8*, i8** %3
%26 = call i32 @sprintf(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %57
27: ; preds = %2
%28 = load i8*, i8** %3
%29 = call i32 @sprintf(i8* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %57
30: ; preds = %2
%31 = load i8*, i8** %3
%32 = call i32 @sprintf(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %57
33: ; preds = %2
%34 = load i8*, i8** %3
%35 = call i32 @sprintf(i8* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %57
36: ; preds = %2
%37 = load i8*, i8** %3
%38 = call i32 @sprintf(i8* %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %57
39: ; preds = %2
%40 = load i8*, i8** %3
%41 = call i32 @sprintf(i8* %40, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
br label %57
42: ; preds = %2
%43 = load i8*, i8** %3
%44 = call i32 @sprintf(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %57
45: ; preds = %2
%46 = load i8*, i8** %3
%47 = call i32 @sprintf(i8* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
br label %57
48: ; preds = %2
%49 = load i8*, i8** %3
%50 = call i32 @sprintf(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
br label %57
51: ; preds = %2
%52 = load i8*, i8** %3
%53 = call i32 @sprintf(i8* %52, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %57
54: ; preds = %2
%55 = load i8*, i8** %3
%56 = call i32 @sprintf(i8* %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0))
br label %57
57: ; preds = %2, %54, %51, %48, %45, %42, %39, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"1/32T\00"
@.str.1 = [5 x i8] c"1/32\00"
@.str.2 = [6 x i8] c"1/16T\00"
@.str.3 = [6 x i8] c"1/32.\00"
@.str.4 = [5 x i8] c"1/16\00"
@.str.5 = [5 x i8] c"1/8T\00"
@.str.6 = [6 x i8] c"1/16.\00"
@.str.8 = [5 x i8] c"1/4T\00"
@.str.9 = [5 x i8] c"1/8.\00"
@.str.11 = [5 x i8] c"1/2T\00"
@.str.12 = [5 x i8] c"1/4.\00"
@.str.14 = [5 x i8] c"1/1T\00"
@.str.15 = [5 x i8] c"1/2.\00"
define void @panel_utils_step_len_to_str(i8* nocapture writeonly %0, i32 %1) {
switch i32 %1, label %24 [
i32 0, label %3
i32 1, label %4
i32 2, label %5
i32 3, label %6
i32 4, label %7
i32 5, label %8
i32 6, label %9
i32 7, label %10
i32 8, label %12
i32 9, label %13
i32 10, label %14
i32 11, label %16
i32 12, label %17
i32 13, label %18
i32 14, label %20
i32 15, label %21
i32 16, label %22
]
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 %24
4: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5, i1 false)
br label %24
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 %24
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 %24
7: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 5, i1 false)
br label %24
8: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64 5, i1 false)
br label %24
9: ; 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.6, i64 0, i64 0), i64 6, i1 false)
br label %24
10: ; preds = %2
%11 = bitcast i8* %0 to i32*
store i32 3682097, i32* %11
br label %24
12: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64 5, i1 false)
br label %24
13: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i64 5, i1 false)
br label %24
14: ; preds = %2
%15 = bitcast i8* %0 to i32*
store i32 3419953, i32* %15
br label %24
16: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i64 5, i1 false)
br label %24
17: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i64 5, i1 false)
br label %24
18: ; preds = %2
%19 = bitcast i8* %0 to i32*
store i32 3288881, i32* %19
br label %24
20: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i64 5, i1 false)
br label %24
21: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(5) %0, i8* align 1 dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0), i64 5, i1 false)
br label %24
22: ; preds = %2
%23 = bitcast i8* %0 to i32*
store i32 3223345, i32* %23
br label %24
24: ; preds = %2, %22, %21, %20, %18, %17, %16, %14, %13, %12, %10, %9, %8, %7, %6, %5, %4, %3
ret void
}