xunge/DecIR huggingface dataset:
double f4_sum_pre_double_int(double v0, int v) { return v0 + ((double)(v)); }


x86 assembly (clang, -O0):
<f4_sum_pre_double_int>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_double_int>:
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_double_int(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to double
%8 = fadd double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @f4_sum_pre_double_int(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fadd double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ GPSSatellitesHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void GPSSatellitesLogging() { UAVObjLogging(GPSSatellitesHandle()); }


x86 assembly (clang, -O0):
<GPSSatellitesLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <GPSSatellitesHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPSSatellitesLogging>:
push   %rax
xor    %eax,%eax
call   1040 <GPSSatellitesHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @GPSSatellitesLogging() {
%1 = call i32 (...) @GPSSatellitesHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSSatellitesLogging() {
%1 = tail call i32 (...) @GPSSatellitesHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
float acos(float);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float x, f;
  scanf("%f", &x);
  if ((x >= -1) && (x <= 1)) {
    f = acos(x);
  }
  printf("f = %f\n", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xea4(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1186 <main+0x56>
movss  0xe97(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1186 <main+0x56>
movss  -0x8(%rbp),%xmm0
call   1040 <acos@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <acos@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [8 x i8] c"f = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fcmp oge float %5, -1.000000e+00
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load float, float* %2
%9 = fcmp ole float %8, 1.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load float, float* %2
%12 = call float @acos(float %11)
store float %12, float* %3
br label %13
13: ; preds = %10, %7, %0
%14 = load float, float* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [8 x i8] c"f = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fcmp oge float %4, -1.000000e+00
%6 = fcmp ole float %4, 1.000000e+00
%7 = call float @acos(float %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), float %7)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void trim(char *buf) {
  char *cp = buf + strlen(buf);
  while (--cp >= buf && *cp == ' ')
    *cp = 0;
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
jb     1168 <trim+0x58>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1178 <trim+0x68>
jmp    1184 <trim+0x74>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    113d <trim+0x2d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jb     1141 <trim+0x31>
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,(%rax)
jne    1141 <trim+0x31>
movb   $0x0,(%rax)
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jae    1130 <trim+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @trim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8* %8, i8** %3
br label %9
9: ; preds = %21, %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 -1
store i8* %11, i8** %3
%12 = load i8*, i8** %2
%13 = icmp uge i8* %11, %12
br i1 %13, label %14, label %19
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 32
br label %19
19: ; preds = %14, %9
%20 = phi i1 [ false, %9 ], [ %18, %14 ]
br i1 %20, label %21, label %23
21: ; preds = %19
%22 = load i8*, i8** %3
store i8 0, i8* %22
br label %9
23: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @trim(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ult i8* %5, %0
br i1 %6, label %14, label %7
7: ; preds = %1, %11
%8 = phi i8* [ %12, %11 ], [ %5, %1 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 32
br i1 %10, label %11, label %14
11: ; preds = %7
store i8 0, i8* %8
%12 = getelementptr inbounds i8, i8* %8, i64 -1
%13 = icmp ult i8* %12, %0
br i1 %13, label %14, label %7
14: ; preds = %7, %11, %1
ret void
}
void TMR3TimerSetCritSect(void) {}


x86 assembly (clang, -O0):
<TMR3TimerSetCritSect>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TMR3TimerSetCritSect>:
ret

LLVM IR (-O0):
define void @TMR3TimerSetCritSect() {
ret void
}

LLVM IR (-O2):
define void @TMR3TimerSetCritSect() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void Usage() {
  fprintf(stdout,
          "=============================================================\n");
  fprintf(stdout,
          "rtpis [serial-port-name] [serial-port-name server-name]  \n");
  fprintf(stdout,
          "=============================================================\n");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xf06(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%r14
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0a(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [63 x i8] c"=============================================================\0A\00"
@.str.1 = [59 x i8] c"rtpis [serial-port-name] [serial-port-name server-name] \0A\00"
define void @Usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [63 x i8] c"=============================================================\0A\00"
@.str.1 = [59 x i8] c"rtpis [serial-port-name] [serial-port-name server-name] \0A\00"
define void @Usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float powf(float, float);
float srgb2linear(float v) {
  float K0 = 0.04045f;
  float a = 0.055f;
  float phi = 12.92f;
  float gamma = 2.4f;
  return v <= K0 ? v / phi : powf((v + a) / (1.0f + a), gamma);
}


x86 assembly (clang, -O0):
<srgb2linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee7(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xeb4(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1178 <srgb2linear+0x68>
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11a2 <srgb2linear+0x92>
movss  -0x4(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xe86(%rip),%xmm1
addss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
call   1030 <powf@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srgb2linear>:
movss  0xee8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    113a <srgb2linear+0x2a>
addss  0xee3(%rip),%xmm0
divss  0xedf(%rip),%xmm0
movss  0xedb(%rip),%xmm1
jmp    1030 <powf@plt>
divss  0xec2(%rip),%xmm0
ret

LLVM IR (-O0):
define float @srgb2linear(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %2
store float 0x3FA4B5DCC0000000, float* %3
store float 0x3FAC28F5C0000000, float* %4
store float 0x4029D70A40000000, float* %5
store float 0x4003333340000000, float* %6
%7 = load float, float* %2
%8 = load float, float* %3
%9 = fcmp ole float %7, %8
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load float, float* %2
%12 = load float, float* %5
%13 = fdiv float %11, %12
br label %23
14: ; preds = %1
%15 = load float, float* %2
%16 = load float, float* %4
%17 = fadd float %15, %16
%18 = load float, float* %4
%19 = fadd float 1.000000e+00, %18
%20 = fdiv float %17, %19
%21 = load float, float* %6
%22 = call float @powf(float %20, float %21)
br label %23
23: ; preds = %14, %10
%24 = phi float [ %13, %10 ], [ %22, %14 ]
ret float %24
}

LLVM IR (-O2):
define float @srgb2linear(float %0) {
%2 = fcmp ugt float %0, 0x3FA4B5DCC0000000
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = fdiv float %0, 0x4029D70A40000000
br label %9
5: ; preds = %1
%6 = fadd float %0, 0x3FAC28F5C0000000
%7 = fdiv float %6, 0x3FF0E147A0000000
%8 = tail call float @powf(float %7, float 0x4003333340000000)
br label %9
9: ; preds = %5, %3
%10 = phi float [ %4, %3 ], [ %8, %5 ]
ret float %10
}
/* Variables and functions */
int quick_sort_partion(int *, int, int);
int quick_sort_r(int array[], int start, int end) {
  if (start < end) {
    int j = quick_sort_partion(array, start, end);
    quick_sort_r(array, start, j - 1);
    quick_sort_r(array, j + 1, end);
  }
  return 0;
}


x86 assembly (clang, -O0):
<quick_sort_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort_r+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <quick_sort_partion@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort_r@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort_r@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort_r>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort_r+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <quick_sort_partion@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort_r@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort_r+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @quick_sort_r(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @quick_sort_partion(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = call i32 @quick_sort_r(i32* %16, i32 %17, i32 %19)
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
%25 = call i32 @quick_sort_r(i32* %21, i32 %23, i32 %24)
br label %26
26: ; preds = %11, %3
ret i32 0
}

LLVM IR (-O2):
define i32 @quick_sort_r(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ %1, %3 ]
%7 = tail call i32 @quick_sort_partion(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
%9 = tail call i32 @quick_sort_r(i32* %0, i32 %6, i32 %8)
%10 = add nsw i32 %7, 1
%11 = icmp slt i32 %10, %2
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ I2C_ReadByte(int, int, unsigned char *);
unsigned char SHT20_read_user_reg(void) {
  unsigned char val = 0;
  I2C_ReadByte(0X40, 0XE7, &val);
  return val;
}


x86 assembly (clang, -O0):
<SHT20_read_user_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x40,%edi
mov    $0xe7,%esi
lea    -0x1(%rbp),%rdx
call   1030 <I2C_ReadByte@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHT20_read_user_reg>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x40,%edi
mov    $0xe7,%esi
call   1030 <I2C_ReadByte@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @SHT20_read_user_reg() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @I2C_ReadByte(i32 64, i32 231, i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @SHT20_read_user_reg() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @I2C_ReadByte(i32 64, i32 231, i8* %1)
%3 = load i8, i8* %1
ret i8 %3
}
void _asl_fork_child(void) {}


x86 assembly (clang, -O0):
<_asl_fork_child>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_asl_fork_child>:
ret

LLVM IR (-O0):
define void @_asl_fork_child() {
ret void
}

LLVM IR (-O2):
define void @_asl_fork_child() {
ret void
}
void CANDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) =
      (*((volatile unsigned long *)(ulBase + 0x00000000))) | 0x00000001;
}


x86 assembly (clang, -O0):
<CANDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANDisable>:
orq    $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @CANDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 1
%8 = load i64, i64* %2
%9 = add i64 %8, 0
%10 = inttoptr i64 %9 to i64*
store volatile i64 %7, i64* %10
ret void
}

LLVM IR (-O2):
define void @CANDisable(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = or i64 %3, 1
store volatile i64 %4, i64* %2
ret void
}
char getChar(char n) { return (n < 10) ? n + '0' : n + 'A' - 10; }


x86 assembly (clang, -O0):
<getChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jge    1126 <getChar+0x26>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <getChar+0x33>
movsbl -0x1(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getChar>:
cmp    $0xa,%dil
mov    $0x30,%ecx
mov    $0x37,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @getChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, 48
br label %15
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = add nsw i32 %12, 65
%14 = sub nsw i32 %13, 10
br label %15
15: ; preds = %10, %6
%16 = phi i32 [ %9, %6 ], [ %14, %10 ]
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @getChar(i8 signext %0) {
%2 = icmp slt i8 %0, 10
%3 = select i1 %2, i8 48, i8 55
%4 = add i8 %3, %0
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void l2_close(int fd) { close(fd); }


x86 assembly (clang, -O0):
<l2_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l2_close>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @l2_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
ret void
}

LLVM IR (-O2):
define void @l2_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
float __glsl_dot(float p0, float p1) { return p0 * p1; }


x86 assembly (clang, -O0):
<__glsl_dot>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_dot>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__glsl_dot(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @__glsl_dot(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
char *path_identity(const char path[]) { return (char *)path; }


x86 assembly (clang, -O0):
<path_identity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_identity>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @path_identity(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret i8* %3
}

LLVM IR (-O2):
define i8* @path_identity(i8* readnone returned %0) {
ret i8* %0
}
int Bematech_FI_VersaoFirmware(Var, Retorno) {
  return Formata("\x1b|35|01|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_VersaoFirmware>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_VersaoFirmware>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\1B|35|01|\1B\00"
define i32 @Bematech_FI_VersaoFirmware(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"\1B|35|01|\1B\00"
define i32 @Bematech_FI_VersaoFirmware(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32, ...)*)(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 %3
}
void tVacationNavList(void) {}


x86 assembly (clang, -O0):
<tVacationNavList>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tVacationNavList>:
ret

LLVM IR (-O0):
define void @tVacationNavList() {
ret void
}

LLVM IR (-O2):
define void @tVacationNavList() {
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_AVTransport_Seek(struct UPnPService *Service,
                                      int ErrorCode, void *User) {
  printf("RND Invoke Response: AVTransport/Seek[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_AVTransport_Seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_AVTransport_Seek>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [56 x i8] c"RND Invoke Response: AVTransport/Seek[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_AVTransport_Seek(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [56 x i8] c"RND Invoke Response: AVTransport/Seek[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_AVTransport_Seek(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
unsigned int estMenuPause(const unsigned int touche) { return touche == 27; }


x86 assembly (clang, -O0):
<estMenuPause>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1b,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<estMenuPause>:
xor    %eax,%eax
cmp    $0x1b,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @estMenuPause(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 27
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @estMenuPause(i32 %0) {
%2 = icmp eq i32 %0, 27
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int symlink(const char *oldname __attribute__((unused)),
            const char *newname __attribute__((unused))) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<symlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symlink>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @symlink(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @symlink(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
int toupper(int chr) { return (chr >= 'a' && chr <= 'z') ? (chr - 32) : (chr); }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1129 <toupper+0x29>
cmpl   $0x7a,-0x4(%rbp)
jg     1129 <toupper+0x29>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <toupper+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ lcd_command(int);
int /*<<< orphan*/ print(char *);
void clearScreen() {
  lcd_command(0x01);
  print("\f");
}


x86 assembly (clang, -O0):
<clearScreen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <lcd_command@plt>
lea    0xecb(%rip),%rdi
call   1030 <print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearScreen>:
push   %rax
mov    $0x1,%edi
call   1040 <lcd_command@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0C\00"
define void @clearScreen() {
%1 = call i32 @lcd_command(i32 1)
%2 = call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0C\00"
define void @clearScreen() {
%1 = tail call i32 @lcd_command(i32 1)
%2 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_get_lifted_point(int n, int i, int j, double *point) {
  int fail;
  fail = _ada_use_c2phc4c(86, &i, &j, point, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_get_lifted_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x56,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_get_lifted_point>:
push   %rax
mov    %esi,0x4(%rsp)
mov    %edx,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x56,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_get_lifted_point(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
%10 = load double*, double** %8
%11 = call i32 @_ada_use_c2phc4c(i32 86, i32* %6, i32* %7, double* %10, i32 0)
store i32 %11, i32* %9
%12 = load i32, i32* %9
ret i32 %12
}

LLVM IR (-O2):
define i32 @celcon_get_lifted_point(i32 %0, i32 %1, i32 %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @_ada_use_c2phc4c(i32 86, i32* %5, i32* %6, double* %3, i32 0)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ configure_ADC(int);
int /*<<< orphan*/ configure_pulse();
int /*<<< orphan*/ configure_ramp();
void init_control(int decimation) {
  configure_pulse();
  configure_ramp();
  configure_ADC(decimation);
}


x86 assembly (clang, -O0):
<init_control>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <configure_pulse@plt>
mov    $0x0,%al
call   1040 <configure_ramp@plt>
mov    -0x4(%rbp),%edi
call   1050 <configure_ADC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_control>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <configure_pulse@plt>
xor    %eax,%eax
call   1040 <configure_ramp@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <configure_ADC@plt>

LLVM IR (-O0):
define void @init_control(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @configure_pulse()
%4 = call i32 (...) @configure_ramp()
%5 = load i32, i32* %2
%6 = call i32 @configure_ADC(i32 %5)
ret void
}

LLVM IR (-O2):
define void @init_control(i32 %0) {
%2 = tail call i32 (...) @configure_pulse()
%3 = tail call i32 (...) @configure_ramp()
%4 = tail call i32 @configure_ADC(i32 %0)
ret void
}
void unlockSemaphore(int semaphore_id) {}


x86 assembly (clang, -O0):
<unlockSemaphore>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlockSemaphore>:
ret

LLVM IR (-O0):
define void @unlockSemaphore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @unlockSemaphore(i32 %0) {
ret void
}
int __attribute__((no)) foo(int i) {
  switch (i) {
  case 0:
  case 1:
  case 2:
  case 3:
    return 0;
  default:
    return 1;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
ja     1124 <foo+0x24>
jmp    1118 <foo+0x18>
movl   $0x0,-0x4(%rbp)
jmp    112b <foo+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x4,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
i32 1, label %5
i32 2, label %5
i32 3, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 0, i32* %2
br label %7
6: ; preds = %1
store i32 1, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp ugt i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lcdPutchar(int /*<<< orphan*/);
void lcdPuts(char *string) {
  while (*string)
    lcdPutchar(*string++);
}


x86 assembly (clang, -O0):
<lcdPuts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <lcdPuts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <lcdPutchar@plt>
jmp    111c <lcdPuts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcdPuts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <lcdPuts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <lcdPutchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lcdPuts+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @lcdPuts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @lcdPutchar(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @lcdPuts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @lcdPutchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int get_msb(unsigned int n) { return 31 ^ __builtin_clz(n); }


x86 assembly (clang, -O0):
<get_msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
xor    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_msb>:
bsr    %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_msb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = xor i32 31, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_msb(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = xor i32 %2, 31
ret i32 %3
}
void i2d_CERTIFICATEPOLICIES(void) {}


x86 assembly (clang, -O0):
<i2d_CERTIFICATEPOLICIES>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_CERTIFICATEPOLICIES>:
ret

LLVM IR (-O0):
define void @i2d_CERTIFICATEPOLICIES() {
ret void
}

LLVM IR (-O2):
define void @i2d_CERTIFICATEPOLICIES() {
ret void
}
/* Variables and functions */
int session_get_session_process_access_ok(char *, char *, char *, char *,
                                          char *);
int session_access_process(char *application_name, char *session,
                           char *process_name, char *login_name,
                           char *role_name) {
  int access_ok;
  access_ok = session_get_session_process_access_ok(
      application_name, login_name, session, process_name, role_name);
  return access_ok;
}


x86 assembly (clang, -O0):
<session_access_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <session_get_session_process_access_ok@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<session_access_process>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rcx,%rsi
mov    %rax,%rcx
jmp    1030 <session_get_session_process_access_ok@plt>

LLVM IR (-O0):
define i32 @session_access_process(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%12 = load i8*, i8** %6
%13 = load i8*, i8** %9
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = load i8*, i8** %10
%17 = call i32 @session_get_session_process_access_ok(i8* %12, i8* %13, i8* %14, i8* %15, i8* %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
ret i32 %18
}

LLVM IR (-O2):
define i32 @session_access_process(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @session_get_session_process_access_ok(i8* %0, i8* %3, i8* %1, i8* %2, i8* %4)
ret i32 %6
}
void g_date_valid_dmy() {}


x86 assembly (clang, -O0):
<g_date_valid_dmy>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_date_valid_dmy>:
ret

LLVM IR (-O0):
define void @g_date_valid_dmy() {
ret void
}

LLVM IR (-O2):
define void @g_date_valid_dmy() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
void fwriteint16_t(uint16_t data, FILE *fp) { fwrite(&data, 1, 2, fp); }


x86 assembly (clang, -O0):
<fwriteint16_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwriteint16_t>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @fwriteint16_t(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @fwrite(i32* %3, i32 1, i32 2, i32* %5)
ret void
}

LLVM IR (-O2):
define void @fwriteint16_t(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @fwrite(i32* %3, i32 1, i32 2, i32* %1)
ret void
}
/* Variables and functions */
long long pow(int base, int power) {
  long long result = 1;
  while (power) {
    if (power & 1)
      result *= base;
    base *= base;
    power >>= 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1150 <pow+0x50>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1138 <pow+0x38>
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <pow+0x12>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
mov    $0x1,%eax
test   %esi,%esi
je     113d <pow+0x3d>
mov    $0x1,%r8d
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
movslq %ecx,%rcx
imul   %rcx,%rax
imul   %edi,%edi
sar    %edx
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <pow+0x20>
ret

LLVM IR (-O0):
define i64 @pow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
store i64 1, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = load i64, i64* %5
%17 = mul nsw i64 %16, %15
store i64 %17, i64* %5
br label %18
18: ; preds = %13, %9
%19 = load i32, i32* %3
%20 = load i32, i32* %3
%21 = mul nsw i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %4
%23 = ashr i32 %22, 1
store i32 %23, i32* %4
br label %6
24: ; preds = %6
%25 = load i64, i64* %5
ret i64 %25
}

LLVM IR (-O2):
define i64 @pow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %12, %4 ], [ 1, %2 ]
%6 = phi i32 [ %14, %4 ], [ %1, %2 ]
%7 = phi i32 [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = sext i32 %10 to i64
%12 = mul nsw i64 %5, %11
%13 = mul nsw i32 %7, %7
%14 = ashr i32 %6, 1
%15 = icmp ult i32 %6, 2
br i1 %15, label %16, label %4
16: ; preds = %4, %2
%17 = phi i64 [ 1, %2 ], [ %12, %4 ]
ret i64 %17
}
void sif_platform_irq_mask(int enable_mask) {}


x86 assembly (clang, -O0):
<sif_platform_irq_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sif_platform_irq_mask>:
ret

LLVM IR (-O0):
define void @sif_platform_irq_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @sif_platform_irq_mask(i32 %0) {
ret void
}
unsigned int compare_and_swap32(volatile unsigned int *address,
                                unsigned int old_value,
                                unsigned int new_value) {
  unsigned long prev = 0;
  __asm__ __volatile__("lock ; "
                       "cmpxchgl %k1,%2"
                       : "=a"(prev)
                       : "r"(new_value), "m"(*address), "0"(old_value)
                       : "memory");
  return prev == old_value;
}


x86 assembly (clang, -O0):
<compare_and_swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%eax
lock cmpxchg %ecx,(%rdx)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_and_swap32>:
mov    %esi,%ecx
mov    %rcx,%rax
lock cmpxchg %edx,(%rdi)
xor    %edx,%edx
cmp    %rcx,%rax
sete   %dl
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare_and_swap32(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i64 0, i64* %7
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = call i64 asm sideeffect "lock ; cmpxchgl ${1:k},$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %8, i32* elementtype(i32) %9, i64 %11)
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = icmp eq i64 %13, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @compare_and_swap32(i32* %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = tail call i64 asm sideeffect "lock ; cmpxchgl ${1:k},$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %2, i32* elementtype(i32) %0, i64 %4)
%6 = icmp eq i64 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int strlen(char *);
void removeNewLine(char str[]) {
  size_t ln = strlen(str) - 1;
  if (str[ln] == '\n') {
    str[ln] = '\0';
  }
}


x86 assembly (clang, -O0):
<removeNewLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    114f <removeNewLine+0x3f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeNewLine>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <removeNewLine+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @removeNewLine(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i8*, i8** %2
%9 = load i64, i64* %3
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %18
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8 0, i8* %17
br label %18
18: ; preds = %14, %1
ret void
}

LLVM IR (-O2):
define void @removeNewLine(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void error_handling(char *_message) {
  fputs(_message, stderr);
  fputc('\n', stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<error_handling>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error_handling>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @error_handling(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputc(i8 signext 10, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @error_handling(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputc(i8 signext 10, i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *getcwd(char *buf, size_t size) {
  buf[0] = 0;
  return buf;
}


x86 assembly (clang, -O0):
<getcwd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd>:
mov    %rdi,%rax
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define i8* @getcwd(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 0, i8* %6
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define i8* @getcwd(i8* returned writeonly %0, i64 %1) {
store i8 0, i8* %0
ret i8* %0
}
int finite(double x) { return __builtin_isfinite(x); }


x86 assembly (clang, -O0):
<finite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xefb(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xedf(%rip),%xmm1
ucomisd %xmm1,%xmm0
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<finite>:
andpd  0xef8(%rip),%xmm0
xor    %eax,%eax
ucomisd 0xefe(%rip),%xmm0
setne  %al
ret

LLVM IR (-O0):
define i32 @finite(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
%5 = fcmp one double %4, 0x7FF0000000000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @finite(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = fcmp one double %2, 0x7FF0000000000000
%4 = zext i1 %3 to i32
ret i32 %4
}