xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ readFile(char *);
int main() {
  char fname[20] = "r.txt";
  readFile(fname);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <readFile@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.fname = [20 x i8] c"r.txt\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = bitcast [20 x i8]* %2 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @readFile(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.fname = [20 x i8] c"r.txt\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @readFile(i8* %2)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  unsigned long long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t now(void) {
  struct timeval tv;
  if (gettimeofday(&tv, NULL))
    abort();
  return tv.tv_sec * 1000000ULL + tv.tv_usec;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
cmp    $0x0,%rax
je     1146 <now+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
imul   $0xf4240,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
test   %rax,%rax
jne    1148 <now+0x28>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @now() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = mul i64 %8, 1000000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%11 = load i64, i64* %10
%12 = add i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = mul i64 %9, 1000000
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%12 = load i64, i64* %11
%13 = add i64 %10, %12
ret i64 %13
}
__attribute__((weak)) int _close(void) { return -1; }


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

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

LLVM IR (-O0):
define weak i32 @_close() {
ret i32 -1
}

LLVM IR (-O2):
define weak i32 @_close() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(char *name) {
  printf("Usage: %s [width] [height]\n", name);
  return;
}


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

x86 assembly (clang, -O2):
<show_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [28 x i8] c"Usage: %s [width] [height]\0A\00"
define void @show_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int escKey();
int /*<<< orphan*/ getch_(int /*<<< orphan*/);
int kbhit();
int quit() {
  int foo[] = {0};
  if (kbhit() == 0x1b) {
    getch_(0);
    return escKey();
  }
  return 0;
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    $0x0,%al
call   1030 <kbhit@plt>
cmp    $0x1b,%eax
jne    117e <quit+0x3e>
xor    %edi,%edi
call   1060 <getch_@plt>
mov    $0x0,%al
call   1050 <escKey@plt>
mov    %eax,-0x4(%rbp)
jmp    1185 <quit+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %eax,%eax
call   1030 <kbhit@plt>
cmp    $0x1b,%eax
jne    114c <quit+0x1c>
xor    %edi,%edi
call   1050 <getch_@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <escKey@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @quit() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = call i32 (...) @kbhit()
%5 = icmp eq i32 %4, 27
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @getch_(i32 0)
%8 = call i32 (...) @escKey()
store i32 %8, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @quit() {
%1 = tail call i32 (...) @kbhit()
%2 = icmp eq i32 %1, 27
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @getch_(i32 0)
%5 = tail call i32 (...) @escKey()
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 0, %0 ]
ret i32 %7
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t _OSSwapInt32(uint32_t data) {
  __asm__("bswap %0" : "+r"(data));
  return data;
}


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

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

LLVM IR (-O0):
define i8* @_OSSwapInt32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @_OSSwapInt32(i8* readnone %0) {
%2 = tail call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int wcnss_wlan_crypto_ahash_digest(void *req) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wcnss_wlan_crypto_ahash_digest(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
unsigned int hideme(unsigned int);
unsigned int rand();
int main(int argc, char **argv) {
  unsigned r = rand();
  unsigned s = hideme(r);
  return (r <= s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <hideme@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <hideme@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
setbe  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @rand()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @hideme(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = icmp ule i32 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = tail call i32 @hideme(i32 %3)
%5 = icmp ule i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void test6(long i) { asm("nop" : : "er"(i)); }


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

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

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

LLVM IR (-O2):
define void @test6(i64 %0) {
tail call void asm sideeffect "nop", "er,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
int expect_double_sum(double (*f)(double, double)) {
  return f(-20.0, -22.0) == -42.0;
}


x86 assembly (clang, -O0):
<expect_double_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
call   *-0x8(%rbp)
movsd  0xed9(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_double_sum>:
push   %rax
movsd  0xef7(%rip),%xmm0
movsd  0xef7(%rip),%xmm1
call   *%rdi
cmpeqsd 0xef4(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @expect_double_sum(double (double, double)* %0) {
%2 = alloca double (double, double)*
store double (double, double)* %0, double (double, double)** %2
%3 = load double (double, double)*, double (double, double)** %2
%4 = call double %3(double -2.000000e+01, double -2.200000e+01)
%5 = fcmp oeq double %4, -4.200000e+01
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @expect_double_sum(double (double, double)* nocapture %0) {
%2 = tail call double %0(double -2.000000e+01, double -2.200000e+01)
%3 = fcmp oeq double %2, -4.200000e+01
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ end_measurement();
int fib(int);
int /*<<< orphan*/ print_int(int);
int read_int();
int /*<<< orphan*/ start_measurement();
int main() {
  int i = read_int();
  start_measurement();
  int res = fib(i);
  end_measurement();
  print_int(res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <read_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <start_measurement@plt>
mov    -0x8(%rbp),%edi
call   1060 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <end_measurement@plt>
mov    -0xc(%rbp),%edi
call   1040 <print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <read_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <start_measurement@plt>
mov    %ebx,%edi
call   1060 <fib@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <end_measurement@plt>
mov    %ebx,%edi
call   1040 <print_int@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @read_int()
store i32 %4, i32* %2
%5 = call i32 (...) @start_measurement()
%6 = load i32, i32* %2
%7 = call i32 @fib(i32 %6)
store i32 %7, i32* %3
%8 = call i32 (...) @end_measurement()
%9 = load i32, i32* %3
%10 = call i32 @print_int(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @read_int()
%2 = tail call i32 (...) @start_measurement()
%3 = tail call i32 @fib(i32 %1)
%4 = tail call i32 (...) @end_measurement()
%5 = tail call i32 @print_int(i32 %3)
ret i32 0
}
float QuinticEaseIn(float p) { return p * p * p * p * p; }


x86 assembly (clang, -O0):
<QuinticEaseIn>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuinticEaseIn>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @QuinticEaseIn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = load float, float* %2
%11 = fmul float %9, %10
ret float %11
}

LLVM IR (-O2):
define float @QuinticEaseIn(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fmul float %3, %0
%5 = fmul float %4, %0
ret float %5
}
unsigned int fnv_1a_hash_str(char *str) {
  unsigned int hash = 2166136261;
  for (; *str != '\0'; str++) {
    hash ^= *str;
    hash *= 16777619;
  }
  return hash;
}


x86 assembly (clang, -O0):
<fnv_1a_hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x811c9dc5,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1147 <fnv_1a_hash_str+0x47>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x1000193,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <fnv_1a_hash_str+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnv_1a_hash_str>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <fnv_1a_hash_str+0x27>
add    $0x1,%rdi
mov    $0x811c9dc5,%eax
nop
movsbl %cl,%ecx
xor    %eax,%ecx
imul   $0x1000193,%ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <fnv_1a_hash_str+0x10>
ret
mov    $0x811c9dc5,%eax
ret

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

LLVM IR (-O2):
define i32 @fnv_1a_hash_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ -2128831035, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = xor i32 %6, %8
%10 = mul i32 %9, 16777619
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ -2128831035, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ top_func();
int main() {
  top_func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @top_func()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setuid(uid_t uid) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__setuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setuid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__setuid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__setuid(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int options;
};

/* Variables and functions */
int RES_STAYOPEN;
int RES_USEVC;
TYPE_1__ _res;
int /*<<< orphan*/ _res_close();
endhostent() {
  _res.options &= ~(RES_STAYOPEN | RES_USEVC);
  _res_close();
}


x86 assembly (clang, -O0):
<endhostent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
or     (%rax),%ecx
xor    $0xffffffff,%ecx
mov    0x2eac(%rip),%rax
and    (%rax),%ecx
mov    0x2ea3(%rip),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_res_close@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endhostent>:
mov    0x2eb9(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
not    %ecx
mov    0x2eb5(%rip),%rax
and    %ecx,(%rax)
xor    %eax,%eax
jmp    1030 <_res_close@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
@RES_STAYOPEN = global i32 0
@RES_USEVC = global i32 0
@_res = global %struct.TYPE_2__ zeroinitializer
define i32 @endhostent() {
%1 = alloca i32
%2 = load i32, i32* @RES_STAYOPEN
%3 = load i32, i32* @RES_USEVC
%4 = or i32 %2, %3
%5 = xor i32 %4, -1
%6 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i32 0, i32 0)
%7 = and i32 %6, %5
store i32 %7, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i32 0, i32 0)
%8 = call i32 (...) @_res_close()
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
@RES_STAYOPEN = global i32 0
@RES_USEVC = global i32 0
@_res = global %struct.TYPE_2__ zeroinitializer
define i32 @endhostent() {
%1 = load i32, i32* @RES_STAYOPEN
%2 = load i32, i32* @RES_USEVC
%3 = or i32 %2, %1
%4 = xor i32 %3, -1
%5 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%6 = and i32 %5, %4
store i32 %6, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%7 = tail call i32 (...) @_res_close()
ret i32 undef
}
void pnx833x_gpio_select_function_io(unsigned int pin) {
  if (pin < 32)
    do {
      ((*((volatile unsigned long *)((0xa0000000ul + 0x17E00000ul) +
                                     0xF014))) &= ~(1 << (pin)));
    } while (0);
  else
    do {
      ((*((volatile unsigned long *)((0xa0000000ul + 0x17E00000ul) +
                                     0xF068))) &= ~(1 << (pin & 31)));
    } while (0);
}


x86 assembly (clang, -O0):
<pnx833x_gpio_select_function_io>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jae    113d <pnx833x_gpio_select_function_io+0x3d>
jmp    1116 <pnx833x_gpio_select_function_io+0x16>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
cltq
mov    $0xb7e0f014,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0xb7e0f014,%eax
mov    %rcx,(%rax)
jmp    116c <pnx833x_gpio_select_function_io+0x6c>
jmp    1142 <pnx833x_gpio_select_function_io+0x42>
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
cltq
mov    $0xb7e0f068,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0xb7e0f068,%eax
mov    %rcx,(%rax)
jmp    116c <pnx833x_gpio_select_function_io+0x6c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnx833x_gpio_select_function_io>:
mov    %edi,%ecx
mov    $0xb7e0f014,%eax
lea    0x54(%rax),%rdx
cmp    $0x20,%edi
cmovb  %rax,%rdx
mov    $0xfffffffe,%eax
rol    %cl,%eax
cltq
and    %rax,(%rdx)
ret

LLVM IR (-O0):
define void @pnx833x_gpio_select_function_io(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 32
br i1 %4, label %5, label %14
5: ; preds = %1
br label %6
6: ; preds = %5
%7 = load i32, i32* %2
%8 = shl i32 1, %7
%9 = xor i32 %8, -1
%10 = sext i32 %9 to i64
%11 = load volatile i64, i64* inttoptr (i64 3084972052 to i64*)
%12 = and i64 %11, %10
store volatile i64 %12, i64* inttoptr (i64 3084972052 to i64*)
br label %13
13: ; preds = %6
br label %24
14: ; preds = %1
br label %15
15: ; preds = %14
%16 = load i32, i32* %2
%17 = and i32 %16, 31
%18 = shl i32 1, %17
%19 = xor i32 %18, -1
%20 = sext i32 %19 to i64
%21 = load volatile i64, i64* inttoptr (i64 3084972136 to i64*)
%22 = and i64 %21, %20
store volatile i64 %22, i64* inttoptr (i64 3084972136 to i64*)
br label %23
23: ; preds = %15
br label %24
24: ; preds = %23, %13
ret void
}

LLVM IR (-O2):
define void @pnx833x_gpio_select_function_io(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = and i32 %0, 31
%4 = select i1 %2, i64* inttoptr (i64 3084972052 to i64*), i64* inttoptr (i64 3084972136 to i64*)
%5 = shl nuw i32 1, %3
%6 = xor i32 %5, -1
%7 = sext i32 %6 to i64
%8 = load volatile i64, i64* %4
%9 = and i64 %8, %7
store volatile i64 %9, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
int t() { f(); }


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

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

LLVM IR (-O0):
define i32 @t() {
%1 = alloca i32
%2 = call i32 (...) @f()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @t() {
%1 = tail call i32 (...) @f()
ret i32 undef
}
void fn0000000000401A60() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn0000000000401A60() {
ret void
}
void foo090(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo090(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(unsigned char *, unsigned char *, unsigned int);
unsigned char *memcpy(unsigned char *out, unsigned char *in,
                      unsigned int length) {
  bcopy(in, out, length);
  return out;
}


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

x86 assembly (clang, -O2):
<memcpy>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i32 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i32(i8* align 1 %0, i8* align 1 %1, i32 %2, i1 false)
ret i8* %0
}
void cpuid(int f, int *eax, int *ebx, int *ecx, int *edx) {
  asm volatile("mov %%ebx, %%esi\n\t"
               "cpuid\n\t"
               "xchgl %%ebx, %%esi"
               : "=a"(*eax), "=S"(*ebx), "=c"(*ecx), "=d"(*edx)
               : "0"(f)
               : "memory");
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%eax
mov    %ebx,%esi
cpuid
xchg   %esi,%ebx
mov    %eax,%r10d
mov    -0x38(%rbp),%rax
mov    %esi,%r8d
mov    %ecx,%esi
mov    -0x30(%rbp),%rcx
mov    %r10d,(%r9)
mov    %r8d,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
mov    %rcx,%r9
mov    %rdx,%r10
mov    %rsi,%r11
mov    %edi,%eax
mov    %ebx,%esi
cpuid
xchg   %esi,%ebx
mov    %eax,(%r11)
mov    %esi,(%r10)
mov    %ecx,(%r9)
mov    %edx,(%r8)
ret

LLVM IR (-O0):
define void @cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %9
%14 = load i32*, i32** %10
%15 = load i32, i32* %6
%16 = call { i32, i32, i32, i32 } asm sideeffect "mov %ebx, %esi\0A\09cpuid\0A\09xchgl %ebx, %esi", "={ax},={si},={cx},={dx},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %15)
%17 = extractvalue { i32, i32, i32, i32 } %16, 0
%18 = extractvalue { i32, i32, i32, i32 } %16, 1
%19 = extractvalue { i32, i32, i32, i32 } %16, 2
%20 = extractvalue { i32, i32, i32, i32 } %16, 3
store i32 %17, i32* %11
store i32 %18, i32* %12
store i32 %19, i32* %13
store i32 %20, i32* %14
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "mov %ebx, %esi\0A\09cpuid\0A\09xchgl %ebx, %esi", "={ax},={si},={cx},={dx},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
ret void
}
float __max(float a, float b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<__max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <__max+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <__max+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__max>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @__max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
int resolveValue(char c) {
  if (c >= '2' && c <= '9')
    return c - '0';
  return 10;
}


x86 assembly (clang, -O0):
<resolveValue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x32,%eax
jl     1133 <resolveValue+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <resolveValue+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    113a <resolveValue+0x3a>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolveValue>:
lea    -0x32(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0x8,%al
mov    $0xa,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @resolveValue(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 50
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %16
15: ; preds = %7, %1
store i32 10, i32* %2
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @resolveValue(i8 signext %0) {
%2 = add i8 %0, -50
%3 = icmp ult i8 %2, 8
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 %5, i32 10
ret i32 %6
}
void cleanup_module(void) {}


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

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

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

LLVM IR (-O2):
define void @cleanup_module() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void subtraction(int x, int y) { printf("%i\n", (x - y)); }


x86 assembly (clang, -O0):
<subtraction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
sub    -0x8(%rbp),%esi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define void @subtraction(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 = sub nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @subtraction(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t s0(uint64_t w) {
  return (((w) >> (1)) | ((w) << (64 - (1)))) ^
         (((w) >> (8)) | ((w) << (64 - (8)))) ^ (w >> 7);
}


x86 assembly (clang, -O0):
<s0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%edx
mov    $0x3f,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    -0x8(%rbp),%ecx
or     %edx,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x7,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @s0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = shl i32 %5, 63
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = ashr i32 %8, 8
%10 = load i32, i32* %2
%11 = shl i32 %10, 56
%12 = or i32 %9, %11
%13 = xor i32 %7, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 7
%16 = xor i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @s0(i32 %0) {
ret i32 poison
}
void RTPathStripExt(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathStripExt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CMGR_simple_finalize();
int /*<<< orphan*/ crypt_finalize();
void hcache_finalize_simple(void) {
  crypt_finalize();
  CMGR_simple_finalize();
  ;
}


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

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

LLVM IR (-O0):
define void @hcache_finalize_simple() {
%1 = call i32 (...) @crypt_finalize()
%2 = call i32 (...) @CMGR_simple_finalize()
ret void
}

LLVM IR (-O2):
define void @hcache_finalize_simple() {
%1 = tail call i32 (...) @crypt_finalize()
%2 = tail call i32 (...) @CMGR_simple_finalize()
ret void
}
/* Variables and functions */
int bar();
int barbar();
int baz();
int foo();
int foobar();
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
int main() {
  printf("foo: %d bar: %d foobar: %d barbar: %d baz: %d\n", foo(), bar(),
         foobar(), barbar(), baz());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <bar@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <foobar@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1080 <barbar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <baz@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    %eax,%r9d
lea    0xe4b(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <foo@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <bar@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1050 <foobar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <barbar@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <baz@plt>
lea    0xe65(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %eax,%r9d
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [47 x i8] c"foo: %d bar: %d foobar: %d barbar: %d baz: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @foobar()
%4 = tail call i32 (...) @barbar()
%5 = tail call i32 (...) @baz()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret i32 0
}
int verifyEndLine(char *buffer, int *linha, int *coluna, int *i) {
  if (buffer == '\n') {
    *i = *i + 1;
    *linha = *linha + 1;
    *coluna = 0;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<verifyEndLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xa,%eax
cmp    %rax,-0x10(%rbp)
jne    1157 <verifyEndLine+0x57>
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    115e <verifyEndLine+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifyEndLine>:
xor    %eax,%eax
cmp    $0xa,%rdi
je     1109 <verifyEndLine+0x9>
ret
addl   $0x1,(%rcx)
addl   $0x1,(%rsi)
movl   $0x0,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @verifyEndLine(i8* readnone %0, i32* nocapture %1, i32* nocapture writeonly %2, i32* nocapture %3) {
%5 = icmp eq i8* %0, inttoptr (i64 10 to i8*)
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
store i32 0, i32* %2
br label %11
11: ; preds = %4, %6
%12 = phi i32 [ 1, %6 ], [ 0, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perrordie(char *);
FILE *safe_fopen(char *path, char *mode) {
  FILE *r = fopen(path, mode);
  if (r == NULL)
    perrordie("fopen");
  return r;
}


x86 assembly (clang, -O0):
<safe_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <safe_fopen+0x38>
lea    0xead(%rip),%rdi
call   1030 <perrordie@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fopen>:
push   %rbx
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <safe_fopen+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <perrordie@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"fopen\00"
define noalias i32* @safe_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perrordie(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32* %3
}
/* Variables and functions */
int isUgly(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char const *argv[]) {
  int number = 11;
  printf("%d = %d\n", number, isUgly(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xb,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <isUgly@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @isUgly(i32 11)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 11, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  long int i;
  for (i = 1;; i *= 10) {
    printf("%d\n", 10 * i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
imul   $0xa,-0x10(%rbp),%rax
mov    %eax,%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <main+0x17>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
add    %rbx,%rbx
lea    (%rbx,%rbx,4),%rbx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 1, %0 ], [ %3, %1 ]
%3 = mul nuw nsw i64 %2, 10
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ CyIntEnable(int);
void ADC_SAR_1_IRQ_Enable(void) { CyIntEnable(2); }


x86 assembly (clang, -O0):
<ADC_SAR_1_IRQ_Enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <CyIntEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_SAR_1_IRQ_Enable>:
mov    $0x2,%edi
jmp    1030 <CyIntEnable@plt>

LLVM IR (-O0):
define void @ADC_SAR_1_IRQ_Enable() {
%1 = call i32 @CyIntEnable(i32 2)
ret void
}

LLVM IR (-O2):
define void @ADC_SAR_1_IRQ_Enable() {
%1 = tail call i32 @CyIntEnable(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ run();
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  setvbuf(stdout, NULL, _IONBF, 0);
  run();
  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)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    $0x0,%al
call   1030 <run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
xor    %eax,%eax
call   1030 <run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
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 = load i32, i32* @stdout
%7 = load i32, i32* @_IONBF
%8 = call i32 @setvbuf(i32 %6, i32* null, i32 %7, i32 0)
%9 = call i32 (...) @run()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = load i32, i32* @_IONBF
%5 = tail call i32 @setvbuf(i32 %3, i32* null, i32 %4, i32 0)
%6 = tail call i32 (...) @run()
ret i32 0
}
int fn1(int p1) {
lbl_549:
  if (p1)
    goto lbl_549;
  return 0;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1116 <fn1+0x16>
jmp    1107 <fn1+0x7>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
test   %edi,%edi
je     1112 <fn1+0x12>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1110 <fn1+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fn1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret i32 0
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int procnetdev_ver(char *buf) {
  if (strstr(buf, "compressed"))
    return 3;
  if (strstr(buf, "bytes"))
    return 2;
  return 1;
}


x86 assembly (clang, -O0):
<procnetdev_ver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <procnetdev_ver+0x32>
movl   $0x3,-0x4(%rbp)
jmp    116f <procnetdev_ver+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1168 <procnetdev_ver+0x58>
movl   $0x2,-0x4(%rbp)
jmp    116f <procnetdev_ver+0x5f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procnetdev_ver>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    $0x3,%eax
test   %rcx,%rcx
je     112f <procnetdev_ver+0x1f>
pop    %rbx
ret
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
cmp    $0x1,%rax
mov    $0x2,%eax
sbb    $0x0,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"compressed\00"
@.str.1 = [6 x i8] c"bytes\00"
define i32 @procnetdev_ver(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 1, i32 2
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 3, %1 ], [ %7, %4 ]
ret i32 %9
}