xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assertDeepEqual(int *, int *, int);
char *test_assertDeepEqual() {
  static int a[2] = {1, 2};
  static int b[2] = {1, 2};
  do {
    if (!(assertDeepEqual(a, b, 2)))
      return "e: test_assertDeepEqual";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_assertDeepEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f09(%rip),%rdi
lea    0x2f0a(%rip),%rsi
mov    $0x2,%edx
call   1030 <assertDeepEqual@plt>
cmp    $0x0,%eax
jne    1149 <test_assertDeepEqual+0x39>
lea    0xec0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <test_assertDeepEqual+0x46>
jmp    114e <test_assertDeepEqual+0x3e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assertDeepEqual>:
push   %rax
lea    0x2f10(%rip),%rdi
lea    0x2f11(%rip),%rsi
mov    $0x2,%edx
call   1030 <assertDeepEqual@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xecc(%rip),%rax
cmove  %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@test_assertDeepEqual.a = internal global [2 x i32] [i32 1, i32 2]
@test_assertDeepEqual.b = internal global [2 x i32] [i32 1, i32 2]
@.str = [24 x i8] c"e: test_assertDeepEqual\00"
define i8* @test_assertDeepEqual() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 @assertDeepEqual(i32* getelementptr inbounds ([2 x i32], [2 x i32]* @test_assertDeepEqual.a, i64 0, i64 0), i32* getelementptr inbounds ([2 x i32], [2 x i32]* @test_assertDeepEqual.b, i64 0, i64 0), i32 2)
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@test_assertDeepEqual.a = internal global [2 x i32] [i32 1, i32 2]
@test_assertDeepEqual.b = internal global [2 x i32] [i32 1, i32 2]
@.str = [24 x i8] c"e: test_assertDeepEqual\00"
define i8* @test_assertDeepEqual() {
%1 = tail call i32 @assertDeepEqual(i32* getelementptr inbounds ([2 x i32], [2 x i32]* @test_assertDeepEqual.a, i64 0, i64 0), i32* getelementptr inbounds ([2 x i32], [2 x i32]* @test_assertDeepEqual.b, i64 0, i64 0), i32 2)
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Type definitions */
struct mloop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mloop__break_out(struct mloop *);
__attribute__((visibility("default"))) void mloop_iterate(struct mloop *self) {
  mloop__break_out(self);
}


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

x86 assembly (clang, -O2):
<mloop_iterate>:
jmp    1030 <mloop__break_out@plt>

LLVM IR (-O0):
%struct.mloop = type { i32 }
define void @mloop_iterate(%struct.mloop* %0) {
%2 = alloca %struct.mloop*
store %struct.mloop* %0, %struct.mloop** %2
%3 = load %struct.mloop*, %struct.mloop** %2
%4 = call i32 @mloop__break_out(%struct.mloop* %3)
ret void
}

LLVM IR (-O2):
%struct.mloop = type { i32 }
define void @mloop_iterate(%struct.mloop* %0) {
%2 = tail call i32 @mloop__break_out(%struct.mloop* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
scalar_t__ strstr(char const *, char const *);
__attribute__((visibility("default"))) int
trio_contains(const char *string, const char *substring) {
  assert(string);
  assert(substring);
  return (0 != strstr(string, substring));
}


x86 assembly (clang, -O0):
<trio_contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_contains>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @trio_contains(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i64 @strstr(i8* %9, i8* %10)
%12 = icmp ne i64 0, %11
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @trio_contains(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = tail call i64 @strstr(i8* %0, i8* %1)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void genbltzl_out() {}


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

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

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

LLVM IR (-O2):
define void @genbltzl_out() {
ret void
}
int op_and(int x, int y) { return x & y; }


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

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

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

LLVM IR (-O2):
define i32 @op_and(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Run C code");
  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 <printf@plt>
xor    %eax,%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 = [11 x i8] c"Run C code\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Run C code\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
scalar_t__ cwn_read(int /*<<< orphan*/ *);
scalar_t__ cwn_rewind();
int /*<<< orphan*/ hash_seti(int /*<<< orphan*/, int /*<<< orphan*/);
void cwn_processing() {
  int64_t id;
  if (cwn_rewind())
    return;
  for (;;) {
    if (cwn_read(&id))
      break;
    hash_seti(0, id);
  }
}


x86 assembly (clang, -O0):
<cwn_processing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <cwn_rewind@plt>
cmp    $0x0,%rax
je     114e <cwn_processing+0x1e>
jmp    117a <cwn_processing+0x4a>
jmp    1153 <cwn_processing+0x23>
lea    -0x4(%rbp),%rdi
call   1030 <cwn_read@plt>
cmp    $0x0,%rax
je     116b <cwn_processing+0x3b>
jmp    117a <cwn_processing+0x4a>
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1040 <hash_seti@plt>
jmp    1153 <cwn_processing+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwn_processing>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <cwn_rewind@plt>
test   %rax,%rax
jne    1178 <cwn_processing+0x48>
lea    0xc(%rsp),%rdi
call   1030 <cwn_read@plt>
test   %rax,%rax
jne    1178 <cwn_processing+0x48>
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    0xc(%rsp),%esi
xor    %edi,%edi
call   1040 <hash_seti@plt>
mov    %rbx,%rdi
call   1030 <cwn_read@plt>
test   %rax,%rax
je     1160 <cwn_processing+0x30>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @cwn_processing() {
%1 = alloca i32
%2 = call i64 (...) @cwn_rewind()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %13
5: ; preds = %0
br label %6
6: ; preds = %10, %5
%7 = call i64 @cwn_read(i32* %1)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %13
10: ; preds = %6
%11 = load i32, i32* %1
%12 = call i32 @hash_seti(i32 0, i32 %11)
br label %6
13: ; preds = %4, %9
ret void
}

LLVM IR (-O2):
define void @cwn_processing() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i64 (...) @cwn_rewind()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = call i64 @cwn_read(i32* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5, %8
%9 = load i32, i32* %1
%10 = call i32 @hash_seti(i32 0, i32 %9)
%11 = call i64 @cwn_read(i32* %1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %8, label %13
13: ; preds = %8, %5, %0
ret void
}
void foo496(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo496(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dummy_xship(int /*<<< orphan*/ *, int, char *, int);
int pdf_xship(FILE *f, int filter, char *s, int len) {
  return dummy_xship(f, filter, s, len);
}


x86 assembly (clang, -O0):
<pdf_xship>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <dummy_xship@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdf_xship>:
jmp    1030 <dummy_xship@plt>

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

LLVM IR (-O2):
define i32 @pdf_xship(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @dummy_xship(i32* %0, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
double floor(double);
double libm_floor(double x) { return floor(x); }


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

x86 assembly (clang, -O2):
<libm_floor>:
jmp    1030 <floor@plt>

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

LLVM IR (-O2):
define double @libm_floor(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
scalar_t__ random();
int /*<<< orphan*/ srandomdev();
int main(void) {
  static int element;
  while (element++ < 10) {
    srandomdev();
    printf("%d ", (int)random());
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eef(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2ee4(%rip)
cmp    $0xa,%eax
jge    118a <main+0x4a>
mov    $0x0,%al
call   1060 <srandomdev@plt>
mov    $0x0,%al
call   1050 <random@plt>
mov    %eax,%esi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
jmp    114f <main+0xf>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2efd(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ef4(%rip)
cmp    $0x9,%eax
jg     118c <main+0x4c>
lea    0xea4(%rip),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <srandomdev@plt>
xor    %eax,%eax
call   1050 <random@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2ec6(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ebd(%rip)
cmp    $0xa,%eax
jl     1160 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@main.element = internal global i32 0
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* @main.element
%4 = add nsw i32 %3, 1
store i32 %4, i32* @main.element
%5 = icmp slt i32 %3, 10
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = call i32 (...) @srandomdev()
%8 = call i64 (...) @random()
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %2
11: ; preds = %2
%12 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@main.element = internal unnamed_addr global i32 0
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = load i32, i32* @main.element
%2 = add nsw i32 %1, 1
store i32 %2, i32* @main.element
%3 = icmp slt i32 %1, 10
br i1 %3, label %4, label %12
4: ; preds = %0, %4
%5 = tail call i32 (...) @srandomdev()
%6 = tail call i64 (...) @random()
%7 = trunc i64 %6 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @main.element
%10 = add nsw i32 %9, 1
store i32 %10, i32* @main.element
%11 = icmp slt i32 %9, 10
br i1 %11, label %4, label %12
12: ; preds = %4, %0
%13 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ printf(char *);
int wifidir_use_fixed_ie_indices(void) {
  char *ret = getenv("WIFIDIR_USE_FIXED_IE_INDICES");
  if (ret != NULL && *ret == '1') {
    printf("Using fixed ie indices 0 and 1 for P2P and WPS IEs");
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<wifidir_use_fixed_ie_indices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <wifidir_use_fixed_ie_indices+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    116b <wifidir_use_fixed_ie_indices+0x4b>
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1172 <wifidir_use_fixed_ie_indices+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wifidir_use_fixed_ie_indices>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     114d <wifidir_use_fixed_ie_indices+0x2d>
cmpb   $0x31,(%rcx)
jne    114d <wifidir_use_fixed_ie_indices+0x2d>
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"WIFIDIR_USE_FIXED_IE_INDICES\00"
@.str.1 = [51 x i8] c"Using fixed ie indices 0 and 1 for P2P and WPS IEs\00"
define i32 @wifidir_use_fixed_ie_indices() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 49
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %14
13: ; preds = %6, %0
store i32 0, i32* %1
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [29 x i8] c"WIFIDIR_USE_FIXED_IE_INDICES\00"
@.str.1 = [51 x i8] c"Using fixed ie indices 0 and 1 for P2P and WPS IEs\00"
define i32 @wifidir_use_fixed_ie_indices() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 49
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %0, %3, %6
%9 = phi i32 [ 1, %6 ], [ 0, %3 ], [ 0, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ daemonize(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  daemonize("test-deamon");
  sleep(10000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <daemonize@plt>
mov    $0x2710,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <daemonize@plt>
mov    $0x2710,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"test-deamon\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @daemonize(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sleep(i32 10000)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"test-deamon\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @daemonize(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 10000)
ret i32 0
}
unsigned char inb_p(unsigned short port) {
  unsigned char _v;
  __asm__ __volatile__("in"
                       "b"
                       " %"
                       "w"
                       "1,%"
                       ""
                       "0"
                       "\noutb %%al,$0x80"
                       : "=a"(_v)
                       : "Nd"(port));
  return _v;
}


x86 assembly (clang, -O0):
<inb_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
out    %al,$0x80
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb_p>:
mov    %edi,%edx
in     (%dx),%al
out    %al,$0x80
ret

LLVM IR (-O0):
define zeroext i8 @inb_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0\0Aoutb %al,$$0x80", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb_p(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0\0Aoutb %al,$$0x80", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double randBorne(double fMin, double fMax) {
  return fMin + ((double)rand() / RAND_MAX) * (fMax - fMin);
}


x86 assembly (clang, -O0):
<randBorne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x18(%rbp),%xmm1
cvtsi2sd %rax,%xmm0
mov    0x2ea4(%rip),%rax
divsd  (%rax),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randBorne>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm1
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @randBorne(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i64 (...) @rand()
%7 = sitofp i64 %6 to double
%8 = load double, double* @RAND_MAX
%9 = fdiv double %7, %8
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fsub double %10, %11
%13 = call double @llvm.fmuladd.f64(double %9, double %12, double %5)
ret double %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @randBorne(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = fsub double %1, %0
%8 = tail call double @llvm.fmuladd.f64(double %6, double %7, double %0)
ret double %8
}
int c40_dskey(c40)
int c40;
{ return (ioctl(c40, (_IO('v', 7)), 0)); }


x86 assembly (clang, -O0):
<c40_dskey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x76,%edi
mov    $0x7,%esi
mov    $0x0,%al
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c40_dskey>:
push   %rbx
mov    %edi,%ebx
mov    $0x76,%edi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
xor    %eax,%eax
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @c40_dskey(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @_IO to i32 (i32, i32, ...)*)(i32 118, i32 7)
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32, ...)*)(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @c40_dskey(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_IO to i32 (i32, i32, ...)*)(i32 118, i32 7)
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @ioctl to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %2, i32 0)
ret i32 %3
}
int test_imm_56int32_reg(int val) { return ((val) & (0x56 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_56int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x56,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_56int32_reg>:
test   $0x56,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_56int32_reg(i32 %0) {
%2 = and i32 %0, 86
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gdk_event_free() {}


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

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

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

LLVM IR (-O2):
define void @gdk_event_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eninit();
int /*<<< orphan*/ enreset();
int EtherdevStartup(int verbose) {
  enreset();
  eninit();
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @EtherdevStartup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @enreset()
%4 = call i32 (...) @eninit()
ret i32 0
}

LLVM IR (-O2):
define i32 @EtherdevStartup(i32 %0) {
%2 = tail call i32 (...) @enreset()
%3 = tail call i32 (...) @eninit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ stdout;
void *xmalloc(size_t n) {
  void *ptr;
  ptr = malloc(n);
  if (ptr == NULL) {
    fputs("** Error ** : out of memory\n", stdout);
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <xmalloc+0x47>
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"** Error ** : out of memory\0A\00"
@stdout = global i32 0
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stdout
%10 = call i32 @fputs(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [29 x i8] c"** Error ** : out of memory\0A\00"
@stdout = global i32 0
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
void nrf_802154_random_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @nrf_802154_random_deinit() {
ret void
}
char eembed_nibble_to_hex(unsigned char nibble) {
  if (nibble < 10) {
    return '0' + nibble;
  }
  return 'A' + (nibble - 10);
}


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

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

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

LLVM IR (-O2):
define signext i8 @eembed_nibble_to_hex(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = select i1 %2, i8 48, i8 55
%4 = add i8 %3, %0
ret i8 %4
}
int pimote_onoff(int socket, int on1off) {
  int r = 0;
  return r;
}


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

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

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

LLVM IR (-O2):
define i32 @pimote_onoff(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read_from_serial_device();
void *reader_thread(void *arg) {
  while (1) {
    read_from_serial_device();
  }
  return NULL;
}


x86 assembly (clang, -O0):
<reader_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <read_from_serial_device@plt>
jmp    111c <reader_thread+0xc>

x86 assembly (clang, -O2):
<reader_thread>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <read_from_serial_device@plt>
jmp    1120 <reader_thread+0x10>

LLVM IR (-O0):
define i8* @reader_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (...) @read_from_serial_device()
br label %3
}

LLVM IR (-O2):
define noalias i8* @reader_thread(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (...) @read_from_serial_device()
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *mpeg_file_open(char *file, char *mode) {
  if (!file) {
    return NULL;
  }
  return fopen(file, mode);
}


x86 assembly (clang, -O0):
<mpeg_file_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <mpeg_file_open+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1149 <mpeg_file_open+0x39>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpeg_file_open>:
test   %rdi,%rdi
je     111a <mpeg_file_open+0xa>
jmp    1030 <fopen@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i32* @mpeg_file_open(i8* %0, i8* nocapture %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32* @fopen(i8* %0, i8* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32* [ %5, %4 ], [ null, %2 ]
ret i32* %7
}
int isSlash(char c) { return (c == '\\') || (c == '/'); }


x86 assembly (clang, -O0):
<isSlash>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5c,%ecx
mov    %al,-0x2(%rbp)
je     1129 <isSlash+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x2f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSlash>:
cmp    $0x5c,%dil
sete   %al
cmp    $0x2f,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isSlash(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 92
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 47
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isSlash(i8 signext %0) {
%2 = icmp eq i8 %0, 92
%3 = icmp eq i8 %0, 47
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
float __ocml_fma_rte_f32(float, float, float);
float __fmaf_rn(float x, float y, float z) {
  return __ocml_fma_rte_f32(x, y, z);
}


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

x86 assembly (clang, -O2):
<__fmaf_rn>:
jmp    1030 <__ocml_fma_rte_f32@plt>

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

LLVM IR (-O2):
define float @__fmaf_rn(float %0, float %1, float %2) {
%4 = tail call float @__ocml_fma_rte_f32(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
void *fonction(void *arg) {
  long numero = (long)arg;
  while (1) {
    fprintf(stderr, "fonction(%ld)\n", numero);
    sleep(1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<fonction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1134 <fonction+0x14>

x86 assembly (clang, -O2):
<fonction>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eb1(%rip),%r15
lea    0xeca(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    (%r15),%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1140 <fonction+0x20>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"fonction(%ld)\0A\00"
define i8* @fonction(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
br label %6
6: ; preds = %1, %6
%7 = load i32, i32* @stderr
%8 = load i64, i64* %3
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = call i32 @sleep(i32 1)
br label %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"fonction(%ld)\0A\00"
define noalias i8* @fonction(i8* %0) {
%2 = ptrtoint i8* %0 to i64
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %2)
%6 = tail call i32 @sleep(i32 1)
br label %3
}
void RTDirCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDirCreate() {
ret void
}
/* Variables and functions */
size_t ensure_capacity(size_t size) {
  size_t capacity = size;
  if (capacity > 16) {
    capacity += (size >> 1);
  } else {
    capacity += size;
  }
  return capacity;
}


x86 assembly (clang, -O0):
<ensure_capacity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x10,-0x10(%rbp)
jbe    1130 <ensure_capacity+0x30>
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    113c <ensure_capacity+0x3c>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_capacity>:
mov    %rdi,%rcx
shr    %rcx
add    %rdi,%rcx
lea    (%rdi,%rdi,1),%rax
cmp    $0x11,%rdi
cmovae %rcx,%rax
ret

LLVM IR (-O0):
define i64 @ensure_capacity(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = icmp ugt i64 %5, 16
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i64, i64* %2
%9 = lshr i64 %8, 1
%10 = load i64, i64* %3
%11 = add i64 %10, %9
store i64 %11, i64* %3
br label %16
12: ; preds = %1
%13 = load i64, i64* %2
%14 = load i64, i64* %3
%15 = add i64 %14, %13
store i64 %15, i64* %3
br label %16
16: ; preds = %12, %7
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @ensure_capacity(i64 %0) {
%2 = icmp ugt i64 %0, 16
%3 = lshr i64 %0, 1
%4 = add i64 %3, %0
%5 = shl i64 %0, 1
%6 = select i1 %2, i64 %4, i64 %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ default_isr();
__attribute__((weak)) void WKUP_GPIO_Handler() { default_isr(); }


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

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

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

LLVM IR (-O2):
define weak void @WKUP_GPIO_Handler() {
%1 = tail call i32 (...) @default_isr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("main enter\n");
  func1();
  printf("main exit\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <func1@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"main enter\0A\00"
@.str.1 = [11 x i8] c"main exit\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @func1()
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"main enter\00"
@str.2 = [10 x i8] c"main exit\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func1()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_stm(int /*<<< orphan*/);
int /*<<< orphan*/ t16_memio_mult_op();
void t16_stm() { arm_memio_stm(t16_memio_mult_op()); }


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

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

LLVM IR (-O0):
define void @t16_stm() {
%1 = call i32 (...) @t16_memio_mult_op()
%2 = call i32 @arm_memio_stm(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_stm() {
%1 = tail call i32 (...) @t16_memio_mult_op()
%2 = tail call i32 @arm_memio_stm(i32 %1)
ret void
}
unsigned xrop3_16_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | S;
  stk2 = ~stk2;
  stk1 = T & stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_16_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_16_1_0>:
mov    %edi,%eax
not    %eax
and    %esi,%eax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_16_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_16_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = xor i32 %3, -1
%6 = and i32 %4, %5
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  struct date {
    int month;
    int day;
    int year;
  };
  struct date today;
  today.month = 11;
  today.day = 11;
  today.year = 2015;
  printf("Today's date is %i/%i/%.2i.\n", today.month, today.day,
         today.year % 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x10(%rbp)
movl   $0xb,-0xc(%rbp)
movl   $0x7df,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x14(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.date = type { i32, i32, i32 }
@.str = [29 x i8] c"Today's date is %i/%i/%.2i.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.date
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 0
store i32 11, i32* %3
%4 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 1
store i32 11, i32* %4
%5 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 2
store i32 2015, i32* %5
%6 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 2
%11 = load i32, i32* %10
%12 = srem i32 %11, 100
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Today's date is %i/%i/%.2i.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 11, i32 11, i32 15)
ret i32 0
}
void __mp_clearleaktable(void) {}


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

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

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

LLVM IR (-O2):
define void @__mp_clearleaktable() {
ret void
}
void ex_debug(void) {
  int a, b, *c;
  a = 5;
  b = 3;
  *c = a + b;
}


x86 assembly (clang, -O0):
<ex_debug>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @ex_debug() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 5, i32* %1
store i32 3, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = load i32*, i32** %3
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
long long test_csneg64_condasn2(long long x0, long long x1, long long x2,
                                long long x3) {
  long long x4;
  x4 = (x0 == x1) ? x3 : -x2;
  return x4;
}


x86 assembly (clang, -O0):
<test_csneg64_condasn2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    112f <test_csneg64_condasn2+0x2f>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1139 <test_csneg64_condasn2+0x39>
xor    %eax,%eax
sub    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_csneg64_condasn2>:
mov    %rdx,%rax
neg    %rax
cmp    %rsi,%rdi
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @test_csneg64_condasn2(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %0, %1
%6 = sub nsw i64 0, %2
%7 = select i1 %5, i64 %3, i64 %6
ret i64 %7
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  char *name;
};
typedef TYPE_1__ X509_PURPOSE;

/* Variables and functions */
char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp) { return xp->name; }


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

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i8* }
define i8* @X509_PURPOSE_get0_name(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i8* }
define i8* @X509_PURPOSE_get0_name(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%3 = load i8*, i8** %2
ret i8* %3
}