#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_key_split_str(char *tempstr, int key_split) {
  switch (key_split) {
  case 1:
    sprintf(tempstr, "Left Hand");
    break;
  case 2:
    sprintf(tempstr, "Right Hand");
    break;
  case 0:
  default:
    sprintf(tempstr, "OFF");
    break;
  }
}


x86 assembly (clang, -O0):
<panel_utils_key_split_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     117e <panel_utils_key_split_str+0x6e>
jmp    1132 <panel_utils_key_split_str+0x22>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1154 <panel_utils_key_split_str+0x44>
jmp    1143 <panel_utils_key_split_str+0x33>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     1169 <panel_utils_key_split_str+0x59>
jmp    1183 <panel_utils_key_split_str+0x73>
mov    -0x8(%rbp),%rdi
lea    0xea1(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1193 <panel_utils_key_split_str+0x83>
mov    -0x8(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1193 <panel_utils_key_split_str+0x83>
jmp    1183 <panel_utils_key_split_str+0x73>
mov    -0x8(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panel_utils_key_split_str>:
cmp    $0x2,%esi
je     111e <panel_utils_key_split_str+0x1e>
cmp    $0x1,%esi
jne    1133 <panel_utils_key_split_str+0x33>
movabs $0x6e6148207466654c,%rax
48 61 6e
mov    %rax,(%rdi)
movw   $0x64,0x8(%rdi)
ret
movabs $0x6148207468676952,%rax
20 48 61
mov    %rax,(%rdi)
movl   $0x646e61,0x7(%rdi)
ret
movl   $0x46464f,(%rdi)
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Left Hand\00"
@.str.1 = [11 x i8] c"Right Hand\00"
@.str.2 = [4 x i8] c"OFF\00"
define void @panel_utils_key_split_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 %13 [
i32 1, label %6
i32 2, label %9
i32 0, label %12
]
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %16
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %16
12: ; preds = %2
br label %13
13: ; preds = %2, %12
%14 = load i8*, i8** %3
%15 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %13, %9, %6
ret void
}

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