xunge/DecIR huggingface dataset:
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int readdir_r(int /*<<< orphan*/ *, struct dirent *, struct dirent **);
int zfs_readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) {
  return readdir_r(dirp, entry, result);
}


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

x86 assembly (clang, -O2):
<zfs_readdir_r>:
jmp    1030 <readdir_r@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @zfs_readdir_r(i32* %0, %struct.dirent* %1, %struct.dirent** %2) {
%4 = alloca i32*
%5 = alloca %struct.dirent*
%6 = alloca %struct.dirent**
store i32* %0, i32** %4
store %struct.dirent* %1, %struct.dirent** %5
store %struct.dirent** %2, %struct.dirent*** %6
%7 = load i32*, i32** %4
%8 = load %struct.dirent*, %struct.dirent** %5
%9 = load %struct.dirent**, %struct.dirent*** %6
%10 = call i32 @readdir_r(i32* %7, %struct.dirent* %8, %struct.dirent** %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @zfs_readdir_r(i32* %0, %struct.dirent* %1, %struct.dirent** %2) {
%4 = tail call i32 @readdir_r(i32* %0, %struct.dirent* %1, %struct.dirent** %2)
ret i32 %4
}
void I422ToYUY2Row_AVX2() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char);
void fprint_char(FILE *f, char c) {
  if (c >= 32 && c < 127)
    fprintf(f, "%c", c);
  else
    fprintf(f, "<%02x>", c);
}


x86 assembly (clang, -O0):
<fprint_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jl     1155 <fprint_char+0x45>
movsbl -0x9(%rbp),%eax
cmp    $0x7f,%eax
jge    1155 <fprint_char+0x45>
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
movsbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
jmp    1169 <fprint_char+0x59>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
movsbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_char>:
mov    %rdi,%rax
lea    -0x20(%rsi),%ecx
cmp    $0x5e,%cl
ja     1137 <fprint_char+0x17>
movzbl %sil,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>
movsbl %sil,%edx
lea    0xebe(%rip),%rsi
mov    %rax,%rdi
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [7 x i8] c"<%02x>\00"
define void @fprint_char(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 32
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp slt i32 %10, 127
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i32*, i32** %3
%14 = load i8, i8* %4
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %14)
br label %20
16: ; preds = %8, %2
%17 = load i32*, i32** %3
%18 = load i8, i8* %4
%19 = call i32 @fprintf(i32* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %18)
br label %20
20: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"<%02x>\00"
define void @fprint_char(i32* nocapture %0, i8 signext %1) {
%3 = add i8 %1, -32
%4 = icmp ult i8 %3, 95
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = zext i8 %1 to i32
%7 = tail call i32 @fputc(i32 %6, i32* %0)
br label %10
8: ; preds = %2
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %1)
br label %10
10: ; preds = %8, %5
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long target;
};
typedef TYPE_1__ XSelectionEvent;

/* Variables and functions */
void set_XSelectionEvent_target(void *_p, unsigned long _v) {
  ((XSelectionEvent *)_p)->target = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XSelectionEvent_target(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_UART_TXD1_PIN() { clear_io_bit(0x43, 3); }


x86 assembly (clang, -O0):
<TOSH_CLR_UART_TXD1_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x3,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_UART_TXD1_PIN>:
mov    $0x43,%edi
mov    $0x3,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_UART_TXD1_PIN() {
%1 = call i32 @clear_io_bit(i32 67, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_UART_TXD1_PIN() {
%1 = tail call i32 @clear_io_bit(i32 67, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aa_endconv_st_le(double *, void *, int);
double aa_endconv_ld_le_d(void *src) {
  double r;
  aa_endconv_st_le(&r, src, sizeof(double));
  return r;
}


x86 assembly (clang, -O0):
<aa_endconv_ld_le_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x8,%edx
call   1030 <aa_endconv_st_le@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_endconv_ld_le_d>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x8,%edx
call   1030 <aa_endconv_st_le@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @aa_endconv_ld_le_d(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @aa_endconv_st_le(double* %3, i8* %4, i32 8)
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @aa_endconv_ld_le_d(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @aa_endconv_st_le(double* %2, i8* %0, i32 8)
%5 = load double, double* %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ add_trailing_slash(char *);
int /*<<< orphan*/ strcat(char *, char *);
void cat_with_slash(char *buf, char *file) {
  add_trailing_slash(buf);
  strcat(buf, file);
}


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

x86 assembly (clang, -O2):
<cat_with_slash>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <add_trailing_slash@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

LLVM IR (-O0):
define void @cat_with_slash(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 = call i32 @add_trailing_slash(i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @strcat(i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @cat_with_slash(i8* %0, i8* %1) {
%3 = tail call i32 @add_trailing_slash(i8* %0)
%4 = tail call i32 @strcat(i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ posix_error(int, char *);
int pthread_join(int /*<<< orphan*/, void **);
void Pthread_join(pthread_t tid, void **thread_return) {
  int rc;
  if ((rc = pthread_join(tid, thread_return)) != 0)
    posix_error(rc, "Pthread_join error");
}


x86 assembly (clang, -O0):
<Pthread_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <pthread_join@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1156 <Pthread_join+0x36>
mov    -0x14(%rbp),%edi
lea    0xeaf(%rip),%rsi
call   1030 <posix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pthread_join>:
push   %rax
call   1040 <pthread_join@plt>
test   %eax,%eax
je     1139 <Pthread_join+0x19>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <posix_error@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Pthread_join error\00"
define void @Pthread_join(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @pthread_join(i32 %6, i8** %7)
store i32 %8, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %5
%12 = call i32 @posix_error(i32 %11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Pthread_join error\00"
define void @Pthread_join(i32 %0, i8** %1) {
%3 = tail call i32 @pthread_join(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @posix_error(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dmaxsorted(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dmaxsorted(N, x, stride);
  printf("max: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1040 <stdlib_strided_dmaxsorted@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dmaxsorted@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"max: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dmaxsorted(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"max: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dmaxsorted(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void cliff_init() {}


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

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

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

LLVM IR (-O2):
define void @cliff_init() {
ret void
}
/* Variables and functions */
char *utf8_next_char(char const *);
extern int utf8_strlen(const char *str) {
  int char_counter = 0;
  while (*str) {
    str = utf8_next_char(str);
    ++char_counter;
  }
  return char_counter;
}


x86 assembly (clang, -O0):
<utf8_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <utf8_strlen+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <utf8_next_char@plt>
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <utf8_strlen+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_strlen>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1132 <utf8_strlen+0x22>
mov    %rdi,%rax
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <utf8_next_char@plt>
add    $0x1,%ebx
cmpb   $0x0,(%rax)
jne    1120 <utf8_strlen+0x10>
jmp    1134 <utf8_strlen+0x24>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @utf8_strlen(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = tail call i8* @utf8_next_char(i8* %6)
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void hashtable_nullFree(void *o) { return; }


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

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

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

LLVM IR (-O2):
define void @hashtable_nullFree(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int baz(int);
int bar(int a) { return (baz(a + 1) - 1); }


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

x86 assembly (clang, -O2):
<bar>:
push   %rax
add    $0x1,%edi
call   1030 <baz@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @baz(i32 %2)
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t UARTModemControlGet(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000030))) &
          (0x00000800 | 0x00000400));
}


x86 assembly (clang, -O0):
<UARTModemControlGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
mov    (%rax),%eax
and    $0xc00,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlGet>:
movslq %edi,%rcx
mov    $0xc00,%eax
and    0x30(%rcx),%eax
ret

LLVM IR (-O0):
define i32 @UARTModemControlGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 48
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 3072
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTModemControlGet(i32 %0) {
%2 = add nsw i32 %0, 48
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 3072
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, unsigned char *, int);
signed int I4(unsigned char *p) {
  signed int u;
  memcpy(&u, p, 4);
  return u;
}


x86 assembly (clang, -O0):
<I4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I4>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @I4(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ vw_rx_start();
int /*<<< orphan*/ vw_set_rx_pin(int);
int /*<<< orphan*/ vw_setup(int);
void SetupReceiver(int pin) {
  vw_set_rx_pin(pin);
  vw_setup(2000);
  vw_rx_start();
}


x86 assembly (clang, -O0):
<SetupReceiver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <vw_set_rx_pin@plt>
mov    $0x7d0,%edi
call   1040 <vw_setup@plt>
mov    $0x0,%al
call   1050 <vw_rx_start@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetupReceiver>:
push   %rax
call   1030 <vw_set_rx_pin@plt>
mov    $0x7d0,%edi
call   1040 <vw_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <vw_rx_start@plt>

LLVM IR (-O0):
define void @SetupReceiver(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @vw_set_rx_pin(i32 %3)
%5 = call i32 @vw_setup(i32 2000)
%6 = call i32 (...) @vw_rx_start()
ret void
}

LLVM IR (-O2):
define void @SetupReceiver(i32 %0) {
%2 = tail call i32 @vw_set_rx_pin(i32 %0)
%3 = tail call i32 @vw_setup(i32 2000)
%4 = tail call i32 (...) @vw_rx_start()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ elms;

/* Variables and functions */
int /*<<< orphan*/ print_list(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ qs(int *, int /*<<< orphan*/, int);
int main(void) {
  int len;
  int elms[] = {7, 2, 5, 9, 6, 1, 3, 8, 4};
  len = sizeof(elms) / sizeof(elms[0]);
  qs(elms, 0, len - 1);
  print_list(elms, 0, len - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
movl   $0x9,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <qs@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <print_list@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef5(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <qs@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <print_list@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.elms = [9 x i32] [i32 7, i32 2, i32 5, i32 9, i32 6, i32 1, i32 3, i32 8, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [9 x i32]
store i32 0, i32* %1
%4 = bitcast [9 x i32]* %3 to i8*
store i32 9, i32* %2
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = call i32 @qs(i32* %5, i32 0, i32 %7)
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = call i32 @print_list(i32* %9, i32 0, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.elms = [9 x i32] [i32 7, i32 2, i32 5, i32 9, i32 6, i32 1, i32 3, i32 8, i32 4]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @qs(i32* %3, i32 0, i32 8)
%5 = call i32 @print_list(i32* %3, i32 0, i32 8)
ret i32 0
}
/* Variables and functions */
int dummy02(int);
int dummy04(int);
int main(void) {
  int i = 0;
  i = dummy02(i);
  i = dummy04(i);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <dummy02@plt>
mov    %eax,%edi
call   1030 <dummy04@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @dummy02(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @dummy04(i32 %5)
store i32 %6, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @dummy02(i32 0)
%2 = tail call i32 @dummy04(i32 %1)
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int compareString(void *p1, void *p2) {
  char *s1 = (char *)p1;
  char *s2 = (char *)p2;
  return strcmp(s1, s2);
}


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

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

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

LLVM IR (-O2):
define i32 @compareString(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ m221_reset();
int /*<<< orphan*/ p16c8init(int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/ *, int /*<<< orphan*/);
void m221_init(uint8_t *prgROMin, uint32_t prgROMsizeIn, uint8_t *prgRAMin,
               uint32_t prgRAMsizeIn, uint8_t *chrROMin,
               uint32_t chrROMsizeIn) {
  p16c8init(prgROMin, prgROMsizeIn, prgRAMin, prgRAMsizeIn, chrROMin,
            chrROMsizeIn);
  m221_reset();
}


x86 assembly (clang, -O0):
<m221_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1040 <p16c8init@plt>
mov    $0x0,%al
call   1030 <m221_reset@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @m221_init(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 @p16c8init(i32* %13, i32 %14, i32* %15, i32 %16, i32* %17, i32 %18)
%20 = call i32 (...) @m221_reset()
ret void
}

LLVM IR (-O2):
define void @m221_init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5) {
%7 = tail call i32 @p16c8init(i32* %0, i32 %1, i32* %2, i32 %3, i32* %4, i32 %5)
%8 = tail call i32 (...) @m221_reset()
ret void
}
int main() {
  asm volatile(".byte 0xd6" : : "a"(0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
(bad)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect ".byte 0xd6", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 0)
ret i32 0
}
int test_imm_2Bint16_mem(short *val) {
  return ((*val) & (0x2B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Bint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 43
%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_2Bint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 43
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ test_init_noxdg();
int /*<<< orphan*/ test_init_xdg();
int main() {
  assert(!test_init_noxdg());
  assert(!test_init_xdg());
  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 <test_init_noxdg@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1050 <test_init_xdg@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_init_noxdg@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1050 <test_init_xdg@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    0x2e80(%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 (...) @test_init_noxdg()
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 (...) @test_init_xdg()
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test_init_noxdg()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @test_init_xdg()
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
/* Variables and functions */
int EXIT_SUCCESS;
int main() {
  for (int i = 0; i < 10; ++i) {
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112f <main+0x2f>
jmp    1121 <main+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @EXIT_SUCCESS
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int EBUSY;
int /*<<< orphan*/ abort();
int pthread_mutex_trylock(int /*<<< orphan*/ *);
int __safe_p_mutex_trylock(pthread_mutex_t *mtx) {
  int en = pthread_mutex_trylock(mtx);
  if (en != 0 && en != EBUSY) {
    abort();
  }
  return en;
}


x86 assembly (clang, -O0):
<__safe_p_mutex_trylock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_trylock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115b <__safe_p_mutex_trylock+0x3b>
mov    -0xc(%rbp),%eax
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%eax
je     115b <__safe_p_mutex_trylock+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__safe_p_mutex_trylock>:
push   %rax
call   1040 <pthread_mutex_trylock@plt>
test   %eax,%eax
je     1135 <__safe_p_mutex_trylock+0x15>
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
jne    1137 <__safe_p_mutex_trylock+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@EBUSY = global i32 0
define i32 @__safe_p_mutex_trylock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_trylock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32, i32* @EBUSY
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %8, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EBUSY = global i32 0
define i32 @__safe_p_mutex_trylock(i32* %0) {
%2 = tail call i32 @pthread_mutex_trylock(i32* %0)
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @EBUSY
%5 = icmp eq i32 %2, %4
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_notfound(char *hash, unsigned char flags) {
  if (flags & 0x01) {
    printf("0\n");
  } else {
    printf("%s\t%s\n", hash, "Hash Not Found");
  }
  return;
}


x86 assembly (clang, -O0):
<print_notfound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1145 <print_notfound+0x35>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115e <print_notfound+0x4e>
mov    -0x8(%rbp),%rsi
lea    0xeb3(%rip),%rdi
lea    0xeb3(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_notfound>:
test   $0x1,%sil
jne    1141 <print_notfound+0x21>
mov    %rdi,%rax
lea    0xed0(%rip),%rdi
lea    0xed0(%rip),%rdx
mov    %rax,%rsi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xece(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"0\0A\00"
@.str.1 = [7 x i8] c"%s\09%s\0A\00"
@.str.2 = [15 x i8] c"Hash Not Found\00"
define void @print_notfound(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%s\09%s\0A\00"
@.str.2 = [15 x i8] c"Hash Not Found\00"
@str = [2 x i8] c"0\00"
define void @print_notfound(i8* %0, i8 zeroext %1) {
%3 = and i8 %1, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %9
7: ; preds = %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ runAllTests_dbparser();
int main(void) {
  runAllTests_dbparser();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runAllTests_dbparser()
ret i32 0
}
/* Variables and functions */
char *pppoat_alloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *pppoat_strdup(const char *s) {
  char *out = pppoat_alloc(strlen(s) + 1);
  if (out != NULL)
    strcpy(out, s);
  return out;
}


x86 assembly (clang, -O0):
<pppoat_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 <pppoat_alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <pppoat_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):
<pppoat_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <pppoat_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <pppoat_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* @pppoat_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 i8* @pppoat_alloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @pppoat_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @pppoat_alloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int main1();
int main() {
  check_vect();
  return main1();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 (...) @main1()
ret i32 %2
}
int test_imm_02uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x02 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_02uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 131072
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int n = 0;
  while (n++ < 3)
    printf("n is %d\n", n);
  printf("That's all this program does.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x3,%eax
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1126 <main+0x16>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"n is %d\0A\00"
@.str.1 = [31 x i8] c"That's all this program does.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = icmp slt i32 %4, 3
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %3
10: ; preds = %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"n is %d\0A\00"
@str = [30 x i8] c"That's all this program does.\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct ps_process {
  int dummy;
};
struct obus_object {
  int dummy;
};

/* Variables and functions */
int obus_object_is_registered(struct obus_object const *);
int ps_process_is_registered(const struct ps_process *object) {
  const struct obus_object *obj = (const struct obus_object *)object;
  return obus_object_is_registered(obj);
}


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

x86 assembly (clang, -O2):
<ps_process_is_registered>:
jmp    1030 <obus_object_is_registered@plt>

LLVM IR (-O0):
%struct.ps_process = type { i32 }
%struct.obus_object = type { i32 }
define i32 @ps_process_is_registered(%struct.ps_process* %0) {
%2 = alloca %struct.ps_process*
%3 = alloca %struct.obus_object*
store %struct.ps_process* %0, %struct.ps_process** %2
%4 = load %struct.ps_process*, %struct.ps_process** %2
%5 = bitcast %struct.ps_process* %4 to %struct.obus_object*
store %struct.obus_object* %5, %struct.obus_object** %3
%6 = load %struct.obus_object*, %struct.obus_object** %3
%7 = call i32 @obus_object_is_registered(%struct.obus_object* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.ps_process = type { i32 }
%struct.obus_object = type { i32 }
define i32 @ps_process_is_registered(%struct.ps_process* %0) {
%2 = bitcast %struct.ps_process* %0 to %struct.obus_object*
%3 = tail call i32 @obus_object_is_registered(%struct.obus_object* %2)
ret i32 %3
}
int a() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @a() {
ret i32 1
}
void ft_get_values(char **data, char **str, char **nl) {
  *str = data[0];
  *nl = data[1];
}


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

x86 assembly (clang, -O2):
<ft_get_values>:
mov    (%rdi),%rax
mov    %rax,(%rsi)
mov    0x8(%rdi),%rax
mov    %rax,(%rdx)
ret

LLVM IR (-O0):
define void @ft_get_values(i8** %0, i8** %1, i8** %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i8**
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %5
store i8* %9, i8** %10
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %6
store i8* %13, i8** %14
ret void
}

LLVM IR (-O2):
define void @ft_get_values(i8** nocapture %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2) {
%4 = load i8*, i8** %0
store i8* %4, i8** %1
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
store i8* %6, i8** %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sysbar2(void *);
int sysfn2(void) {
  int a = (void *)0;
  a = (void *)0;
  sysbar2((void *)0);
  return (void *)0;
}


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

x86 assembly (clang, -O2):
<sysfn2>:
push   %rax
xor    %edi,%edi
call   1030 <sysbar2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sysfn2() {
%1 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %1
%2 = call i32 @sysbar2(i8* null)
ret i32 0
}

LLVM IR (-O2):
define i32 @sysfn2() {
%1 = tail call i32 @sysbar2(i8* null)
ret i32 0
}
void XDefaultString() {}


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

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

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

LLVM IR (-O2):
define void @XDefaultString() {
ret void
}
/* Variables and functions */
int foo(int, int);
int foz(int, int);
int bar(int j) { return foo(j, j - 2) * foz(j - 2, j); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
sub    $0x2,%esi
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
mov    -0x4(%rbp),%esi
call   1030 <foz@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    -0x2(%rbx),%ebp
mov    %ebp,%esi
call   1040 <foo@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <foz@plt>
imul   %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 2
%6 = call i32 @foo(i32 %3, i32 %5)
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 2
%9 = load i32, i32* %2
%10 = call i32 @foz(i32 %8, i32 %9)
%11 = mul nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add nsw i32 %0, -2
%3 = tail call i32 @foo(i32 %0, i32 %2)
%4 = tail call i32 @foz(i32 %2, i32 %0)
%5 = mul nsw i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ perror(char *);
FILE *Fopen(const char *path, const char *mode) {
  FILE *fp;
  fp = fopen(path, mode);
  if (fp == NULL)
    perror("fopen error");
  return fp;
}


x86 assembly (clang, -O0):
<Fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <Fopen+0x38>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fopen>:
push   %rbx
call   1030 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1133 <Fopen+0x13>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rdi
call   1040 <perror@plt>
jmp    112e <Fopen+0xe>

LLVM IR (-O0):
@.str = [12 x i8] c"fopen error\00"
define i32* @Fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"fopen error\00"
define noalias i32* @Fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32* %3
}