xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void writeGpxHeader(FILE *OUT) {
  fprintf(OUT, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" "
               "?>\n<gpx version=\"1.1\"\n    creator=\"Osmawalk - "
               "https://github.com/xtompok/osmawalk\"\n    "
               "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n    "
               "xmlns=\"http://www.topografix.com/GPX/1/1\"\n    "
               "xsi:schemaLocation=\"http://www.topografix.com/GPX/1/1 "
               "http://www.topografix.com/GPX/1/1/gpx.xsd\">\n");
}


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

x86 assembly (clang, -O2):
<writeGpxHeader>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x157,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [344 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22 standalone=\22yes\22 ?>\0A<gpx version=\221.1\22\0A creator=\22Osmawalk - https://github.com/xtompok/osmawalk\22\0A xmlns:xsi=\22http://www.w3.org/2001/XMLSchema-instance\22\0A xmlns=\22http://www.topografix.com/GPX/1/1\22\0A xsi:schemaLocation=\22http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd\22>\0A\00"
define void @writeGpxHeader(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [344 x i8] c"<?xml version=\221.0\22 encoding=\22UTF-8\22 standalone=\22yes\22 ?>\0A<gpx version=\221.1\22\0A creator=\22Osmawalk - https://github.com/xtompok/osmawalk\22\0A xmlns:xsi=\22http://www.w3.org/2001/XMLSchema-instance\22\0A xmlns=\22http://www.topografix.com/GPX/1/1\22\0A xsi:schemaLocation=\22http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd\22>\0A\00"
define void @writeGpxHeader(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([344 x i8], [344 x i8]* @.str, i64 0, i64 0), i64 343, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ factor();
int /*<<< orphan*/ match(char);
int /*<<< orphan*/ popMul();
void multiply() {
  match('*');
  factor();
  popMul();
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1040 <match@plt>
mov    $0x0,%al
call   1050 <factor@plt>
mov    $0x0,%al
call   1030 <popMul@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
push   %rax
mov    $0x2a,%edi
call   1040 <match@plt>
xor    %eax,%eax
call   1050 <factor@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <popMul@plt>

LLVM IR (-O0):
define void @multiply() {
%1 = call i32 @match(i8 signext 42)
%2 = call i32 (...) @factor()
%3 = call i32 (...) @popMul()
ret void
}

LLVM IR (-O2):
define void @multiply() {
%1 = tail call i32 @match(i8 signext 42)
%2 = tail call i32 (...) @factor()
%3 = tail call i32 (...) @popMul()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int __LDMpthread_mutex_lock(int /*<<< orphan*/ *);
int pthread_mutex_lock(pthread_mutex_t *lock) {
  return __LDMpthread_mutex_lock(lock);
}


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

x86 assembly (clang, -O2):
<pthread_mutex_lock>:
jmp    1030 <__LDMpthread_mutex_lock@plt>

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

LLVM IR (-O2):
define i32 @pthread_mutex_lock(i32* %0) {
%2 = tail call i32 @__LDMpthread_mutex_lock(i32* %0)
ret i32 %2
}
int numanuma__set_thread_affinity(const int node) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @numanuma__set_thread_affinity(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int check_syscall(int ret) {
  if (ret)
    fprintf(stderr, "Syscall Error: %s\n", strerror(errno));
  return ret;
}


x86 assembly (clang, -O0):
<check_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1161 <check_syscall+0x41>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_syscall>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
test   %edi,%edi
je     1151 <check_syscall+0x31>
mov    0x2eb0(%rip),%rax
mov    (%rax),%ebp
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xeb9(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Syscall Error: %s\0A\00"
@errno = global i32 0
define i32 @check_syscall(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i32, i32* @errno
%8 = call i8* @strerror(i32 %7)
%9 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %5, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Syscall Error: %s\0A\00"
@errno = global i32 0
define i32 @check_syscall(i32 returned %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %3, %1
ret i32 %0
}
void RTVfsIoStrmZeroFill(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsIoStrmZeroFill() {
ret void
}
void rt_warn(char *mesg, ...) {
  (void)mesg;
  return;
}


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

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

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

LLVM IR (-O2):
define void @rt_warn(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cachetest();
int /*<<< orphan*/ ramfill();
int /*<<< orphan*/ report_end();
int /*<<< orphan*/ report_start();
int main() {
  report_start();
  ramfill();
  cachetest();
  report_end();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <report_start@plt>
mov    $0x0,%al
call   1050 <ramfill@plt>
mov    $0x0,%al
call   1030 <cachetest@plt>
mov    $0x0,%al
call   1040 <report_end@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <report_start@plt>
xor    %eax,%eax
call   1050 <ramfill@plt>
xor    %eax,%eax
call   1030 <cachetest@plt>
xor    %eax,%eax
call   1040 <report_end@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @report_start()
%3 = call i32 (...) @ramfill()
%4 = call i32 (...) @cachetest()
%5 = call i32 (...) @report_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @report_start()
%2 = tail call i32 (...) @ramfill()
%3 = tail call i32 (...) @cachetest()
%4 = tail call i32 (...) @report_end()
ret i32 0
}
int intmax(const int a, const int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<intmax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <intmax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <intmax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @intmax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @intmax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_init3() {
  printf("main_init3"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"main_init3\00"
define void @main_init3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void(Memento_breakOnFree)(void *a) {}


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

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

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

LLVM IR (-O2):
define void @Memento_breakOnFree(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct mesh_var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ quad_border_cond(struct mesh_var *, int const, int const,
                                    int, int, int, int);
int /*<<< orphan*/ quad_mesh(struct mesh_var *, int const, int const);
void free_mesh(struct mesh_var *mv) {
  const int n_x_a = 0, n_y_a = 0;
  quad_mesh(mv, n_x_a, n_y_a);
  quad_border_cond(mv, n_x_a, n_y_a, -3, -3, -3, -3);
}


x86 assembly (clang, -O0):
<free_mesh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <quad_mesh@plt>
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    $0xfffffffd,%r9d
mov    %edx,%esi
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0xfffffffd,(%rsp)
call   1040 <quad_border_cond@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_mesh>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
call   1030 <quad_mesh@plt>
movl   $0xfffffffd,(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0xfffffffd,%ecx
mov    $0xfffffffd,%r8d
mov    $0xfffffffd,%r9d
call   1040 <quad_border_cond@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.mesh_var = type { i32 }
define void @free_mesh(%struct.mesh_var* %0) {
%2 = alloca %struct.mesh_var*
%3 = alloca i32
%4 = alloca i32
store %struct.mesh_var* %0, %struct.mesh_var** %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = load %struct.mesh_var*, %struct.mesh_var** %2
%6 = call i32 @quad_mesh(%struct.mesh_var* %5, i32 0, i32 0)
%7 = load %struct.mesh_var*, %struct.mesh_var** %2
%8 = call i32 @quad_border_cond(%struct.mesh_var* %7, i32 0, i32 0, i32 -3, i32 -3, i32 -3, i32 -3)
ret void
}

LLVM IR (-O2):
%struct.mesh_var = type { i32 }
define void @free_mesh(%struct.mesh_var* %0) {
%2 = tail call i32 @quad_mesh(%struct.mesh_var* %0, i32 0, i32 0)
%3 = tail call i32 @quad_border_cond(%struct.mesh_var* %0, i32 0, i32 0, i32 -3, i32 -3, i32 -3, i32 -3)
ret void
}
const char *scamper_do_tbit_usage(void) {
  return "tbit [-t type] [-p app] [-d dport] [-s sport] [-m mss] [-M mtu]\n"
         "     [-O option] [-P ptbsrc] [-S srcaddr] [-u url]";
}


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

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

LLVM IR (-O0):
@.str = [115 x i8] c"tbit [-t type] [-p app] [-d dport] [-s sport] [-m mss] [-M mtu]\0A [-O option] [-P ptbsrc] [-S srcaddr] [-u url]\00"
define i8* @scamper_do_tbit_usage() {
ret i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [115 x i8] c"tbit [-t type] [-p app] [-d dport] [-s sport] [-m mss] [-M mtu]\0A [-O option] [-P ptbsrc] [-S srcaddr] [-u url]\00"
define i8* @scamper_do_tbit_usage() {
ret i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0)
}
void foo485(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo485(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *szSrc) {
  char *szResult;
  szResult = (char *)malloc(strlen(szSrc) + 1);
  if (szResult) {
    strcpy(szResult, szSrc);
  }
  return (szResult);
}


x86 assembly (clang, -O0):
<strdup>:
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 <strdup+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):
<strdup>:
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 <strdup+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* @strdup(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* @strdup(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
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
struct timespec print_current_time_with_ms(void) {
  struct timespec spec;
  clock_gettime(CLOCK_REALTIME, &spec);
  return (spec);
}


x86 assembly (clang, -O0):
<print_current_time_with_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_current_time_with_ms>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @print_current_time_with_ms() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @print_current_time_with_ms() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
int ata_read_dport(unsigned long base) {
  while (!((*((volatile unsigned long *)(base + 0x78))) & 0x08))
    ;
  return *((volatile unsigned long *)(base + 0x40));
}


x86 assembly (clang, -O0):
<ata_read_dport>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x78(%rax),%rax
and    $0x8,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112a <ata_read_dport+0x2a>
jmp    112f <ata_read_dport+0x2f>
jmp    1108 <ata_read_dport+0x8>
mov    -0x8(%rbp),%rax
mov    0x40(%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ata_read_dport>:
testq  $0x8,0x78(%rdi)
je     1100 <ata_read_dport>
mov    0x40(%rdi),%rax
ret

LLVM IR (-O0):
define i32 @ata_read_dport(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %11, %1
%4 = load i64, i64* %2
%5 = add i64 %4, 120
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, 8
%9 = icmp ne i64 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %12
11: ; preds = %3
br label %3
12: ; preds = %3
%13 = load i64, i64* %2
%14 = add i64 %13, 64
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @ata_read_dport(i64 %0) {
%2 = add i64 %0, 120
%3 = inttoptr i64 %2 to i64*
br label %4
4: ; preds = %4, %1
%5 = load volatile i64, i64* %3
%6 = and i64 %5, 8
%7 = icmp eq i64 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = add i64 %0, 64
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
int create_file(const char *filename) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @create_file(i8* nocapture readnone %0) {
ret i32 2
}
void memfill(unsigned long addr, unsigned long size, unsigned char value) {
  __asm__("1:stosb;loop 1b" ::"c"(size), "D"(addr), "a"(value));
  return;
}


x86 assembly (clang, -O0):
<memfill>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdi
mov    -0x11(%rbp),%al
stos   %al,%es:(%rdi)
loop   111c <memfill+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memfill>:
mov    %edx,%eax
mov    %rsi,%rcx
stos   %al,%es:(%rdi)
loop   1105 <memfill+0x5>
ret

LLVM IR (-O0):
define void @memfill(i64 %0, i64 %1, i8 zeroext %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = load i8, i8* %6
ret void
}

LLVM IR (-O2):
define void @memfill(i64 %0, i64 %1, i8 zeroext %2) {
tail call void asm sideeffect "1:stosb;loop 1b", "{cx},{di},{ax},~{dirflag},~{fpsr},~{flags}"(i64 %1, i64 %0, i8 %2)
ret void
}
int read_Salary(float *salary_ptr) {}


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

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

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

LLVM IR (-O2):
define i32 @read_Salary(float* nocapture readnone %0) {
ret i32 undef
}
void device_free(struct udevice *dev) {}


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

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

LLVM IR (-O0):
%struct.udevice = type opaque
define void @device_free(%struct.udevice* %0) {
%2 = alloca %struct.udevice*
store %struct.udevice* %0, %struct.udevice** %2
ret void
}

LLVM IR (-O2):
%struct.udevice = type opaque
define void @device_free(%struct.udevice* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pifacecad_lcd_set_backlight(int /*<<< orphan*/);
void pifacecad_lcd_backlight_off(void) { pifacecad_lcd_set_backlight(0); }


x86 assembly (clang, -O0):
<pifacecad_lcd_backlight_off>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <pifacecad_lcd_set_backlight@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pifacecad_lcd_backlight_off() {
%1 = call i32 @pifacecad_lcd_set_backlight(i32 0)
ret void
}

LLVM IR (-O2):
define void @pifacecad_lcd_backlight_off() {
%1 = tail call i32 @pifacecad_lcd_set_backlight(i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ pthread_sigmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *);
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void block_sigint() {
  sigset_t mask;
  sigemptyset(&mask);
  sigaddset(&mask, SIGINT);
  pthread_sigmask(SIG_BLOCK, &mask, NULL);
}


x86 assembly (clang, -O0):
<block_sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <sigemptyset@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_sigint>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigemptyset@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <pthread_sigmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_BLOCK = global i32 0
define void @block_sigint() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIGINT
%4 = call i32 @sigaddset(i32* %1, i32 %3)
%5 = load i32, i32* @SIG_BLOCK
%6 = call i32 @pthread_sigmask(i32 %5, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_BLOCK = global i32 0
define void @block_sigint() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGINT
%5 = call i32 @sigaddset(i32* %1, i32 %4)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @pthread_sigmask(i32 %6, i32* %1, i32* null)
ret void
}
int my_strlen(char *str) {
  register unsigned int i;
  i = 0;
  while (str[i] != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1131 <my_strlen+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi,%rax,1)
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
mvcaddstr(r, c, s) char *s;
{ (VMove(r, c - (strlen(s) + 1) / 2), VPutString(s)); }


x86 assembly (clang, -O0):
<mvcaddstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edi
add    $0x1,%rax
shr    $0x1,%rax
sub    %rax,%rsi
mov    $0x0,%al
call   1050 <VMove@plt>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <VPutString@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvcaddstr>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %edi,%r14d
movslq %esi,%rbp
mov    %rdx,%rdi
call   1040 <strlen@plt>
add    $0x1,%rax
shr    %rax
sub    %rax,%rbp
mov    %r14d,%edi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <VMove@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <VPutString@plt>

LLVM IR (-O0):
define i32 @mvcaddstr(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = load i8*, i8** %7
%12 = call i64 @strlen(i8* %11)
%13 = add i64 %12, 1
%14 = udiv i64 %13, 2
%15 = sub i64 %10, %14
%16 = call i32 (i32, i64, ...) bitcast (i32 (...)* @VMove to i32 (i32, i64, ...)*)(i32 %8, i64 %15)
%17 = load i8*, i8** %7
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @VPutString to i32 (i8*, ...)*)(i8* %17)
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @mvcaddstr(i32 %0, i32 %1, i8* %2) {
%4 = sext i32 %1 to i64
%5 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%6 = add i64 %5, 1
%7 = lshr i64 %6, 1
%8 = sub i64 %4, %7
%9 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @VMove to i32 (i32, i64, ...)*)(i32 %0, i64 %8)
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @VPutString to i32 (i8*, ...)*)(i8* %2)
ret i32 undef
}
int test_imm_22int32_reg(int val) { return ((val) & (0x22 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_22int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x22,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_22int32_reg(i32 %0) {
%2 = and i32 %0, 34
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int callee_deep_u(unsigned int);
unsigned caller_deep_u(unsigned bla) { return callee_deep_u(bla); }


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

x86 assembly (clang, -O2):
<caller_deep_u>:
jmp    1030 <callee_deep_u@plt>

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

LLVM IR (-O2):
define i32 @caller_deep_u(i32 %0) {
%2 = tail call i32 @callee_deep_u(i32 %0)
ret i32 %2
}
void PACER_TIMER_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @PACER_TIMER_RestoreConfig() {
ret void
}
unsigned int test04(unsigned int a, int b) { return a >> (b & 31); }


x86 assembly (clang, -O0):
<test04>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test04>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @test04(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 = and i32 %6, 31
%8 = lshr i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @test04(i32 %0, i32 %1) {
%3 = and i32 %1, 31
%4 = lshr i32 %0, %3
ret i32 %4
}
int test_imm_B4int8_mem(signed char *val) {
  return ((*val) & (-0xB4 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B4int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff4c,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B4int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -180
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bitarithm_bits_set(int /*<<< orphan*/);
uint8_t bitarithm_bits_set_u32(uint32_t v) { return bitarithm_bits_set(v); }


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

x86 assembly (clang, -O2):
<bitarithm_bits_set_u32>:
jmp    1030 <bitarithm_bits_set@plt>

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

LLVM IR (-O2):
define i32 @bitarithm_bits_set_u32(i32 %0) {
%2 = tail call i32 @bitarithm_bits_set(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bitw_reset_lowest_set_bit_64_blsr(int /*<<< orphan*/);
__attribute__((always_)) uint64_t
bitw_reset_lowest_set_bit_64(uint64_t bit_sequence) {
  return bitw_reset_lowest_set_bit_64_blsr(bit_sequence);
}


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

x86 assembly (clang, -O2):
<bitw_reset_lowest_set_bit_64>:
jmp    1030 <bitw_reset_lowest_set_bit_64_blsr@plt>

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

LLVM IR (-O2):
define i32 @bitw_reset_lowest_set_bit_64(i32 %0) {
%2 = tail call i32 @bitw_reset_lowest_set_bit_64_blsr(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void const *, int);
char *mongo_data_append32(char *start, const void *data) {
  (memcpy(start, data, 4));
  return start + 4;
}


x86 assembly (clang, -O0):
<mongo_data_append32>:
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    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mongo_data_append32>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x4,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @mongo_data_append32(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 @memcpy(i8* %5, i8* %6, i32 4)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 4
ret i8* %9
}

LLVM IR (-O2):
define i8* @mongo_data_append32(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 4)
%4 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %4
}
int my_strcmp(const char *a, const char *b) {
  while (*a == *b) {
    if (*a == '\0')
      return 0;
    ++a;
    ++b;
  }
  return (int)(unsigned char)*a - (int)(unsigned char)*b;
}


x86 assembly (clang, -O0):
<my_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115b <my_strcmp+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <my_strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    116e <my_strcmp+0x6e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <my_strcmp+0xc>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <my_strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <my_strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <my_strcmp+0x10>
movzbl %al,%eax
movzbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = zext i8 %18 to i32
%21 = zext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int ano_atual = 0;
  int ano_nascimento = 0;
  scanf("%d %d", &ano_nascimento, &ano_atual);
  printf("%d %d\n", ano_atual - ano_nascimento, 2017 - ano_nascimento);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
mov    $0x7e1,%edx
sub    -0xc(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xec9(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%eax
sub    %eax,%esi
mov    $0x7e1,%edx
sub    %eax,%edx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %1)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = sub nsw i32 2017, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
char random_char();
int strlen(char *);
void mutate(char *child) {
  int len = strlen(child);
  int index = ((float)rand() / RAND_MAX) * len;
  char new_char = random_char();
  child[index] = new_char;
}


x86 assembly (clang, -O0):
<mutate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2e8d(%rip),%rax
divss  (%rax),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <random_char@plt>
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutate>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2e98(%rip),%rax
divss  (%rax),%xmm0
cvtsi2ss %ebp,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%ebp
xor    %eax,%eax
call   1040 <random_char@plt>
movslq %ebp,%rcx
mov    %al,(%rbx,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define void @mutate(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %3
%8 = call i64 (...) @rand()
%9 = sitofp i64 %8 to float
%10 = load float, float* @RAND_MAX
%11 = fdiv float %9, %10
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to float
%14 = fmul float %11, %13
%15 = fptosi float %14 to i32
store i32 %15, i32* %4
%16 = call signext i8 (...) @random_char()
store i8 %16, i8* %5
%17 = load i8, i8* %5
%18 = load i8*, i8** %2
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
ret void
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define void @mutate(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to float
%5 = load float, float* @RAND_MAX
%6 = fdiv float %4, %5
%7 = sitofp i32 %2 to float
%8 = fmul float %6, %7
%9 = fptosi float %8 to i32
%10 = tail call signext i8 (...) @random_char()
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
store i8 %10, i8* %12
ret void
}
/* Variables and functions */
scalar_t__ isascii(int);
int tolower(int);
int utf32_tolower(int c) { return isascii(c) ? tolower(c) : c; }


x86 assembly (clang, -O0):
<utf32_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isascii@plt>
cmp    $0x0,%rax
je     114d <utf32_tolower+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x8(%rbp)
jmp    1153 <utf32_tolower+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf32_tolower>:
push   %rbx
mov    %edi,%ebx
call   1040 <isascii@plt>
test   %rax,%rax
je     1135 <utf32_tolower+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tolower@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @utf32_tolower(i32 %0) {
%2 = tail call i64 @isascii(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @tolower(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, short);
void RNDResponseSink_RenderingControl_GetHorizontalKeystone(
    struct UPnPService *Service, int ErrorCode, void *User,
    short CurrentHorizontalKeystone) {
  printf("RND Invoke Response: "
         "RenderingControl/GetHorizontalKeystone[ErrorCode:%d](%d)\r\n",
         ErrorCode, CurrentHorizontalKeystone);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_GetHorizontalKeystone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecc(%rip),%rdi
movswl -0x1a(%rbp),%edx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNDResponseSink_RenderingControl_GetHorizontalKeystone>:
lea    0xee9(%rip),%rdi
mov    %ecx,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [80 x i8] c"RND Invoke Response: RenderingControl/GetHorizontalKeystone[ErrorCode:%d](%d)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetHorizontalKeystone(%struct.UPnPService* %0, i32 %1, i8* %2, i16 signext %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i16
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
%9 = load i32, i32* %6
%10 = load i16, i16* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %9, i16 signext %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [80 x i8] c"RND Invoke Response: RenderingControl/GetHorizontalKeystone[ErrorCode:%d](%d)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetHorizontalKeystone(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i16 signext %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %1, i16 signext %3)
ret void
}
int test_033(int a, int b, int c, int d) { return ((d >> 31) & 1) + a + b + c; }


x86 assembly (clang, -O0):
<test_033>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
add    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_033>:
shr    $0x1f,%ecx
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_033(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = ashr i32 %9, 31
%11 = and i32 %10, 1
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %7
%17 = add nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @test_033(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = lshr i32 %3, 31
%6 = add i32 %1, %0
%7 = add i32 %6, %2
%8 = add i32 %7, %5
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
unsigned long get_XEnterWindowEvent_window(void *_p) {
  return (unsigned long)((XEnterWindowEvent *)_p)->window;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEnterWindowEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int tigetflag(char *);
int curses_bool_cap(const char *name) { return tigetflag((char *)name); }


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

x86 assembly (clang, -O2):
<curses_bool_cap>:
jmp    1030 <tigetflag@plt>

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

LLVM IR (-O2):
define i32 @curses_bool_cap(i8* %0) {
%2 = tail call i32 @tigetflag(i8* %0)
ret i32 %2
}