#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_source_str(char *tempstr, int source) {
  switch (source) {
  case -1:
    sprintf(tempstr, "INT");
    break;
  case (7 - (7)):
    sprintf(tempstr, "DIN IN");
    break;
  case (8 - (7)):
    sprintf(tempstr, "USB HOST");
    break;
  case (9 - (7)):
    sprintf(tempstr, "USB DEV");
    break;
  default:
    sprintf(tempstr, "---");
    break;
  }
}


x86 assembly (clang, -O0):
<panel_utils_clock_source_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     119c <panel_utils_clock_source_str+0x8c>
mov    -0x18(%rbp),%rax
lea    0xec1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <sprintf@plt>
jmp    11ac <panel_utils_clock_source_str+0x9c>
mov    -0x8(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1030 <sprintf@plt>
jmp    11ac <panel_utils_clock_source_str+0x9c>
mov    -0x8(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1030 <sprintf@plt>
jmp    11ac <panel_utils_clock_source_str+0x9c>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1030 <sprintf@plt>
jmp    11ac <panel_utils_clock_source_str+0x9c>
mov    -0x8(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panel_utils_clock_source_str>:
add    $0x1,%esi
cmp    $0x3,%esi
ja     111f <panel_utils_clock_source_str+0x1f>
lea    0xef1(%rip),%rax
movslq (%rax,%rsi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movl   $0x544e49,(%rdi)
ret
movl   $0x2d2d2d,(%rdi)
ret
movl   $0x4e4920,0x3(%rdi)
movl   $0x204e4944,(%rdi)
ret
movabs $0x54534f4820425355,%rax
4f 53 54
mov    %rax,(%rdi)
movb   $0x0,0x8(%rdi)
ret
movabs $0x56454420425355,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
@.str = [4 x i8] c"INT\00"
@.str.1 = [7 x i8] c"DIN IN\00"
@.str.2 = [9 x i8] c"USB HOST\00"
@.str.3 = [8 x i8] c"USB DEV\00"
@.str.4 = [4 x i8] c"---\00"
define void @panel_utils_clock_source_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 %18 [
i32 -1, label %6
i32 0, label %9
i32 1, label %12
i32 2, label %15
]
6: ; preds = %2
%7 = load i8*, i8** %3
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %21
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %21
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %21
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = call i32 @sprintf(i8* %16, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %21
18: ; preds = %2
%19 = load i8*, i8** %3
%20 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %21
21: ; preds = %18, %15, %12, %9, %6
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"DIN IN\00"
@.str.2 = [9 x i8] c"USB HOST\00"
define void @panel_utils_clock_source_str(i8* nocapture writeonly %0, i32 %1) {
switch i32 %1, label %9 [
i32 -1, label %3
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
3: ; preds = %2
%4 = bitcast i8* %0 to i32*
store i32 5525065, i32* %4
br label %11
5: ; 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.1, i64 0, i64 0), i64 7, i1 false)
br label %11
6: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(9) %0, i8* align 1 dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 9, i1 false)
br label %11
7: ; preds = %2
%8 = bitcast i8* %0 to i64*
store i64 24283006898426709, i64* %8
br label %11
9: ; preds = %2
%10 = bitcast i8* %0 to i32*
store i32 2960685, i32* %10
br label %11
11: ; preds = %9, %7, %6, %5, %3
ret void
}