xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t get_closest_power(size_t n) {
  size_t closest_power = 1;
  while (closest_power < n)
    closest_power <<= 1;
  return closest_power;
}


x86 assembly (clang, -O0):
<get_closest_power>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    112f <get_closest_power+0x2f>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <get_closest_power+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_closest_power>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1110 <get_closest_power+0x10>
ret

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

LLVM IR (-O2):
define i64 @get_closest_power(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ult i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef unsigned int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ pcg_rotr_8(unsigned int, unsigned int);
uint8_t pcg_output_xsh_rr_16_8(uint16_t state) {
  return pcg_rotr_8(((state >> 5u) ^ state) >> 5u, state >> 13u);
}


x86 assembly (clang, -O0):
<pcg_output_xsh_rr_16_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x5,%edi
xor    -0x4(%rbp),%edi
shr    $0x5,%edi
mov    -0x4(%rbp),%esi
shr    $0xd,%esi
call   1030 <pcg_rotr_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcg_output_xsh_rr_16_8>:
mov    %edi,%esi
mov    %edi,%eax
shr    $0xa,%eax
shr    $0x5,%edi
xor    %eax,%edi
shr    $0xd,%esi
jmp    1030 <pcg_rotr_8@plt>

LLVM IR (-O0):
define i32 @pcg_output_xsh_rr_16_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 5
%5 = load i32, i32* %2
%6 = xor i32 %4, %5
%7 = lshr i32 %6, 5
%8 = load i32, i32* %2
%9 = lshr i32 %8, 13
%10 = call i32 @pcg_rotr_8(i32 %7, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @pcg_output_xsh_rr_16_8(i32 %0) {
%2 = lshr i32 %0, 10
%3 = lshr i32 %0, 5
%4 = xor i32 %2, %3
%5 = lshr i32 %0, 13
%6 = tail call i32 @pcg_rotr_8(i32 %4, i32 %5)
ret i32 %6
}
void RTSemRWRequestReadDebug(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemRWRequestReadDebug() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void sigchld_handler(int signum) { assert(0 && "Please fill me!"); }


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

x86 assembly (clang, -O2):
<sigchld_handler>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @sigchld_handler(i32 %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
int f_i13(int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7,
          int i8, int i9, int i10, int i11, int i12) {
  return i12;
}


x86 assembly (clang, -O0):
<f_i13>:
push   %rbp
mov    %rsp,%rbp
mov    0x40(%rbp),%eax
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    0x40(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_i13>:
mov    0x38(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @f_i13(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12) {
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
store i32 %0, i32* %14
store i32 %1, i32* %15
store i32 %2, i32* %16
store i32 %3, i32* %17
store i32 %4, i32* %18
store i32 %5, i32* %19
store i32 %6, i32* %20
store i32 %7, i32* %21
store i32 %8, i32* %22
store i32 %9, i32* %23
store i32 %10, i32* %24
store i32 %11, i32* %25
store i32 %12, i32* %26
%27 = load i32, i32* %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @f_i13(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 returned %12) {
ret i32 %12
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main() {
  puts("begin");
  printf("foo result: %d\n", foo());
  puts("end");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <foo@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <foo@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"begin\00"
@.str.1 = [16 x i8] c"foo result: %d\0A\00"
@.str.2 = [4 x i8] c"end\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @foo()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int computer();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int number = 0;
  printf("Hello ! This is a naive computer."
         "Her name is 'Lisa' :)\n");
  number = computer();
  printf("The result of your inputed :%d\n", number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <computer@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
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
call   1050 <computer@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"Hello ! This is a naive computer.Her name is 'Lisa' :)\0A\00"
@.str.1 = [32 x i8] c"The result of your inputed :%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @computer()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [32 x i8] c"The result of your inputed :%d\0A\00"
@str = [55 x i8] c"Hello ! This is a naive computer.Her name is 'Lisa' :)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @computer()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
void false8() {
  int a = 10000000;
  a = (short)a;
  test(a);
}


x86 assembly (clang, -O0):
<false8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x989680,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cwtl
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<false8>:
mov    $0xffff9680,%edi
jmp    1030 <test@plt>

LLVM IR (-O0):
define void @false8() {
%1 = alloca i32
store i32 10000000, i32* %1
%2 = load i32, i32* %1
%3 = trunc i32 %2 to i16
%4 = sext i16 %3 to i32
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @test(i32 %5)
ret void
}

LLVM IR (-O2):
define void @false8() {
%1 = tail call i32 @test(i32 -27008)
ret void
}
/* Variables and functions */
int __builtin_memcmp(void const *, void const *, size_t);
int memcmp(void const *lhs, void const *rhs, size_t cnt) {
  return __builtin_memcmp(lhs, rhs, cnt);
}


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

x86 assembly (clang, -O2):
<memcmp>:
jmp    1100 <memcmp>

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

LLVM IR (-O2):
define i32 @memcmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
br label %4
4: ; preds = %4, %3
br label %4
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getchar();
int eatLine() {
  int c;
  while ((c = getchar()) != EOF && (c != '\n'))
    ;
  if (c == EOF)
    exit(0);
  return c;
}


x86 assembly (clang, -O0):
<eatLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
mov    0x2eab(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1152 <eatLine+0x32>
cmpl   $0xa,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1162 <eatLine+0x42>
jmp    1167 <eatLine+0x47>
jmp    1128 <eatLine+0x8>
mov    -0x4(%rbp),%eax
mov    0x2e77(%rip),%rcx
cmp    (%rcx),%eax
jne    1180 <eatLine+0x60>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatLine>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
mov    (%rbx),%ecx
cmp    $0xa,%eax
je     1142 <eatLine+0x22>
cmp    %ecx,%eax
jne    1130 <eatLine+0x10>
cmp    %ecx,%eax
je     1148 <eatLine+0x28>
pop    %rbx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @eatLine() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = icmp ne i32 %7, 10
br label %9
9: ; preds = %6, %2
%10 = phi i1 [ false, %2 ], [ %8, %6 ]
br i1 %10, label %11, label %12
11: ; preds = %9
br label %2
12: ; preds = %9
%13 = load i32, i32* %1
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @exit(i32 0)
unreachable
18: ; preds = %12
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @eatLine() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp ne i32 %2, %3
%5 = icmp ne i32 %2, 10
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
%8 = icmp eq i32 %2, %3
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %7
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rw_css() {
  printf("\t\t<style type='text/css'>\n");
  printf("\t\t\thtml body { width: 100%%; margin: auto;}\n"
         "\t\t\t.imgtable { width: 100%%; text-align: center}\n"
         "\t\t\t.imgtable td {width: 50%%;}\n"
         "\t\t\t.imgtable img { margin: auto; }\n"
         "\t\t\t.menutable { margin: auto; }\n");
  printf("\t\t</style>\n");
}


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

x86 assembly (clang, -O2):
<rw_css>:
push   %rax
lea    0xf98(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xf9a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"\09\09<style type='text/css'>\0A\00"
@.str.1 = [192 x i8] c"\09\09\09html body { width: 100%%; margin: auto;}\0A\09\09\09.imgtable { width: 100%%; text-align: center}\0A\09\09\09.imgtable td {width: 50%%;}\0A\09\09\09.imgtable img { margin: auto; }\0A\09\09\09.menutable { margin: auto; }\0A\00"
@.str.2 = [12 x i8] c"\09\09</style>\0A\00"
define void @rw_css() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([192 x i8], [192 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [192 x i8] c"\09\09\09html body { width: 100%%; margin: auto;}\0A\09\09\09.imgtable { width: 100%%; text-align: center}\0A\09\09\09.imgtable td {width: 50%%;}\0A\09\09\09.imgtable img { margin: auto; }\0A\09\09\09.menutable { margin: auto; }\0A\00"
@str = [26 x i8] c"\09\09<style type='text/css'>\00"
@str.3 = [11 x i8] c"\09\09</style>\00"
define void @rw_css() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([192 x i8], [192 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0))
ret void
}
double sc(signed char *p) { return (double)*p; }


x86 assembly (clang, -O0):
<sc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc>:
movsbl (%rdi),%eax
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @sc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sitofp i8 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @sc(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sitofp i8 %2 to double
ret double %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ send_event;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xgraphicsexpose_send_event(void *_p) {
  return (int)((XEvent *)_p)->xgraphicsexpose.send_event;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xgraphicsexpose_send_event>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xgraphicsexpose_send_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xgraphicsexpose_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int suma;
  suma = 50 + 25;
  printf("La suma de 50 y 25 es %i\n", suma);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"La suma de 50 y 25 es %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 75, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"La suma de 50 y 25 es %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 75)
ret i32 0
}
void linux_store_registers(int regno) {}


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

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

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

LLVM IR (-O2):
define void @linux_store_registers(i32 %0) {
ret void
}
/* Variables and functions */
int memcmp(void const *, void const *, size_t const);
int hashmap_keycmp(const void *key1, const size_t key1_len, const void *key2,
                   const size_t key2_len) {
  if (key1_len != key2_len)
    return 1;
  return memcmp(key1, key2, key1_len);
}


x86 assembly (clang, -O0):
<hashmap_keycmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1142 <hashmap_keycmp+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1156 <hashmap_keycmp+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmap_keycmp>:
cmp    %rcx,%rsi
jne    1123 <hashmap_keycmp+0x13>
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <memcmp@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @hashmap_keycmp(i8* nocapture %0, i64 %1, i8* nocapture %2, i64 %3) {
%5 = icmp eq i64 %1, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @memcmp(i8* %0, i8* %2, i64 %1)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ 1, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Read(int, void *, size_t);
int /*<<< orphan*/ assert(int);
void Unpack(void *p, size_t len, int fd) {
  size_t l;
  Read(fd, &l, sizeof(int));
  assert(l == len);
  Read(fd, p, len);
}


x86 assembly (clang, -O0):
<Unpack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x4,%edx
call   1030 <Read@plt>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <Read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Unpack>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x8(%rsp),%rsi
mov    $0x4,%edx
mov    %ebx,%edi
call   1030 <Read@plt>
xor    %edi,%edi
cmp    %r14,0x8(%rsp)
sete   %dil
call   1040 <assert@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <Read@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @Unpack(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = bitcast i64* %7 to i8*
%10 = call i32 @Read(i32 %8, i8* %9, i64 4)
%11 = load i64, i64* %7
%12 = load i64, i64* %5
%13 = icmp eq i64 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %6
%17 = load i8*, i8** %4
%18 = load i64, i64* %5
%19 = call i32 @Read(i32 %16, i8* %17, i64 %18)
ret void
}

LLVM IR (-O2):
define void @Unpack(i8* %0, i64 %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @Read(i32 %2, i8* %5, i64 4)
%7 = load i64, i64* %4
%8 = icmp eq i64 %7, %1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @Read(i32 %2, i8* %0, i64 %1)
ret void
}
int do_a() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @do_a() {
ret i32 1
}
const char *pathcon_nm3_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathcon_nm3_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathcon_nm3_name_in+0x2b>
jmp    111a <pathcon_nm3_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathcon_nm3_name_in+0x3b>
jmp    114b <pathcon_nm3_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm3_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathcon_nm3_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm3_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @pathcon_nm3_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @pathcon_nm3_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Write_LCD(int, char *, int);
int /*<<< orphan*/ usleep(int);
void CwLnx_reboot(int fd) {
  char cmd[] = {254, 86, 253};
  Write_LCD(fd, cmd, 3);
  usleep(20000);
  return;
}


x86 assembly (clang, -O0):
<CwLnx_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x3,%edx
call   1030 <Write_LCD@plt>
mov    $0x4e20,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CwLnx_reboot>:
push   %rax
movb   $0xfd,0x6(%rsp)
movw   $0x56fe,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x3,%edx
call   1030 <Write_LCD@plt>
mov    $0x4e20,%edi
call   1040 <usleep@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.CwLnx_reboot.cmd = [3 x i8] c"\FEV\FD"
define void @CwLnx_reboot(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
store i32 %0, i32* %2
%4 = bitcast [3 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%7 = call i32 @Write_LCD(i32 %5, i8* %6, i32 3)
%8 = call i32 @usleep(i32 20000)
ret void
}

LLVM IR (-O2):
@__const.CwLnx_reboot.cmd = [3 x i8] c"\FEV\FD"
define void @CwLnx_reboot(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 @Write_LCD(i32 %0, i8* %3, i32 3)
%5 = call i32 @usleep(i32 20000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  char path[512];
  getcwd(path, 512);
  fprintf(stdout, "%s\n", path);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    $0x200,%esi
call   1030 <getcwd@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    -0x210(%rbp),%rdx
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1030 <getcwd@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @getcwd(i8* %4, i32 512)
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void close_file(FILE *file) {
  if (fclose(file)) {
    fprintf(stderr, "error: couldn't close stream.");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<close_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     1172 <close_file+0x42>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_file>:
push   %rax
call   1030 <fclose@plt>
test   %rax,%rax
jne    113d <close_file+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"error: couldn't close stream.\00"
@EXIT_FAILURE = global i32 0
define void @close_file(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @fclose(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"error: couldn't close stream.\00"
@EXIT_FAILURE = global i32 0
define void @close_file(i32* nocapture %0) {
%2 = tail call i64 @fclose(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int show(int a) {
  printf("func show\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"func show\00"
define i32 @show(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ B(char);
int /*<<< orphan*/ putchar(int);
void b(int w, int c) {
  B(c);
  putchar(w);
  B('%');
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1040 <B@plt>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x25,%edi
call   1040 <B@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rbx
mov    %edi,%ebx
movsbl %sil,%edi
call   1040 <B@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    $0x25,%edi
pop    %rbx
jmp    1040 <B@plt>

LLVM IR (-O0):
define void @b(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 = trunc i32 %5 to i8
%7 = call i32 @B(i8 signext %6)
%8 = load i32, i32* %3
%9 = call i32 @putchar(i32 %8)
%10 = call i32 @B(i8 signext 37)
ret void
}

LLVM IR (-O2):
define void @b(i32 %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i32 @B(i8 signext %3)
%5 = tail call i32 @putchar(i32 %0)
%6 = tail call i32 @B(i8 signext 37)
ret void
}
unsigned int decode_artnet_uint32_hilo(unsigned char *data) {
  return (data[0] << 24) | (data[1] << 16) | (data[2] << 8) | data[3];
}


x86 assembly (clang, -O0):
<decode_artnet_uint32_hilo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @decode_artnet_uint32_hilo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @decode_artnet_uint32_hilo(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
double mul_double(double a, double b) { return a * b; }


x86 assembly (clang, -O0):
<mul_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul_double>:
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @mul_double(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
unsigned int GetChipID_winbond(void) { return 0xFFFFFFFF; }


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

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

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

LLVM IR (-O2):
define i32 @GetChipID_winbond() {
ret i32 -1
}
void Int32_To_Int24_Dither(
    void *destinationBuffer, signed int destinationStride, void *sourceBuffer,
    signed int sourceStride, unsigned int count,
    struct PaUtilTriangularDitherGenerator *ditherGenerator) {
  (void)destinationBuffer;
  (void)destinationStride;
  (void)sourceBuffer;
  (void)sourceStride;
  (void)count;
  (void)ditherGenerator;
}


x86 assembly (clang, -O0):
<Int32_To_Int24_Dither>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.PaUtilTriangularDitherGenerator = type opaque
define void @Int32_To_Int24_Dither(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, %struct.PaUtilTriangularDitherGenerator* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.PaUtilTriangularDitherGenerator*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store %struct.PaUtilTriangularDitherGenerator* %5, %struct.PaUtilTriangularDitherGenerator** %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load %struct.PaUtilTriangularDitherGenerator*, %struct.PaUtilTriangularDitherGenerator** %12
ret void
}

LLVM IR (-O2):
%struct.PaUtilTriangularDitherGenerator = type opaque
define void @Int32_To_Int24_Dither(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3, i32 %4, %struct.PaUtilTriangularDitherGenerator* nocapture %5) {
ret void
}
void omap_prm_base_init(void) {}


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

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

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

LLVM IR (-O2):
define void @omap_prm_base_init() {
ret void
}
void SV_Shutdown(const char *finalmsg) {}


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

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

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

LLVM IR (-O2):
define void @SV_Shutdown(i8* nocapture %0) {
ret void
}
int recon_get_card_detect3(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @recon_get_card_detect3() {
ret i32 0
}
/* Variables and functions */
char *strchr(const char *s, int c) {
  for (; *s != (char)c; ++s) {
    if (*s == '\0') {
      return NULL;
    }
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     1153 <strchr+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113d <strchr+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    115b <strchr+0x5b>
jmp    1142 <strchr+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ], [ null, %8 ]
ret i8* %18
}
/* Variables and functions */
scalar_t__ dt_char_is_upper(unsigned char);
unsigned char dt_char_to_lower(unsigned char c) {
  if (dt_char_is_upper(c))
    c |= 0x20;
  return c;
}


x86 assembly (clang, -O0):
<dt_char_to_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <dt_char_is_upper@plt>
cmp    $0x0,%rax
je     113b <dt_char_to_lower+0x2b>
movzbl -0x1(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_char_to_lower>:
push   %rbx
mov    %edi,%ebx
call   1030 <dt_char_is_upper@plt>
mov    %ebx,%ecx
or     $0x20,%cl
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @dt_char_to_lower(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @dt_char_is_upper(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = or i32 %8, 32
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
br label %11
11: ; preds = %6, %1
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @dt_char_to_lower(i8 zeroext %0) {
%2 = tail call i64 @dt_char_is_upper(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
%4 = or i8 %0, 32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
int check_pin(int pin_number) {
  return (pin_number >= 32 && pin_number <= 37 && pin_number != 36);
}


x86 assembly (clang, -O0):
<check_pin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     112f <check_pin+0x2f>
xor    %eax,%eax
cmpl   $0x25,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     112f <check_pin+0x2f>
cmpl   $0x24,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pin>:
lea    -0x20(%rdi),%eax
cmp    $0x6,%eax
setb   %al
cmp    $0x24,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @check_pin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 37
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 36
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ false, %5 ], [ false, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @check_pin(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 6
%4 = icmp ne i32 %0, 36
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i;
  int a = 2;
  int *b = &a;
  for (i = 0; i < 5; i++) {
    *b = a * 5;
  }
  __print_int(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1157 <main+0x47>
imul   $0x5,-0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <main+0x25>
mov    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 6250)
ret i32 0
}
/* Variables and functions */
int SIGSEGV;
int scalanative_libc_sigsegv() { return SIGSEGV; }


x86 assembly (clang, -O0):
<scalanative_libc_sigsegv>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalanative_libc_sigsegv>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SIGSEGV = global i32 0
define i32 @scalanative_libc_sigsegv() {
%1 = load i32, i32* @SIGSEGV
ret i32 %1
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
define i32 @scalanative_libc_sigsegv() {
%1 = load i32, i32* @SIGSEGV
ret i32 %1
}
int plugin_call_ssl(const struct plugin_list *pl, const int type,
                    const struct argv *av, struct plugin_return *pr,
                    struct env_set *es) {
  return 0;
}


x86 assembly (clang, -O0):
<plugin_call_ssl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.plugin_list = type opaque
%struct.argv = type opaque
%struct.plugin_return = type opaque
%struct.env_set = type opaque
define i32 @plugin_call_ssl(%struct.plugin_list* %0, i32 %1, %struct.argv* %2, %struct.plugin_return* %3, %struct.env_set* %4) {
%6 = alloca %struct.plugin_list*
%7 = alloca i32
%8 = alloca %struct.argv*
%9 = alloca %struct.plugin_return*
%10 = alloca %struct.env_set*
store %struct.plugin_list* %0, %struct.plugin_list** %6
store i32 %1, i32* %7
store %struct.argv* %2, %struct.argv** %8
store %struct.plugin_return* %3, %struct.plugin_return** %9
store %struct.env_set* %4, %struct.env_set** %10
ret i32 0
}

LLVM IR (-O2):
%struct.plugin_list = type opaque
%struct.argv = type opaque
%struct.plugin_return = type opaque
%struct.env_set = type opaque
define i32 @plugin_call_ssl(%struct.plugin_list* nocapture readnone %0, i32 %1, %struct.argv* nocapture readnone %2, %struct.plugin_return* nocapture readnone %3, %struct.env_set* nocapture readnone %4) {
ret i32 0
}
/* Variables and functions */
char *mempcpy(char *, char *, size_t);
void copy_str(char *dst, char *src, size_t n) {
  char *ptr;
  ptr = mempcpy(dst, src, n);
  *ptr = '\0';
}


x86 assembly (clang, -O0):
<copy_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %rdx,-0x30(%rbp)
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @copy_str(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @mempcpy(i8* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
store i8 0, i8* %12
ret void
}

LLVM IR (-O2):
define void @copy_str(i8* nocapture writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
%4 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 0, i8* %4
ret void
}