xunge/DecIR huggingface dataset:
long C_flonum(long **ptr, double n) {
  long *p = *ptr, *p0;
  p0 = p;
  *(p++) = ((0x0500000000000000L | 0x4000000000000000L | 0x1000000000000000L) |
            sizeof(double));
  *((double *)p) = n;
  *ptr = p + sizeof(double) / sizeof(long);
  return (long)p0;
}


x86 assembly (clang, -O0):
<C_flonum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
movabs $0x5500000000000008,%rcx
mov    %rcx,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rcx
add    $0x8,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_flonum>:
mov    (%rdi),%rax
movabs $0x5500000000000008,%rcx
mov    %rcx,(%rax)
movsd  %xmm0,0x8(%rax)
lea    0x10(%rax),%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i64 @C_flonum(i64** %0, double %1) {
%3 = alloca i64**
%4 = alloca double
%5 = alloca i64*
%6 = alloca i64*
store i64** %0, i64*** %3
store double %1, double* %4
%7 = load i64**, i64*** %3
%8 = load i64*, i64** %7
store i64* %8, i64** %5
%9 = load i64*, i64** %5
store i64* %9, i64** %6
%10 = load i64*, i64** %5
%11 = getelementptr inbounds i64, i64* %10, i32 1
store i64* %11, i64** %5
store i64 6124895493223874568, i64* %10
%12 = load double, double* %4
%13 = load i64*, i64** %5
%14 = bitcast i64* %13 to double*
store double %12, double* %14
%15 = load i64*, i64** %5
%16 = getelementptr inbounds i64, i64* %15, i64 1
%17 = load i64**, i64*** %3
store i64* %16, i64** %17
%18 = load i64*, i64** %6
%19 = ptrtoint i64* %18 to i64
ret i64 %19
}

LLVM IR (-O2):
define i64 @C_flonum(i64** nocapture %0, double %1) {
%3 = load i64*, i64** %0
%4 = getelementptr inbounds i64, i64* %3, i64 1
store i64 6124895493223874568, i64* %3
%5 = bitcast i64* %4 to double*
store double %1, double* %5
%6 = getelementptr inbounds i64, i64* %3, i64 2
store i64* %6, i64** %0
%7 = ptrtoint i64* %3 to i64
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ argb();
void rop_1b() { argb(); }


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

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

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

LLVM IR (-O2):
define void @rop_1b() {
%1 = tail call i32 (...) @argb()
ret void
}
int _sasl_verifyfile(void *context __attribute__((unused)),
                     char *file __attribute__((unused)),
                     int type __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<_sasl_verifyfile>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_sasl_verifyfile(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
void out_long(int port, int value) {
  __asm__("movl	%0, %%eax;		        movl %1, %%edx;		       "
          " outl %%eax, %%dx;"
          :
          : "r"(value), "r"(port)
          : "%eax", "%edx");
}


x86 assembly (clang, -O0):
<out_long>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%esi
mov    %ecx,%eax
mov    %esi,%edx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_long>:
mov    %esi,%eax
mov    %edi,%edx
out    %eax,(%dx)
ret

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

LLVM IR (-O2):
define void @out_long(i32 %0, i32 %1) {
tail call void asm sideeffect "movl\09$0, %eax;\09\09 movl $1, %edx;\09\09 outl %eax, %dx;", "r,r,~{eax},~{edx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
int /*<<< orphan*/ padding(int);
void vt52cuu1(void) {
  esc("A");
  padding(5);
}


x86 assembly (clang, -O0):
<vt52cuu1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
call   1030 <padding@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt52cuu1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <padding@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"A\00"
define void @vt52cuu1() {
%1 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @padding(i32 5)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
define void @vt52cuu1() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @padding(i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
__attribute__((always_)) void print_double(double v) { printf("%f", v); }


x86 assembly (clang, -O0):
<print_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @print_double(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
double exp(double);
double cosh(double x) {
  double y = exp(x);
  return (y + 1. / y) * 0.5;
}


x86 assembly (clang, -O0):
<cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosh>:
push   %rax
call   1030 <exp@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  %xmm1,%xmm0
mulsd  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cosh(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @exp(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fdiv double 1.000000e+00, %7
%9 = fadd double %6, %8
%10 = fmul double %9, 5.000000e-01
ret double %10
}

LLVM IR (-O2):
define double @cosh(double %0) {
%2 = tail call double @exp(double %0)
%3 = fdiv double 1.000000e+00, %2
%4 = fadd double %2, %3
%5 = fmul double %4, 5.000000e-01
ret double %5
}
/* Variables and functions */
char *do_big_dnum(double, int /*<<< orphan*/, int);
char *big_dnum(double dnum, int decimal_digits) {
  return do_big_dnum(dnum, 0, decimal_digits);
}


x86 assembly (clang, -O0):
<big_dnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%esi
xor    %edi,%edi
call   1030 <do_big_dnum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<big_dnum>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <do_big_dnum@plt>

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

LLVM IR (-O2):
define i8* @big_dnum(double %0, i32 %1) {
%3 = tail call i8* @do_big_dnum(double %0, i32 0, i32 %1)
ret i8* %3
}
void rule_neural_act_copy(const struct XCSF *xcsf, struct Cl *dest,
                          const struct Cl *src) {
  (void)xcsf;
  (void)dest;
  (void)src;
}


x86 assembly (clang, -O0):
<rule_neural_act_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_neural_act_copy(%struct.XCSF* %0, %struct.Cl* %1, %struct.Cl* %2) {
%4 = alloca %struct.XCSF*
%5 = alloca %struct.Cl*
%6 = alloca %struct.Cl*
store %struct.XCSF* %0, %struct.XCSF** %4
store %struct.Cl* %1, %struct.Cl** %5
store %struct.Cl* %2, %struct.Cl** %6
%7 = load %struct.XCSF*, %struct.XCSF** %4
%8 = load %struct.Cl*, %struct.Cl** %5
%9 = load %struct.Cl*, %struct.Cl** %6
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_neural_act_copy(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, %struct.Cl* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function4();
int /*<<< orphan*/ printf(char *);
void function3() {
  printf("Function 3\n");
  function4();
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"Function 3\00"
define void @function3() {
%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 (...) @function4()
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("!!!Hello World!!!");
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"!!!Hello World!!!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int main() {
start:
  goto next;
  return 1;
success:
  return 0;
next:
  goto success;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1114 <main+0x14>
xor    %eax,%eax
pop    %rbp
ret
jmp    1110 <main+0x10>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %2
br label %3
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close_graphics();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void quit(void (*drawscreen)(void)) {
  close_graphics();
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <close_graphics@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %eax,%eax
call   1030 <close_graphics@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @quit(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = call i32 (...) @close_graphics()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @quit(void ()* nocapture readnone %0) {
%2 = tail call i32 (...) @close_graphics()
%3 = tail call i32 @exit(i32 0)
unreachable
}
int max_value(int n, int k) { return ((k - 1) | k) <= n ? k - 1 : k - 2; }


x86 assembly (clang, -O0):
<max_value>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
or     -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     112a <max_value+0x2a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <max_value+0x33>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_value>:
lea    -0x1(%rsi),%ecx
mov    %ecx,%edx
or     %esi,%edx
lea    -0x2(%rsi),%eax
cmp    %edi,%edx
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @max_value(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 = sub nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = or i32 %6, %7
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
br label %17
14: ; preds = %2
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 2
br label %17
17: ; preds = %14, %11
%18 = phi i32 [ %13, %11 ], [ %16, %14 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @max_value(i32 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = or i32 %3, %1
%5 = icmp sgt i32 %4, %0
%6 = add nsw i32 %1, -2
%7 = select i1 %5, i32 %6, i32 %3
ret i32 %7
}
int fun433() { return 433; }


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

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

LLVM IR (-O0):
define i32 @fun433() {
ret i32 433
}

LLVM IR (-O2):
define i32 @fun433() {
ret i32 433
}
/* Variables and functions */
bool could_be_string_literal(char c) {
  return (c == 'U' || c == 'u' || c == 'L' || c == 'R' || c == '8');
}


x86 assembly (clang, -O0):
<could_be_string_literal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x55,%ecx
mov    %al,-0x2(%rbp)
je     115f <could_be_string_literal+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x75,%ecx
mov    %al,-0x2(%rbp)
je     115f <could_be_string_literal+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x4c,%ecx
mov    %al,-0x2(%rbp)
je     115f <could_be_string_literal+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x52,%ecx
mov    %al,-0x2(%rbp)
je     115f <could_be_string_literal+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x38,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<could_be_string_literal>:
lea    -0x4c(%rdi),%ecx
cmp    $0x29,%cl
ja     1121 <could_be_string_literal+0x21>
mov    $0x1,%eax
movzbl %cl,%ecx
movabs $0x20000000241,%rdx
bt     %rcx,%rdx
jae    1121 <could_be_string_literal+0x21>
ret
xor    %eax,%eax
cmp    $0x38,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @could_be_string_literal(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, 85
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 117
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 76
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 82
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 56
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @could_be_string_literal(i8 signext %0) {
switch i8 %0, label %2 [
i8 117, label %5
i8 85, label %5
i8 82, label %5
i8 76, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 56
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int strcoll(void const *, void const *);
int compare_elements(const void **p1, const void **p2) {
  return strcoll(*p1, *p2);
}


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

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

LLVM IR (-O0):
define i32 @compare_elements(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 = load i8*, i8** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 @strcoll(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare_elements(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcoll(i8* %3, i8* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ shutdown(int, int);
void ConnexClose(int msgin_sock) {
  shutdown(msgin_sock, 2);
  close(msgin_sock);
}


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

x86 assembly (clang, -O2):
<ConnexClose>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

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

LLVM IR (-O2):
define void @ConnexClose(i32 %0) {
%2 = tail call i32 @shutdown(i32 %0, i32 2)
%3 = tail call i32 @close(i32 %0)
ret void
}
int BIO_dgram_non_fatal_error(int err) {
  switch (err) {
    return (1);
  default:
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<BIO_dgram_non_fatal_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    110c <BIO_dgram_non_fatal_error+0xc>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BIO_dgram_non_fatal_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
br label %5
5: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @BIO_dgram_non_fatal_error(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello_world(void) { printf("\nHello World\n\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"\0AHello World\0A\00"
define void @hello_world() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ hal_iic_read_nak();
int /*<<< orphan*/ hal_iic_rep_start(int);
int /*<<< orphan*/ hal_iic_start(int);
int /*<<< orphan*/ hal_iic_stop();
int /*<<< orphan*/ hal_iic_write(int);
uint8_t rtc_get_alarm_state(void) {
  uint8_t ret = 0;
  hal_iic_start(0xd0U + 0x00U);
  hal_iic_write(0x0bU);
  hal_iic_rep_start(0xd0U + 0x01U);
  ret = hal_iic_read_nak();
  hal_iic_stop();
  return ret;
}


x86 assembly (clang, -O0):
<rtc_get_alarm_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xd0,%edi
call   1060 <hal_iic_start@plt>
mov    $0xb,%edi
call   1050 <hal_iic_write@plt>
mov    $0xd1,%edi
call   1070 <hal_iic_rep_start@plt>
mov    $0x0,%al
call   1030 <hal_iic_read_nak@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <hal_iic_stop@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_get_alarm_state>:
push   %rbx
mov    $0xd0,%edi
call   1060 <hal_iic_start@plt>
mov    $0xb,%edi
call   1050 <hal_iic_write@plt>
mov    $0xd1,%edi
call   1070 <hal_iic_rep_start@plt>
xor    %eax,%eax
call   1030 <hal_iic_read_nak@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <hal_iic_stop@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rtc_get_alarm_state() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @hal_iic_start(i32 208)
%3 = call i32 @hal_iic_write(i32 11)
%4 = call i32 @hal_iic_rep_start(i32 209)
%5 = call i32 (...) @hal_iic_read_nak()
store i32 %5, i32* %1
%6 = call i32 (...) @hal_iic_stop()
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @rtc_get_alarm_state() {
%1 = tail call i32 @hal_iic_start(i32 208)
%2 = tail call i32 @hal_iic_write(i32 11)
%3 = tail call i32 @hal_iic_rep_start(i32 209)
%4 = tail call i32 (...) @hal_iic_read_nak()
%5 = tail call i32 (...) @hal_iic_stop()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int check(int zero, int count, int x, int y) {
  if (zero == 1 && count == 2) {
    printf("%d %d", x, y);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1156 <check+0x46>
cmpl   $0x2,-0xc(%rbp)
jne    1156 <check+0x46>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    115d <check+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
xor    %eax,%eax
cmp    $0x1,%edi
jne    1136 <check+0x26>
cmp    $0x2,%esi
jne    1136 <check+0x26>
push   %rax
lea    0xedc(%rip),%rdi
mov    %edx,%esi
mov    %ecx,%edx
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @check(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, 1
%6 = icmp eq i32 %1, 2
%7 = and i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ 1, %8 ], [ 0, %4 ]
ret i32 %11
}
/* Variables and functions */
unsigned long AlignAddr(unsigned long, unsigned long);
unsigned long AlignCount(unsigned long Addr, unsigned long Alignment) {
  return AlignAddr(Addr, Alignment) - Addr;
}


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

x86 assembly (clang, -O2):
<AlignCount>:
push   %rbx
mov    %rdi,%rbx
call   1030 <AlignAddr@plt>
sub    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @AlignCount(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 = call i64 @AlignAddr(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = sub i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @AlignCount(i64 %0, i64 %1) {
%3 = tail call i64 @AlignAddr(i64 %0, i64 %1)
%4 = sub i64 %3, %0
ret i64 %4
}
int check_prime(int num) {
  int i;
  for (i = 2; i < num; i++) {
    if (num % i != 0)
      continue;
    else
      break;
  }
  if (num == i)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1142 <check_prime+0x42>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     112f <check_prime+0x2f>
jmp    1134 <check_prime+0x34>
jmp    1142 <check_prime+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    115a <check_prime+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <check_prime+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x2,%ecx
cmp    $0x3,%edi
jl     1122 <check_prime+0x22>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1122 <check_prime+0x22>
add    $0x1,%ecx
cmp    %ecx,%edi
jne    1110 <check_prime+0x10>
mov    %edi,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %7, %3, %1
%11 = phi i32 [ 2, %1 ], [ %4, %3 ], [ %0, %7 ]
%12 = icmp eq i32 %11, %0
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void uart_init(void) {
  outb(0x0, 0x3f8 + 0x01);
  outb(0x01, 0x3f8 + 0x02);
  outb(0x80 | 0x3, 0x3f8 + 0x03);
  outb((115200 / 9600) & 0xFF, 0x3f8 + 0x00);
  outb(((115200 / 9600) >> 8) & 0xFF, 0x3f8 + 0x01);
  outb(0x3, 0x3f8 + 0x03);
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x3f9,%esi
call   1030 <outb@plt>
mov    $0x1,%edi
mov    $0x3fa,%esi
call   1030 <outb@plt>
mov    $0x83,%edi
mov    $0x3fb,%esi
call   1030 <outb@plt>
mov    $0xc,%edi
mov    $0x3f8,%esi
call   1030 <outb@plt>
xor    %edi,%edi
mov    $0x3f9,%esi
call   1030 <outb@plt>
mov    $0x3,%edi
mov    $0x3fb,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
push   %rax
xor    %edi,%edi
mov    $0x3f9,%esi
call   1030 <outb@plt>
mov    $0x1,%edi
mov    $0x3fa,%esi
call   1030 <outb@plt>
mov    $0x83,%edi
mov    $0x3fb,%esi
call   1030 <outb@plt>
mov    $0xc,%edi
mov    $0x3f8,%esi
call   1030 <outb@plt>
xor    %edi,%edi
mov    $0x3f9,%esi
call   1030 <outb@plt>
mov    $0x3,%edi
mov    $0x3fb,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @uart_init() {
%1 = call i32 @outb(i32 0, i32 1017)
%2 = call i32 @outb(i32 1, i32 1018)
%3 = call i32 @outb(i32 131, i32 1019)
%4 = call i32 @outb(i32 12, i32 1016)
%5 = call i32 @outb(i32 0, i32 1017)
%6 = call i32 @outb(i32 3, i32 1019)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
%1 = tail call i32 @outb(i32 0, i32 1017)
%2 = tail call i32 @outb(i32 1, i32 1018)
%3 = tail call i32 @outb(i32 131, i32 1019)
%4 = tail call i32 @outb(i32 12, i32 1016)
%5 = tail call i32 @outb(i32 0, i32 1017)
%6 = tail call i32 @outb(i32 3, i32 1019)
ret void
}
void XParseGeometry() {}


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

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

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

LLVM IR (-O2):
define void @XParseGeometry() {
ret void
}
int rcu_preempted_readers(struct rcu_node *rnp) { return 0; }


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

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

LLVM IR (-O0):
%struct.rcu_node = type opaque
define i32 @rcu_preempted_readers(%struct.rcu_node* %0) {
%2 = alloca %struct.rcu_node*
store %struct.rcu_node* %0, %struct.rcu_node** %2
ret i32 0
}

LLVM IR (-O2):
%struct.rcu_node = type opaque
define i32 @rcu_preempted_readers(%struct.rcu_node* nocapture readnone %0) {
ret i32 0
}
int test_imm_75uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x75 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_75uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 117
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(float *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ swap_octets(float *, float *, int);
float lire_reel_binaire_swap(FILE *fichier) {
  float reel, reel2;
  fread(&reel, 4, 1, fichier);
  swap_octets(&reel, &reel2, 4);
  return (reel2);
}


x86 assembly (clang, -O0):
<lire_reel_binaire_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <swap_octets@plt>
movss  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lire_reel_binaire_swap>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rcx
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <swap_octets@plt>
movss  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @lire_reel_binaire_swap(i32* %0) {
%2 = alloca i32*
%3 = alloca float
%4 = alloca float
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @fread(float* %3, i32 4, i32 1, i32* %5)
%7 = call i32 @swap_octets(float* %3, float* %4, i32 4)
%8 = load float, float* %4
ret float %8
}

LLVM IR (-O2):
define float @lire_reel_binaire_swap(i32* nocapture %0) {
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = call i32 @fread(float* %2, i32 4, i32 1, i32* %0)
%7 = call i32 @swap_octets(float* %2, float* %3, i32 4)
%8 = load float, float* %3
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("test!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"test!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void anulli(int *x, int p) {
  int i;
  for (i = 0; i < p; i++) {
    x[i] = 0;
  }
}


x86 assembly (clang, -O0):
<anulli>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <anulli+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <anulli+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<anulli>:
test   %esi,%esi
jle    1126 <anulli+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @anulli(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
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @anulli(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
scalar_t__ strcmp2(char const *, char const *);
char *strstr1(const char *s1, const char *s2) {
  while (*s1 != '\0') {
    if (strcmp2(s1, s2) == 0)
      return s1;
    s1++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<strstr1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1165 <strstr1+0x55>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp2@plt>
cmp    $0x0,%rax
jne    1154 <strstr1+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <strstr1+0x5d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <strstr1+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstr1>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113a <strstr1+0x2a>
mov    %rsi,%r14
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp2@plt>
test   %rax,%rax
je     113c <strstr1+0x2c>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <strstr1+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strstr1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %18, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i64 @strcmp2(i8* %12, i8* %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i8*, i8** %4
store i8* %17, i8** %3
br label %22
18: ; preds = %11
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %4
br label %6
21: ; preds = %6
store i8* null, i8** %3
br label %22
22: ; preds = %21, %16
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @strstr1(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = tail call i64 @strcmp2(i8* %6, i8* %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i8* [ null, %2 ], [ null, %9 ], [ %6, %5 ]
ret i8* %14
}
int main(void) {
  int i = 1;
  int *ii = &i;
  !ii;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 1, i32* %1
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  const static int i = 43;
  long volatile int egy = 10;
  double a = 1.0;
  float b = (float)33;
  if (i > 40 && i < 60) {
    printf("valami %d \n", sizeof(int));
  } else {
    switch (i) {
    case 5:
      break;
    case 4:
      break;
    default:
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xa,-0x18(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  0xebd(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@main.i = internal constant i32 43
@.str = [12 x i8] c"valami %d \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca double
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i64 10, i64* %6
store double 1.000000e+00, double* %7
store float 3.300000e+01, float* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"valami %d \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store volatile i64 10, i64* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int isClientDone() {
  int a = 0;
  while (a == 0) {
    if (access("done", F_OK) != -1) {
      a = 1;
    }
    return a;
  }
}


x86 assembly (clang, -O0):
<isClientDone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1154 <isClientDone+0x44>
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
call   1030 <access@plt>
cmp    $0xffffffff,%eax
je     114e <isClientDone+0x3e>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isClientDone>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"done\00"
@F_OK = global i32 0
define i32 @isClientDone() {
%1 = load i32, i32* @F_OK
%2 = tail call i32 @access(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PopulateRoomArray();
int /*<<< orphan*/ WriteRoomFiles();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  PopulateRoomArray();
  WriteRoomFiles();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <PopulateRoomArray@plt>
mov    $0x0,%al
call   1030 <WriteRoomFiles@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <PopulateRoomArray@plt>
xor    %eax,%eax
call   1030 <WriteRoomFiles@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @PopulateRoomArray()
%5 = call i32 (...) @WriteRoomFiles()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @PopulateRoomArray()
%4 = tail call i32 (...) @WriteRoomFiles()
ret i32 0
}
int fun1300() { return 1300; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x514,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x514,%eax
ret

LLVM IR (-O0):
define i32 @fun1300() {
ret i32 1300
}

LLVM IR (-O2):
define i32 @fun1300() {
ret i32 1300
}
/* Variables and functions */
bool nrf53_errata_45(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_45() {
ret i32 0
}
char *strcpy(char *dst, const char *src) {
  while (*src) {
    *dst = *src;
    dst++;
    src++;
  }
  *dst = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <strcpy+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
store i8 0, i8* %14
ret i8* %14
}
void gen_context(struct tg_context *context, struct TG_context *opts) {}


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

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

LLVM IR (-O0):
%struct.tg_context = type opaque
%struct.TG_context = type opaque
define void @gen_context(%struct.tg_context* %0, %struct.TG_context* %1) {
%3 = alloca %struct.tg_context*
%4 = alloca %struct.TG_context*
store %struct.tg_context* %0, %struct.tg_context** %3
store %struct.TG_context* %1, %struct.TG_context** %4
ret void
}

LLVM IR (-O2):
%struct.tg_context = type opaque
%struct.TG_context = type opaque
define void @gen_context(%struct.tg_context* nocapture %0, %struct.TG_context* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("This is test #1.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [17 x i8] c"This is test.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}