xunge/DecIR huggingface dataset:
int test_imm_6Cuint16_reg(unsigned short val) {
  return ((val) & (-0x6C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Cuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff94,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Cuint16_reg>:
test   $0xff94,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Cuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -108
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_6Cuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -108
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[], char *envp[]) {
  char *user;
  user = getenv("USER");
  if (!user || !*user)
    user = "meatbag";
  printf("Hello, %s!\n", user);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xebf(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1162 <main+0x42>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    116d <main+0x4d>
lea    0xe9c(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1137 <main+0x17>
cmpb   $0x0,(%rax)
jne    113e <main+0x1e>
lea    0xec7(%rip),%rax
lea    0xec8(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"USER\00"
@.str.1 = [8 x i8] c"meatbag\00"
@.str.2 = [12 x i8] c"Hello, %s!\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8*
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%9 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %8
%10 = load i8*, i8** %8
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i8*, i8** %8
%14 = load i8, i8* %13
%15 = icmp ne i8 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %12, %3
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %8
br label %17
17: ; preds = %16, %12
%18 = load i8*, i8** %8
%19 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"USER\00"
@.str.1 = [8 x i8] c"meatbag\00"
@.str.2 = [12 x i8] c"Hello, %s!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i8, i8* %4
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6, %3
br label %10
10: ; preds = %9, %6
%11 = phi i8* [ %4, %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %9 ]
%12 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ svcPanic();
int kill(int pid, int sig) { svcPanic(); }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <svcPanic@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
%3 = tail call i32 (...) @svcPanic()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void lib_set_servo_position(int v0, int v1) {
  printf("set_servo_position  %d  %d \n", v0, v1);
}


x86 assembly (clang, -O0):
<lib_set_servo_position>:
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
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [29 x i8] c"set_servo_position %d %d \0A\00"
define void @lib_set_servo_position(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xt_core_trace_exit(char *);
int xt_core_pair_compare(void *pair_object_a, void *pair_object_b) {
  xt_core_trace_exit("TODO: implement");
  return 0;
}


x86 assembly (clang, -O0):
<xt_core_pair_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
call   1030 <xt_core_trace_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xt_core_pair_compare>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <xt_core_trace_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"TODO: implement\00"
define i32 @xt_core_pair_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @xt_core_trace_exit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"TODO: implement\00"
define i32 @xt_core_pair_compare(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @xt_core_trace_exit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long *fill();
int bar() {
  long *w = fill();
  return (int)(*w);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <fill@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1030 <fill@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i64*
%2 = call i64* (...) @fill()
store i64* %2, i64** %1
%3 = load i64*, i64** %1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i64* (...) @fill()
%2 = load i64, i64* %1
%3 = trunc i64 %2 to i32
ret i32 %3
}
double dot_prod(const double a[3], const double b[3]) {
  double sum = 0.0;
  do {
    for (int __i = 0; __i < 3; ++__i) {
      sum += a[__i] * b[__i];
    }
  } while (0);
  return sum;
}


x86 assembly (clang, -O0):
<dot_prod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    115f <dot_prod+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <dot_prod+0x1b>
jmp    1164 <dot_prod+0x64>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_prod>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  (%rsi),%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x8(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot_prod(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
br label %7
7: ; preds = %2
store i32 0, i32* %6
br label %8
8: ; preds = %24, %7
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 3
br i1 %10, label %11, label %27
11: ; preds = %8
%12 = load double*, double** %3
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds double, double* %12, i64 %14
%16 = load double, double* %15
%17 = load double*, double** %4
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %17, i64 %19
%21 = load double, double* %20
%22 = load double, double* %5
%23 = call double @llvm.fmuladd.f64(double %16, double %21, double %22)
store double %23, double* %5
br label %24
24: ; preds = %11
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %8
27: ; preds = %8
br label %28
28: ; preds = %27
%29 = load double, double* %5
ret double %29
}

LLVM IR (-O2):
define double @dot_prod(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 0.000000e+00)
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %5)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
char const *strpbrk(char const *, char *);
const char *has_glob_specials(const char *pattern) {
  return strpbrk(pattern, "?*[");
}


x86 assembly (clang, -O0):
<has_glob_specials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strpbrk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_glob_specials>:
lea    0xee9(%rip),%rsi
jmp    1030 <strpbrk@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"?*[\00"
define i8* @has_glob_specials(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strpbrk(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"?*[\00"
define i8* @has_glob_specials(i8* %0) {
%2 = tail call i8* @strpbrk(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int main() { return sizeof(signed long int); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
void simtec_disable_all_devices() {}


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

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

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

LLVM IR (-O2):
define void @simtec_disable_all_devices() {
ret void
}
/* Variables and functions */
bool nrf51_errata_11(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_11() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, long);
void *func(void *no) {
  for (int i = 1; i <= 1000; ++i)
    printf("#%04d in thread %ld\n", i, (long)no);
  return (void *)0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jg     1151 <func+0x41>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <func+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%ebp
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x3e9,%ebp
jne    1130 <func+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"#%04d in thread %ld\0A\00"
define i8* @func(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 1000
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i8*, i8** %2
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8, i64 %10)
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret i8* null
}

LLVM IR (-O2):
@.str = [21 x i8] c"#%04d in thread %ld\0A\00"
define noalias i8* @func(i8* %0) {
%2 = ptrtoint i8* %0 to i64
br label %4
3: ; preds = %4
ret i8* null
4: ; preds = %1, %4
%5 = phi i32 [ 1, %1 ], [ %7, %4 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %2)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 1001
br i1 %8, label %3, label %4
}
/* Variables and functions */
int /*<<< orphan*/ angle_rotate(unsigned int);
int /*<<< orphan*/ left();
void left_degrees(unsigned int Degrees) {
  left();
  angle_rotate(Degrees);
}


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

x86 assembly (clang, -O2):
<left_degrees>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <left@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <angle_rotate@plt>

LLVM IR (-O0):
define void @left_degrees(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @left()
%4 = load i32, i32* %2
%5 = call i32 @angle_rotate(i32 %4)
ret void
}

LLVM IR (-O2):
define void @left_degrees(i32 %0) {
%2 = tail call i32 (...) @left()
%3 = tail call i32 @angle_rotate(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ is_alpha(char);
int is_valid_name(const char *token) {
  char c;
  c = token[0];
  return c == '_' || is_alpha(c);
}


x86 assembly (clang, -O0):
<is_valid_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0xa(%rbp)
je     114a <is_valid_name+0x3a>
movsbl -0x9(%rbp),%edi
call   1030 <is_alpha@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_name>:
push   %rax
mov    (%rdi),%cl
mov    $0x1,%eax
cmp    $0x5f,%cl
je     1130 <is_valid_name+0x20>
movsbl %cl,%edi
call   1030 <is_alpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_valid_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = load i8, i8* %3
%12 = call i64 @is_alpha(i8 signext %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %1
%15 = phi i1 [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_valid_name(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 95
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @is_alpha(i8 signext %2)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ultra();
void cucuzator(int seq) { ultra(); }


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

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

LLVM IR (-O0):
define void @cucuzator(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ultra()
ret void
}

LLVM IR (-O2):
define void @cucuzator(i32 %0) {
%2 = tail call i32 (...) @ultra()
ret void
}
int multiplication(int val1, int val2) { return (val1 * val2); }


x86 assembly (clang, -O0):
<multiplication>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiplication>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @multiplication(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @multiplication(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void timeout_handler(int sig_type) {
  printf("EE: timeout, no answer\n");
  exit(1);
}


x86 assembly (clang, -O0):
<timeout_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<timeout_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"EE: timeout, no answer\0A\00"
define void @timeout_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"EE: timeout, no answer\00"
define void @timeout_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void av_stream_set_r_frame_rate() {}


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

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

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

LLVM IR (-O2):
define void @av_stream_set_r_frame_rate() {
ret void
}
/* Variables and functions */
int BIT(int);
unsigned long smmu_pgd_addr_end_lpae(unsigned long addr, unsigned long end) {
  unsigned long boundary = (addr + BIT((30))) & (~(BIT((30)) - 1));
  return (boundary - 1 < end - 1) ? boundary : end;
}


x86 assembly (clang, -O0):
<smmu_pgd_addr_end_lpae>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x1e,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    $0x1e,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jae    1188 <smmu_pgd_addr_end_lpae+0x78>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1190 <smmu_pgd_addr_end_lpae+0x80>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smmu_pgd_addr_end_lpae>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x1e,%edi
call   1030 <BIT@plt>
movslq %eax,%rbx
add    %r14,%rbx
mov    $0x1e,%edi
call   1030 <BIT@plt>
neg    %eax
cltq
and    %rbx,%rax
lea    -0x1(%rax),%rcx
lea    -0x1(%r15),%rdx
cmp    %rdx,%rcx
cmovae %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @smmu_pgd_addr_end_lpae(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = call i32 @BIT(i32 30)
%8 = sext i32 %7 to i64
%9 = add i64 %6, %8
%10 = call i32 @BIT(i32 30)
%11 = sub nsw i32 %10, 1
%12 = xor i32 %11, -1
%13 = sext i32 %12 to i64
%14 = and i64 %9, %13
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = sub i64 %15, 1
%17 = load i64, i64* %4
%18 = sub i64 %17, 1
%19 = icmp ult i64 %16, %18
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = load i64, i64* %5
br label %24
22: ; preds = %2
%23 = load i64, i64* %4
br label %24
24: ; preds = %22, %20
%25 = phi i64 [ %21, %20 ], [ %23, %22 ]
ret i64 %25
}

LLVM IR (-O2):
define i64 @smmu_pgd_addr_end_lpae(i64 %0, i64 %1) {
%3 = tail call i32 @BIT(i32 30)
%4 = sext i32 %3 to i64
%5 = add i64 %4, %0
%6 = tail call i32 @BIT(i32 30)
%7 = sub i32 0, %6
%8 = sext i32 %7 to i64
%9 = and i64 %5, %8
%10 = add i64 %9, -1
%11 = add i64 %1, -1
%12 = icmp ult i64 %10, %11
%13 = select i1 %12, i64 %9, i64 %1
ret i64 %13
}
int bar(int x) {
  if (x > 0)
    return x;
  else
    return -1;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111c <bar+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1123 <bar+0x23>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edi,%edi
mov    $0xffffffff,%eax
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %9
9: ; preds = %8, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 -1
ret i32 %3
}
void g_param_spec_unref() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_unref() {
ret void
}
void verbose_printf(char const *buf) {}


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

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

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

LLVM IR (-O2):
define void @verbose_printf(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gfx_get_display_video_yuv_offsets(unsigned long *,
                                                     unsigned long *,
                                                     unsigned long *);
void redcloud_get_video_yuv_offsets(unsigned long *yoffset,
                                    unsigned long *uoffset,
                                    unsigned long *voffset) {
  gfx_get_display_video_yuv_offsets(yoffset, uoffset, voffset);
}


x86 assembly (clang, -O0):
<redcloud_get_video_yuv_offsets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <gfx_get_display_video_yuv_offsets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redcloud_get_video_yuv_offsets>:
jmp    1030 <gfx_get_display_video_yuv_offsets@plt>

LLVM IR (-O0):
define void @redcloud_get_video_yuv_offsets(i64* %0, i64* %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %4
%8 = load i64*, i64** %5
%9 = load i64*, i64** %6
%10 = call i32 @gfx_get_display_video_yuv_offsets(i64* %7, i64* %8, i64* %9)
ret void
}

LLVM IR (-O2):
define void @redcloud_get_video_yuv_offsets(i64* %0, i64* %1, i64* %2) {
%4 = tail call i32 @gfx_get_display_video_yuv_offsets(i64* %0, i64* %1, i64* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int errno;
void nl_close(int sd) {
  int saved_errno = errno;
  if (sd >= 0)
    close(sd);
  errno = saved_errno;
}


x86 assembly (clang, -O0):
<nl_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1139 <nl_close+0x29>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%ecx
mov    0x2e9d(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl_close>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
test   %edi,%edi
js     1125 <nl_close+0x15>
call   1030 <close@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @nl_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @close(i32 %8)
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %3
store i32 %11, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @nl_close(i32 %0) {
%2 = load i32, i32* @errno
%3 = icmp sgt i32 %0, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @close(i32 %0)
br label %6
6: ; preds = %4, %1
store i32 %2, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_menu() {
  printf("%s", "\nu) Uncover cell\nf) Flag cell as mine\ng) Mark cell as "
               "guess\nU) Unmark cell\nq) Quit\n\nChoice? ");
}


x86 assembly (clang, -O0):
<print_menu>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [93 x i8] c"\0Au) Uncover cell\0Af) Flag cell as mine\0Ag) Mark cell as guess\0AU) Unmark cell\0Aq) Quit\0A\0AChoice? \00"
define void @print_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [93 x i8] c"\0Au) Uncover cell\0Af) Flag cell as mine\0Ag) Mark cell as guess\0AU) Unmark cell\0Aq) Quit\0A\0AChoice? \00"
define void @print_menu() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void handle_out_of_memory() {
  fprintf(stderr, "FATAL ERROR: Out of memory. Shutting down.");
  exit(16);
}


x86 assembly (clang, -O0):
<handle_out_of_memory>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x10,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_out_of_memory>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x10,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"FATAL ERROR: Out of memory. Shutting down.\00"
define void @handle_out_of_memory() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"FATAL ERROR: Out of memory. Shutting down.\00"
define void @handle_out_of_memory() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 16)
unreachable
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_notifyf(int unset_environment,
                                                      const char *format, ...) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_notifyf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_notifyf>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_notifyf(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_notifyf(i32 %0, i8* nocapture readnone %1, ...) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
float atan2f(float, float);
float __ocl_atan2_float(float src1, float src2) { return atan2f(src1, src2); }


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

x86 assembly (clang, -O2):
<__ocl_atan2_float>:
jmp    1030 <atan2f@plt>

LLVM IR (-O0):
define float @__ocl_atan2_float(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 = call float @atan2f(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__ocl_atan2_float(float %0, float %1) {
%3 = tail call float @atan2f(float %0, float %1)
ret float %3
}
void diskmon_push_curr_file(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<diskmon_push_curr_file>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<diskmon_push_curr_file>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.diskmon_push_curr_file = [23 x i8] c"diskmon_push_curr_file\00"
define void @diskmon_push_curr_file() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.diskmon_push_curr_file, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.diskmon_push_curr_file = [23 x i8] c"diskmon_push_curr_file\00"
define void @diskmon_push_curr_file() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.diskmon_push_curr_file, i64 0, i64 0))
ret void
}
void gpio_opendrain(unsigned gpio, int value) {}


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

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

LLVM IR (-O0):
define void @gpio_opendrain(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @gpio_opendrain(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int main() {
  fun(23);
  fun(24);
  fun(42);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
call   1030 <fun@plt>
mov    $0x18,%edi
call   1030 <fun@plt>
mov    $0x2a,%edi
call   1030 <fun@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x17,%edi
call   1030 <fun@plt>
mov    $0x18,%edi
call   1030 <fun@plt>
mov    $0x2a,%edi
call   1030 <fun@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @fun(i32 23)
%2 = call i32 @fun(i32 24)
%3 = call i32 @fun(i32 42)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fun(i32 23)
%2 = tail call i32 @fun(i32 24)
%3 = tail call i32 @fun(i32 42)
ret i32 0
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_data_offer_listener {
  int dummy;
};
struct wl_data_offer {
  int dummy;
};

/* Variables and functions */
int wl_proxy_add_listener(struct wl_proxy *, void (*)(), void *);
int wl_data_offer_add_listener(struct wl_data_offer *wl_data_offer,
                               const struct wl_data_offer_listener *listener,
                               void *data) {
  return wl_proxy_add_listener((struct wl_proxy *)wl_data_offer,
                               (void (**)(void))listener, data);
}


x86 assembly (clang, -O0):
<wl_data_offer_add_listener>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wl_proxy_add_listener@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_data_offer_add_listener>:
jmp    1030 <wl_proxy_add_listener@plt>

LLVM IR (-O0):
%struct.wl_data_offer = type { i32 }
%struct.wl_data_offer_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_data_offer_add_listener(%struct.wl_data_offer* %0, %struct.wl_data_offer_listener* %1, i8* %2) {
%4 = alloca %struct.wl_data_offer*
%5 = alloca %struct.wl_data_offer_listener*
%6 = alloca i8*
store %struct.wl_data_offer* %0, %struct.wl_data_offer** %4
store %struct.wl_data_offer_listener* %1, %struct.wl_data_offer_listener** %5
store i8* %2, i8** %6
%7 = load %struct.wl_data_offer*, %struct.wl_data_offer** %4
%8 = bitcast %struct.wl_data_offer* %7 to %struct.wl_proxy*
%9 = load %struct.wl_data_offer_listener*, %struct.wl_data_offer_listener** %5
%10 = bitcast %struct.wl_data_offer_listener* %9 to void ()**
%11 = bitcast void ()** %10 to void (...)*
%12 = load i8*, i8** %6
%13 = call i32 @wl_proxy_add_listener(%struct.wl_proxy* %8, void (...)* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.wl_data_offer = type { i32 }
%struct.wl_data_offer_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_data_offer_add_listener(%struct.wl_data_offer* %0, %struct.wl_data_offer_listener* %1, i8* %2) {
%4 = bitcast %struct.wl_data_offer* %0 to %struct.wl_proxy*
%5 = bitcast %struct.wl_data_offer_listener* %1 to void (...)*
%6 = tail call i32 @wl_proxy_add_listener(%struct.wl_proxy* %4, void (...)* %5, i8* %2)
ret i32 %6
}
int main() {
  int a;
  float p;
  p = 1.0 / 2.0;
  a = 5 / 2;
  p = 1 / 2 + 1 / 8;
  p = 3.5 / 2.8;
  a = p;
  a = a + 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xef1(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
cvttss2si -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store float 5.000000e-01, float* %3
store i32 2, i32* %2
store float 0.000000e+00, float* %3
store float 1.250000e+00, float* %3
%4 = load float, float* %3
%5 = fptosi float %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(int);
int /*<<< orphan*/ printf(char *, int *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0;
  scanf("%d", &n);
  print(n);
  printf("Address on integer in the main function:  %p\n", &n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <print@plt>
lea    0xe9e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <print@plt>
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [46 x i8] c"Address on integer in the main function: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @print(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [46 x i8] c"Address on integer in the main function: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @print(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
void read_from_memory(char *array, int position) {
  volatile char character = array[position];
}


x86 assembly (clang, -O0):
<read_from_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_from_memory>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%al
mov    %al,-0x1(%rsp)
ret

LLVM IR (-O0):
define void @read_from_memory(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
store volatile i8 %10, i8* %5
ret void
}

LLVM IR (-O2):
define void @read_from_memory(i8* nocapture %0, i32 %1) {
%3 = alloca i8
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
store volatile i8 %6, i8* %3
ret void
}
int test_imm_6Cint16_mem(short *val) {
  return ((*val) & (0x6C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Cint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x6c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Cint16_mem>:
testb  $0x6c,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Cint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 108
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_6Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 108
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
long floor(double num) {
  long res = (long)num;
  if ((res < 0) && (num != res)) {
    res--;
  }
  return res;
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    114a <floor+0x4a>
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    113e <floor+0x3e>
jp     113e <floor+0x3e>
jmp    114a <floor+0x4a>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
cvttsd2si %xmm0,%rax
test   %rax,%rax
sets   %sil
cvtsi2sd %rax,%xmm1
ucomisd %xmm0,%xmm1
setp   %dl
setne  %cl
or     %dl,%cl
and    %sil,%cl
movzbl %cl,%ecx
sub    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @floor(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load double, double* %2
%10 = load i64, i64* %3
%11 = sitofp i64 %10 to double
%12 = fcmp une double %9, %11
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i64, i64* %3
%15 = add nsw i64 %14, -1
store i64 %15, i64* %3
br label %16
16: ; preds = %13, %8, %1
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @floor(double %0) {
%2 = fptosi double %0 to i64
%3 = icmp slt i64 %2, 0
%4 = sitofp i64 %2 to double
%5 = fcmp une double %4, %0
%6 = and i1 %3, %5
%7 = sext i1 %6 to i64
%8 = add nsw i64 %7, %2
ret i64 %8
}
void DStore(unsigned long long *dvar, unsigned long hi, unsigned long lo) {
  *dvar = ((unsigned long long)hi << 32) + lo;
}


x86 assembly (clang, -O0):
<DStore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
shl    $0x20,%rcx
add    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DStore>:
shl    $0x20,%rsi
add    %rdx,%rsi
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @DStore(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = shl i64 %7, 32
%9 = load i64, i64* %6
%10 = add i64 %8, %9
%11 = load i64*, i64** %4
store i64 %10, i64* %11
ret void
}

LLVM IR (-O2):
define void @DStore(i64* nocapture writeonly %0, i64 %1, i64 %2) {
%4 = shl i64 %1, 32
%5 = add i64 %4, %2
store i64 %5, i64* %0
ret void
}
int clear_bit(unsigned int nr, void *addr) {
  int mask, retval;
  unsigned char *ADDR = (unsigned char *)addr;
  ADDR += nr >> 3;
  mask = 1 << ((nr & 0x07));
  retval = mask & *ADDR;
  *ADDR &= ~mask;
  return retval;
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x20(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %edi,%ecx
mov    %edi,%edx
shr    $0x3,%rdx
and    $0x7,%cl
mov    $0x1,%edi
shl    %cl,%edi
movzbl (%rsi,%rdx,1),%ecx
mov    %ecx,%eax
and    %edi,%eax
not    %dil
and    %cl,%dil
mov    %dil,(%rsi,%rdx,1)
ret

LLVM IR (-O0):
define i32 @clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i32, i32* %3
%10 = lshr i32 %9, 3
%11 = load i8*, i8** %7
%12 = zext i32 %10 to i64
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8* %13, i8** %7
%14 = load i32, i32* %3
%15 = and i32 %14, 7
%16 = shl i32 1, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i8*, i8** %7
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %17, %20
store i32 %21, i32* %6
%22 = load i32, i32* %5
%23 = xor i32 %22, -1
%24 = load i8*, i8** %7
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = and i32 %26, %23
%28 = trunc i32 %27 to i8
store i8 %28, i8* %24
%29 = load i32, i32* %6
ret i32 %29
}

LLVM IR (-O2):
define i32 @clear_bit(i32 %0, i8* nocapture %1) {
%3 = lshr i32 %0, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = shl nuw nsw i32 1, %6
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = and i32 %7, %9
%11 = trunc i32 %7 to i8
%12 = xor i8 %11, -1
%13 = and i8 %8, %12
store i8 %13, i8* %5
ret i32 %10
}
void ill() {}


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

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

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

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

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_negotiate_creds(void *bus, uint64_t mask) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_negotiate_creds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_negotiate_creds>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_negotiate_creds(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_negotiate_creds(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
void fn6(void) { ; }


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

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

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

LLVM IR (-O2):
define void @fn6() {
ret void
}
/* Variables and functions */
size_t strlen(char const *);
__attribute__((__weak__, __always___)) size_t
softboundcets_strlen(const char *s) {
  return strlen(s);
}


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

x86 assembly (clang, -O2):
<softboundcets_strlen>:
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define weak i64 @softboundcets_strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
ret i64 %4
}

LLVM IR (-O2):
define weak i64 @softboundcets_strlen(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}