xunge/DecIR huggingface dataset:
void target_sound_warn(void) {}


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

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

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

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

/* Variables and functions */
int skip2thingamy(int /*<<< orphan*/ *, char *);
int skip2charcode(FILE *pcl) { return (skip2thingamy(pcl, "*c")); }


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

x86 assembly (clang, -O2):
<skip2charcode>:
lea    0xee9(%rip),%rsi
jmp    1030 <skip2thingamy@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ selectionSort(int *, int);
int main() {
  int array[] = {15, 10, 99, 53, 36};
  int size = sizeof(array) / sizeof(array[0]);
  selectionSort(array, size);
  printf("Sorted array: ");
  printArray(array, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <selectionSort@plt>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xed5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeba(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <selectionSort@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [5 x i32] [i32 15, i32 10, i32 99, i32 53, i32 36]
@.str = [15 x i8] c"Sorted array: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @selectionSort(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @printArray(i32* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [5 x i32] [i32 15, i32 10, i32 99, i32 53, i32 36]
@.str = [15 x i8] c"Sorted array: \00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @selectionSort(i32* %3, i32 5)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printArray(i32* %3, i32 5)
ret i32 0
}
int lxc_caps_down(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lxc_caps_down() {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ runSimulation();
int main(void) {
  runSimulation();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <runSimulation@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <runSimulation@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @runSimulation()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Intel Bluetooth firmware converter\n"
         "Usage:\n");
  printf("\tseq2bseq [options] <file>\n");
  printf("Options:\n"
         "\t-o, --output <file>    Provide firmware output file\n"
         "\t-h, --help             Show help options\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
call   1030 <printf@plt>
lea    0xf14(%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    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Intel Bluetooth firmware converter\0AUsage:\0A\00"
@.str.1 = [28 x i8] c"\09seq2bseq [options] <file>\0A\00"
@.str.2 = [105 x i8] c"Options:\0A\09-o, --output <file> Provide firmware output file\0A\09-h, --help Show help options\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"Intel Bluetooth firmware converter\0AUsage:\00"
@str.3 = [27 x i8] c"\09seq2bseq [options] <file>\00"
@str.4 = [104 x i8] c"Options:\0A\09-o, --output <file> Provide firmware output file\0A\09-h, --help Show help options\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void option4() { printf("You have selected option 4\n"); }


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"You have selected option 4\00"
define void @option4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
void dlopen() {}


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

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

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

LLVM IR (-O2):
define void @dlopen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void log_error(char *error, int code) {
  fprintf(stderr, "ERROR: %s\n", error);
  exit(code);
}


x86 assembly (clang, -O0):
<log_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<log_error>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @log_error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int my_global_func();
int main() { return my_global_func(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <my_global_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @RSA_memory_lock() {
ret void
}
int ktime_equal(const long long cmp1, const long long cmp2) {
  return cmp1 == cmp2;
}


x86 assembly (clang, -O0):
<ktime_equal>:
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):
<ktime_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @ktime_equal(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 @ktime_equal(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmp(const void *x, const void *y) {
  return strcmp((const char *)x, (const char *)y);
}


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

x86 assembly (clang, -O2):
<cmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp(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)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void open_log(void) {}


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

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

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

LLVM IR (-O2):
define void @open_log() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
int write(int, char *, int);
void *fd_st(void *arg) {
  int fd = (int)(long)arg;
  if (write(fd, "bye", 3) != 3)
    err(1, "write()");
  return NULL;
}


x86 assembly (clang, -O0):
<fd_st>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xec3(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
cmp    $0x3,%eax
je     1161 <fd_st+0x41>
mov    $0x1,%edi
lea    0xea8(%rip),%rsi
call   1040 <err@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_st>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
cmp    $0x3,%eax
je     1148 <fd_st+0x28>
lea    0xec6(%rip),%rsi
mov    $0x1,%edi
call   1040 <err@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"bye\00"
@.str.1 = [8 x i8] c"write()\00"
define i8* @fd_st(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @write(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @err(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
ret i8* null
}

LLVM IR (-O2):
@.str = [4 x i8] c"bye\00"
@.str.1 = [8 x i8] c"write()\00"
define noalias i8* @fd_st(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = icmp eq i32 %4, 3
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ addToTree(char *);
int /*<<< orphan*/ dequeueList();
int /*<<< orphan*/ peekList();
int /*<<< orphan*/ reportError(char);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int comma() {
  if (strcmp(peekList(), ",") != 0) {
    reportError(',');
    return 0;
  }
  dequeueList();
  addToTree(",");
  return 1;
}


x86 assembly (clang, -O0):
<comma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <peekList@plt>
mov    %eax,%edi
lea    0xe98(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     118d <comma+0x3d>
mov    $0x2c,%edi
call   1030 <reportError@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <comma+0x57>
mov    $0x0,%al
call   1070 <dequeueList@plt>
lea    0xe65(%rip),%rdi
call   1050 <addToTree@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comma>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <peekList@plt>
lea    0xe9f(%rip),%rsi
mov    %eax,%edi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1179 <comma+0x29>
mov    $0x2c,%edi
call   1030 <reportError@plt>
jmp    1191 <comma+0x41>
xor    %eax,%eax
call   1070 <dequeueList@plt>
lea    0xe79(%rip),%rdi
call   1050 <addToTree@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
define i32 @comma() {
%1 = alloca i32
%2 = call i32 (...) @peekList()
%3 = call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @reportError(i8 signext 44)
store i32 0, i32* %1
br label %10
7: ; preds = %0
%8 = call i32 (...) @dequeueList()
%9 = call i32 @addToTree(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
define i32 @comma() {
%1 = tail call i32 (...) @peekList()
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @reportError(i8 signext 44)
br label %9
6: ; preds = %0
%7 = tail call i32 (...) @dequeueList()
%8 = tail call i32 @addToTree(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 0, %4 ], [ 1, %6 ]
ret i32 %10
}
int isleap(int y) { return (y & 3) == 0 && (y % 100 != 0 || y % 400 == 0); }


x86 assembly (clang, -O0):
<isleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    114e <isleap+0x4e>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    1148 <isleap+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleap>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <isleap+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <isleap+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isleap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y;
};
struct TYPE_4__ {
  TYPE_1__ xgravity;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xgravity_y(void *_p) { return (int)((XEvent *)_p)->xgravity.y; }


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xgravity_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gotoxy(int, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ resetColors();
int /*<<< orphan*/ setBgcolor(int);
int /*<<< orphan*/ setFgcolor(int);
void displayXY(char *s, int f, int b, int row, int col) {
  gotoxy(row, col);
  setFgcolor(f);
  setBgcolor(b);
  printf("%s", s);
  resetColors();
}


x86 assembly (clang, -O0):
<displayXY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <gotoxy@plt>
mov    -0xc(%rbp),%edi
call   1030 <setFgcolor@plt>
mov    -0x10(%rbp),%edi
call   1070 <setBgcolor@plt>
mov    -0x8(%rbp),%rsi
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <resetColors@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayXY>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %ecx,%edi
mov    %r8d,%esi
call   1060 <gotoxy@plt>
mov    %ebp,%edi
call   1030 <setFgcolor@plt>
mov    %ebx,%edi
call   1070 <setBgcolor@plt>
lea    0xe86(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <resetColors@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @displayXY(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %9
%12 = load i32, i32* %10
%13 = call i32 @gotoxy(i32 %11, i32 %12)
%14 = load i32, i32* %7
%15 = call i32 @setFgcolor(i32 %14)
%16 = load i32, i32* %8
%17 = call i32 @setBgcolor(i32 %16)
%18 = load i8*, i8** %6
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = call i32 (...) @resetColors()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @displayXY(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @gotoxy(i32 %3, i32 %4)
%7 = tail call i32 @setFgcolor(i32 %1)
%8 = tail call i32 @setBgcolor(i32 %2)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = tail call i32 (...) @resetColors()
ret void
}
/* Type definitions */
struct dev_punchrd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct dev_punchrd *);
void dev_punchrd_destroy(void *dev) {
  struct dev_punchrd *punchrd = dev;
  free(punchrd);
}


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

x86 assembly (clang, -O2):
<dev_punchrd_destroy>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.dev_punchrd = type { i32 }
define void @dev_punchrd_destroy(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.dev_punchrd*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.dev_punchrd*
store %struct.dev_punchrd* %5, %struct.dev_punchrd** %3
%6 = load %struct.dev_punchrd*, %struct.dev_punchrd** %3
%7 = call i32 @free(%struct.dev_punchrd* %6)
ret void
}

LLVM IR (-O2):
%struct.dev_punchrd = type { i32 }
define void @dev_punchrd_destroy(i8* nocapture %0) {
%2 = bitcast i8* %0 to %struct.dev_punchrd*
%3 = tail call i32 @free(%struct.dev_punchrd* %2)
ret void
}
/* Variables and functions */
int arc4random();
int random_int(int max) { return arc4random() % (max + 1); }


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

x86 assembly (clang, -O2):
<random_int>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <arc4random@plt>
add    $0x1,%ebx
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @arc4random()
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = srem i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @random_int(i32 %0) {
%2 = tail call i32 (...) @arc4random()
%3 = add nsw i32 %0, 1
%4 = srem i32 %2, %3
ret i32 %4
}
int comp_int(const void *i, const void *j) { return *(int *)i - *(int *)j; }


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

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

LLVM IR (-O0):
define i32 @comp_int(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 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @comp_int(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 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void mathInit() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<mathInit>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mathInit>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @mathInit() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @mathInit() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
void TmsLowTransition(void) {
  ;
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @TmsLowTransition() {
ret void
}
/* Type definitions */
struct region {
  int dummy;
};

/* Variables and functions */
scalar_t__ generic_ptr(int, int);
struct region *region_ptr(int number) {
  return ((struct region *)generic_ptr(42, number));
}


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

x86 assembly (clang, -O2):
<region_ptr>:
mov    %edi,%esi
mov    $0x2a,%edi
jmp    1030 <generic_ptr@plt>

LLVM IR (-O0):
%struct.region = type { i32 }
define %struct.region* @region_ptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @generic_ptr(i32 42, i32 %3)
%5 = inttoptr i64 %4 to %struct.region*
ret %struct.region* %5
}

LLVM IR (-O2):
%struct.region = type { i32 }
define %struct.region* @region_ptr(i32 %0) {
%2 = tail call i64 @generic_ptr(i32 42, i32 %0)
%3 = inttoptr i64 %2 to %struct.region*
ret %struct.region* %3
}
int test_imm_DAint64_lowword_mem(long long *val) {
  return ((*val) & (0xDA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DAint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 218
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void set_intr_gate(int nr, void *func) {}


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

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

LLVM IR (-O0):
define void @set_intr_gate(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @set_intr_gate(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  while (1) {
    printf("RESULT: %d\n", getchar() != EOF);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
mov    %al,-0x5(%rbp)
movzbl %al,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
lea    0xece(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %esi,%esi
cmp    (%r14),%rax
setne  %sil
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [12 x i8] c"RESULT: %d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %2
}

LLVM IR (-O2):
@.str = [12 x i8] c"RESULT: %d\0A\00"
@EOF = global i64 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int);
void f1(int a, int b, int c, int d, int e, int f) {
  printf("%d %d %d %d %d %d\n", a, b, c, d, e, f);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x18(%rbp),%eax
lea    0xeb9(%rip),%rdi
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    %r8d,%eax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    %r9d,(%rsp)
lea    0xed8(%rip),%rdi
mov    %eax,%r9d
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"%d %d %d %d %d %d\0A\00"
define void @f1(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
ret void
}
void initcrt(const char *host) {}


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

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

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

LLVM IR (-O2):
define void @initcrt(i8* nocapture %0) {
ret void
}
int isOctal(int c) { return '0' <= c && c <= '7'; }


x86 assembly (clang, -O0):
<isOctal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <isOctal+0x24>
cmpl   $0x37,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOctal>:
and    $0xfffffff8,%edi
xor    %eax,%eax
cmp    $0x30,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isOctal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 55
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isOctal(i32 %0) {
%2 = and i32 %0, -8
%3 = icmp eq i32 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
void e24toasc(x, string, ndigs) unsigned short x[];
char *string;
int ndigs;
{
  unsigned short w[(6 + 3)];
  e24toe(x, w);
  etoasc(w, string, ndigs);
}


x86 assembly (clang, -O0):
<e24toasc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1030 <e24toe@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1040 <etoasc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e24toasc>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <e24toe@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <etoasc@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @e24toasc(i16* %0, i8* %1, i32 %2) {
%4 = alloca i16*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [9 x i16]
store i16* %0, i16** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i16*, i16** %4
%9 = getelementptr inbounds [9 x i16], [9 x i16]* %7, i64 0, i64 0
%10 = call i32 (i16*, i16*, ...) bitcast (i32 (...)* @e24toe to i32 (i16*, i16*, ...)*)(i16* %8, i16* %9)
%11 = getelementptr inbounds [9 x i16], [9 x i16]* %7, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 (i16*, i8*, i32, ...) bitcast (i32 (...)* @etoasc to i32 (i16*, i8*, i32, ...)*)(i16* %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @e24toasc(i16* %0, i8* %1, i32 %2) {
%4 = alloca [9 x i16]
%5 = bitcast [9 x i16]* %4 to i8*
%6 = getelementptr inbounds [9 x i16], [9 x i16]* %4, i64 0, i64 0
%7 = call i32 (i16*, i16*, ...) bitcast (i32 (...)* @e24toe to i32 (i16*, i16*, ...)*)(i16* %0, i16* %6)
%8 = call i32 (i16*, i8*, i32, ...) bitcast (i32 (...)* @etoasc to i32 (i16*, i8*, i32, ...)*)(i16* %6, i8* %1, i32 %2)
ret void
}
void ls_costN_nm9_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_costN_nm9_decref() {
ret void
}
/* Variables and functions */
int handle_status_quiet(int, int, char *);
int /*<<< orphan*/ info(int, char *, int);
int handle_status(int devfd, int nodeid, char *arg) {
  int ret = handle_status_quiet(devfd, nodeid, arg);
  info(1, "%03d\n", ret);
  return ret;
}


x86 assembly (clang, -O0):
<handle_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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 <handle_status_quiet@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x1,%edi
lea    0xead(%rip),%rsi
call   1040 <info@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_status>:
push   %rbx
call   1030 <handle_status_quiet@plt>
mov    %eax,%ebx
lea    0xed1(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
call   1040 <info@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%03d\0A\00"
define i32 @handle_status(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @handle_status_quiet(i32 %0, i32 %1, i8* %2)
%5 = tail call i32 @info(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 %4
}
void asm_code_footprint(void) {}


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

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

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

LLVM IR (-O2):
define void @asm_code_footprint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ pointer_equal(int *, int *);
void test_pointer_equal(void) {
  int a, b;
  assert(pointer_equal(&a, &a) != 0);
  assert(pointer_equal(&a, &b) == 0);
}


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

x86 assembly (clang, -O2):
<test_pointer_equal>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1030 <pointer_equal@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <pointer_equal@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test_pointer_equal() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 @pointer_equal(i32* %1, i32* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i64 @pointer_equal(i32* %1, i32* %2)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
define void @test_pointer_equal() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @pointer_equal(i32* %1, i32* %1)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i64 @pointer_equal(i32* %1, i32* %2)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
unsigned func_116(unsigned short p_117, unsigned char p_118, short p_119,
                  unsigned short p_120) {
  step_hash(376);
  return p_117;
}


x86 assembly (clang, -O0):
<func_116>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %sil,%dl
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dl,-0x3(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    $0x178,%edi
call   1030 <step_hash@plt>
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_116>:
push   %rbx
mov    %edi,%ebx
mov    $0x178,%edi
call   1030 <step_hash@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @func_116(i16 zeroext %0, i8 zeroext %1, i16 signext %2, i16 zeroext %3) {
%5 = alloca i16
%6 = alloca i8
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i8 %1, i8* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = call i32 @step_hash(i32 376)
%10 = load i16, i16* %5
%11 = zext i16 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @func_116(i16 zeroext %0, i8 zeroext %1, i16 signext %2, i16 zeroext %3) {
%5 = tail call i32 @step_hash(i32 376)
%6 = zext i16 %0 to i32
ret i32 %6
}
int add2(int (*a)[2]) { return a[0][0] + a[1][0]; }


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

x86 assembly (clang, -O2):
<add2>:
mov    0x8(%rdi),%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @add2([2 x i32]* %0) {
%2 = alloca [2 x i32]*
store [2 x i32]* %0, [2 x i32]** %2
%3 = load [2 x i32]*, [2 x i32]** %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = load [2 x i32]*, [2 x i32]** %2
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 1
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%10 = load i32, i32* %9
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @add2([2 x i32]* nocapture %0) {
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 0
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
char *stdc_AA9635D7(char *, char const *);
char *strcat(char *dest, const char *src) { return stdc_AA9635D7(dest, src); }


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

x86 assembly (clang, -O2):
<strcat>:
jmp    1030 <stdc_AA9635D7@plt>

LLVM IR (-O0):
define i8* @strcat(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 i8* @stdc_AA9635D7(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* %1) {
%3 = tail call i8* @stdc_AA9635D7(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ TIOCMGET;
int TIOCM_DSR;
int modem_ioctl(int /*<<< orphan*/, int /*<<< orphan*/);
int tty_dsr(void) { return !!(modem_ioctl(TIOCMGET, 0) & TIOCM_DSR); }


x86 assembly (clang, -O0):
<tty_dsr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <modem_ioctl@plt>
mov    0x2ebd(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_dsr>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <modem_ioctl@plt>
mov    0x2ec0(%rip),%rdx
xor    %ecx,%ecx
test   %eax,(%rdx)
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@TIOCMGET = global i32 0
@TIOCM_DSR = global i32 0
define i32 @tty_dsr() {
%1 = load i32, i32* @TIOCMGET
%2 = call i32 @modem_ioctl(i32 %1, i32 0)
%3 = load i32, i32* @TIOCM_DSR
%4 = and i32 %2, %3
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@TIOCMGET = global i32 0
@TIOCM_DSR = global i32 0
define i32 @tty_dsr() {
%1 = load i32, i32* @TIOCMGET
%2 = tail call i32 @modem_ioctl(i32 %1, i32 0)
%3 = load i32, i32* @TIOCM_DSR
%4 = and i32 %3, %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int get_millisecond_timer();
uint16_t seconds16(void) {
  uint32_t ms = get_millisecond_timer();
  uint16_t s16;
  s16 = ms / 1000;
  return s16;
}


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

x86 assembly (clang, -O2):
<seconds16>:
push   %rax
xor    %eax,%eax
call   1030 <get_millisecond_timer@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @seconds16() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @get_millisecond_timer()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 1000
store i32 %5, i32* %2
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @seconds16() {
%1 = tail call i32 (...) @get_millisecond_timer()
%2 = sdiv i32 %1, 1000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  unsigned int a, b = 0;
  for (a = 0x80000000; a < 0xffffffff; a++) {
    b = (a << 5) + 0x456860;
    if (b == 0x0041bda0) {
      printf("Value: %08x\n", a);
      return 0;
    }
  }
  printf("No valid value found.\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x80000000,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jae    1182 <main+0x72>
mov    -0x8(%rbp),%eax
shl    $0x5,%eax
add    $0x456860,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x41bda0,-0xc(%rbp)
jne    116f <main+0x5f>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1197 <main+0x87>
jmp    1174 <main+0x64>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x7ffe2a0,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xfffffea0,%eax
jne    1120 <main+0x10>
push   %rax
lea    0xed1(%rip),%rdi
mov    $0x87ffe2aa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Value: %08x\0A\00"
@.str.1 = [23 x i8] c"No valid value found.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 -2147483648, i32* %2
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, -1
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i32, i32* %2
%9 = shl i32 %8, 5
%10 = add i32 %9, 4548704
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 4308384
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %14)
store i32 0, i32* %1
br label %22
16: ; preds = %7
br label %17
17: ; preds = %16
%18 = load i32, i32* %2
%19 = add i32 %18, 1
store i32 %19, i32* %2
br label %4
20: ; preds = %4
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %22
22: ; preds = %20, %13
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [13 x i8] c"Value: %08x\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 352
%4 = icmp eq i32 %3, 134210208
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 -2013273430)
ret i32 0
}