xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ web_child(int);
void *doit(void *arg) {
  int connfd = *((int *)arg);
  pthread_detach(pthread_self());
  web_child(connfd);
  close(connfd);
  return NULL;
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <pthread_detach@plt>
mov    -0xc(%rbp),%edi
call   1040 <web_child@plt>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit>:
push   %rbx
mov    (%rdi),%ebx
xor    %eax,%eax
call   1060 <pthread_self@plt>
mov    %eax,%edi
call   1050 <pthread_detach@plt>
mov    %ebx,%edi
call   1040 <web_child@plt>
mov    %ebx,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @doit(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = call i32 (...) @pthread_self()
%8 = call i32 @pthread_detach(i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @web_child(i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @close(i32 %11)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @doit(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 (...) @pthread_self()
%5 = tail call i32 @pthread_detach(i32 %4)
%6 = tail call i32 @web_child(i32 %3)
%7 = tail call i32 @close(i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void newLine() { putchar('\n'); }


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

x86 assembly (clang, -O2):
<newLine>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @newLine() {
%1 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @newLine() {
%1 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint16_t add8to16(uint8_t i, uint16_t j) {
  uint16_t t = i + j;
  return t;
}


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

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

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

LLVM IR (-O2):
define i64 @add8to16(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void innerDoTreeStuff(int letGcFree) {
  int i;
  printf("inserting...\n");
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"inserting...\00"
define void @innerDoTreeStuff(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long long __crc32q(unsigned long long, unsigned long long);
unsigned long long test__crc32q(unsigned long long CRC, unsigned long long V) {
  return __crc32q(CRC, V);
}


x86 assembly (clang, -O0):
<test__crc32q>:
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 <__crc32q@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test__crc32q>:
jmp    1030 <__crc32q@plt>

LLVM IR (-O0):
define i64 @test__crc32q(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 @__crc32q(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @test__crc32q(i64 %0, i64 %1) {
%3 = tail call i64 @__crc32q(i64 %0, i64 %1)
ret i64 %3
}
int begin(int i) {
  if (i)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<begin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <begin+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1124 <begin+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<begin>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @begin(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
long long _random_longlong_func(long, long);
long long AMCRandomLongLong(long min, long max) {
  return _random_longlong_func(min, max);
}


x86 assembly (clang, -O0):
<AMCRandomLongLong>:
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 <_random_longlong_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMCRandomLongLong>:
jmp    1030 <_random_longlong_func@plt>

LLVM IR (-O0):
define i64 @AMCRandomLongLong(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 @_random_longlong_func(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @AMCRandomLongLong(i64 %0, i64 %1) {
%3 = tail call i64 @_random_longlong_func(i64 %0, i64 %1)
ret i64 %3
}
int boot_marker_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @boot_marker_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x47() {
  Assert_real((isgraph(71)),
              "/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_isgraph.c",
              360, ("isgraph should be 1 for G"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x47>:
push   %rbp
mov    %rsp,%rbp
mov    $0x47,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x168,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x47>:
push   %rax
mov    $0x47,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x168,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for G\00"
define void @t_isgraph_0x47() {
%1 = call i32 @isgraph(i32 71)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for G\00"
define void @t_isgraph_0x47() {
%1 = tail call i32 @isgraph(i32 71)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 360, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_63uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x63 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_63uint64_lowword_reg>:
test   $0x63,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

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

/* Variables and functions */
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   void *(*)(void *), int /*<<< orphan*/ *);
int piThreadCreate(void *(*fn)(void *)) {
  pthread_t myThread;
  return pthread_create(&myThread, NULL, fn, NULL);
}


x86 assembly (clang, -O0):
<piThreadCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
call   1030 <pthread_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piThreadCreate>:
push   %rax
mov    %rdi,%rdx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <pthread_create@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @piThreadCreate(i8* (i8*)* %0) {
%2 = alloca i8* (i8*)*
%3 = alloca i32
store i8* (i8*)* %0, i8* (i8*)** %2
%4 = load i8* (i8*)*, i8* (i8*)** %2
%5 = call i32 @pthread_create(i32* %3, i32* null, i8* (i8*)* %4, i32* null)
ret i32 %5
}

LLVM IR (-O2):
define i32 @piThreadCreate(i8* (i8*)* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @pthread_create(i32* %2, i32* null, i8* (i8*)* %0, i32* null)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int main(void) {
  while (true) {
    uint32_t btn2 = *((volatile uint32_t *)0x20060000) & 1;
    *((volatile uint32_t *)0x20060000) = (btn2 << 1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x20060000,%eax
mov    (%rax),%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
mov    $0x20060000,%eax
mov    %ecx,(%rax)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
mov    0x20060000,%eax
add    %eax,%eax
and    $0x2,%eax
mov    %eax,0x20060000
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = load volatile i32, i32* inttoptr (i64 537264128 to i32*)
%5 = and i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = shl i32 %6, 1
store volatile i32 %7, i32* inttoptr (i64 537264128 to i32*)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = load volatile i32, i32* inttoptr (i64 537264128 to i32*)
%3 = shl i32 %2, 1
%4 = and i32 %3, 2
store volatile i32 %4, i32* inttoptr (i64 537264128 to i32*)
br label %1
}
int string_char_count(char *str, char c) {
  int count = 0;
  while (1) {
    char x = *str++;
    if (x == '\0') {
      break;
    }
    if (x == c) {
      ++count;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<string_char_count>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    113b <string_char_count+0x3b>
jmp    1159 <string_char_count+0x59>
movsbl -0x11(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1154 <string_char_count+0x54>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <string_char_count+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_char_count>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%eax
movzbl (%rdi),%edx
add    $0x1,%rdi
xor    %ecx,%ecx
cmp    %sil,%dl
sete   %cl
add    %eax,%ecx
test   %dl,%dl
jne    1110 <string_char_count+0x10>
ret

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

LLVM IR (-O2):
define i32 @string_char_count(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %11, %3 ]
%5 = phi i8* [ %0, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = icmp eq i8 %7, 0
%9 = icmp eq i8 %7, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %4, %10
br i1 %8, label %12, label %3
12: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int unlink(char const *);
int deleteFile(const char *path) { return unlink(path); }


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

x86 assembly (clang, -O2):
<deleteFile>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @deleteFile(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
void XkbAllocGeomSections() {}


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

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

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

LLVM IR (-O2):
define void @XkbAllocGeomSections() {
ret void
}
void f(char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @f(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int oom_adj_to_oom_score_adj(int);
int oom_score_adj_conversion_value_tests(void) {
  return oom_adj_to_oom_score_adj(15) != 1000 ||
         oom_adj_to_oom_score_adj(-17) != -1000;
}


x86 assembly (clang, -O0):
<oom_score_adj_conversion_value_tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xf,%edi
call   1030 <oom_adj_to_oom_score_adj@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x3e8,%ecx
mov    %al,-0x1(%rbp)
jne    114a <oom_score_adj_conversion_value_tests+0x3a>
mov    $0xffffffef,%edi
call   1030 <oom_adj_to_oom_score_adj@plt>
cmp    $0xfffffc18,%eax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oom_score_adj_conversion_value_tests>:
push   %rax
mov    $0xf,%edi
call   1030 <oom_adj_to_oom_score_adj@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x3e8,%ecx
jne    1141 <oom_score_adj_conversion_value_tests+0x31>
mov    $0xffffffef,%edi
call   1030 <oom_adj_to_oom_score_adj@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xfffffc18,%ecx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @oom_score_adj_conversion_value_tests() {
%1 = call i32 @oom_adj_to_oom_score_adj(i32 15)
%2 = icmp ne i32 %1, 1000
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 @oom_adj_to_oom_score_adj(i32 -17)
%5 = icmp ne i32 %4, -1000
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @oom_score_adj_conversion_value_tests() {
%1 = tail call i32 @oom_adj_to_oom_score_adj(i32 15)
%2 = icmp eq i32 %1, 1000
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @oom_adj_to_oom_score_adj(i32 -17)
%5 = icmp ne i32 %4, -1000
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t md5_I(uint32_t x, uint32_t y, uint32_t z) { return (y ^ (x | (~z))); }


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

x86 assembly (clang, -O2):
<md5_I>:
mov    %edx,%eax
not    %eax
or     %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @md5_I(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = xor i32 %9, -1
%11 = or i32 %8, %10
%12 = xor i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @md5_I(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = or i32 %4, %0
%6 = xor i32 %5, %1
ret i32 %6
}
int get_salt_size(void) { return 25; }


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

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

LLVM IR (-O0):
define i32 @get_salt_size() {
ret i32 25
}

LLVM IR (-O2):
define i32 @get_salt_size() {
ret i32 25
}
/* Variables and functions */
int byteswap(int);
int writedata(size_t, void *);
int writeblock(size_t count, void *data) {
  int x;
  int y = byteswap((int)count);
  x = writedata(sizeof(int), &y);
  if (x == (1))
    x = writedata(count, data);
  return (x);
}


x86 assembly (clang, -O0):
<writeblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <byteswap@plt>
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rsi
mov    $0x4,%edi
call   1030 <writedata@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1169 <writeblock+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <writedata@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeblock>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <byteswap@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edi
call   1030 <writedata@plt>
cmp    $0x1,%eax
jne    1152 <writeblock+0x32>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <writedata@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @writeblock(i64 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = trunc i64 %0 to i32
%6 = tail call i32 @byteswap(i32 %5)
store i32 %6, i32* %3
%7 = call i32 @writedata(i64 4, i8* %4)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @writedata(i64 %0, i8* %1)
br label %11
11: ; preds = %9, %2
%12 = phi i32 [ %10, %9 ], [ %7, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  for (;;) {
    printf("two\n");
    for (int i = 0; i < 100000000; ++i) {
    }
  }
  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>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5f5e100,-0x8(%rbp)
jge    1152 <main+0x42>
jmp    1144 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <main+0x22>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@str = [4 x i8] c"two\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void printUsage() {
  fprintf(stdout,
          "Usage: tee [OPTION]... [FILE]... \n      Copy standard input to "
          "each FILE, and also to standard output.\n      \n      OPTIONS: \n  "
          "    -a To append to the file\n      -i ignore interrupt\n      -h "
          "help\n\n      If file is - it is written to stdout\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [242 x i8] c"Usage: tee [OPTION]... [FILE]... \0A Copy standard input to each FILE, and also to standard output.\0A \0A OPTIONS: \0A -a To append to the file\0A -i ignore interrupt\0A -h help\0A\0A If file is - it is written to stdout\0A\00"
@EXIT_SUCCESS = global i32 0
define void @printUsage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([242 x i8], [242 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [242 x i8] c"Usage: tee [OPTION]... [FILE]... \0A Copy standard input to each FILE, and also to standard output.\0A \0A OPTIONS: \0A -a To append to the file\0A -i ignore interrupt\0A -h help\0A\0A If file is - it is written to stdout\0A\00"
@EXIT_SUCCESS = global i32 0
define void @printUsage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([242 x i8], [242 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int compare_uint64_t(const uint64_t *lhs, const uint64_t *rhs) {
  assert(lhs != NULL && rhs != NULL);
  return (((*lhs) > (*rhs)) - ((*lhs) < (*rhs)));
}


x86 assembly (clang, -O0):
<compare_uint64_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     113b <compare_uint64_t+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%rcx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_uint64_t>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    (%rbx),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%r14),%rcx
setg   %al
setl   %dl
sub    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @compare_uint64_t(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 = icmp ne i64* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64*, i64** %4
%9 = icmp ne i64* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64*, i64** %3
%15 = load i64, i64* %14
%16 = load i64*, i64** %4
%17 = load i64, i64* %16
%18 = icmp sgt i64 %15, %17
%19 = zext i1 %18 to i32
%20 = load i64*, i64** %3
%21 = load i64, i64* %20
%22 = load i64*, i64** %4
%23 = load i64, i64* %22
%24 = icmp slt i64 %21, %23
%25 = zext i1 %24 to i32
%26 = sub nsw i32 %19, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @compare_uint64_t(i64* %0, i64* %1) {
%3 = icmp ne i64* %0, null
%4 = icmp ne i64* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = load i64, i64* %0
%9 = load i64, i64* %1
%10 = icmp sgt i64 %8, %9
%11 = zext i1 %10 to i32
%12 = icmp slt i64 %8, %9
%13 = sext i1 %12 to i32
%14 = add nsw i32 %13, %11
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t w4rev(uint32_t const x) {
  return ((0xff & (x >> (0 * 8))) << (3 * 8)) |
         ((0xff & (x >> (1 * 8))) << (2 * 8)) |
         ((0xff & (x >> (2 * 8))) << (1 * 8)) |
         ((0xff & (x >> (3 * 8))) << (0 * 8));
}


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

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

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

LLVM IR (-O2):
define i32 @w4rev(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void PKCS7_dup(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS7_dup() {
ret void
}
/* Variables and functions */
size_t rnd();
size_t randomSize(int i) {
  size_t maxSize = 2 * 160 * 0x2000;
  return rnd() %
             ((((maxSize >> (i / 10))) > (2)) ? ((maxSize >> (i / 10))) : (2)) +
         1;
}


x86 assembly (clang, -O0):
<randomSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x280000,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rnd@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
shr    %cl,%rax
cmp    $0x2,%rax
jbe    117d <randomSize+0x6d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,%ecx
shr    %cl,%rax
mov    %rax,-0x28(%rbp)
jmp    118b <randomSize+0x7b>
mov    $0x2,%eax
mov    %rax,-0x28(%rbp)
jmp    118b <randomSize+0x7b>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
add    $0x1,%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomSize>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rnd@plt>
movslq %ebx,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
mov    $0x280000,%edx
shr    %cl,%rdx
cmp    $0x3,%rdx
mov    $0x2,%ecx
cmovae %rdx,%rcx
mov    %rax,%rdx
shr    $0x20,%rdx
je     1159 <randomSize+0x49>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
jmp    115f <randomSize+0x4f>
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @randomSize(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 2621440, i64* %3
%4 = call i64 (...) @rnd()
%5 = load i64, i64* %3
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 10
%8 = zext i32 %7 to i64
%9 = lshr i64 %5, %8
%10 = icmp ugt i64 %9, 2
br i1 %10, label %11, label %17
11: ; preds = %1
%12 = load i64, i64* %3
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 10
%15 = zext i32 %14 to i64
%16 = lshr i64 %12, %15
br label %18
17: ; preds = %1
br label %18
18: ; preds = %17, %11
%19 = phi i64 [ %16, %11 ], [ 2, %17 ]
%20 = urem i64 %4, %19
%21 = add i64 %20, 1
ret i64 %21
}

LLVM IR (-O2):
define i64 @randomSize(i32 %0) {
%2 = tail call i64 (...) @rnd()
%3 = sdiv i32 %0, 10
%4 = zext i32 %3 to i64
%5 = lshr i64 2621440, %4
%6 = icmp ugt i64 %5, 2
%7 = select i1 %6, i64 %5, i64 2
%8 = urem i64 %2, %7
%9 = add nuw nsw i64 %8, 1
ret i64 %9
}
int test_imm_75int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x75 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_75int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7667712
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main_visibility_checkcom() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @main_visibility_checkcom() {
ret i32 1
}
int sum(int v1, int v2) { return v1 + v2; }


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

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

LLVM IR (-O0):
define i32 @sum(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "sish: usage: sish [-c command -x]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"sish: usage: sish [-c command -x]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"sish: usage: sish [-c command -x]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ malloc(scalar_t__);
char *strcpy(int /*<<< orphan*/, char *);
scalar_t__ strlen(char *);
char *strclone(char *str) { return strcpy(malloc(strlen(str) + 1), str); }


x86 assembly (clang, -O0):
<strclone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strclone>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @strclone(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = add nsw i64 %4, 1
%6 = call i32 @malloc(i64 %5)
%7 = load i8*, i8** %2
%8 = call i8* @strcpy(i32 %6, i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @strclone(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @malloc(i64 %3)
%5 = tail call i8* @strcpy(i32 %4, i8* %0)
ret i8* %5
}
/* Variables and functions */
char *_(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  printf(_("test of string\n"));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"test of string\0A\00"
define i32 @main() {
%1 = tail call i8* @_(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) %1)
ret i32 0
}
char *add_pairtag(char *p) { return (p + 0x01); }


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

x86 assembly (clang, -O2):
<add_pairtag>:
lea    0x1(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @add_pairtag(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
void smal_buffer_write_barrier_init_os() {}


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

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

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

LLVM IR (-O2):
define void @smal_buffer_write_barrier_init_os() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hal_uart_putchar(char);
void hal_uart_putstr(char *str) {
  if (!str)
    return;
  while (*str) {
    hal_uart_putchar(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<hal_uart_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <hal_uart_putstr+0x1c>
jmp    115b <hal_uart_putstr+0x4b>
jmp    1131 <hal_uart_putstr+0x21>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <hal_uart_putstr+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <hal_uart_putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <hal_uart_putstr+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hal_uart_putstr>:
push   %rbx
test   %rdi,%rdi
je     1143 <hal_uart_putstr+0x33>
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <hal_uart_putstr+0x33>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <hal_uart_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <hal_uart_putstr+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @hal_uart_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call i32 @hal_uart_putchar(i8 signext %7)
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
char *get_tz_name() { return "UTC"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"UTC\00"
define i8* @get_tz_name() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"UTC\00"
define i8* @get_tz_name() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ __iopl(int);
int main() {
  __iopl(3);
  __iopl(-1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__iopl(i32 3)
%2 = tail call i32 @__iopl(i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long num1, sum1 = 0, sum2 = 0, i, ans;
  for (i = 1; i <= 100; i++) {
    sum1 = sum1 + (i * i);
    sum2 = sum2 + i;
  }
  ans = sum2 * sum2 - sum1;
  printf("%u", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
cmpq   $0x64,-0x28(%rbp)
ja     1173 <main+0x63>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
imul   -0x28(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1137 <main+0x27>
mov    -0x20(%rbp),%rax
imul   -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %3
store i64 0, i64* %4
store i64 1, i64* %5
br label %7
7: ; preds = %19, %0
%8 = load i64, i64* %5
%9 = icmp ule i64 %8, 100
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i64, i64* %3
%12 = load i64, i64* %5
%13 = load i64, i64* %5
%14 = mul i64 %12, %13
%15 = add i64 %11, %14
store i64 %15, i64* %3
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = add i64 %16, %17
store i64 %18, i64* %4
br label %19
19: ; preds = %10
%20 = load i64, i64* %5
%21 = add i64 %20, 1
store i64 %21, i64* %5
br label %7
22: ; preds = %7
%23 = load i64, i64* %4
%24 = load i64, i64* %4
%25 = mul i64 %23, %24
%26 = load i64, i64* %3
%27 = sub i64 %25, %26
store i64 %27, i64* %6
%28 = load i64, i64* %6
%29 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 25164150)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ send_char_usart1(char);
void send_string_usart1(char *str) {
  int i = 0;
  while (str[i] != 0) {
    send_char_usart1(str[i++]);
  }
}


x86 assembly (clang, -O0):
<send_string_usart1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <send_string_usart1+0x48>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <send_char_usart1@plt>
jmp    1123 <send_string_usart1+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_string_usart1>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <send_string_usart1+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <send_char_usart1@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <send_string_usart1+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @send_string_usart1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @send_char_usart1(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
long _random_long_func(long, long);
long AMCRandomLong(long min, long max) { return _random_long_func(min, max); }


x86 assembly (clang, -O0):
<AMCRandomLong>:
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 <_random_long_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMCRandomLong>:
jmp    1030 <_random_long_func@plt>

LLVM IR (-O0):
define i64 @AMCRandomLong(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 @_random_long_func(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @AMCRandomLong(i64 %0, i64 %1) {
%3 = tail call i64 @_random_long_func(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ _ptrc_glBindBuffer(int, int /*<<< orphan*/);
bool unbind() {
  _ptrc_glBindBuffer(0x8892, 0);
  return true;
}


x86 assembly (clang, -O0):
<unbind>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8892,%edi
xor    %esi,%esi
call   1030 <_ptrc_glBindBuffer@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unbind>:
push   %rax
mov    $0x8892,%edi
xor    %esi,%esi
call   1030 <_ptrc_glBindBuffer@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @unbind() {
%1 = call i32 @_ptrc_glBindBuffer(i32 34962, i32 0)
ret i32 1
}

LLVM IR (-O2):
define i32 @unbind() {
%1 = tail call i32 @_ptrc_glBindBuffer(i32 34962, i32 0)
ret i32 1
}