xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ HwSparkyHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void HwSparkyRequestUpdate() { UAVObjRequestUpdate(HwSparkyHandle()); }


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

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

LLVM IR (-O0):
define void @HwSparkyRequestUpdate() {
%1 = call i32 (...) @HwSparkyHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwSparkyRequestUpdate() {
%1 = tail call i32 (...) @HwSparkyHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
__attribute__((__const__)) float dim_rampsf(float encoding) {
  return encoding / 2.f;
}


x86 assembly (clang, -O0):
<dim_rampsf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dim_rampsf>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @dim_rampsf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 2.000000e+00
ret float %4
}

LLVM IR (-O2):
define float @dim_rampsf(float %0) {
%2 = fmul float %0, 5.000000e-01
ret float %2
}
/* Variables and functions */
double fabs(double);
double math___Float_abs___impl(double recv) { return fabs(recv); }


x86 assembly (clang, -O0):
<math___Float_abs___impl>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<math___Float_abs___impl>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @math___Float_abs___impl(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fabs.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @math___Float_abs___impl(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
ret double %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool mpga_get_copyright(const uint8_t *p_mpga) { return !!(p_mpga[3] & 0x80); }


x86 assembly (clang, -O0):
<mpga_get_copyright>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_get_copyright>:
mov    0xc(%rdi),%eax
shr    $0x7,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mpga_get_copyright(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mpga_get_copyright(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = lshr i32 %3, 7
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  float a = 3.5;
  float b = 2.5;
  __VERIFIER_assert(a == b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 3.500000e+00, float* %2
store float 2.500000e+00, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = fcmp oeq float %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
/* Variables and functions */
int fn_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110(
    char const *);
int fn_al_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110>:
jmp    1030 <fn_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110(i8* %0) {
%2 = tail call i32 @fn_sq_ch_68_ch_101_ch_99_ch_108_ch_97_ch_114_ch_97_ch_116_ch_105_ch_111_ch_110(i8* %0)
ret i32 %2
}
void I2C_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @I2C_IRQHandler() {
ret void
}
void gtk_icon_view_get_item_width() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_get_item_width() {
ret void
}
/* Variables and functions */
float absf(int);
float manhattan(int x1, int y1, int x2, int y2) {
  return (absf(x1 - x2) + absf(y1 - y2));
}


x86 assembly (clang, -O0):
<manhattan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <absf@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x10(%rbp),%edi
call   1030 <absf@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manhattan>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %esi,%ebp
sub    %edx,%edi
call   1030 <absf@plt>
movss  %xmm0,0x4(%rsp)
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <absf@plt>
addss  0x4(%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define float @manhattan(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = call float @absf(i32 %11)
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = sub nsw i32 %13, %14
%16 = call float @absf(i32 %15)
%17 = fadd float %12, %16
ret float %17
}

LLVM IR (-O2):
define float @manhattan(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = tail call float @absf(i32 %5)
%7 = sub nsw i32 %1, %3
%8 = tail call float @absf(i32 %7)
%9 = fadd float %6, %8
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ create_image();
int /*<<< orphan*/ create_image_preprocess();
int /*<<< orphan*/ output_image();
int /*<<< orphan*/ process_options(int, char **);
int main(int argc, char *argv[]) {
  process_options(argc, argv);
  create_image_preprocess();
  create_image();
  output_image();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <process_options@plt>
mov    $0x0,%al
call   1040 <create_image_preprocess@plt>
mov    $0x0,%al
call   1060 <create_image@plt>
mov    $0x0,%al
call   1050 <output_image@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <process_options@plt>
xor    %eax,%eax
call   1040 <create_image_preprocess@plt>
xor    %eax,%eax
call   1060 <create_image@plt>
xor    %eax,%eax
call   1050 <output_image@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @process_options(i32 %6, i8** %7)
%9 = call i32 (...) @create_image_preprocess()
%10 = call i32 (...) @create_image()
%11 = call i32 (...) @output_image()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @process_options(i32 %0, i8** %1)
%4 = tail call i32 (...) @create_image_preprocess()
%5 = tail call i32 (...) @create_image()
%6 = tail call i32 (...) @output_image()
ret i32 0
}
const char *filename_version(void) {
  return ("filename : V1.10 Peter Boesecke 2010-12-18");
}


x86 assembly (clang, -O0):
<filename_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filename_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"filename : V1.10 Peter Boesecke 2010-12-18\00"
define i8* @filename_version() {
ret i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [43 x i8] c"filename : V1.10 Peter Boesecke 2010-12-18\00"
define i8* @filename_version() {
ret i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ array_print_full(int *, int, char *, int /*<<< orphan*/ *,
                                    char *);
void array_print(int *arr, int n) { array_print_full(arr, n, " ", NULL, "\n"); }


x86 assembly (clang, -O0):
<array_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
lea    0xeca(%rip),%r8
call   1030 <array_print_full@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_print>:
lea    0xee9(%rip),%rdx
lea    0xee4(%rip),%r8
xor    %ecx,%ecx
jmp    1030 <array_print_full@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @array_print(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 @array_print_full(i32* %5, i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @array_print(i32* %0, i32 %1) {
%3 = tail call i32 @array_print_full(i32* %0, i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int Strlen(char *s) {
  int len;
  for (len = 0; *s != '\0'; s++, len++)
    ;
  return len;
}


x86 assembly (clang, -O0):
<Strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113e <Strlen+0x3e>
jmp    1124 <Strlen+0x24>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <Strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strlen>:
cmpb   $0x0,(%rdi)
je     111c <Strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <Strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
int e_str_len(unsigned char *s) {
  int i;
  for (i = 0; *(s + i) != '\0' && *(s + i) != 10; i++)
    ;
  return (i);
}


x86 assembly (clang, -O0):
<e_str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     113e <e_str_len+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114e <e_str_len+0x4e>
jmp    1161 <e_str_len+0x61>
jmp    1153 <e_str_len+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <e_str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_str_len>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <e_str_len+0x23>
cmp    $0xa,%cl
je     1123 <e_str_len+0x23>
add    $0x1,%rax
jmp    1110 <e_str_len+0x10>
ret

LLVM IR (-O0):
define i32 @e_str_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %23, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = icmp ne i32 %18, 10
br label %20
20: ; preds = %12, %4
%21 = phi i1 [ false, %4 ], [ %19, %12 ]
br i1 %21, label %22, label %26
22: ; preds = %20
br label %23
23: ; preds = %22
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %4
26: ; preds = %20
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @e_str_len(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 10, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
bool descending(int a, int b) { return a < b; }


x86 assembly (clang, -O0):
<descending>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<descending>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @descending(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 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @descending(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_115(void) {
  if (*(uint32_t *)0x10000130ul == 0x8ul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_115>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x8,%rax
jne    1139 <errata_115+0x39>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_115+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1140 <errata_115+0x40>
jmp    1139 <errata_115+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_115>:
cmpl   $0x8,0x10000130
08
jne    1114 <errata_115+0x14>
cmpl   $0x0,0x10000134
je     1117 <errata_115+0x17>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @errata_115() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 8
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %12
10: ; preds = %5
br label %11
11: ; preds = %10, %0
store i32 0, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @errata_115() {
%1 = load i32, i32* inttoptr (i64 268435760 to i32*)
%2 = icmp eq i32 %1, 8
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 268435764 to i32*)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ unlink(char *);
void setPid(int pid) {
  FILE *pidfp;
  unlink("/home/moody/SysDiffLog/pid");
  pidfp = fopen("/tmp/sysdifflog_pid", "w");
  fprintf(pidfp, "%d", pid);
  fclose(pidfp);
}


x86 assembly (clang, -O0):
<setPid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <unlink@plt>
lea    0xebd(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb5(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPid>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0xeb4(%rip),%rdi
call   1030 <unlink@plt>
lea    0xec3(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xec3(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"/home/moody/SysDiffLog/pid\00"
@.str.1 = [20 x i8] c"/tmp/sysdifflog_pid\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [3 x i8] c"%d\00"
define void @setPid(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i32 @unlink(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %2
%8 = call i32 @fprintf(i32* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %3
%10 = call i32 @fclose(i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"/home/moody/SysDiffLog/pid\00"
@.str.1 = [20 x i8] c"/tmp/sysdifflog_pid\00"
@.str.2 = [2 x i8] c"w\00"
@.str.3 = [3 x i8] c"%d\00"
define void @setPid(i32 %0) {
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %0)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
void some_func(int i) {
  printf("[%s:%s:%d] "
         "i = %d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/bszcz/c/refs/heads/master/macros.c",
         __func__, 30, i);
}


x86 assembly (clang, -O0):
<some_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%r8d
lea    0xeda(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xf5c(%rip),%rdx
mov    $0x1e,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<some_func>:
mov    %edi,%r8d
lea    0xee6(%rip),%rdi
lea    0xef2(%rip),%rsi
lea    0xf68(%rip),%rdx
mov    $0x1e,%ecx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"[%s:%s:%d] i = %d\0A\00"
@.str.1 = [125 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bszcz/c/refs/heads/master/macros.c\00"
@__func__.some_func = [10 x i8] c"some_func\00"
define void @some_func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.some_func, i64 0, i64 0), i32 30, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"[%s:%s:%d] i = %d\0A\00"
@.str.1 = [125 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bszcz/c/refs/heads/master/macros.c\00"
@__func__.some_func = [10 x i8] c"some_func\00"
define void @some_func(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([125 x i8], [125 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.some_func, i64 0, i64 0), i32 30, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void init_screen(void) {
  syslog(LOG_INFO, "taking control of screen\n");
  syscall(58, 0, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<init_screen>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x3a,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_screen>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x3a,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
pop    %rax
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [26 x i8] c"taking control of screen\0A\00"
define void @init_screen() {
%1 = load i32, i32* @LOG_INFO
%2 = call i32 @syslog(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @syscall(i32 58, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [26 x i8] c"taking control of screen\0A\00"
define void @init_screen() {
%1 = load i32, i32* @LOG_INFO
%2 = tail call i32 @syslog(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @syscall(i32 58, i32 0, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
float back_io(float, float, float);
float back_f_io(float step, float max_steps, float max_val) {
  return back_io(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<back_f_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <back_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_f_io>:
jmp    1030 <back_io@plt>

LLVM IR (-O0):
define float @back_f_io(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @back_io(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @back_f_io(float %0, float %1, float %2) {
%4 = tail call float @back_io(float %0, float %1, float %2)
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int print_usage(FILE *stream, const char *prog_name) {
  fprintf(stream, "Usage: %s [-n num_trials] [options] <command>\n", prog_name);
  fprintf(stream, "avgtime, Command Benchmarking Tool.\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeee(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xef3(%rip),%rdi
mov    $0x25,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Usage: %s [-n num_trials] [options] <command>\0A\00"
@.str.1 = [38 x i8] c"avgtime, Command Benchmarking Tool.\0A\0A\00"
define i32 @print_usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %3
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"Usage: %s [-n num_trials] [options] <command>\0A\00"
@.str.1 = [38 x i8] c"avgtime, Command Benchmarking Tool.\0A\0A\00"
define i32 @print_usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i64 37, i64 1, i32* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fn1();
int /*<<< orphan*/ fn2();
int /*<<< orphan*/ fn3();
int /*<<< orphan*/ fn4();
int /*<<< orphan*/ fn5();
int main(void) {
  fn1();
  fn2();
  fn3();
  fn4();
  fn5();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fn1@plt>
mov    $0x0,%al
call   1070 <fn2@plt>
mov    $0x0,%al
call   1040 <fn3@plt>
mov    $0x0,%al
call   1060 <fn4@plt>
mov    $0x0,%al
call   1050 <fn5@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <fn1@plt>
xor    %eax,%eax
call   1070 <fn2@plt>
xor    %eax,%eax
call   1040 <fn3@plt>
xor    %eax,%eax
call   1060 <fn4@plt>
xor    %eax,%eax
call   1050 <fn5@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fn1()
%3 = call i32 (...) @fn2()
%4 = call i32 (...) @fn3()
%5 = call i32 (...) @fn4()
%6 = call i32 (...) @fn5()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fn1()
%2 = tail call i32 (...) @fn2()
%3 = tail call i32 (...) @fn3()
%4 = tail call i32 (...) @fn4()
%5 = tail call i32 (...) @fn5()
ret i32 0
}
void moduleTypeLookupModuleByID(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               92, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<moduleTypeLookupModuleByID>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5c,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<moduleTypeLookupModuleByID>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x5c,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.moduleTypeLookupModuleByID = [27 x i8] c"moduleTypeLookupModuleByID\00"
define void @moduleTypeLookupModuleByID() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 92, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.moduleTypeLookupModuleByID, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.moduleTypeLookupModuleByID = [27 x i8] c"moduleTypeLookupModuleByID\00"
define void @moduleTypeLookupModuleByID() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 92, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.moduleTypeLookupModuleByID, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ func1();
int main() { return func1() && func1() && func1(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <func1@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1162 <main+0x52>
mov    $0x0,%al
call   1030 <func1@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1162 <main+0x52>
mov    $0x0,%al
call   1030 <func1@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <func1@plt>
test   %rax,%rax
je     113c <main+0x2c>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <func1@plt>
test   %rax,%rax
je     113c <main+0x2c>
xor    %eax,%eax
call   1030 <func1@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @func1()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = call i64 (...) @func1()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = call i64 (...) @func1()
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %7, %4, %0
%11 = phi i1 [ false, %4 ], [ false, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @func1()
%2 = icmp eq i64 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 (...) @func1()
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 (...) @func1()
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 0, %3 ], [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
long grib_op_mul(long a, long b) { return a * b; }


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

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

LLVM IR (-O0):
define i64 @grib_op_mul(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @grib_op_mul(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ ngen2(char *, char *, int, int);
void cgdecpl(int a, int v) { ngen2("%s\t$%d,%d(%%rbp)", "subq", v, a); }


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

x86 assembly (clang, -O2):
<cgdecpl>:
mov    %esi,%edx
mov    %edi,%ecx
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <ngen2@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s\09$%d,%d(%%rbp)\00"
@.str.1 = [5 x i8] c"subq\00"
define void @cgdecpl(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 = load i32, i32* %3
%7 = call i32 @ngen2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s\09$%d,%d(%%rbp)\00"
@.str.1 = [5 x i8] c"subq\00"
define void @cgdecpl(i32 %0, i32 %1) {
%3 = tail call i32 @ngen2(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
char *strstr(char *, char *);
char *make_args_control_type(char *type) {
  if (type == strstr(type, "const ")) {
    type += strlen("const ");
  }
  return type;
}


x86 assembly (clang, -O0):
<make_args_control_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
jne    1170 <make_args_control_type+0x50>
lea    0xea5(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_args_control_type>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1159 <make_args_control_type+0x39>
lea    0xeb1(%rip),%rdi
call   1040 <strlen@plt>
cltq
add    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"const \00"
define i8* @make_args_control_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %3, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %2
%10 = sext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %2
br label %12
12: ; preds = %7, %1
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"const \00"
define i8* @make_args_control_type(i8* %0) {
%2 = tail call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
br label %9
9: ; preds = %5, %1
%10 = phi i8* [ %8, %5 ], [ %0, %1 ]
ret i8* %10
}
void I422ToARGB4444Row_C() {}


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

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

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

LLVM IR (-O2):
define void @I422ToARGB4444Row_C() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotl_64a(short dummy, uint64_t x) { return (x << 56) | (x >> 8); }


x86 assembly (clang, -O0):
<rotl_64a>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x38,%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rotl_64a(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 56
%7 = load i32, i32* %4
%8 = ashr i32 %7, 8
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rotl_64a(i16 signext %0, i32 %1) {
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t new_uint8_t(void) { return 0; }


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

x86 assembly (clang, -O2):
<new_uint8_t>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @new_uint8_t() {
ret i32 0
}

LLVM IR (-O2):
define i32 @new_uint8_t() {
ret i32 0
}
/* Variables and functions */
int yas_pcb_power_off();
int yas_pcb_test2(void) { return yas_pcb_power_off(); }


x86 assembly (clang, -O0):
<yas_pcb_test2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <yas_pcb_power_off@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_pcb_test2>:
xor    %eax,%eax
jmp    1030 <yas_pcb_power_off@plt>

LLVM IR (-O0):
define i32 @yas_pcb_test2() {
%1 = call i32 (...) @yas_pcb_power_off()
ret i32 %1
}

LLVM IR (-O2):
define i32 @yas_pcb_test2() {
%1 = tail call i32 (...) @yas_pcb_power_off()
ret i32 %1
}
/* Type definitions */
struct num {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ num_neg(struct num *);
struct num *num_shl(struct num *, int /*<<< orphan*/);
struct num *num_shr(struct num *a, struct num *b) {
  return num_shl(a, num_neg(b));
}


x86 assembly (clang, -O0):
<num_shr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <num_neg@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <num_shl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_shr>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <num_neg@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <num_shl@plt>

LLVM IR (-O0):
%struct.num = type { i32 }
define %struct.num* @num_shr(%struct.num* %0, %struct.num* %1) {
%3 = alloca %struct.num*
%4 = alloca %struct.num*
store %struct.num* %0, %struct.num** %3
store %struct.num* %1, %struct.num** %4
%5 = load %struct.num*, %struct.num** %3
%6 = load %struct.num*, %struct.num** %4
%7 = call i32 @num_neg(%struct.num* %6)
%8 = call %struct.num* @num_shl(%struct.num* %5, i32 %7)
ret %struct.num* %8
}

LLVM IR (-O2):
%struct.num = type { i32 }
define %struct.num* @num_shr(%struct.num* %0, %struct.num* %1) {
%3 = tail call i32 @num_neg(%struct.num* %1)
%4 = tail call %struct.num* @num_shl(%struct.num* %0, i32 %3)
ret %struct.num* %4
}
const char *getKinematicsDeviceName(void) { return "Kinematics"; }


x86 assembly (clang, -O0):
<getKinematicsDeviceName>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getKinematicsDeviceName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Kinematics\00"
define i8* @getKinematicsDeviceName() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"Kinematics\00"
define i8* @getKinematicsDeviceName() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR91_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


x86 assembly (clang, -O0):
<U_WMR91_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <U_WMRNOTIMPLEMENTED_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMR91_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR91_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void EEPROMIntEnable(unsigned long ulIntFlags) {
  DEBUG_ASSERT(ulIntFlags == 0x00000004);
  (*((volatile unsigned long *)(0x400AF040))) |= 0x00000001;
  (*((volatile unsigned long *)(0x400FD010))) |= 0x00000004;
}


x86 assembly (clang, -O0):
<EEPROMIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x4,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    $0x400af040,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x400af040,%eax
mov    %rcx,(%rax)
mov    $0x400fd010,%eax
mov    (%rax),%rcx
or     $0x4,%rcx
mov    $0x400fd010,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMIntEnable>:
push   %rax
xor    %eax,%eax
cmp    $0x4,%rdi
sete   %al
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
orq    $0x1,0x400af040
40 01
orq    $0x4,0x400fd010
40 04
pop    %rax
ret

LLVM IR (-O0):
define void @EEPROMIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 4
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load volatile i64, i64* inttoptr (i64 1074458688 to i64*)
%8 = or i64 %7, 1
store volatile i64 %8, i64* inttoptr (i64 1074458688 to i64*)
%9 = load volatile i64, i64* inttoptr (i64 1074778128 to i64*)
%10 = or i64 %9, 4
store volatile i64 %10, i64* inttoptr (i64 1074778128 to i64*)
ret void
}

LLVM IR (-O2):
define void @EEPROMIntEnable(i64 %0) {
%2 = icmp eq i64 %0, 4
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = load volatile i64, i64* inttoptr (i64 1074458688 to i64*)
%6 = or i64 %5, 1
store volatile i64 %6, i64* inttoptr (i64 1074458688 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1074778128 to i64*)
%8 = or i64 %7, 4
store volatile i64 %8, i64* inttoptr (i64 1074778128 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ leds_set(int);
void timer_init() {
  (*(volatile unsigned int *)(0x44E0007C) = (unsigned int)(0x2));
  leds_set(3);
  (*(volatile unsigned int *)(0x4804A038) = (unsigned int)(0x3));
}


x86 assembly (clang, -O0):
<timer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44e0007c,%eax
movl   $0x2,(%rax)
mov    $0x3,%edi
call   1030 <leds_set@plt>
mov    $0x4804a038,%eax
movl   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_init>:
push   %rax
movl   $0x2,0x44e0007c
mov    $0x3,%edi
call   1030 <leds_set@plt>
movl   $0x3,0x4804a038
pop    %rax
ret

LLVM IR (-O0):
define void @timer_init() {
store volatile i32 2, i32* inttoptr (i64 1155530876 to i32*)
%1 = call i32 @leds_set(i32 3)
store volatile i32 3, i32* inttoptr (i64 1208262712 to i32*)
ret void
}

LLVM IR (-O2):
define void @timer_init() {
store volatile i32 2, i32* inttoptr (i64 1155530876 to i32*)
%1 = tail call i32 @leds_set(i32 3)
store volatile i32 3, i32* inttoptr (i64 1208262712 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(char *, int /*<<< orphan*/);
int /*<<< orphan*/ ft_strlen(char *);
void ft_strclr(char *s) {
  if (s)
    ft_bzero(s, ft_strlen(s));
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <ft_strclr+0x33>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <ft_bzero@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     1139 <ft_strclr+0x19>
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <ft_bzero@plt>
ret

LLVM IR (-O0):
define void @ft_strclr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @ft_strlen(i8* %7)
%9 = call i32 @ft_bzero(i8* %6, i32 %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @ft_bzero(i8* %0, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
unsigned NI_GPCT_UP_DOWN_PIN_GATE_SELECT(unsigned n) { return 0x202 + n; }


x86 assembly (clang, -O0):
<NI_GPCT_UP_DOWN_PIN_GATE_SELECT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x202,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NI_GPCT_UP_DOWN_PIN_GATE_SELECT>:
lea    0x202(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @NI_GPCT_UP_DOWN_PIN_GATE_SELECT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 514, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @NI_GPCT_UP_DOWN_PIN_GATE_SELECT(i32 %0) {
%2 = add i32 %0, 514
ret i32 %2
}