xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void raint1024() {
  printf("\nChanging Read Ahead Cache size for Internal sdcard to 1024kb\n");
  char buf[256];
  sprintf(buf, "/system/bin/sh -c %s",
          "'echo 1024 > /sys/block/mmcblk0/queue/read_ahead_kb'");
  system(buf);
}


x86 assembly (clang, -O0):
<raint1024>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xeea(%rip),%rsi
lea    0xef8(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raint1024>:
push   %rbx
sub    $0x100,%rsp
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"\0AChanging Read Ahead Cache size for Internal sdcard to 1024kb\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [53 x i8] c"'echo 1024 > /sys/block/mmcblk0/queue/read_ahead_kb'\00"
define void @raint1024() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [53 x i8] c"'echo 1024 > /sys/block/mmcblk0/queue/read_ahead_kb'\00"
@str = [62 x i8] c"\0AChanging Read Ahead Cache size for Internal sdcard to 1024kb\00"
define void @raint1024() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
void avpriv_tempfile() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_tempfile() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void malloc_error() {
  fprintf(stderr, "Malloc failed.\n");
  exit(-1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Malloc failed.\0A\00"
define void @malloc_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int Cyc_Port_hash_seg_t(unsigned loc) { return (int)loc; }


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

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

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

LLVM IR (-O2):
define i32 @Cyc_Port_hash_seg_t(i32 returned %0) {
ret i32 %0
}
void move_cursor(row, col) int row, col;
{ (void)move(row, col); }


x86 assembly (clang, -O0):
<move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <move@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @move_cursor(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 = call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @move_cursor(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @move to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage:\n");
  printf("b {remote ip}\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [15 x i8] c"b {remote ip}\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"usage:\00"
@str.2 = [14 x i8] c"b {remote ip}\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void Error(const char *display, const char *msg) {
  fprintf(stderr, "Error on display %s - %s\n", display, msg);
  exit(1);
}


x86 assembly (clang, -O0):
<Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Error>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Error on display %s - %s\0A\00"
define void @Error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Error on display %s - %s\0A\00"
define void @Error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ tf(void *, void *, int);
void __attribute__((no_instrument_function))
__cyg_profile_func_exit(void *this, void *callsite) {
  tf(this, callsite, 1);
}


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

x86 assembly (clang, -O2):
<__cyg_profile_func_exit>:
mov    $0x1,%edx
jmp    1030 <tf@plt>

LLVM IR (-O0):
define void @__cyg_profile_func_exit(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 @tf(i8* %5, i8* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @__cyg_profile_func_exit(i8* %0, i8* %1) {
%3 = tail call i32 @tf(i8* %0, i8* %1, i32 1)
ret void
}
unsigned int unpackShort(const void *data) {
  return (unsigned int)(((const unsigned char *)data)[0] << 8) |
         (((const unsigned char *)data)[1]);
}


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

x86 assembly (clang, -O2):
<unpackShort>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @unpackShort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @unpackShort(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
void SIO1_writeBaud32(unsigned long val) {}


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

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

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

LLVM IR (-O2):
define void @SIO1_writeBaud32(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
void replace(int desc, int target) {
  close(target);
  dup2(desc, target);
  close(desc);
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <dup2@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @replace(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @close(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @dup2(i32 %7, i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @close(i32 %10)
ret void
}

LLVM IR (-O2):
define void @replace(i32 %0, i32 %1) {
%3 = tail call i32 @close(i32 %1)
%4 = tail call i32 @dup2(i32 %0, i32 %1)
%5 = tail call i32 @close(i32 %0)
ret void
}
int main() {
  unsigned long t1 = (unsigned long)1L;
  unsigned long t2 = 1L;
  return t1 + t2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %2
store i64 1, i64* %3
%4 = load i64, i64* %2
%5 = load i64, i64* %3
%6 = add i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
main() {
  int n = 10;
  int *m = 100;
  printf("%d", m);
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 10, i32* %1
store i32* inttoptr (i64 100 to i32*), i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* inttoptr (i64 100 to i32*))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void instruction_bus_error_handler() {
  printf("\n #####> Exiting on instruction bus error !!\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<instruction_bus_error_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<instruction_bus_error_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"\0A #####> Exiting on instruction bus error !!\0A\00"
define void @instruction_bus_error_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [45 x i8] c"\0A #####> Exiting on instruction bus error !!\00"
define void @instruction_bus_error_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __dup(int fd) {
  __set_errno(ENOSYS);
  return -1;
}


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

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

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__dup(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int ne_hash_str_comp(const void *a, const void *b) {
  return !strcmp((const char *)a, (const char *)b);
}


x86 assembly (clang, -O0):
<ne_hash_str_comp>:
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 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ne_hash_str_comp(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 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ne_hash_str_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void unsetenv(const char *name __attribute__((unused))) { assert(0); }


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

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

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

LLVM IR (-O2):
define void @unsetenv(i8* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
void outw_p(unsigned short value, unsigned short port) {
  __asm__ __volatile__("out"
                       "w"
                       " %"
                       "w"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "Nd"(port));
  slow_down_io();
}


x86 assembly (clang, -O0):
<outw_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
mov    $0x0,%al
call   1030 <slow_down_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
xor    %eax,%eax
jmp    1030 <slow_down_io@plt>

LLVM IR (-O0):
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = call i32 (...) @slow_down_io()
ret void
}

LLVM IR (-O2):
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
%3 = tail call i32 (...) @slow_down_io()
ret void
}
/* Type definitions */
typedef scalar_t__ int_fast32_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_int_fast32_t(int_fast32_t const k1,
                                           int_fast32_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_int_fast32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_int_fast32_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int_fast32_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 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int_fast32_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int main(int argc, char *argv[]) {
  long sum, sumOfSquares;
  sum = 100 * (100 - 1) / 2;
  sumOfSquares = (100 * (100 + 1) * (2 * 100 + 1)) / 6;
  printf("Difference: %ld\n", sum * sum - sumOfSquares);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1356,-0x18(%rbp)
movq   $0x529ae,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
imul   -0x18(%rbp),%rsi
sub    -0x20(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"Difference: %ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 24164150)
ret i32 0
}
unsigned long long rdtsc_oai(void) {
  unsigned long long a, d;
  __asm__ volatile("rdtsc" : "=a"(a), "=d"(d));
  return (d << 32) | a;
}


x86 assembly (clang, -O0):
<rdtsc_oai>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
or     -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc_oai>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc_oai() {
%1 = alloca i64
%2 = alloca i64
%3 = call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %1
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = shl i64 %6, 32
%8 = load i64, i64* %1
%9 = or i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @rdtsc_oai() {
%1 = tail call { i64, i64 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = shl i64 %3, 32
%5 = or i64 %4, %2
ret i64 %5
}
int __sys_readc(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__sys_readc() {
ret i32 0
}
/* Variables and functions */
scalar_t__ Exponential(double);
double Erlang(long n, double b) {
  long i;
  double x = 0.0;
  for (i = 0; i < n; i++)
    x += Exponential(b);
  return (x);
}


x86 assembly (clang, -O0):
<Erlang>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1169 <Erlang+0x59>
movsd  -0x10(%rbp),%xmm0
call   1030 <Exponential@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1131 <Erlang+0x21>
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Erlang>:
push   %rbx
sub    $0x10,%rsp
test   %rdi,%rdi
jle    115a <Erlang+0x4a>
mov    %rdi,%rbx
xorpd  %xmm1,%xmm1
movsd  %xmm0,(%rsp)
cs nopw 0x0(%rax,%rax,1)
movsd  %xmm1,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1030 <Exponential@plt>
movsd  0x8(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  %xmm0,%xmm1
add    $0xffffffffffffffff,%rbx
jne    1130 <Erlang+0x20>
jmp    115e <Erlang+0x4e>
xorpd  %xmm1,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @Erlang(i64 %0, double %1) {
%3 = alloca i64
%4 = alloca double
%5 = alloca i64
%6 = alloca double
store i64 %0, i64* %3
store double %1, double* %4
store double 0.000000e+00, double* %6
store i64 0, i64* %5
br label %7
7: ; preds = %17, %2
%8 = load i64, i64* %5
%9 = load i64, i64* %3
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load double, double* %4
%13 = call i64 @Exponential(double %12)
%14 = sitofp i64 %13 to double
%15 = load double, double* %6
%16 = fadd double %15, %14
store double %16, double* %6
br label %17
17: ; preds = %11
%18 = load i64, i64* %5
%19 = add nsw i64 %18, 1
store i64 %19, i64* %5
br label %7
20: ; preds = %7
%21 = load double, double* %6
ret double %21
}

LLVM IR (-O2):
define double @Erlang(i64 %0, double %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi double [ %9, %4 ], [ 0.000000e+00, %2 ]
%6 = phi i64 [ %10, %4 ], [ 0, %2 ]
%7 = tail call i64 @Exponential(double %1)
%8 = sitofp i64 %7 to double
%9 = fadd double %5, %8
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, %0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi double [ 0.000000e+00, %2 ], [ %9, %4 ]
ret double %13
}
double foo(double a) { return ((double)0.12 - a); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.200000e-01, %3
ret double %4
}

LLVM IR (-O2):
define double @foo(double %0) {
%2 = fsub double 1.200000e-01, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ dev_write(int, unsigned char *, int);
void dev_reset(int devfd) {
  unsigned char c = 0xFF;
  dev_write(devfd, &c, 1);
}


x86 assembly (clang, -O0):
<dev_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0xff,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <dev_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_reset>:
push   %rax
movb   $0xff,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <dev_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @dev_reset(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 -1, i8* %3
%4 = load i32, i32* %2
%5 = call i32 @dev_write(i32 %4, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @dev_reset(i32 %0) {
%2 = alloca i8
store i8 -1, i8* %2
%3 = call i32 @dev_write(i32 %0, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ supcon_putc(char);
int printf_buffer(int i) {
  int j;
  if (i <= 0)
    return 0;
  for (j = 0; j < i; j++)
    supcon_putc(' ');
  return 0;
}


x86 assembly (clang, -O0):
<printf_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <printf_buffer+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1163 <printf_buffer+0x53>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115c <printf_buffer+0x4c>
mov    $0x20,%edi
call   1030 <supcon_putc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <printf_buffer+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_buffer>:
push   %rbx
test   %edi,%edi
jle    112f <printf_buffer+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <supcon_putc@plt>
add    $0xffffffff,%ebx
jne    1120 <printf_buffer+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @printf_buffer(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @supcon_putc(i8 signext 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 0
}
int compareints(const void *a, const void *b) {
  return (*(int *)a > *(int *)b) - (*(int *)a < *(int *)b);
}


x86 assembly (clang, -O0):
<compareints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareints>:
mov    (%rdi),%ecx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%ecx
setg   %al
setl   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compareints(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %17
%19 = icmp slt i32 %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @compareints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i32 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ sesc_preevent(int, int, void *);
void sesc_preevent_(int vaddr, int type, void *sptr) {
  sesc_preevent(vaddr, type, sptr);
}


x86 assembly (clang, -O0):
<sesc_preevent_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <sesc_preevent@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sesc_preevent_>:
jmp    1030 <sesc_preevent@plt>

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

LLVM IR (-O2):
define void @sesc_preevent_(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @sesc_preevent(i32 %0, i32 %1, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putbit(int /*<<< orphan*/ *, int);
void puteol(FILE *fp) {
  int i;
  for (i = 0; i < 11; ++i)
    putbit(fp, 0);
  putbit(fp, 1);
}


x86 assembly (clang, -O0):
<puteol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xb,-0xc(%rbp)
jge    1146 <puteol+0x36>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <puteol+0x13>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <putbit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puteol>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <putbit@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <putbit@plt>

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

LLVM IR (-O2):
define void @puteol(i32* %0) {
%2 = tail call i32 @putbit(i32* %0, i32 0)
%3 = tail call i32 @putbit(i32* %0, i32 0)
%4 = tail call i32 @putbit(i32* %0, i32 0)
%5 = tail call i32 @putbit(i32* %0, i32 0)
%6 = tail call i32 @putbit(i32* %0, i32 0)
%7 = tail call i32 @putbit(i32* %0, i32 0)
%8 = tail call i32 @putbit(i32* %0, i32 0)
%9 = tail call i32 @putbit(i32* %0, i32 0)
%10 = tail call i32 @putbit(i32* %0, i32 0)
%11 = tail call i32 @putbit(i32* %0, i32 0)
%12 = tail call i32 @putbit(i32* %0, i32 0)
%13 = tail call i32 @putbit(i32* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xterm();
int /*<<< orphan*/ xterms();
void express() {
  xterm();
  xterms();
}


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

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

LLVM IR (-O0):
define void @express() {
%1 = call i32 (...) @xterm()
%2 = call i32 (...) @xterms()
ret void
}

LLVM IR (-O2):
define void @express() {
%1 = tail call i32 (...) @xterm()
%2 = tail call i32 (...) @xterms()
ret void
}
void prkalc(course, dist) int course;
double dist;
{ printf(": course %d  dist %.3f\n", course, dist); }


x86 assembly (clang, -O0):
<prkalc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%esi
movsd  -0x10(%rbp),%xmm0
lea    0xed1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prkalc>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
mov    $0x1,%al
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c": course %d dist %.3f\0A\00"
define void @prkalc(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = load double, double* %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5, double %6)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c": course %d dist %.3f\0A\00"
define void @prkalc(i32 %0, double %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %0, double %1)
ret void
}
indreg0reg1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*p0) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jg     113d <indreg0reg1+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <indreg0reg1+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0reg1>:
movzbl (%r8),%ecx
movzbl %sil,%edx
xor    %eax,%eax
cmp    %ecx,%edx
setae  %al
ret

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

LLVM IR (-O2):
define i32 @indreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = and i32 %1, 255
%10 = icmp uge i32 %9, %8
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strdup1(char *s) {
  char *p;
  p = (char *)malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<strdup1>:
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    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup1+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup1+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @strdup1(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
void my_f1(int array[]) {}


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

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

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

LLVM IR (-O2):
define void @my_f1(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void ne_eq(unsigned a) {
  char *b = ((void *)0);
  if (a != -1U)
    b = malloc(1);
  if (a + 1 == 0)
    return;
  if (a - 1 == -1U - 1)
    return;
  free(b);
}


x86 assembly (clang, -O0):
<ne_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     114b <ne_eq+0x2b>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
jne    115f <ne_eq+0x3f>
jmp    117c <ne_eq+0x5c>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cmp    $0xfffffffe,%eax
jne    1173 <ne_eq+0x53>
jmp    117c <ne_eq+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_eq>:
cmp    $0xffffffff,%edi
je     1139 <ne_eq+0x19>
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @ne_eq(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%5 = tail call i32 @free(i8* %4)
br label %6
6: ; preds = %1, %3
ret void
}
__attribute__((always_)) int string_isspace(char const a) {
  return (((a == 0x20) || (a == 0x0d) || (a == 0x0a)) ? 1 : 0);
}


x86 assembly (clang, -O0):
<string_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <string_isspace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x2(%rbp)
je     113b <string_isspace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_isspace>:
mov    $0x1,%eax
cmp    $0xd,%dil
je     1111 <string_isspace+0x11>
cmp    $0x20,%dil
jne    1112 <string_isspace+0x12>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @string_isspace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 13
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
ret i32 %17
}

LLVM IR (-O2):
define i32 @string_isspace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 13, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
int stack_pushint(int ret) {
  int (*signature)(int);
  *((int *)(&signature)) = 0x080A9A3C;
  return signature(ret);
}


x86 assembly (clang, -O0):
<stack_pushint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x80a9a3c,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_pushint>:
mov    $0x80a9a3c,%eax
jmp    *%rax

LLVM IR (-O0):
define i32 @stack_pushint(i32 %0) {
%2 = alloca i32
%3 = alloca i32 (i32)*
store i32 %0, i32* %2
%4 = bitcast i32 (i32)** %3 to i32*
store i32 134912572, i32* %4
%5 = load i32 (i32)*, i32 (i32)** %3
%6 = load i32, i32* %2
%7 = call i32 %5(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @stack_pushint(i32 %0) {
%2 = tail call i32 inttoptr (i64 134912572 to i32 (i32)*)(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ put_byte(int, int);
int /*<<< orphan*/ put_word(int, int);
int /*<<< orphan*/ write_ndless3x_loader(int, int);
__attribute__((always_)) void patch_CAS_3_9_0_46x_extra(void) {
  write_ndless3x_loader(1, 2);
  put_byte(0x1008817B, 0xEA);
  put_word(0x10111584, 0x00000000);
  put_word(0x1013C894, 0xE12FFF1E);
}


x86 assembly (clang, -O0):
<patch_CAS_3_9_0_46x_extra>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <write_ndless3x_loader@plt>
mov    $0x1008817b,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
mov    $0x10111584,%edi
xor    %esi,%esi
call   1050 <put_word@plt>
mov    $0x1013c894,%edi
mov    $0xe12fff1e,%esi
call   1050 <put_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch_CAS_3_9_0_46x_extra>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <write_ndless3x_loader@plt>
mov    $0x1008817b,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
mov    $0x10111584,%edi
xor    %esi,%esi
call   1050 <put_word@plt>
mov    $0x1013c894,%edi
mov    $0xe12fff1e,%esi
pop    %rax
jmp    1050 <put_word@plt>

LLVM IR (-O0):
define void @patch_CAS_3_9_0_46x_extra() {
%1 = call i32 @write_ndless3x_loader(i32 1, i32 2)
%2 = call i32 @put_byte(i32 268992891, i32 234)
%3 = call i32 @put_word(i32 269555076, i32 0)
%4 = call i32 @put_word(i32 269731988, i32 -516948194)
ret void
}

LLVM IR (-O2):
define void @patch_CAS_3_9_0_46x_extra() {
%1 = tail call i32 @write_ndless3x_loader(i32 1, i32 2)
%2 = tail call i32 @put_byte(i32 268992891, i32 234)
%3 = tail call i32 @put_word(i32 269555076, i32 0)
%4 = tail call i32 @put_word(i32 269731988, i32 -516948194)
ret void
}
void sync_change_bit(long nr, volatile unsigned long *addr) {
  asm volatile("lock; btc %1,%0"
               : "+m"((*(volatile long *)addr))
               : "Ir"(nr)
               : "memory");
}


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

x86 assembly (clang, -O2):
<sync_change_bit>:
lock btc %rdi,(%rsi)
ret

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

LLVM IR (-O2):
define void @sync_change_bit(i64 %0, i64* %1) {
tail call void asm sideeffect "lock; btc $1,$0", "=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0, i64* elementtype(i64) %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_cappr_function_list();
void cappr_init() { register_cappr_function_list(); }


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

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

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

LLVM IR (-O2):
define void @cappr_init() {
%1 = tail call i32 (...) @register_cappr_function_list()
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) {
  if (isupper(c))
    return c + 0x20;
  else
    return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113b <tolower+0x2b>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 32
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}