xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
const uint16_t bswap_16(uint16_t x) {
  x = (x >> 8) | (x << 8);
  return x;
}


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bswap_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @bswap_16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo() { bar(1); }


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

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

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @bar(i32 1)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @bar(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_10612() {
  Assert_real((isqrt(10612) == 103),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1500, ("Integer square root of 10612 should be 103"));
}


x86 assembly (clang, -O0):
<t_sqrt_10612>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2974,%edi
call   1030 <isqrt@plt>
cmp    $0x67,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x5dc,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_10612>:
push   %rax
mov    $0x2974,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x67,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x5dc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 10612 should be 103\00"
define void @t_sqrt_10612() {
%1 = call i32 @isqrt(i32 10612)
%2 = icmp eq i32 %1, 103
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1500, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [43 x i8] c"Integer square root of 10612 should be 103\00"
define void @t_sqrt_10612() {
%1 = tail call i32 @isqrt(i32 10612)
%2 = icmp eq i32 %1, 103
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1500, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void line() {}


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

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

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

LLVM IR (-O2):
define void @line() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _z_failed(char const *, int, char const *);
void _z_assert(int bool_val, const char *file, int line, const char *func) {
  if (!bool_val) {
    _z_failed(file, line, func);
  }
}


x86 assembly (clang, -O0):
<_z_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1140 <_z_assert+0x30>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <_z_failed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_z_assert>:
test   %edi,%edi
je     1115 <_z_assert+0x5>
ret
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rcx,%rdx
jmp    1030 <_z_failed@plt>

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

LLVM IR (-O2):
define void @_z_assert(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @_z_failed(i8* %1, i32 %2, i8* %3)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "cksum"
        " [file...]\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: cksum [file...]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [24 x i8] c"Usage: cksum [file...]\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
char *addColor(char *, char *);
char *green(char *str) { return addColor("32", str); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"32\00"
define i8* @green(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
char *strerror(int);
int main(int argc, char *argv[]) {
  pthread_t thread;
  int status;
  status = pthread_join(thread, NULL);
  if (status != 0)
    fprintf(stderr, "error %d: %s\n", status, strerror(status));
  return status;
}


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    -0x14(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_join@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     118e <main+0x5e>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%edx
mov    %rax,%rcx
lea    0xe77(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
call   1040 <pthread_join@plt>
mov    %eax,%ebx
test   %eax,%eax
je     1163 <main+0x33>
mov    0x2e99(%rip),%rax
mov    (%rax),%ebp
mov    %ebx,%edi
call   1050 <strerror@plt>
lea    0xea9(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"error %d: %s\0A\00"
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 = load i32, i32* %6
%9 = call i32 @pthread_join(i32 %8, i32* null)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i32, i32* %7
%15 = load i32, i32* %7
%16 = call i8* @strerror(i32 %15)
%17 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %16)
br label %18
18: ; preds = %12, %2
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"error %d: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @pthread_join(i32 undef, i32* null)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i8* @strerror(i32 %3)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %7)
br label %9
9: ; preds = %5, %2
ret i32 %3
}
int rijndaelEndOfCode() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @rijndaelEndOfCode() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M48_f(char *s) {
  debug("M48_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M48_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M48_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M48_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M48_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M48_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M48_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void NOROM_PRCMAudioClockInternalSource(void) {
  (*((volatile unsigned long
          *)(((unsigned long)(0x40082000 + 0x000000C8) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40082000 + 0x000000C8) & 0x000FFFFF) << 5) |
             ((0) << 2)))) = 1;
}


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

x86 assembly (clang, -O2):
<NOROM_PRCMAudioClockInternalSource>:
movq   $0x1,0x43041900
ret

LLVM IR (-O0):
define void @NOROM_PRCMAudioClockInternalSource() {
store volatile i64 1, i64* inttoptr (i64 1124342016 to i64*)
ret void
}

LLVM IR (-O2):
define void @NOROM_PRCMAudioClockInternalSource() {
store volatile i64 1, i64* inttoptr (i64 1124342016 to i64*)
ret void
}
/* Variables and functions */
scalar_t__ chroot(char const *);
int serverJail(const char *dir) { return chroot(dir) == 0 ? 1 : 0; }


x86 assembly (clang, -O0):
<serverJail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chroot@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serverJail>:
push   %rax
call   1030 <chroot@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @serverJail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @chroot(i8* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @serverJail(i8* %0) {
%2 = tail call i64 @chroot(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int clamp(int v, int min, int max) {
  int tmp = (v < min) ? min : v;
  return (tmp > max) ? max : tmp;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <clamp+0x2a>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1147 <clamp+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <clamp+0x4d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
cmp    %edx,%eax
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
void XSupportsLocale() {}


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

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

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

LLVM IR (-O2):
define void @XSupportsLocale() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ m44_reset();
int /*<<< orphan*/ mmc3init(int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void m44_init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
              uint32_t prgRAMsizeIn, uint8_t *chrROMin, uint32_t chrROMsizeIn) {
  mmc3init(prgROMin, prgROMsizeIn, prgRAMin, prgRAMsizeIn, chrROMin,
           chrROMsizeIn);
  m44_reset();
  printf("Mapper 44 (Mapper 4 Game Select) inited\n");
}


x86 assembly (clang, -O0):
<m44_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <mmc3init@plt>
mov    $0x0,%al
call   1040 <m44_reset@plt>
lea    0xe89(%rip),%rdi
call   1050 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m44_init>:
push   %rax
call   1030 <mmc3init@plt>
xor    %eax,%eax
call   1050 <m44_reset@plt>
lea    0xebc(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Mapper 44 (Mapper 4 Game Select) inited\0A\00"
define void @m44_init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = load i32*, i32** %9
%16 = load i32, i32* %10
%17 = load i32*, i32** %11
%18 = load i32, i32* %12
%19 = call i32 @mmc3init(i32* %13, i32 %14, i32* %15, i32 %16, i32* %17, i32 %18)
%20 = call i32 (...) @m44_reset()
%21 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Mapper 44 (Mapper 4 Game Select) inited\00"
define void @m44_init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = tail call i32 @mmc3init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5)
%8 = tail call i32 (...) @m44_reset()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
int SER_PutChar(int c) { return (c); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SPI_IOC_RD_MAX_SPEED_HZ;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int spi_get_max_speed_hz(int fd, __u32 *pspeed) {
  return ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, pspeed);
}


x86 assembly (clang, -O0):
<spi_get_max_speed_hz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_get_max_speed_hz>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@SPI_IOC_RD_MAX_SPEED_HZ = global i32 0
define i32 @spi_get_max_speed_hz(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* @SPI_IOC_RD_MAX_SPEED_HZ
%7 = load i32*, i32** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
@SPI_IOC_RD_MAX_SPEED_HZ = global i32 0
define i32 @spi_get_max_speed_hz(i32 %0, i32* %1) {
%3 = load i32, i32* @SPI_IOC_RD_MAX_SPEED_HZ
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32* %1)
ret i32 %4
}
void av_set_cpu_flags_mask() {}


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

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

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

LLVM IR (-O2):
define void @av_set_cpu_flags_mask() {
ret void
}
/* Variables and functions */
double sqrt(double);
double funcTest(double x) { return sqrt((x * x) + 1); }


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

x86 assembly (clang, -O2):
<funcTest>:
mulsd  %xmm0,%xmm0
addsd  0xee4(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <funcTest+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @funcTest(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double 1.000000e+00)
%6 = call double @sqrt(double %5)
ret double %6
}

LLVM IR (-O2):
define double @funcTest(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = tail call double @sqrt(double %2)
ret double %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get_mem_big_endian(uint8_t B3, uint8_t B2, uint8_t B1, uint8_t B0) {
  return (B3 << 24) | (B2 << 16) | (B1 << 8) | B0;
}


x86 assembly (clang, -O0):
<get_mem_big_endian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mem_big_endian>:
mov    %edx,%eax
shl    $0x18,%edi
shl    $0x10,%esi
or     %edi,%esi
shl    $0x8,%eax
or     %ecx,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @get_mem_big_endian(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 24
%6 = shl i32 %1, 16
%7 = or i32 %6, %5
%8 = shl i32 %2, 8
%9 = or i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t ustime(void) {
  struct timeval tv;
  int64_t ust;
  gettimeofday(&tv, NULL);
  ust = ((int64_t)tv.tv_sec) * 1000000;
  ust += tv.tv_usec;
  return ust;
}


x86 assembly (clang, -O0):
<ustime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movabs $0xf424000000000,%rax
imul   0x10(%rsp),%rax
shr    $0x20,%rax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @ustime() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
store i32 %7, i32* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @ustime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = mul i64 %5, 4294967296000000
%9 = lshr exact i64 %8, 32
%10 = add i64 %9, %7
%11 = trunc i64 %10 to i32
ret i32 %11
}
void emptyfunc2() { ; }


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

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

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

LLVM IR (-O2):
define void @emptyfunc2() {
ret void
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_attach_event(void *bus, void *event, int priority) {
  return -EINVAL;
}


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

x86 assembly (clang, -O2):
<sd_bus_attach_event>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_attach_event(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 i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_attach_event(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
scalar_t__ is_prime_number(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  int count = 1000000;
  for (i = 2; i <= count; i++) {
    if (is_prime_number(i))
      printf("%d\n", i);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf4240,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     117d <main+0x5d>
mov    -0x8(%rbp),%edi
call   1040 <is_prime_number@plt>
cmp    $0x0,%rax
je     116a <main+0x4a>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <main+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    0x2e5c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xed0(%rip),%r14
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0xf4241,%ebx
je     1163 <main+0x43>
mov    %ebx,%edi
call   1040 <is_prime_number@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 2, %0 ], [ %8, %7 ]
%3 = tail call i64 @is_prime_number(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 1000001
br i1 %9, label %10, label %1
10: ; preds = %7
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int ukp(int, int *, int *, int);
void testUkp(int expected, int c, int *w, int *v, int n) {
  int actual = ukp(c, w, v, n);
  if (actual != expected) {
    puts("Failed.");
  }
}


x86 assembly (clang, -O0):
<testUkp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <ukp@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
je     1168 <testUkp+0x48>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testUkp>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
call   1040 <ukp@plt>
cmp    %ebx,%eax
jne    1139 <testUkp+0x19>
pop    %rbx
ret
lea    0xec0(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Failed.\00"
define void @testUkp(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
%11 = 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
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32, i32* %10
%16 = call i32 @ukp(i32 %12, i32* %13, i32* %14, i32 %15)
store i32 %16, i32* %11
%17 = load i32, i32* %11
%18 = load i32, i32* %6
%19 = icmp ne i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %5
%21 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %5
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Failed.\00"
define void @testUkp(i32 %0, i32 %1, i32* %2, i32* %3, i32 %4) {
%6 = tail call i32 @ukp(i32 %1, i32* %2, i32* %3, i32 %4)
%7 = icmp eq i32 %6, %0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int be64toh(int);
int /*<<< orphan*/ memcpy(int *, char const *, int);
uint64_t digest2hashkey(const char *digest, uint64_t mask) {
  assert(digest);
  uint64_t keyspan = 0;
  size_t offset = 20 > 8 ? (20 - 8) : 0;
  memcpy(&keyspan, digest + offset, ((8) < (20) ? (8) : (20)));
  return be64toh(keyspan) & mask;
}


x86 assembly (clang, -O0):
<digest2hashkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
movl   $0x0,-0x10(%rbp)
movq   $0xc,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
add    -0x18(%rbp),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x8,%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%edi
call   1040 <be64toh@plt>
and    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digest2hashkey>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <assert@plt>
movl   $0x0,0x4(%rsp)
add    $0xc,%rbx
lea    0x4(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1050 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <be64toh@plt>
and    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @digest2hashkey(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @assert(i8* %7)
store i32 0, i32* %5
store i64 12, i64* %6
%9 = load i8*, i8** %3
%10 = load i64, i64* %6
%11 = getelementptr inbounds i8, i8* %9, i64 %10
%12 = call i32 @memcpy(i32* %5, i8* %11, i32 8)
%13 = load i32, i32* %5
%14 = call i32 @be64toh(i32 %13)
%15 = load i32, i32* %4
%16 = and i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @digest2hashkey(i8* %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @assert(i8* %0)
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = getelementptr inbounds i8, i8* %0, i64 12
%7 = call i32 @memcpy(i32* %3, i8* %6, i32 8)
%8 = load i32, i32* %3
%9 = call i32 @be64toh(i32 %8)
%10 = and i32 %9, %1
ret i32 %10
}
void booz_pwm_init_arch(void) {}


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

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

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

LLVM IR (-O2):
define void @booz_pwm_init_arch() {
ret void
}
int hash(int x) {}


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

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

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

LLVM IR (-O2):
define i32 @hash(i32 %0) {
ret i32 undef
}
char *start_experiment() {
  return "{'initial_configuration' : {}, 'batch' : false}";
}


x86 assembly (clang, -O0):
<start_experiment>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_experiment>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [48 x i8] c"{'initial_configuration' : {}, 'batch' : false}\00"
define i8* @start_experiment() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [48 x i8] c"{'initial_configuration' : {}, 'batch' : false}\00"
define i8* @start_experiment() {
ret i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0)
}
char get_b(void) { return 'b'; }


x86 assembly (clang, -O0):
<get_b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x62,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_b>:
mov    $0x62,%al
ret

LLVM IR (-O0):
define signext i8 @get_b() {
ret i8 98
}

LLVM IR (-O2):
define signext i8 @get_b() {
ret i8 98
}
/* Variables and functions */
unsigned int asciihex2int(unsigned char *);
unsigned int get_cid_identity(unsigned char *c, unsigned int *cid) {
  *cid = asciihex2int(c);
  return 4;
}


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

x86 assembly (clang, -O2):
<get_cid_identity>:
push   %rbx
mov    %rsi,%rbx
call   1030 <asciihex2int@plt>
mov    %eax,(%rbx)
mov    $0x4,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_cid_identity(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @asciihex2int(i8* %0)
store i32 %3, i32* %1
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int input, kvadratwe, kubwe;
  scanf("%d", &input);
  kvadratwe = input * input;
  kubwe = kvadratwe * input;
  printf("\n%d", kvadratwe);
  printf("\n%d", kubwe);
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
float float_from_uchar(unsigned char value) { return value / 255.0f; }


x86 assembly (clang, -O0):
<float_from_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  0xee6(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_from_uchar>:
cvtsi2ss %edi,%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @float_from_uchar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = sitofp i32 %4 to float
%6 = fdiv float %5, 2.550000e+02
ret float %6
}

LLVM IR (-O2):
define float @float_from_uchar(i8 zeroext %0) {
%2 = uitofp i8 %0 to float
%3 = fdiv float %2, 2.550000e+02
ret float %3
}
void noop() {}


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

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

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

LLVM IR (-O2):
define void @noop() {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int c, nl;
  nl = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\n') {
      nl = nl + 1;
    }
  }
  printf("%d\n", nl);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1167 <main+0x47>
cmpl   $0xa,-0x8(%rbp)
jne    1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}
int omap3_mux_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap3_mux_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncmp(char *, char *, int);
int is_ris_start_tag(char *p) {
  if (!strncmp(p, "TY  - ", 6))
    return 1;
  if (!strncmp(p, "TY   - ", 7))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_ris_start_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1146 <is_ris_start_tag+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1177 <is_ris_start_tag+0x67>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x7,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1170 <is_ris_start_tag+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1177 <is_ris_start_tag+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ris_start_tag>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1148 <is_ris_start_tag+0x38>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x7,%edx
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"TY - \00"
@.str.1 = [8 x i8] c"TY - \00"
define i32 @is_ris_start_tag(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __PHYSFS_setError(int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int lstat(char const *, struct stat *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int __PHYSFS_platformExists(const char *fname) {
  struct stat statbuf;
  if (lstat(fname, &statbuf) == -1) {
    __PHYSFS_setError(strerror(errno));
    return 0;
  };
  return (1);
}


x86 assembly (clang, -O0):
<__PHYSFS_platformExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <lstat@plt>
cmp    $0xffffffff,%eax
jne    1173 <__PHYSFS_platformExists+0x43>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1040 <__PHYSFS_setError@plt>
movl   $0x0,-0x4(%rbp)
jmp    117a <__PHYSFS_platformExists+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__PHYSFS_platformExists>:
push   %rax
mov    %rsp,%rsi
call   1030 <lstat@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1147 <__PHYSFS_platformExists+0x17>
pop    %rcx
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edi
call   1040 <__PHYSFS_setError@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @__PHYSFS_platformExists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @lstat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @errno
%10 = call i32 @strerror(i32 %9)
%11 = call i32 @__PHYSFS_setError(i32 %10)
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i32 0
define i32 @__PHYSFS_platformExists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = tail call i32 @strerror(i32 %7)
%9 = tail call i32 @__PHYSFS_setError(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ 0, %6 ], [ 1, %1 ]
ret i32 %11
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR77_get(void) { return U_WMRCORENONE_get("U_WMR77"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR77\00"
define i32 @U_WMR77_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR77\00"
define i32 @U_WMR77_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ pool_optimize();
void talloc_optimize() { pool_optimize(); }


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

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

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

LLVM IR (-O2):
define void @talloc_optimize() {
%1 = tail call i32 (...) @pool_optimize()
ret void
}