xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strchr(char *, char);
void sysfs_devname_dev_to_sys(char *name) {
  char *c;
  if (name)
    while ((c = strchr(name, '/')))
      c[0] = '!';
}


x86 assembly (clang, -O0):
<sysfs_devname_dev_to_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1159 <sysfs_devname_dev_to_sys+0x49>
jmp    112c <sysfs_devname_dev_to_sys+0x1c>
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1154 <sysfs_devname_dev_to_sys+0x44>
mov    -0x10(%rbp),%rax
movb   $0x21,(%rax)
jmp    112c <sysfs_devname_dev_to_sys+0x1c>
jmp    1159 <sysfs_devname_dev_to_sys+0x49>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysfs_devname_dev_to_sys>:
push   %rbx
test   %rdi,%rdi
je     1137 <sysfs_devname_dev_to_sys+0x27>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1137 <sysfs_devname_dev_to_sys+0x27>
movb   $0x21,(%rax)
jmp    1120 <sysfs_devname_dev_to_sys+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @sysfs_devname_dev_to_sys(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i8* @strchr(i8* %0, i8 signext 47)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %4, %3 ]
store i8 33, i8* %7
%8 = tail call i8* @strchr(i8* %0, i8 signext 47)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %6
10: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *, int, int);
int *twoSum(int *, int, int);
int main() {
  int nums[5] = {1, 2, 3, 4, 5};
  int *indices = twoSum(nums, 5, 7);
  printf("%d, %d\n", indices[0], indices[1]);
  free(indices);
  return 0;
}


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

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

LLVM IR (-O0):
@__const.main.nums = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = call i32* @twoSum(i32* %5, i32 5, i32 7)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12)
%14 = load i32*, i32** %3
%15 = call i32 @free(i32* %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [8 x i8] c"%d, %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32* @twoSum(i32* %3, i32 5, i32 7)
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = call i32 @free(i32* %4)
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int is_dir(const char *path) {
  struct stat st;
  return (stat(path, &st) == 0 && S_ISDIR(st.st_mode));
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <is_dir+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <is_dir+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stdout;
void __map_print_u32(void *c, void *k, void *v) {
  fprintf(stdout, "(%u,%u)\n", *(uint32_t *)k, *(uint32_t *)v);
}


x86 assembly (clang, -O0):
<__map_print_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__map_print_u32>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%eax
mov    (%rdx),%ecx
lea    0xedc(%rip),%rsi
mov    %eax,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"(%u,%u)\0A\00"
define void @__map_print_u32(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 i32, i32* @stdout
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = load i8*, i8** %6
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
%14 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"(%u,%u)\0A\00"
define void @__map_print_u32(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = load i32, i32* @stdout
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = bitcast i8* %2 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vfs;

/* Variables and functions */
int RTLD_GLOBAL;
int RTLD_NOW;
void *dlopen(char const *, int);
void *unixDlOpen(sqlite3_vfs *NotUsed, const char *zFilename) {
  (void)(NotUsed);
  return dlopen(zFilename, RTLD_NOW | RTLD_GLOBAL);
}


x86 assembly (clang, -O0):
<unixDlOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
call   1030 <dlopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unixDlOpen>:
mov    %rsi,%rdi
mov    0x2ec6(%rip),%rax
mov    0x2ec7(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <dlopen@plt>

LLVM IR (-O0):
@RTLD_NOW = global i32 0
@RTLD_GLOBAL = global i32 0
define i8* @unixDlOpen(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @RTLD_NOW
%8 = load i32, i32* @RTLD_GLOBAL
%9 = or i32 %7, %8
%10 = call i8* @dlopen(i8* %6, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
@RTLD_NOW = global i32 0
@RTLD_GLOBAL = global i32 0
define i8* @unixDlOpen(i32* nocapture readnone %0, i8* %1) {
%3 = load i32, i32* @RTLD_NOW
%4 = load i32, i32* @RTLD_GLOBAL
%5 = or i32 %4, %3
%6 = tail call i8* @dlopen(i8* %1, i32 %5)
ret i8* %6
}
/* Variables and functions */
void pumas_version(int *major, int *minor) {
  if (major != NULL)
    *major = 1;
  if (minor != NULL)
    *minor = 1;
}


x86 assembly (clang, -O0):
<pumas_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1121 <pumas_version+0x21>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     1136 <pumas_version+0x36>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pumas_version>:
test   %rdi,%rdi
je     110b <pumas_version+0xb>
movl   $0x1,(%rdi)
test   %rsi,%rsi
je     1116 <pumas_version+0x16>
movl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @pumas_version(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 = icmp ne i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32*, i32** %3
store i32 1, i32* %8
br label %9
9: ; preds = %7, %2
%10 = load i32*, i32** %4
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = load i32*, i32** %4
store i32 1, i32* %13
br label %14
14: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @pumas_version(i32* writeonly %0, i32* writeonly %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
store i32 1, i32* %0
br label %5
5: ; preds = %4, %2
%6 = icmp eq i32* %1, null
br i1 %6, label %8, label %7
7: ; preds = %5
store i32 1, i32* %1
br label %8
8: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sla_djcl_(double *, int *, int *, int *, double *, int *);
void slaDjcl(double djm, int *iy, int *im, int *id, double *fd, int *j) {
  sla_djcl_(&djm, iy, im, id, fd, j);
}


x86 assembly (clang, -O0):
<slaDjcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    -0x8(%rbp),%rdi
call   1030 <sla_djcl_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaDjcl>:
push   %rax
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <sla_djcl_@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @slaDjcl(double %0, i32* %1, i32* %2, i32* %3, double* %4, i32* %5) {
%7 = alloca double
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca i32*
store double %0, double* %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store double* %4, double** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = load double*, double** %11
%17 = load i32*, i32** %12
%18 = call i32 @sla_djcl_(double* %7, i32* %13, i32* %14, i32* %15, double* %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @slaDjcl(double %0, i32* %1, i32* %2, i32* %3, double* %4, i32* %5) {
%7 = alloca double
store double %0, double* %7
%8 = call i32 @sla_djcl_(double* %7, i32* %1, i32* %2, i32* %3, double* %4, i32* %5)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
double fahr2cels(double);
int /*<<< orphan*/ printf(char *, double);
double readd(char *);
int main() {
  double celsius, fahrenheit;
  fahrenheit = readd("Enter temperature in Fahrenheit");
  celsius = fahr2cels(fahrenheit);
  printf("Temperature in Celsius: %.2f\n", celsius);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <readd@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <fahr2cels@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <readd@plt>
call   1030 <fahr2cels@plt>
lea    0xed7(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Enter temperature in Fahrenheit\00"
@.str.1 = [30 x i8] c"Temperature in Celsius: %.2f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call double @readd(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store double %4, double* %3
%5 = load double, double* %3
%6 = call double @fahr2cels(double %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@.str = [32 x i8] c"Enter temperature in Fahrenheit\00"
@.str.1 = [30 x i8] c"Temperature in Celsius: %.2f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call double @readd(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call double @fahr2cels(double %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), double %2)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int write(int, unsigned char *, int);
int a2cin(int fd, char cin) {
  unsigned char cinpkt[2];
  cinpkt[0] = 0x96;
  cinpkt[1] = cin;
  return (write(fd, cinpkt, 2));
}


x86 assembly (clang, -O0):
<a2cin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movb   $0x96,-0x7(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x7(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a2cin>:
push   %rax
movb   $0x96,0x6(%rsp)
mov    %sil,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @a2cin(i32 %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -106, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %1, i8* %5
%6 = call i32 @write(i32 %0, i8* %4, i32 2)
ret i32 %6
}
void VP8EncDspInitMIPSdspR2(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *product_ops_get_sku(struct product *product) {
  printf("product::get_sku()\n");
  return 0;
}


x86 assembly (clang, -O0):
<product_ops_get_sku>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<product_ops_get_sku>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.product = type { i32 }
@.str = [20 x i8] c"product::get_sku()\0A\00"
define i8* @product_ops_get_sku(%struct.product* %0) {
%2 = alloca %struct.product*
store %struct.product* %0, %struct.product** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
%struct.product = type { i32 }
@str = [19 x i8] c"product::get_sku()\00"
define noalias i8* @product_ops_get_sku(%struct.product* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i8* null
}
int func(int val) { return val; }


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

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

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

LLVM IR (-O2):
define i32 @func(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ ffcmrk();
extern void ftcmrk_(void) {
  ;
  ffcmrk();
  return;
}


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

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

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

LLVM IR (-O2):
define void @ftcmrk_() {
%1 = tail call i32 (...) @ffcmrk()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
struct lcp_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_code_reject(struct lcp_context *, int /*<<< orphan*/ *,
                                    int /*<<< orphan*/);
void receive_unknown_code(struct lcp_context *context, uint8_t *buf,
                          uint16_t len) {
  send_code_reject(context, buf, len);
}


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

x86 assembly (clang, -O2):
<receive_unknown_code>:
jmp    1030 <send_code_reject@plt>

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

LLVM IR (-O2):
%struct.lcp_context = type { i32 }
define void @receive_unknown_code(%struct.lcp_context* %0, i32* %1, i32 %2) {
%4 = tail call i32 @send_code_reject(%struct.lcp_context* %0, i32* %1, i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ gid_t;

/* Variables and functions */
scalar_t__ getgid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  gid_t id;
  id = getgid();
  printf("%d\n", (int)id);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getgid()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ prt(char *, int, int /*<<< orphan*/);
void display_commands() {
  prt("You may:", 20, 0);
  prt(" p) Purchase an item.           b) Browse store's inventory.", 21, 0);
  prt(" s) Sell an item.               i/e/t/w/x) Inventory/Equipment Lists.",
      22, 0);
  prt("ESC) Exit from Building.        ^R) Redraw the screen.", 23, 0);
}


x86 assembly (clang, -O0):
<display_commands>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x14,%esi
xor    %edx,%edx
call   1030 <prt@plt>
lea    0xedb(%rip),%rdi
mov    $0x15,%esi
xor    %edx,%edx
call   1030 <prt@plt>
lea    0xf05(%rip),%rdi
mov    $0x16,%esi
xor    %edx,%edx
call   1030 <prt@plt>
lea    0xf38(%rip),%rdi
mov    $0x17,%esi
xor    %edx,%edx
call   1030 <prt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_commands>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x14,%esi
xor    %edx,%edx
call   1030 <prt@plt>
lea    0xede(%rip),%rdi
mov    $0x15,%esi
xor    %edx,%edx
call   1030 <prt@plt>
lea    0xf08(%rip),%rdi
mov    $0x16,%esi
xor    %edx,%edx
call   1030 <prt@plt>
lea    0xf3b(%rip),%rdi
mov    $0x17,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <prt@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"You may:\00"
@.str.1 = [61 x i8] c" p) Purchase an item. b) Browse store's inventory.\00"
@.str.2 = [70 x i8] c" s) Sell an item. i/e/t/w/x) Inventory/Equipment Lists.\00"
@.str.3 = [55 x i8] c"ESC) Exit from Building. ^R) Redraw the screen.\00"
define void @display_commands() {
%1 = call i32 @prt(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 20, i32 0)
%2 = call i32 @prt(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 21, i32 0)
%3 = call i32 @prt(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0), i32 22, i32 0)
%4 = call i32 @prt(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0), i32 23, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"You may:\00"
@.str.1 = [61 x i8] c" p) Purchase an item. b) Browse store's inventory.\00"
@.str.2 = [70 x i8] c" s) Sell an item. i/e/t/w/x) Inventory/Equipment Lists.\00"
@.str.3 = [55 x i8] c"ESC) Exit from Building. ^R) Redraw the screen.\00"
define void @display_commands() {
%1 = tail call i32 @prt(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 20, i32 0)
%2 = tail call i32 @prt(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0), i32 21, i32 0)
%3 = tail call i32 @prt(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0), i32 22, i32 0)
%4 = tail call i32 @prt(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0), i32 23, i32 0)
ret void
}
int proctal_implementation_pid(struct proctal *p) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.proctal = type opaque
define i32 @proctal_implementation_pid(%struct.proctal* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *new_pq(size_t, int /*<<< orphan*/, int (*)(void const *, void const *));
void *priority_queue_min(size_t init_size, int (*compare)(const void *first,
                                                          const void *second)) {
  return new_pq(init_size, 0, compare);
}


x86 assembly (clang, -O0):
<priority_queue_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <new_pq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<priority_queue_min>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <new_pq@plt>

LLVM IR (-O0):
define i8* @priority_queue_min(i64 %0, i32 (i8*, i8*)* %1) {
%3 = alloca i64
%4 = alloca i32 (i8*, i8*)*
store i64 %0, i64* %3
store i32 (i8*, i8*)* %1, i32 (i8*, i8*)** %4
%5 = load i64, i64* %3
%6 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %4
%7 = call i8* @new_pq(i64 %5, i32 0, i32 (i8*, i8*)* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @priority_queue_min(i64 %0, i32 (i8*, i8*)* %1) {
%3 = tail call i8* @new_pq(i64 %0, i32 0, i32 (i8*, i8*)* %1)
ret i8* %3
}
char *strupr(char *str) { return str; }


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

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

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

LLVM IR (-O2):
define i8* @strupr(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f1(int x) { printf("f1: %d\n", x); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"f1: %d\0A\00"
define void @f1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bitcount(unsigned int);
int main(void) {
  unsigned int x = 100;
  bitcount(x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1030 <bitcount@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 100, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @bitcount(i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bitcount(i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(long);
void timer_pause(long milliseconds) { usleep(milliseconds * 1000); }


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

x86 assembly (clang, -O2):
<timer_pause>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @timer_pause(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul nsw i64 %3, 1000
%5 = call i32 @usleep(i64 %4)
ret void
}

LLVM IR (-O2):
define void @timer_pause(i64 %0) {
%2 = mul nsw i64 %0, 1000
%3 = tail call i32 @usleep(i64 %2)
ret void
}
int load_config(const char *conf_file) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @load_config(i8* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, long);
void printReturnCode(FILE *out, long return_code) {
  fprintf(out, "%s:%ld\n", "return_code", return_code);
}


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

x86 assembly (clang, -O2):
<printReturnCode>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rsi
lea    0xee7(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s:%ld\0A\00"
@.str.1 = [12 x i8] c"return_code\00"
define void @printReturnCode(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s:%ld\0A\00"
@.str.1 = [12 x i8] c"return_code\00"
define void @printReturnCode(i32* nocapture %0, i64 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i64 %1)
ret void
}
/* Variables and functions */
int _partition(int *, int, int);
void _quick_sort(int *array, int low, int high) {
  if (low >= high)
    return;
  int partition_index = _partition(array, low, high);
  _quick_sort(array, low, partition_index - 1);
  _quick_sort(array, partition_index + 1, high);
}


x86 assembly (clang, -O0):
<_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <_quick_sort+0x23>
jmp    1179 <_quick_sort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <_partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <_quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <_quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <_partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <_quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <_quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @_quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp sge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %25
12: ; preds = %3
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @_partition(i32* %13, i32 %14, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
br label %25
25: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @_quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @_partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @_quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, size_t);
int /*<<< orphan*/ exit(int);
void *realloc(void *, size_t);
void *xrealloc(void *oldmem, size_t size) {
  void *mem;
  if (size == 0)
    size = 1;
  mem = realloc(oldmem, size);
  if (mem == NULL) {
    error("xrealloc %ld\n", size);
    exit(69);
  }
  return mem;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <xrealloc+0x23>
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1189 <xrealloc+0x59>
mov    -0x10(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <error@plt>
mov    $0x45,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
test   %rsi,%rsi
mov    $0x1,%ebx
cmovne %rsi,%rbx
mov    %rbx,%rsi
call   1030 <realloc@plt>
test   %rax,%rax
je     114c <xrealloc+0x1c>
pop    %rbx
ret
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
call   1040 <error@plt>
mov    $0x45,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"xrealloc %ld\0A\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 1, i64* %4
br label %9
9: ; preds = %8, %2
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i8* @realloc(i8* %10, i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %9
%16 = load i64, i64* %4
%17 = call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %16)
%18 = call i32 @exit(i32 69)
unreachable
19: ; preds = %9
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [14 x i8] c"xrealloc %ld\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = select i1 %3, i64 1, i64 %1
%5 = tail call i8* @realloc(i8* %0, i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %4)
%9 = tail call i32 @exit(i32 69)
unreachable
10: ; preds = %2
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ ArgText();
int /*<<< orphan*/ Me();
int /*<<< orphan*/ SendItem(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ TextOf(int /*<<< orphan*/);
void Act_Message(void) { SendItem(Me(), "%s\n", TextOf(ArgText())); }


x86 assembly (clang, -O0):
<Act_Message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <Me@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xe94(%rip),%rsi
call   1040 <SendItem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_Message>:
push   %rbx
xor    %eax,%eax
call   1050 <Me@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
lea    0xea1(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1040 <SendItem@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @Act_Message() {
%1 = call i32 (...) @Me()
%2 = call i32 (...) @ArgText()
%3 = call i32 @TextOf(i32 %2)
%4 = call i32 @SendItem(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @Act_Message() {
%1 = tail call i32 (...) @Me()
%2 = tail call i32 (...) @ArgText()
%3 = tail call i32 @TextOf(i32 %2)
%4 = tail call i32 @SendItem(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ expm1(double);
int /*<<< orphan*/ expm1f(float);
int /*<<< orphan*/ expm1l(long double);
void uninitvar_expm1(void) {
  float f;
  (void)expm1f(f);
  double d;
  (void)expm1(d);
  long double ld;
  (void)expm1l(ld);
}


x86 assembly (clang, -O0):
<uninitvar_expm1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1040 <expm1f@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <expm1@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expm1l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_expm1>:
sub    $0x18,%rsp
call   1040 <expm1f@plt>
call   1050 <expm1@plt>
call   1030 <expm1l@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_expm1() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @expm1f(float %4)
%6 = load double, double* %2
%7 = call i32 @expm1(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @expm1l(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_expm1() {
%1 = tail call i32 @expm1f(float undef)
%2 = tail call i32 @expm1(double undef)
%3 = tail call i32 @expm1l(x86_fp80 undef)
ret void
}
void rop3_211_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D | S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_211_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_211_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %cl
and    %al,%sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_211_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = xor i32 %40, -1
%42 = and i32 %38, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %5
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = load i8*, i8** %4
%51 = load i8, i8* %50
%52 = zext i8 %51 to i32
%53 = load i8, i8* %6
%54 = zext i8 %53 to i32
%55 = and i32 %52, %54
%56 = or i32 %49, %55
%57 = trunc i32 %56 to i8
%58 = load i8*, i8** %4
store i8 %57, i8* %58
ret void
}

LLVM IR (-O2):
define void @rop3_211_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int Arith_div(int, int);
int Arith_mod(int x, int y) { return x - y * Arith_div(x, y); }


x86 assembly (clang, -O0):
<Arith_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <Arith_div@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Arith_mod>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <Arith_div@plt>
imul   %ebx,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Arith_mod(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 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @Arith_div(i32 %7, i32 %8)
%10 = mul nsw i32 %6, %9
%11 = sub nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @Arith_mod(i32 %0, i32 %1) {
%3 = tail call i32 @Arith_div(i32 %0, i32 %1)
%4 = mul nsw i32 %3, %1
%5 = sub nsw i32 %0, %4
ret i32 %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int ZwClose(int Handle) {
  {
    int tmp_ndt_11;
    tmp_ndt_11 = __VERIFIER_nondet_int();
    if (tmp_ndt_11 == 0) {
      goto switch_12_0;
    } else {
      goto switch_12_default;
      if (0) {
      switch_12_0:
        return (0);
      switch_12_default:;
        return (-1073741823);
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<ZwClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <ZwClose+0x24>
jmp    1139 <ZwClose+0x29>
jmp    1145 <ZwClose+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <ZwClose+0x3c>
movl   $0xc0000001,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZwClose>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0xc0000001,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ZwClose(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
br label %13
10: ; No predecessors!
br i1 false, label %11, label %14
11: ; preds = %10
br label %12
12: ; preds = %11, %8
store i32 0, i32* %2
br label %16
13: ; preds = %9
store i32 -1073741823, i32* %2
br label %16
14: ; preds = %10
br label %15
15: ; preds = %14
br label %16
16: ; preds = %12, %13, %15
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @ZwClose(i32 %0) {
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 0, i32 -1073741823
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
void sprint_xchd_atRi(char *str, unsigned char i) {
  sprintf(str, "XCHD  A, @R%X                    ", i);
}


x86 assembly (clang, -O0):
<sprint_xchd_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_xchd_atRi>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"XCHD A, @R%X \00"
define void @sprint_xchd_atRi(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** %3
%6 = load i8, i8* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"XCHD A, @R%X \00"
define void @sprint_xchd_atRi(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_six_decimals() {
  char *str = "1234.000001";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 1234 && (dest % 1000000000) == 1000);
}


x86 assembly (clang, -O0):
<test_six_decimals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4d2,%ecx
mov    %al,-0xd(%rbp)
jne    1175 <test_six_decimals+0x55>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x3e8,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_six_decimals>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"1234.000001\00"
define void @test_six_decimals() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 1234
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 1000
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"1234.000001\00"
define void @test_six_decimals() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 0)
ret void
}