xunge/DecIR huggingface dataset:
main() {
  int i, a;
  a = 2;
  for (i = 0; i < 5; i++) {
    a = a = i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    113a <main+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
mov    -0x4(%rbp),%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 i32
store i32 0, i32* %1
store i32 2, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
store i32 %8, i32* %3
store i32 %8, i32* %3
br label %9
9: ; preds = %7
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void FlashRX_LED() {}


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

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

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

LLVM IR (-O2):
define void @FlashRX_LED() {
ret void
}
int git_has_dos_drive_prefix(const char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @git_has_dos_drive_prefix(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
int /*<<< orphan*/ printf(char *);
int test_fatal(char *msg) {
  printf("   fatal( \"log.c:fatal(): test message: '%%s'\", msg );");
  fatal("log.c:fatal(): test message: '%s'", msg);
  printf(" passed\n");
  return (0);
}


x86 assembly (clang, -O0):
<test_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef4(%rip),%rdi
call   1040 <fatal@plt>
lea    0xf0a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fatal>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
mov    %rbx,%rsi
call   1050 <fatal@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [55 x i8] c" fatal( \22log.c:fatal(): test message: '%%s'\22, msg );\00"
@.str.1 = [34 x i8] c"log.c:fatal(): test message: '%s'\00"
@.str.2 = [9 x i8] c" passed\0A\00"
define i32 @test_fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @fatal(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c" fatal( \22log.c:fatal(): test message: '%%s'\22, msg );\00"
@.str.1 = [34 x i8] c"log.c:fatal(): test message: '%s'\00"
@str = [8 x i8] c" passed\00"
define i32 @test_fatal(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fatal(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ explode_badly();
__attribute__((no, noclone)) int i_am_pure4(int a) {
  if (a > 50)
    explode_badly();
  return a;
}


x86 assembly (clang, -O0):
<i_am_pure4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jle    112c <i_am_pure4+0x1c>
mov    $0x0,%al
call   1030 <explode_badly@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_am_pure4>:
push   %rbx
mov    %edi,%ebx
cmp    $0x33,%edi
jl     111f <i_am_pure4+0xf>
xor    %eax,%eax
call   1030 <explode_badly@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @i_am_pure4(i32 returned %0) {
%2 = icmp sgt i32 %0, 50
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @explode_badly()
br label %5
5: ; preds = %3, %1
ret i32 %0
}
/* Variables and functions */
scalar_t__ atof(char *);
float oatof(char *str, float def) {
  if (str == (char *)NULL)
    return (def);
  else
    return ((float)atof(str));
}


x86 assembly (clang, -O0):
<oatof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113b <oatof+0x2b>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    114e <oatof+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oatof>:
test   %rdi,%rdi
je     1127 <oatof+0x17>
push   %rax
call   1030 <atof@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define float @oatof(i8* %0, float %1) {
%3 = alloca float
%4 = alloca i8*
%5 = alloca float
store i8* %0, i8** %4
store float %1, float* %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %5
store float %9, float* %3
br label %14
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i64 @atof(i8* %11)
%13 = sitofp i64 %12 to float
store float %13, float* %3
br label %14
14: ; preds = %10, %8
%15 = load float, float* %3
ret float %15
}

LLVM IR (-O2):
define float @oatof(i8* %0, float %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i64 @atof(i8* %0)
%6 = sitofp i64 %5 to float
br label %7
7: ; preds = %2, %4
%8 = phi float [ %6, %4 ], [ %1, %2 ]
ret float %8
}
/* Type definitions */
struct s_array {
  int dummy;
};

/* Variables and functions */
scalar_t__ array_destroy(struct s_array *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct s_array *);
int array_delete(struct s_array **array) {
  assert(array != NULL);
  if (array_destroy(*array))
    return (-1);
  free(*array);
  return (0);
}


x86 assembly (clang, -O0):
<array_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <array_destroy@plt>
cmp    $0x0,%rax
je     1170 <array_delete+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1183 <array_delete+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_delete>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%rdi
call   1050 <array_destroy@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1159 <array_delete+0x29>
pop    %rbx
ret
mov    (%rbx),%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.s_array = type { i32 }
define i32 @array_delete(%struct.s_array** %0) {
%2 = alloca i32
%3 = alloca %struct.s_array**
store %struct.s_array** %0, %struct.s_array*** %3
%4 = load %struct.s_array**, %struct.s_array*** %3
%5 = icmp ne %struct.s_array** %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load %struct.s_array**, %struct.s_array*** %3
%9 = load %struct.s_array*, %struct.s_array** %8
%10 = call i64 @array_destroy(%struct.s_array* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %17
13: ; preds = %1
%14 = load %struct.s_array**, %struct.s_array*** %3
%15 = load %struct.s_array*, %struct.s_array** %14
%16 = call i32 @free(%struct.s_array* %15)
store i32 0, i32* %2
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.s_array = type { i32 }
define i32 @array_delete(%struct.s_array** %0) {
%2 = icmp ne %struct.s_array** %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load %struct.s_array*, %struct.s_array** %0
%6 = tail call i64 @array_destroy(%struct.s_array* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.s_array*, %struct.s_array** %0
%10 = tail call i32 @free(%struct.s_array* %9)
br label %11
11: ; preds = %1, %8
%12 = phi i32 [ 0, %8 ], [ -1, %1 ]
ret i32 %12
}
int do_943() { return 943; }


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

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

LLVM IR (-O0):
define i32 @do_943() {
ret i32 943
}

LLVM IR (-O2):
define i32 @do_943() {
ret i32 943
}
int not_eol(char c) {
  int result = 0;
  if (c != '\0')
    result = 1;
  return result;
}


x86 assembly (clang, -O0):
<not_eol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
je     1125 <not_eol+0x25>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_eol>:
xor    %eax,%eax
test   %dil,%dil
setne  %al
ret

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

LLVM IR (-O2):
define i32 @not_eol(i8 signext %0) {
%2 = icmp ne i8 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void aft_gsm_set_sim_no(int *reg, int sim_no) {
  sim_no <<= 5;
  *reg |= (sim_no & (0x7 << 5));
}


x86 assembly (clang, -O0):
<aft_gsm_set_sim_no>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xe0,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<aft_gsm_set_sim_no>:
shl    $0x5,%esi
movzbl %sil,%eax
or     %eax,(%rdi)
ret

LLVM IR (-O0):
define void @aft_gsm_set_sim_no(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, 224
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = or i32 %10, %8
store i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @aft_gsm_set_sim_no(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 5
%4 = and i32 %3, 224
%5 = load i32, i32* %0
%6 = or i32 %5, %4
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
bool check_if_run_in_background(char **arguments_array, int *args_count) {
  if (strcmp(arguments_array[*args_count - 1], "&") == 0) {
    *args_count -= 1;
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<check_if_run_in_background>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1161 <check_if_run_in_background+0x51>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1168 <check_if_run_in_background+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_run_in_background>:
push   %rbx
mov    %rsi,%rbx
movslq (%rsi),%rax
mov    -0x8(%rdi,%rax,8),%rdi
lea    0xedd(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1134 <check_if_run_in_background+0x24>
pop    %rbx
ret
addl   $0xffffffff,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"&\00"
define i32 @check_if_run_in_background(i8** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %1
%12 = add nsw i32 %11, -1
store i32 %12, i32* %1
br label %13
13: ; preds = %2, %10
%14 = phi i32 [ 1, %10 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ test_isStartWith();
int /*<<< orphan*/ test_replaceStr();
int main() {
  test_replaceStr();
  test_isStartWith();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_replaceStr@plt>
mov    $0x0,%al
call   1040 <test_isStartWith@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_replaceStr()
%2 = call i32 (...) @test_isStartWith()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_replaceStr()
%2 = tail call i32 (...) @test_isStartWith()
ret i32 0
}
int g(int i) {
  int acc = i < 0 ? i : 0;
  while (acc < i) {
    acc++;
  }
  return acc;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111c <g+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <g+0x26>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <g+0x26>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <g+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <g+0x2c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
ret i32 %0
}
int bics_si_test1(int a, int b, int c) {
  int d = a & ~b;
  if (d == 0)
    return a + c;
  else
    return d;
}


x86 assembly (clang, -O0):
<bics_si_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1133 <bics_si_test1+0x33>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1139 <bics_si_test1+0x39>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bics_si_test1>:
not    %esi
and    %edi,%esi
lea    (%rdx,%rdi,1),%eax
test   %esi,%esi
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @bics_si_test1(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, -1
%5 = and i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %2, %0
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ __u64;
typedef scalar_t__ __le64;

/* Variables and functions */
int /*<<< orphan*/ le64toh(int /*<<< orphan*/);
uint64_t le64_to_cpu(__le64 x) { return le64toh((__u64)x); }


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

x86 assembly (clang, -O2):
<le64_to_cpu>:
jmp    1030 <le64toh@plt>

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

LLVM IR (-O2):
define i32 @le64_to_cpu(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @le64toh(i32 %2)
ret i32 %3
}
/* Variables and functions */
int find_bit(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d", find_bit(a, b));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <find_bit@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @find_bit(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @find_bit(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int gettimeofday(struct timeval *tv, void *tz) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<gettimeofday>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @gettimeofday(%struct.timeval* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ESRCH;
int /*<<< orphan*/ errno;
int kill(int, int);
int killpg(pid_t pgid, int sig) {
  if (pgid == 1) {
    errno = ESRCH;
    return (-1);
  }
  return (kill(-pgid, sig));
}


x86 assembly (clang, -O0):
<killpg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1146 <killpg+0x36>
mov    0x2ea1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea8(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <killpg+0x46>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <kill@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<killpg>:
cmp    $0x1,%edi
jne    112d <killpg+0x1d>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
mov    0x2ebb(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret
neg    %edi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@ESRCH = global i32 0
@errno = global i32 0
define i32 @killpg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @ESRCH
store i32 %9, i32* @errno
store i32 -1, i32* %3
br label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = sub nsw i32 0, %11
%13 = load i32, i32* %5
%14 = call i32 @kill(i32 %12, i32 %13)
store i32 %14, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@ESRCH = global i32 0
@errno = global i32 0
define i32 @killpg(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @ESRCH
store i32 %5, i32* @errno
br label %9
6: ; preds = %2
%7 = sub nsw i32 0, %0
%8 = tail call i32 @kill(i32 %7, i32 %1)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ -1, %4 ], [ %8, %6 ]
ret i32 %10
}
int mut_mem_close(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mut_mem_close() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_help() {
  fprintf(stderr, "  >> Usage: sudo ./scan -c nb_cores -b number_of_bits\n");
  fprintf(stderr, "  >> Usage: optional property -r GB (defines number of GB "
                  "which should be allocated, default 2)\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf08(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c" >> Usage: sudo ./scan -c nb_cores -b number_of_bits\0A\00"
@.str.1 = [97 x i8] c" >> Usage: optional property -r GB (defines number of GB which should be allocated, default 2)\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c" >> Usage: sudo ./scan -c nb_cores -b number_of_bits\0A\00"
@.str.1 = [97 x i8] c" >> Usage: optional property -r GB (defines number of GB which should be allocated, default 2)\0A\00"
define void @print_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int pipe(int *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int i, returnval;
  int pipes[10000];
  for (i = 0; i < 10000; i++) {
    returnval = pipe(&pipes[i]);
  }
  printf("PASS\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    116e <main+0x4e>
movslq -0x8(%rbp),%rax
lea    -0x9c50(%rbp),%rdi
shl    $0x2,%rax
add    %rax,%rdi
call   1040 <pipe@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x9c50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x9c40,%rsp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
lea    (%rsp,%rbx,1),%rdi
call   1040 <pipe@plt>
add    $0x4,%rbx
cmp    $0x9c40,%rbx
jne    1130 <main+0x10>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x9c40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = alloca [10000 x i32]
%2 = bitcast [10000 x i32]* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %7, %3 ]
%5 = getelementptr inbounds [10000 x i32], [10000 x i32]* %1, i64 0, i64 %4
%6 = call i32 @pipe(i32* %5)
%7 = add nuw nsw i64 %4, 1
%8 = icmp eq i64 %7, 10000
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double measure_plaquette();
double measure_wilson_action(double beta) {
  double plaquette;
  double wilson;
  plaquette = measure_plaquette();
  wilson = -(beta / (2. * 3.)) * plaquette;
  return wilson;
}


x86 assembly (clang, -O0):
<measure_wilson_action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <measure_plaquette@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeca(%rip),%xmm1
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measure_wilson_action>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <measure_plaquette@plt>
movsd  (%rsp),%xmm1
divsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @measure_wilson_action(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = call double (...) @measure_plaquette()
store double %5, double* %3
%6 = load double, double* %2
%7 = fdiv double %6, 6.000000e+00
%8 = fneg double %7
%9 = load double, double* %3
%10 = fmul double %8, %9
store double %10, double* %4
%11 = load double, double* %4
ret double %11
}

LLVM IR (-O2):
define double @measure_wilson_action(double %0) {
%2 = tail call double (...) @measure_plaquette()
%3 = fdiv double %0, -6.000000e+00
%4 = fmul double %3, %2
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ gpio_toggle_red_led();
void leds_update(void) { gpio_toggle_red_led(); }


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

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

LLVM IR (-O0):
define void @leds_update() {
%1 = call i32 (...) @gpio_toggle_red_led()
ret void
}

LLVM IR (-O2):
define void @leds_update() {
%1 = tail call i32 (...) @gpio_toggle_red_led()
ret void
}
/* Variables and functions */
int twice_sum(int);
int bar() {
  int i;
  int j;
  int sum = 0;
  for (i = 0; i < 100; i++) {
    for (j = 0; j < 100; j++) {
      sum += i + j;
    }
  }
  return twice_sum(sum);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    116e <bar+0x5e>
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    115b <bar+0x4b>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1137 <bar+0x27>
jmp    1160 <bar+0x50>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <bar+0x16>
mov    -0xc(%rbp),%edi
call   1030 <twice_sum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0xf1b30,%edi
jmp    1030 <twice_sum@plt>

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

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 @twice_sum(i32 990000)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int sys_kill(int pid, int sig) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<sys_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_kill>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @sys_kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int ftruncate(int, int /*<<< orphan*/);
int fs_ftruncate(FILE *file, int len) {
  int fd = fileno(file);
  return ftruncate(fd, (off_t)len);
}


x86 assembly (clang, -O0):
<fs_ftruncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <ftruncate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_ftruncate>:
push   %rbx
mov    %esi,%ebx
call   1040 <fileno@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <ftruncate@plt>

LLVM IR (-O0):
define i32 @fs_ftruncate(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @fileno(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @ftruncate(i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @fs_ftruncate(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fileno(i32* %0)
%4 = tail call i32 @ftruncate(i32 %3, i32 %1)
ret i32 %4
}
void test62_Test_pollen__run__E() {}


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

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

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

LLVM IR (-O2):
define void @test62_Test_pollen__run__E() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(size_t);
__attribute__((no)) void function3(size_t size) { malloc(size); }


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

x86 assembly (clang, -O2):
<function3>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define void @function3(i64 %0) {
%2 = tail call i32 @malloc(i64 %0)
ret void
}
float celsius_to_fahrenheit(float celsius) { return celsius * 1.8f + 32.f; }


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

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

LLVM IR (-O0):
define float @celsius_to_fahrenheit(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.fmuladd.f32(float %3, float 0x3FFCCCCCC0000000, float 3.200000e+01)
ret float %4
}

LLVM IR (-O2):
define float @celsius_to_fahrenheit(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 0x3FFCCCCCC0000000, float 3.200000e+01)
ret float %2
}
/* Variables and functions */
int rand();
int rand_int(int range, int min) { return rand() % range + min; }


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

x86 assembly (clang, -O2):
<rand_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %3
%7 = srem i32 %5, %6
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rand_int(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, %0
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char const *);
char *ft_strndup(char const *, int /*<<< orphan*/);
char *ft_strdup(const char *s) { return (ft_strndup(s, ft_strlen(s))); }


x86 assembly (clang, -O0):
<ft_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <ft_strndup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <ft_strndup@plt>

LLVM IR (-O0):
define i8* @ft_strdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ft_strlen(i8* %4)
%6 = call i8* @ft_strndup(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @ft_strdup(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = tail call i8* @ft_strndup(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ IFNAMSIZ;
int /*<<< orphan*/ R_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *);
bool is_bridge(char *if_name) {
  char path[32 + IFNAMSIZ];
  sprintf(path,
          "/sys/class/net"
          "/%s/bridge",
          if_name);
  return (0 == access(path, R_OK));
}


x86 assembly (clang, -O0):
<is_bridge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
add    $0x20,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x20(%rbp),%rdi
mov    0x2e62(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bridge>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
add    $0x20,%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@IFNAMSIZ = global i32 0
@.str = [25 x i8] c"/sys/class/net/%s/bridge\00"
@R_OK = global i32 0
define i32 @is_bridge(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i32, i32* @IFNAMSIZ
%6 = add nsw i32 32, %5
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = load i8*, i8** %2
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @R_OK
%13 = call i64 @access(i8* %9, i32 %12)
%14 = icmp eq i64 0, %13
%15 = zext i1 %14 to i32
%16 = load i8*, i8** %3
ret i32 %15
}

LLVM IR (-O2):
@IFNAMSIZ = global i32 0
@.str = [25 x i8] c"/sys/class/net/%s/bridge\00"
@R_OK = global i32 0
define i32 @is_bridge(i8* %0) {
%2 = load i32, i32* @IFNAMSIZ
%3 = add nsw i32 %2, 32
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = load i32, i32* @R_OK
%8 = call i64 @access(i8* %5, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
double phiarea(const double x) { return .5 * (x - 1.0) * (x - 1.0); }


x86 assembly (clang, -O0):
<phiarea>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xeea(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xecd(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<phiarea>:
addsd  0xef8(%rip),%xmm0
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @phiarea(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.000000e+00
%5 = fmul double 5.000000e-01, %4
%6 = load double, double* %2
%7 = fsub double %6, 1.000000e+00
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @phiarea(double %0) {
%2 = fadd double %0, -1.000000e+00
%3 = fmul double %2, 5.000000e-01
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ SNVS_LP_WRAPPER_DriverIRQHandler();
__attribute__((weak)) void SNVS_LP_WRAPPER_IRQHandler(void) {
  SNVS_LP_WRAPPER_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @SNVS_LP_WRAPPER_IRQHandler() {
%1 = call i32 (...) @SNVS_LP_WRAPPER_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SNVS_LP_WRAPPER_IRQHandler() {
%1 = tail call i32 (...) @SNVS_LP_WRAPPER_DriverIRQHandler()
ret void
}
/* Type definitions */
struct timespec {
  int const member_0;
  int const member_1;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/);
void sleep_ms(const int ms) {
  struct timespec delay = {ms / 1000, (ms % 1000) * 1000 * 1000};
  nanosleep(&delay, 0);
}


x86 assembly (clang, -O0):
<sleep_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_ms>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @sleep_ms(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000
store i32 %6, i32* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%8 = load i32, i32* %2
%9 = srem i32 %8, 1000
%10 = mul nsw i32 %9, 1000
%11 = mul nsw i32 %10, 1000
store i32 %11, i32* %7
%12 = call i32 @nanosleep(%struct.timespec* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @sleep_ms(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%5 = sdiv i32 %0, 1000
store i32 %5, i32* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%7 = srem i32 %0, 1000
%8 = mul nsw i32 %7, 1000000
store i32 %8, i32* %6
%9 = call i32 @nanosleep(%struct.timespec* %2, i32 0)
ret void
}
int fn7(int a, int b, int m) {
  int tem1 = m & b;
  int tem2 = ~m & a;
  return tem1 | tem2;
}


x86 assembly (clang, -O0):
<fn7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn7>:
mov    %esi,%eax
xor    %edi,%eax
and    %edx,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn7(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = and i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = xor i32 %12, -1
%14 = load i32, i32* %4
%15 = and i32 %13, %14
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @fn7(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, %1
%5 = xor i32 %2, -1
%6 = and i32 %5, %0
%7 = or i32 %4, %6
ret i32 %7
}
/* Variables and functions */
size_t min_size(size_t a, size_t b) { return (((a) <= (b)) ? (a) : (b)); }


x86 assembly (clang, -O0):
<min_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1127 <min_size+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_size+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_size>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmova  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @min_size(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ule i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min_size(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}