xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(char *s) { printf("==%s==\n", s); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"==%s==\0A\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[5];
  gets(s);
  printf("%s", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x5(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x5(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x65() {
  Assert_real((isbdigit(101) == 0),
              "/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/ctype/test_isbdigit.c",
              510, ("isbdigit should be 0 for e"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x65>:
push   %rbp
mov    %rsp,%rbp
mov    $0x65,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1fe,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x65>:
push   %rax
mov    $0x65,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1fe,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for e\00"
define void @t_isbdigit_0x65() {
%1 = call i64 @isbdigit(i32 101)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 510, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for e\00"
define void @t_isbdigit_0x65() {
%1 = tail call i64 @isbdigit(i32 101)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 510, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
signed int stereo_to_mono(signed int left_channel, signed int right_channel) {
  signed long temp;
  temp = (signed long)left_channel + (signed long)right_channel;
  temp >>= 1;
  return ((signed int)temp);
}


x86 assembly (clang, -O0):
<stereo_to_mono>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stereo_to_mono>:
movslq %edi,%rcx
movslq %esi,%rax
add    %rcx,%rax
shr    %rax
ret

LLVM IR (-O0):
define i32 @stereo_to_mono(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = add nsw i64 %7, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = ashr i64 %11, 1
store i64 %12, i64* %5
%13 = load i64, i64* %5
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @stereo_to_mono(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = sext i32 %1 to i64
%5 = add nsw i64 %4, %3
%6 = lshr i64 %5, 1
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
int VfsDevtoLetter(const char *DevName, const char *driver) {
  printf("mount %s to %s\n", DevName, driver);
  return 0;
}


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

x86 assembly (clang, -O2):
<VfsDevtoLetter>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"mount %s to %s\0A\00"
define i32 @VfsDevtoLetter(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int O_NDELAY;
int O_NOCTTY;
int O_RDWR;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int open(char const *, int);
int serial_open(const char *device) {
  int result = open(device, O_RDWR | O_NOCTTY | O_NDELAY);
  if (result > -1)
    fcntl(result, F_SETFL, 0);
  return result;
}


x86 assembly (clang, -O0):
<serial_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2e98(%rip),%rax
or     (%rax),%esi
mov    0x2e7f(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jle    1170 <serial_open+0x50>
mov    -0xc(%rbp),%edi
mov    0x2e69(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_open>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e8e(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1159 <serial_open+0x39>
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
@F_SETFL = global i32 0
define i32 @serial_open(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_NOCTTY
%7 = or i32 %5, %6
%8 = load i32, i32* @O_NDELAY
%9 = or i32 %7, %8
%10 = call i32 @open(i8* %4, i32 %9)
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, -1
br i1 %12, label %13, label %17
13: ; preds = %1
%14 = load i32, i32* %3
%15 = load i32, i32* @F_SETFL
%16 = call i32 @fcntl(i32 %14, i32 %15, i32 0)
br label %17
17: ; preds = %13, %1
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@O_NDELAY = global i32 0
@F_SETFL = global i32 0
define i32 @serial_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NOCTTY
%4 = or i32 %3, %2
%5 = load i32, i32* @O_NDELAY
%6 = or i32 %4, %5
%7 = tail call i32 @open(i8* %0, i32 %6)
%8 = icmp sgt i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @F_SETFL
%11 = tail call i32 @fcntl(i32 %7, i32 %10, i32 0)
br label %12
12: ; preds = %9, %1
ret i32 %7
}
/* Variables and functions */
int write(int, void *, unsigned int);
int serialPortWrite(int fd, void *buf, unsigned int size) {
  return write(fd, buf, size);
}


x86 assembly (clang, -O0):
<serialPortWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialPortWrite>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @serialPortWrite(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int16_t extract_l(int32_t L_var1) {
  int16_t var_out;
  var_out = (int16_t)L_var1;
  return (var_out);
}


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

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

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

LLVM IR (-O2):
define i64 @extract_l(i64 returned %0) {
ret i64 %0
}
const char *_Locale_d_fmt(struct _Locale_time *__DUMMY_PAR) { return 0; }


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

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

LLVM IR (-O0):
%struct._Locale_time = type opaque
define i8* @_Locale_d_fmt(%struct._Locale_time* %0) {
%2 = alloca %struct._Locale_time*
store %struct._Locale_time* %0, %struct._Locale_time** %2
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_time = type opaque
define noalias i8* @_Locale_d_fmt(%struct._Locale_time* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int rand();
int random1(int min, int max) { return (rand() % (max - min)) + min; }


x86 assembly (clang, -O0):
<random1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random1>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @random1(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
int fnmatch(pattern, string, flags) const char *pattern;
const char *string;
int flags;
{
  return internal_fnmatch(pattern, string, string + strlen(string),
                          flags & (1 << 2), flags);
}


x86 assembly (clang, -O0):
<fnmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    %rax,%rdx
mov    -0x14(%rbp),%ecx
and    $0x4,%ecx
mov    -0x14(%rbp),%r8d
mov    $0x0,%al
call   1040 <internal_fnmatch@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnmatch>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    (%rax,%rbx,1),%rdx
mov    %ebp,%ecx
and    $0x4,%ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%r8d
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <internal_fnmatch@plt>

LLVM IR (-O0):
define i32 @fnmatch(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %5
%11 = call i64 @strlen(i8* %10)
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i32, i32* %6
%14 = and i32 %13, 4
%15 = load i32, i32* %6
%16 = call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @internal_fnmatch to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* %7, i8* %8, i8* %12, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @fnmatch(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %2, 4
%7 = tail call i32 (i8*, i8*, i8*, i32, i32, ...) bitcast (i32 (...)* @internal_fnmatch to i32 (i8*, i8*, i8*, i32, i32, ...)*)(i8* %0, i8* %1, i8* %5, i32 %6, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_size(int);
int main(int argc, char *argv[]) {
  test_size(0);
  test_size(1);
  test_size(8);
  test_size(128);
  test_size(1024);
  test_size(16384);
  test_size(17);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <test_size@plt>
mov    $0x1,%edi
call   1030 <test_size@plt>
mov    $0x8,%edi
call   1030 <test_size@plt>
mov    $0x80,%edi
call   1030 <test_size@plt>
mov    $0x400,%edi
call   1030 <test_size@plt>
mov    $0x4000,%edi
call   1030 <test_size@plt>
mov    $0x11,%edi
call   1030 <test_size@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <test_size@plt>
mov    $0x1,%edi
call   1030 <test_size@plt>
mov    $0x8,%edi
call   1030 <test_size@plt>
mov    $0x80,%edi
call   1030 <test_size@plt>
mov    $0x400,%edi
call   1030 <test_size@plt>
mov    $0x4000,%edi
call   1030 <test_size@plt>
mov    $0x11,%edi
call   1030 <test_size@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @test_size(i32 0)
%7 = call i32 @test_size(i32 1)
%8 = call i32 @test_size(i32 8)
%9 = call i32 @test_size(i32 128)
%10 = call i32 @test_size(i32 1024)
%11 = call i32 @test_size(i32 16384)
%12 = call i32 @test_size(i32 17)
%13 = load i32, i32* @EXIT_SUCCESS
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_size(i32 0)
%4 = tail call i32 @test_size(i32 1)
%5 = tail call i32 @test_size(i32 8)
%6 = tail call i32 @test_size(i32 128)
%7 = tail call i32 @test_size(i32 1024)
%8 = tail call i32 @test_size(i32 16384)
%9 = tail call i32 @test_size(i32 17)
%10 = load i32, i32* @EXIT_SUCCESS
%11 = tail call i32 @exit(i32 %10)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("First OSS Code\n");
  printf("Third OSS Code\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"First OSS Code\00"
@str.2 = [15 x i8] c"Third OSS Code\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double trunc(double);
double fmod(double x, double y) { return x - trunc(x / y) * y; }


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <trunc@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
divsd  %xmm1,%xmm0
call   1030 <trunc@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fmod(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* %3
%7 = load double, double* %4
%8 = fdiv double %6, %7
%9 = call double @llvm.trunc.f64(double %8)
%10 = load double, double* %4
%11 = fneg double %9
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double %5)
ret double %12
}

LLVM IR (-O2):
define double @fmod(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @llvm.trunc.f64(double %3)
%5 = fneg double %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %1, double %0)
ret double %6
}
/* Variables and functions */
float add10(float, float, int, int, float, float, int, int, float, float);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float n, m, o, p, q, k;
  int a, b, c, d;
  float result;
  scanf("%d", &n);
  result = add10(n, m, a, b, o, p, c, d, q, k);
  printf("Sum = %ld\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mov    -0x20(%rbp),%edi
mov    -0x24(%rbp),%esi
movss  -0x10(%rbp),%xmm2
movss  -0x14(%rbp),%xmm3
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
movss  -0x18(%rbp),%xmm4
movss  -0x1c(%rbp),%xmm5
call   1040 <add10@plt>
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <add10@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Sum = %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
store i32 0, i32* %1
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load float, float* %4
%19 = load float, float* %5
%20 = load i32, i32* %10
%21 = load i32, i32* %11
%22 = load float, float* %6
%23 = load float, float* %7
%24 = call float @add10(float %14, float %15, i32 %16, i32 %17, float %18, float %19, i32 %20, i32 %21, float %22, float %23)
store float %24, float* %12
%25 = load float, float* %12
%26 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Sum = %ld\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call float @add10(float %4, float undef, i32 undef, i32 undef, float undef, float undef, i32 undef, i32 undef, float undef, float undef)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %5)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t c_hash_string(const void *key) {
  const unsigned char *str;
  uint32_t hash;
  hash = 5381;
  for (str = key; *str; str++)
    hash = ((hash << 5) + hash) ^ *str;
  return hash;
}


x86 assembly (clang, -O0):
<c_hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <c_hash_string+0x4a>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <c_hash_string+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <c_hash_string+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movzbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <c_hash_string+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @c_hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = zext i8 %5 to i32
%10 = xor i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ value;

/* Variables and functions */
int CHAR_BIT;
unsigned int rotl(unsigned int value, int shift) {
  return (value << shift) | (value >> (sizeof(value) * CHAR_BIT - shift));
}


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    0x2ec4(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
movslq -0x8(%rbp),%rsi
sub    %rsi,%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    0x2ed3(%rip),%rdx
mov    (%rdx),%edx
shl    $0x2,%edx
sub    %esi,%edx
mov    %edx,%ecx
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @rotl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* @CHAR_BIT
%10 = sext i32 %9 to i64
%11 = mul i64 4, %10
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = sub i64 %11, %13
%15 = trunc i64 %14 to i32
%16 = lshr i32 %8, %15
%17 = or i32 %7, %16
ret i32 %17
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = load i32, i32* @CHAR_BIT
%5 = shl i32 %4, 2
%6 = sub i32 %5, %1
%7 = lshr i32 %0, %6
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmpfunc(const void *a, const void *b) {
  const char **ia = (const char **)a;
  const char **ib = (const char **)b;
  return strcmp(*ia, *ib);
}


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

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

LLVM IR (-O0):
define i32 @cmpfunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmpfunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hlp_endianness(void) {
  printf("LE\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"LE\00"
define i32 @hlp_endianness() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void swap(char **one, char **two) {
  char *tmp = *one;
  *one = *two;
  *two = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
/* Variables and functions */
scalar_t__ __cmpdf2(long, long);
int __gtdf2(long long a1, long long a2) {
  return __cmpdf2((long)a1, (long)a2) > 0;
}


x86 assembly (clang, -O0):
<__gtdf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__cmpdf2@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__gtdf2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @__cmpdf2(i64 %5, i64 %6)
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @__gtdf2(i64 %0, i64 %1) {
%3 = tail call i64 @__cmpdf2(i64 %0, i64 %1)
%4 = icmp sgt i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int introspect_enter_PEMU() { return 192; }


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

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

LLVM IR (-O0):
define i32 @introspect_enter_PEMU() {
ret i32 192
}

LLVM IR (-O2):
define i32 @introspect_enter_PEMU() {
ret i32 192
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint16_t;

/* Variables and functions */
uint16_t rdd08sdp_get_format(const uint16_t *p_rdd08) { return p_rdd08[3]; }


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

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

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

LLVM IR (-O2):
define i32 @rdd08sdp_get_format(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
int func1() {
  int i = 6;
  return i;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func1() {
%1 = alloca i32
store i32 6, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func1() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_status_header(void) {
  fprintf(stderr, "              Thrds Block/kB File/GB Time/sec Done/MB IOPS  "
                  " Byte rate  Progress\n");
}


x86 assembly (clang, -O0):
<print_status_header>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_status_header>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [82 x i8] c" Thrds Block/kB File/GB Time/sec Done/MB IOPS Byte rate Progress\0A\00"
define void @print_status_header() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [82 x i8] c" Thrds Block/kB File/GB Time/sec Done/MB IOPS Byte rate Progress\0A\00"
define void @print_status_header() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_pow10f();
scalar_t__ pow10f(float);
void test_pow10f(float f) {
  if (pow10f(f) != pow10f(f))
    link_failure_pow10f();
}


x86 assembly (clang, -O0):
<test_pow10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <pow10f@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <pow10f@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_pow10f+0x3c>
mov    $0x0,%al
call   1030 <link_failure_pow10f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pow10f>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1040 <pow10f@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1040 <pow10f@plt>
cmp    %rax,%rbx
jne    1149 <test_pow10f+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_pow10f@plt>

LLVM IR (-O0):
define void @test_pow10f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @pow10f(float %3)
%5 = load float, float* %2
%6 = call i64 @pow10f(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_pow10f()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_pow10f(float %0) {
%2 = tail call i64 @pow10f(float %0)
%3 = tail call i64 @pow10f(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_pow10f()
br label %7
7: ; preds = %5, %1
ret void
}
int add(int x, int y) {
  int aresult;
  aresult = (x + y);
  return aresult;
}


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int jlis_inner(int *, int, int, int *, int, int);
int jlis(int *a, int aSize, int aIdx, int *b, int bSize, int bIdx) {
  return jlis_inner(a, aSize, -1, b, bSize, -1);
}


x86 assembly (clang, -O0):
<jlis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0xffffffff,%r9d
mov    %r9d,%edx
call   1030 <jlis_inner@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jlis>:
mov    $0xffffffff,%edx
mov    $0xffffffff,%r9d
jmp    1030 <jlis_inner@plt>

LLVM IR (-O0):
define i32 @jlis(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** %10
%16 = load i32, i32* %11
%17 = call i32 @jlis_inner(i32* %13, i32 %14, i32 -1, i32* %15, i32 %16, i32 -1)
ret i32 %17
}

LLVM IR (-O2):
define i32 @jlis(i32* %0, i32 %1, i32 %2, i32* %3, i32 %4, i32 %5) {
%7 = tail call i32 @jlis_inner(i32* %0, i32 %1, i32 -1, i32* %3, i32 %4, i32 -1)
ret i32 %7
}
/* Type definitions */
struct extent_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ btrfs_set_lock_blocking_rw(struct extent_buffer *, int);
void btrfs_set_lock_blocking(struct extent_buffer *eb) {
  btrfs_set_lock_blocking_rw(eb, 1);
}


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

x86 assembly (clang, -O2):
<btrfs_set_lock_blocking>:
mov    $0x1,%esi
jmp    1030 <btrfs_set_lock_blocking_rw@plt>

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

LLVM IR (-O2):
%struct.extent_buffer = type { i32 }
define void @btrfs_set_lock_blocking(%struct.extent_buffer* %0) {
%2 = tail call i32 @btrfs_set_lock_blocking_rw(%struct.extent_buffer* %0, i32 1)
ret void
}
float int_as_float(int i) {
  union {
    int i;
    float f;
  } u;
  u.i = i;
  return u.f;
}


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

x86 assembly (clang, -O2):
<int_as_float>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @int_as_float(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @int_as_float(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
unsigned int addReverse(unsigned int added) {
  unsigned int reverse = 0, temp = added;
  while (temp != 0) {
    reverse *= 10;
    reverse += temp % 10;
    temp /= 10;
  }
  return added + reverse;
}


x86 assembly (clang, -O0):
<addReverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114b <addReverse+0x4b>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
jmp    1114 <addReverse+0x14>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addReverse>:
xor    %eax,%eax
test   %edi,%edi
je     1133 <addReverse+0x33>
mov    $0xcccccccd,%r8d
mov    %edi,%edx
xchg   %ax,%ax
lea    (%rax,%rax,4),%r9d
mov    %edx,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %edx,%eax
sub    %ecx,%eax
lea    (%rax,%r9,2),%eax
cmp    $0x9,%edx
mov    %esi,%edx
ja     1110 <addReverse+0x10>
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @addReverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = mul i32 %5, 10
%7 = urem i32 %4, 10
%8 = add i32 %7, %6
%9 = udiv i32 %4, 10
%10 = icmp ult i32 %4, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
%13 = add i32 %12, %0
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ __NR_getcpu;
long syscall(int /*<<< orphan*/, unsigned int *, unsigned int *, void *);
long sys_getcpu(unsigned *cpu, unsigned *node, void *cache) {
  return syscall(__NR_getcpu, cpu, node, cache);
}


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

x86 assembly (clang, -O2):
<sys_getcpu>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@__NR_getcpu = global i32 0
define i64 @sys_getcpu(i32* %0, i32* %1, i8* %2) {
%4 = load i32, i32* @__NR_getcpu
%5 = tail call i64 @syscall(i32 %4, i32* %0, i32* %1, i8* %2)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test(int M, int N) {
  int i, j;
  i = 2 * M;
  j = N + 2;
  {
    hash(1);
    hash(2 * M);
    hash(N + 2);
  };
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
add    $0x2,%edi
call   1030 <hash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%edi
call   1030 <hash@plt>
add    %ebp,%ebp
mov    %ebp,%edi
call   1030 <hash@plt>
add    $0x2,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <hash@plt>

LLVM IR (-O0):
define void @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = mul nsw i32 2, %7
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 2
store i32 %10, i32* %6
%11 = call i32 @hash(i32 1)
%12 = load i32, i32* %3
%13 = mul nsw i32 2, %12
%14 = call i32 @hash(i32 %13)
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 2
%17 = call i32 @hash(i32 %16)
ret void
}

LLVM IR (-O2):
define void @test(i32 %0, i32 %1) {
%3 = tail call i32 @hash(i32 1)
%4 = shl nsw i32 %0, 1
%5 = tail call i32 @hash(i32 %4)
%6 = add nsw i32 %1, 2
%7 = tail call i32 @hash(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void hook_entry(char *a) { puts("Hook foo success"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Hook foo success\00"
define void @hook_entry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Hook foo success\00"
define void @hook_entry(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
void swapstring(char *foo, int doit) {
  if (doit) {
    char a = foo[0], b = foo[1], c = foo[2], d = foo[3];
    foo[0] = d;
    foo[1] = c;
    foo[2] = b;
    foo[3] = a;
  }
}


x86 assembly (clang, -O0):
<swapstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1163 <swapstring+0x63>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0xf(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x10(%rbp)
mov    -0x10(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xf(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xe(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapstring>:
test   %esi,%esi
je     111c <swapstring+0x1c>
mov    (%rdi),%sil
mov    0x1(%rdi),%cl
mov    0x2(%rdi),%dl
mov    0x3(%rdi),%al
mov    %al,(%rdi)
mov    %dl,0x1(%rdi)
mov    %cl,0x2(%rdi)
mov    %sil,0x3(%rdi)
ret

LLVM IR (-O0):
define void @swapstring(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %36
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
store i8 %14, i8* %5
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
store i8 %17, i8* %6
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
store i8 %20, i8* %7
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
store i8 %23, i8* %8
%24 = load i8, i8* %8
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 0
store i8 %24, i8* %26
%27 = load i8, i8* %7
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 1
store i8 %27, i8* %29
%30 = load i8, i8* %6
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i64 2
store i8 %30, i8* %32
%33 = load i8, i8* %5
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i64 3
store i8 %33, i8* %35
br label %36
36: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @swapstring(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
store i8 %11, i8* %0
store i8 %9, i8* %6
store i8 %7, i8* %8
store i8 %5, i8* %10
br label %12
12: ; preds = %4, %2
ret void
}
void SHA384_Update(void) {}


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

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

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

LLVM IR (-O2):
define void @SHA384_Update() {
ret void
}