#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_utills_cv_output_scaling_to_str(char *tempstr, int mode) {
  if (mode == (1)) {
    sprintf(tempstr, "1.2V/oct");
  } else if (mode == (2)) {
    sprintf(tempstr, "Hz/volt");
  } else {
    sprintf(tempstr, "1V/oct");
  }
}


x86 assembly (clang, -O0):
<panel_utills_cv_output_scaling_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    113e <panel_utills_cv_output_scaling_to_str+0x2e>
mov    -0x8(%rbp),%rdi
lea    0xecc(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1172 <panel_utills_cv_output_scaling_to_str+0x62>
cmpl   $0x2,-0xc(%rbp)
jne    115d <panel_utills_cv_output_scaling_to_str+0x4d>
mov    -0x8(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <sprintf@plt>
jmp    116d <panel_utills_cv_output_scaling_to_str+0x5d>
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <sprintf@plt>
jmp    1172 <panel_utills_cv_output_scaling_to_str+0x62>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panel_utills_cv_output_scaling_to_str>:
cmp    $0x2,%esi
je     111c <panel_utills_cv_output_scaling_to_str+0x1c>
cmp    $0x1,%esi
jne    112a <panel_utills_cv_output_scaling_to_str+0x2a>
movabs $0x74636f2f56322e31,%rax
6f 63 74
mov    %rax,(%rdi)
movb   $0x0,0x8(%rdi)
ret
movabs $0x746c6f762f7a48,%rax
mov    %rax,(%rdi)
ret
movl   $0x74636f,0x3(%rdi)
movl   $0x6f2f5631,(%rdi)
ret

LLVM IR (-O0):
@.str = [9 x i8] c"1.2V/oct\00"
@.str.1 = [8 x i8] c"Hz/volt\00"
@.str.2 = [7 x i8] c"1V/oct\00"
define void @panel_utills_cv_output_scaling_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
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %20
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %3
%15 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %19
16: ; preds = %10
%17 = load i8*, i8** %3
%18 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %16, %13
br label %20
20: ; preds = %19, %7
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"1.2V/oct\00"
@.str.2 = [7 x i8] c"1V/oct\00"
define void @panel_utills_cv_output_scaling_to_str(i8* nocapture writeonly %0, i32 %1) {
switch i32 %1, label %6 [
i32 1, label %3
i32 2, label %4
]
3: ; 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, i64 0, i64 0), i64 9, i1 false)
br label %7
4: ; preds = %2
%5 = bitcast i8* %0 to i64*
store i64 32770323278428744, i64* %5
br label %7
6: ; 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.2, i64 0, i64 0), i64 7, i1 false)
br label %7
7: ; preds = %4, %6, %3
ret void
}