xunge/DecIR huggingface dataset:
char *iota_Name(void) { return "IOTA32"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"IOTA32\00"
define i8* @iota_Name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISLNK(int /*<<< orphan*/);
scalar_t__ lstat(char *, struct stat *);
int is_symlink(char *path) {
  struct stat sb;
  return lstat(path, &sb) == 0 && S_ISLNK(sb.st_mode);
}


x86 assembly (clang, -O0):
<is_symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <lstat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <is_symlink+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_symlink>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <is_symlink+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISLNK@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_symlink(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @lstat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISLNK(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_symlink(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISLNK(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_PROCESS_CPUTIME_ID;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double get_time() {
  struct timespec t;
  clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t);
  return t.tv_sec + t.tv_nsec * 1e-9;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define double @get_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-09, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timespec = type { double, i32 }
@CLOCK_PROCESS_CPUTIME_ID = global i32 0
define double @get_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_PROCESS_CPUTIME_ID
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load double, double* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = call double @llvm.fmuladd.f64(double %9, double 1.000000e-09, double %6)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int i = 1;
  switch (i) {
    printf("welcome");
  case 1:
    printf("to acumen");
    break;
  case 2:
    printf("how are you");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     114b <main+0x3b>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     115c <main+0x4c>
jmp    1168 <main+0x58>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    1168 <main+0x58>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"to acumen\00"
@.str.1 = [12 x i8] c"how are you\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 1, label %4
i32 2, label %6
]
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [10 x i8] c"to acumen\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int f497(int *);
int f498(int *p) { return f497(p); }


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

x86 assembly (clang, -O2):
<f498>:
jmp    1030 <f497@plt>

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

LLVM IR (-O2):
define i32 @f498(i32* %0) {
%2 = tail call i32 @f497(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ FCEU_DispMessage(char *);
void FCEUD_MovieRecordTo(void) { FCEU_DispMessage("Not implemented."); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Not implemented.\00"
define void @FCEUD_MovieRecordTo() {
%1 = call i32 @FCEU_DispMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Not implemented.\00"
define void @FCEUD_MovieRecordTo() {
%1 = tail call i32 @FCEU_DispMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned bit(unsigned n) { return 1 << n; }


x86 assembly (clang, -O0):
<bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @bit(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail();
int main() {
  int x = 0, y = 0;
  while (1) {
    x++;
    y++;
    if (x != y) {
      __assert_fail();
      return 1;
    }
    if (x > 1000) {
      __assert_fail();
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     115e <main+0x4e>
mov    $0x0,%al
call   1030 <__assert_fail@plt>
movl   $0x1,-0x4(%rbp)
jmp    1183 <main+0x73>
cmpl   $0x3e8,-0x8(%rbp)
jle    117e <main+0x6e>
mov    $0x0,%al
call   1030 <__assert_fail@plt>
movl   $0x1,-0x4(%rbp)
jmp    1183 <main+0x73>
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__assert_fail@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %0, %19
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = call i32 (...) @__assert_fail()
store i32 1, i32* %1
br label %20
14: ; preds = %4
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 1000
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (...) @__assert_fail()
store i32 1, i32* %1
br label %20
19: ; preds = %14
br label %4
20: ; preds = %17, %12
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__assert_fail()
ret i32 1
}
int sum(int a, int b) { return 99; }


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

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

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
ret i32 99
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_write_solution_dimensions(int len, int dim) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(134, &len, &dim, c, 0);
  return fail;
}


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

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

LLVM IR (-O0):
define i32 @solcon_write_solution_dimensions(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc4c(i32 134, i32* %3, i32* %4, double* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_write_solution_dimensions(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 134, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
int client_start() {}


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

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

LLVM IR (-O0):
define i32 @client_start() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @client_start() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int /*<<< orphan*/ fegetenv(int /*<<< orphan*/ *);
int /*<<< orphan*/ fesetenv(int /*<<< orphan*/ *);
float rintf(float);
float nearbyintf(float x) {
  volatile float ret;
  fenv_t env;
  fegetenv(&env);
  ret = rintf(x);
  fesetenv(&env);
  return (ret);
}


x86 assembly (clang, -O0):
<nearbyintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <fegetenv@plt>
movss  -0x4(%rbp),%xmm0
call   1030 <rintf@plt>
movss  %xmm0,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <fesetenv@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearbyintf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0x4(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <fegetenv@plt>
movss  0x4(%rsp),%xmm0
call   1030 <rintf@plt>
movss  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <fesetenv@plt>
movss  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @nearbyintf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = call i32 @fegetenv(i32* %4)
%6 = load float, float* %2
%7 = call float @llvm.rint.f32(float %6)
store volatile float %7, float* %3
%8 = call i32 @fesetenv(i32* %4)
%9 = load volatile float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @nearbyintf(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = bitcast float* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = call i32 @fegetenv(i32* %3)
%7 = call float @llvm.rint.f32(float %0)
store volatile float %7, float* %2
%8 = call i32 @fesetenv(i32* %3)
%9 = load volatile float, float* %2
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello World!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ bar(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void foo(void) {
  char buf[32] __attribute__((aligned(16)));
  memset(buf, 0, sizeof(buf));
  bar(buf);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
lea    -0x20(%rbp),%rdi
call   1030 <bar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
call   1030 <bar@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 32)
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%5 = call i32 @bar(i8* %4)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 0, i32 32)
%4 = call i32 @bar(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void OsaMemFree(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<OsaMemFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @OsaMemFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fixture_buffer(char *, int, char const *);
extern const char *fixture(const char *file) {
  static char buff[256];
  fixture_buffer(buff, 256, file);
  return buff;
}


x86 assembly (clang, -O0):
<fixture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f19(%rip),%rdi
mov    $0x100,%esi
call   1030 <fixture_buffer@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixture>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <fixture_buffer@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@fixture.buff = internal global [256 x i8] zeroinitializer
define i8* @fixture(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fixture_buffer(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @fixture.buff, i64 0, i64 0), i32 256, i8* %3)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @fixture.buff, i64 0, i64 0)
}

LLVM IR (-O2):
@fixture.buff = internal global [256 x i8] zeroinitializer
define i8* @fixture(i8* %0) {
%2 = tail call i32 @fixture_buffer(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @fixture.buff, i64 0, i64 0), i32 256, i8* %0)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @fixture.buff, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void passiveMotionFunc(int x, int y) {
  printf("Mouse motion at %d, %d\n", x, y);
}


x86 assembly (clang, -O0):
<passiveMotionFunc>:
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):
<passiveMotionFunc>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Mouse motion at %d, %d\0A\00"
define void @passiveMotionFunc(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 ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Mouse motion at %d, %d\0A\00"
define void @passiveMotionFunc(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SpecifiedHuffman_AC();
int /*<<< orphan*/ SpecifiedHuffman_DC();
void JpegDefaultHuffman() {
  SpecifiedHuffman_DC();
  SpecifiedHuffman_AC();
}


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

x86 assembly (clang, -O2):
<JpegDefaultHuffman>:
push   %rax
xor    %eax,%eax
call   1030 <SpecifiedHuffman_DC@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <SpecifiedHuffman_AC@plt>

LLVM IR (-O0):
define void @JpegDefaultHuffman() {
%1 = call i32 (...) @SpecifiedHuffman_DC()
%2 = call i32 (...) @SpecifiedHuffman_AC()
ret void
}

LLVM IR (-O2):
define void @JpegDefaultHuffman() {
%1 = tail call i32 (...) @SpecifiedHuffman_DC()
%2 = tail call i32 (...) @SpecifiedHuffman_AC()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ battery_state_service_sudirribe(int /*<<< orphan*/ (*)());
int /*<<< orphan*/ update_battery();
void batteryModule_init() {
  update_battery();
  battery_state_service_sudirribe(update_battery);
}


x86 assembly (clang, -O0):
<batteryModule_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <update_battery@plt>
mov    0x2ebe(%rip),%rdi
call   1030 <battery_state_service_sudirribe@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<batteryModule_init>:
push   %rax
xor    %eax,%eax
call   1040 <update_battery@plt>
mov    0x2ec1(%rip),%rdi
pop    %rax
jmp    1030 <battery_state_service_sudirribe@plt>

LLVM IR (-O0):
define void @batteryModule_init() {
%1 = call i32 (...) @update_battery()
%2 = call i32 @battery_state_service_sudirribe(i32 (...)* @update_battery)
ret void
}

LLVM IR (-O2):
define void @batteryModule_init() {
%1 = tail call i32 (...) @update_battery()
%2 = tail call i32 @battery_state_service_sudirribe(i32 (...)* @update_battery)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ get_uint24(int /*<<< orphan*/ *, int /*<<< orphan*/);
uint32_t format_address_byte_from_index_cylinder(uint8_t *data) {
  return get_uint24(data, 0);
}


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

x86 assembly (clang, -O2):
<format_address_byte_from_index_cylinder>:
xor    %esi,%esi
jmp    1030 <get_uint24@plt>

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

LLVM IR (-O2):
define i32 @format_address_byte_from_index_cylinder(i32* %0) {
%2 = tail call i32 @get_uint24(i32* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SYS_open;
long syscall3(int /*<<< orphan*/, long, long, long);
long _open(char *f, long flags, long mode) {
  return syscall3(SYS_open, (long)f, flags, mode);
}


x86 assembly (clang, -O0):
<_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall3@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_open>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall3@plt>

LLVM IR (-O0):
@SYS_open = global i32 0
define i64 @_open(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32, i32* @SYS_open
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = call i64 @syscall3(i32 %7, i64 %9, i64 %10, i64 %11)
ret i64 %12
}

LLVM IR (-O2):
@SYS_open = global i32 0
define i64 @_open(i8* %0, i64 %1, i64 %2) {
%4 = load i32, i32* @SYS_open
%5 = ptrtoint i8* %0 to i64
%6 = tail call i64 @syscall3(i32 %4, i64 %5, i64 %1, i64 %2)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ setClientId(int, int);
void setup_bob(int bob___0) {
  {
    { setClientId(bob___0, bob___0); }
    return;
  }
}


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

x86 assembly (clang, -O2):
<setup_bob>:
mov    %edi,%esi
jmp    1030 <setClientId@plt>

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

LLVM IR (-O2):
define void @setup_bob(i32 %0) {
%2 = tail call i32 @setClientId(i32 %0, i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void libcperciva_le16enc(void *pp, uint16_t x) {
  uint8_t *p = (uint8_t *)pp;
  p[0] = x & 0xff;
  p[1] = (x >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<libcperciva_le16enc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<libcperciva_le16enc>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @libcperciva_le16enc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %4
%9 = and i32 %8, 255
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
ret void
}

LLVM IR (-O2):
define void @libcperciva_le16enc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = and i32 %1, 255
store i32 %4, i32* %3
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ksft_print_cnts();
int ksft_exit_xfail(void) {
  ksft_print_cnts();
  exit(2);
}


x86 assembly (clang, -O0):
<ksft_exit_xfail>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ksft_print_cnts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ksft_exit_xfail>:
push   %rax
xor    %eax,%eax
call   1030 <ksft_print_cnts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @ksft_exit_xfail() {
%1 = call i32 (...) @ksft_print_cnts()
%2 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define i32 @ksft_exit_xfail() {
%1 = tail call i32 (...) @ksft_print_cnts()
%2 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ desenhaLinha(int);
main() {
  desenhaLinha(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <desenhaLinha@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @desenhaLinha(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
char *strchr(char *, char);
__attribute__((no, noclone)) char *bar(char *p) {
  memcpy(p, "abcd", 5);
  return strchr(p, '\0');
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x5,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"abcd\00"
define i8* @bar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memcpy(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = load i8*, i8** %2
%6 = call i8* @strchr(i8* %5, i8 signext 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
define i8* @bar(i8* %0) {
%2 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ clearenv();
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  setuid(0);
  clearenv();
  system("sync");
  system("echo 1 > /proc/sys/vm/drop_caches");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <setuid@plt>
mov    $0x0,%al
call   1030 <clearenv@plt>
lea    0xeb7(%rip),%rdi
call   1040 <system@plt>
lea    0xeb0(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <setuid@plt>
xor    %eax,%eax
call   1030 <clearenv@plt>
lea    0xeba(%rip),%rdi
call   1040 <system@plt>
lea    0xeb3(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"sync\00"
@.str.1 = [34 x i8] c"echo 1 > /proc/sys/vm/drop_caches\00"
define i32 @main() {
%1 = call i32 @setuid(i32 0)
%2 = call i32 (...) @clearenv()
%3 = call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"sync\00"
@.str.1 = [34 x i8] c"echo 1 > /proc/sys/vm/drop_caches\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 (...) @clearenv()
%3 = tail call i32 @system(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int test_imm_C2uint16_mem(unsigned short *val) {
  return ((*val) & (0xC2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C2uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 194
%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_C2uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 194
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f() { printf("098765432"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"098765432\00"
define void @f() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"098765432\00"
define void @f() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct device_rf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ spi_readwrite(struct device_rf *, unsigned char *,
                                 unsigned char *, int);
unsigned char rf_read_short_reg(struct device_rf *rf, unsigned char reg) {
  unsigned char tx[2], rx[2];
  tx[0] = reg;
  tx[1] = 0xCC;
  rx[1] = 0;
  spi_readwrite(rf, tx, rx, 2);
  return rx[1];
}


x86 assembly (clang, -O0):
<rf_read_short_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xb(%rbp)
movb   $0xcc,-0xa(%rbp)
movb   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rsi
lea    -0xd(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <spi_readwrite@plt>
movzbl -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rf_read_short_reg>:
push   %rax
mov    %sil,0x6(%rsp)
movb   $0xcc,0x7(%rsp)
movb   $0x0,0x5(%rsp)
lea    0x6(%rsp),%rsi
lea    0x4(%rsp),%rdx
mov    $0x2,%ecx
call   1030 <spi_readwrite@plt>
mov    0x5(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
%struct.device_rf = type { i32 }
define zeroext i8 @rf_read_short_reg(%struct.device_rf* %0, i8 zeroext %1) {
%3 = alloca %struct.device_rf*
%4 = alloca i8
%5 = alloca [2 x i8]
%6 = alloca [2 x i8]
store %struct.device_rf* %0, %struct.device_rf** %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 -52, i8* %9
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
store i8 0, i8* %10
%11 = load %struct.device_rf*, %struct.device_rf** %3
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%14 = call i32 @spi_readwrite(%struct.device_rf* %11, i8* %12, i8* %13, i32 2)
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
%16 = load i8, i8* %15
ret i8 %16
}

LLVM IR (-O2):
%struct.device_rf = type { i32 }
define zeroext i8 @rf_read_short_reg(%struct.device_rf* %0, i8 zeroext %1) {
%3 = alloca [2 x i8]
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 %1, i8* %5
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 -52, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 0, i8* %8
%9 = call i32 @spi_readwrite(%struct.device_rf* %0, i8* %5, i8* %6, i32 2)
%10 = load i8, i8* %8
ret i8 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ util_spawn(char const *, int, char const **, char const *,
                              char const *);
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int *, int /*<<< orphan*/);
int util_spawn_blocking(const char *executable, int argc, const char **argv,
                        const char *stdout_file, const char *stderr_file) {
  int status;
  pid_t pid = util_spawn(executable, argc, argv, stdout_file, stderr_file);
  waitpid(pid, &status, 0);
  return status;
}


x86 assembly (clang, -O0):
<util_spawn_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <util_spawn@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%edi
lea    -0x2c(%rbp),%rsi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_spawn_blocking>:
push   %rax
call   1030 <util_spawn@plt>
lea    0x4(%rsp),%rsi
mov    %eax,%edi
xor    %edx,%edx
call   1040 <waitpid@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @util_spawn_blocking(i8* %0, i32 %1, i8** %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
%8 = tail call i32 @util_spawn(i8* %0, i32 %1, i8** %2, i8* %3, i8* %4)
%9 = call i32 @waitpid(i32 %8, i32* %6, i32 0)
%10 = load i32, i32* %6
ret i32 %10
}
/* Variables and functions */
int read2Target(unsigned char *);
int readStructTarget(unsigned char *filePtr, unsigned char *fileEnd, ...) {
  int x = read2Target(fileEnd);
  return x;
}


x86 assembly (clang, -O0):
<readStructTarget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <read2Target@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readStructTarget>:
mov    %rsi,%rdi
jmp    1030 <read2Target@plt>

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

LLVM IR (-O2):
define i32 @readStructTarget(i8* nocapture readnone %0, i8* %1, ...) {
%3 = tail call i32 @read2Target(i8* %1)
ret i32 %3
}
/* Variables and functions */
int fn_sq_ch_68_ch_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102(
    char const *);
int fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102(
    const char *text) {
  int pos = 0;
  pos = fn_sq_ch_68_ch_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102(text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102>:
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_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102+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_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102>:
jmp    1030 <fn_sq_ch_68_ch_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102@plt>

LLVM IR (-O0):
define i32 @fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102(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_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102(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_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102(i8* %0) {
%2 = tail call i32 @fn_sq_ch_68_ch_97_ch_116_ch_97_ch_79_ch_110_ch_101_ch_79_ch_102(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void printN(unsigned n) {
  if (n >= 10)
    printN(n / 10);
  printf("%u ", n % 10);
}


x86 assembly (clang, -O0):
<printN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jb     1148 <printN+0x28>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <printN@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%esi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printN>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%r14d
cmp    $0xa,%edi
jb     1140 <printN+0x20>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
call   1030 <printN@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebx
lea    0xea5(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%u \00"
define void @printN(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = udiv i32 %6, 10
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = urem i32 %9, 10
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u \00"
define void @printN(i32 %0) {
%2 = icmp ugt i32 %0, 9
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = udiv i32 %0, 10
tail call void @printN(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = urem i32 %0, 10
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 3, j = i - 2;
  switch (i + 2) {
  case 1:
    j++;
  case 2:
    j++;
  default:
    j = 0;
  case 0:
    j++;
    break;
  }
  printf("%d", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
je     117e <main+0x6e>
jmp    1143 <main+0x33>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1165 <main+0x55>
jmp    1154 <main+0x44>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     116e <main+0x5e>
jmp    1177 <main+0x67>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 2
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 2
switch i32 %7, label %14 [
i32 1, label %8
i32 2, label %11
i32 0, label %15
]
8: ; preds = %0
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %11
11: ; preds = %0, %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %14
14: ; preds = %0, %11
store i32 0, i32* %3
br label %15
15: ; preds = %0, %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
int ft_is_prime(int nb) {
  int i;
  i = 2;
  if (nb <= 1)
    return (0);
  else {
    while (i <= (nb - 1)) {
      if (nb % i == 0)
        return (0);
      else if (nb % i != 0)
        i++;
    }
    return (1);
  }
}


x86 assembly (clang, -O0):
<ft_is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1124 <ft_is_prime+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1180 <ft_is_prime+0x80>
jmp    1129 <ft_is_prime+0x29>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1179 <ft_is_prime+0x79>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1156 <ft_is_prime+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1180 <ft_is_prime+0x80>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     116f <ft_is_prime+0x6f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1174 <ft_is_prime+0x74>
jmp    1129 <ft_is_prime+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_is_prime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jge    110a <ft_is_prime+0xa>
mov    %ecx,%eax
ret
jne    1112 <ft_is_prime+0x12>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <ft_is_prime+0x7>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <ft_is_prime+0x20>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ft_is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %31
8: ; preds = %1
br label %9
9: ; preds = %29, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = icmp sle i32 %10, %12
br i1 %13, label %14, label %30
14: ; preds = %9
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %2
br label %31
20: ; preds = %14
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = srem i32 %21, %22
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %28
28: ; preds = %25, %20
br label %29
29: ; preds = %28
br label %9
30: ; preds = %9
store i32 1, i32* %2
br label %31
31: ; preds = %30, %19, %7
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @ft_is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %12, label %7
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %7, %5, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %7 ], [ 1, %5 ]
ret i32 %13
}
/* Variables and functions */
double __ocml_rlen4_f64(double, double, double, double);
double rnorm4d(double x, double y, double z, double w) {
  return __ocml_rlen4_f64(x, y, z, w);
}


x86 assembly (clang, -O0):
<rnorm4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <__ocml_rlen4_f64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnorm4d>:
jmp    1030 <__ocml_rlen4_f64@plt>

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

LLVM IR (-O2):
define double @rnorm4d(double %0, double %1, double %2, double %3) {
%5 = tail call double @__ocml_rlen4_f64(double %0, double %1, double %2, double %3)
ret double %5
}