xunge/DecIR huggingface dataset:
void test10(volatile long long *p, volatile long long *q) { *p = *q; }


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

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

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

LLVM IR (-O2):
define void @test10(i64* %0, i64* %1) {
%3 = load volatile i64, i64* %1
store volatile i64 %3, i64* %0
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
size_t strlen(char const *);
int ends_with(const char *s, const char *end) {
  size_t slen = strlen(s);
  size_t endlen = strlen(end);
  return slen >= endlen && strcmp(&s[slen - endlen], end) == 0;
}


x86 assembly (clang, -O0):
<ends_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x20(%rbp),%rcx
mov    %al,-0x21(%rbp)
jb     117f <ends_with+0x5f>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ends_with>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rbx
jb     115e <ends_with+0x3e>
add    %rbx,%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ends_with(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %6
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = icmp uge i64 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = sub i64 %16, %17
%19 = getelementptr inbounds i8, i8* %15, i64 %18
%20 = load i8*, i8** %4
%21 = call i64 @strcmp(i8* %19, i8* %20)
%22 = icmp eq i64 %21, 0
br label %23
23: ; preds = %14, %2
%24 = phi i1 [ false, %2 ], [ %22, %14 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @ends_with(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = sub i64 %3, %4
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i64 @strcmp(i8* %8, i8* %1)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %2
%13 = phi i32 [ 0, %2 ], [ %11, %6 ]
ret i32 %13
}
int expr(char *expbuf) {}


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

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

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

LLVM IR (-O2):
define i32 @expr(i8* nocapture readnone %0) {
ret i32 undef
}
int m12mo_s_power_fac(int on) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @m12mo_s_power_fac(i32 %0) {
ret i32 0
}
int virtual_machine_object_class_print(
    const struct virtual_machine_object *object) {
  (void)object;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.virtual_machine_object = type opaque
define i32 @virtual_machine_object_class_print(%struct.virtual_machine_object* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_conf(void *tmc) { free(tmc); }


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

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

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

LLVM IR (-O2):
define void @free_conf(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void utfree(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @utfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double sqrt(double);
int main() {
  {
    float z10, z5, tmp12;
    tmp12 = (float)(-2.613125930) * z10 + z5;
  }
  {
    double a, b, c, root;
    root = (-b - sqrt(b * b - 4 * a * c)) / (2 * a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xedf(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  0xe97(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe4d(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 0, i32* %1
%9 = load float, float* %2
%10 = load float, float* %3
%11 = call float @llvm.fmuladd.f32(float 0xC004E7AEA0000000, float %9, float %10)
store float %11, float* %4
%12 = load double, double* %6
%13 = fneg double %12
%14 = load double, double* %6
%15 = load double, double* %6
%16 = load double, double* %5
%17 = fmul double 4.000000e+00, %16
%18 = load double, double* %7
%19 = fmul double %17, %18
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %14, double %15, double %20)
%22 = call double @sqrt(double %21)
%23 = fsub double %13, %22
%24 = load double, double* %5
%25 = fmul double 2.000000e+00, %24
%26 = fdiv double %23, %25
store double %26, double* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CacheSync(int);
int SyncDisk() {
  int count;
  for (count = 4096; count--;)
    CacheSync(count);
  return 0;
}


x86 assembly (clang, -O0):
<SyncDisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1000,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1140 <SyncDisk+0x30>
mov    -0x4(%rbp),%edi
call   1030 <CacheSync@plt>
jmp    111f <SyncDisk+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SyncDisk>:
push   %rbx
mov    $0xfff,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <CacheSync@plt>
add    $0xffffffff,%ebx
jb     1120 <SyncDisk+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @SyncDisk() {
%1 = alloca i32
store i32 4096, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
%5 = icmp ne i32 %3, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 @CacheSync(i32 %7)
br label %2
9: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @SyncDisk() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 4095, %0 ], [ %4, %1 ]
%3 = tail call i32 @CacheSync(i32 %2)
%4 = add nsw i32 %2, -1
%5 = icmp eq i32 %2, 0
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void my_strcat(char *d, const char *s) {
  char *source = (char *)s;
  while (*d)
    d++;
  while (*source)
    *d++ = *source++;
  *d = 0;
}


x86 assembly (clang, -O0):
<my_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <my_strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <my_strcat+0x14>
jmp    1137 <my_strcat+0x37>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <my_strcat+0x6b>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1137 <my_strcat+0x37>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcat>:
mov    %rdi,%rcx
add    $0x1,%rdi
cmpb   $0x0,(%rcx)
jne    1100 <my_strcat>
mov    (%rsi),%al
test   %al,%al
je     1136 <my_strcat+0x36>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
mov    %al,(%rdi,%rcx,1)
movzbl 0x2(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1120 <my_strcat+0x20>
add    %rcx,%rdi
mov    %rdi,%rcx
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define void @my_strcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %15, %11 ], [ %1, %8 ]
%14 = phi i8* [ %16, %11 ], [ %4, %8 ]
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %12, i8* %14
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %16, %11 ]
store i8 0, i8* %20
ret void
}
/* Variables and functions */
scalar_t__ ENOSYS;
scalar_t__ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fcntl(int, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int err = fcntl(1, 42);
  if (err == -1 && errno == ENOSYS)
    printf("ENOSYS\n");
  printf("xyzzy\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2a,%esi
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1181 <main+0x51>
mov    0x2e76(%rip),%rax
mov    (%rax),%rax
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%rax
jne    1181 <main+0x51>
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2a,%esi
call   1040 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    1167 <main+0x37>
mov    0x2e8c(%rip),%rax
mov    (%rax),%rax
mov    0x2e92(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <main+0x37>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@ENOSYS = global i64 0
@.str = [8 x i8] c"ENOSYS\0A\00"
@.str.1 = [7 x i8] c"xyzzy\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @fcntl(i32 1, i32 42)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i64, i64* @errno
%8 = load i64, i64* @ENOSYS
%9 = icmp eq i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %6, %0
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@ENOSYS = global i64 0
@str = [6 x i8] c"xyzzy\00"
@str.2 = [7 x i8] c"ENOSYS\00"
define i32 @main() {
%1 = tail call i32 @fcntl(i32 1, i32 42)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = load i64, i64* @errno
%5 = load i64, i64* @ENOSYS
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %3, %0
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned int vp8_sub_pixel_variance16x16_c(unsigned char const *, int,
                                           int /*<<< orphan*/, int,
                                           unsigned char const *, int,
                                           unsigned int *);
unsigned int vp8_variance_halfpixvar16x16_v_c(const unsigned char *src_ptr,
                                              int source_stride,
                                              const unsigned char *ref_ptr,
                                              int recon_stride,
                                              unsigned int *sse) {
  return vp8_sub_pixel_variance16x16_c(src_ptr, source_stride, 0, 4, ref_ptr,
                                       recon_stride, sse);
}


x86 assembly (clang, -O0):
<vp8_variance_halfpixvar16x16_v_c>:
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    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    $0x4,%ecx
mov    %rax,(%rsp)
call   1030 <vp8_sub_pixel_variance16x16_c@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_variance_halfpixvar16x16_v_c>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%rax
mov    %r8,(%rsp)
xor    %edx,%edx
mov    $0x4,%ecx
mov    %rax,%r8
call   1030 <vp8_sub_pixel_variance16x16_c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vp8_variance_halfpixvar16x16_v_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load i32, i32* %9
%15 = load i32*, i32** %10
%16 = call i32 @vp8_sub_pixel_variance16x16_c(i8* %11, i32 %12, i32 0, i32 4, i8* %13, i32 %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @vp8_variance_halfpixvar16x16_v_c(i8* %0, i32 %1, i8* %2, i32 %3, i32* %4) {
%6 = tail call i32 @vp8_sub_pixel_variance16x16_c(i8* %0, i32 %1, i32 0, i32 4, i8* %2, i32 %3, i32* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0x55AA55AA;
  int b = 0x12345678;
  int c = 0x98765432;
  printf("a andn b is %d\n", a & ~b);
  printf("b orn  a is %d\n", b | ~a);
  printf("a xorn c is %d\n", a ^ ~c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x55aa55aa,-0x8(%rbp)
movl   $0x12345678,-0xc(%rbp)
movl   $0x98765432,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
or     %eax,%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
xor    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"a andn b is %d\0A\00"
@.str.1 = [16 x i8] c"b orn a is %d\0A\00"
@.str.2 = [16 x i8] c"a xorn c is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 1437226410, i32* %2
store i32 305419896, i32* %3
store i32 -1737075662, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = xor i32 %6, -1
%8 = and i32 %5, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = xor i32 %11, -1
%13 = or i32 %10, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = xor i32 %16, -1
%18 = xor i32 %15, %17
%19 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"a andn b is %d\0A\00"
@.str.1 = [16 x i8] c"b orn a is %d\0A\00"
@.str.2 = [16 x i8] c"a xorn c is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 1166672258)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 -1166672259)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 841219687)
ret i32 0
}
/* Variables and functions */
unsigned long strlcpy(char *, char const *, unsigned long);
unsigned long strlen(char const *);
void copyout_string(const char *str, char *out, unsigned long *out_len) {
  unsigned long len;
  if (out != NULL)
    len = strlcpy(out, str, *out_len);
  else
    len = strlen(str);
  if (out_len != NULL)
    *out_len = len;
}


x86 assembly (clang, -O0):
<copyout_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <copyout_string+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
call   1040 <strlcpy@plt>
mov    %rax,-0x20(%rbp)
jmp    1169 <copyout_string+0x49>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117f <copyout_string+0x5f>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyout_string>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rax
test   %rsi,%rsi
je     113c <copyout_string+0x1c>
mov    (%rbx),%rdx
mov    %rsi,%rdi
mov    %rax,%rsi
call   1040 <strlcpy@plt>
jmp    1149 <copyout_string+0x29>
mov    %rax,%rdi
call   1030 <strlen@plt>
test   %rbx,%rbx
je     114c <copyout_string+0x2c>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @copyout_string(i8* %0, i8* %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64* %2, i64** %6
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = call i64 @strlcpy(i8* %11, i8* %12, i64 %14)
store i64 %15, i64* %7
br label %19
16: ; preds = %3
%17 = load i8*, i8** %4
%18 = call i64 @strlen(i8* %17)
store i64 %18, i64* %7
br label %19
19: ; preds = %16, %10
%20 = load i64*, i64** %6
%21 = icmp ne i64* %20, null
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i64, i64* %7
%24 = load i64*, i64** %6
store i64 %23, i64* %24
br label %25
25: ; preds = %22, %19
ret void
}

LLVM IR (-O2):
define void @copyout_string(i8* %0, i8* %1, i64* %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = load i64, i64* %2
%7 = tail call i64 @strlcpy(i8* %1, i8* %0, i64 %6)
br label %11
8: ; preds = %3
%9 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%10 = icmp eq i64* %2, null
br i1 %10, label %13, label %11
11: ; preds = %5, %8
%12 = phi i64 [ %7, %5 ], [ %9, %8 ]
store i64 %12, i64* %2
br label %13
13: ; preds = %11, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rename(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ unlink(char *);
backup(char *name) {
  char back[80];
  char *p;
  strcpy(back, name);
  strcat(back, "~");
  unlink(back);
  rename(name, back);
}


x86 assembly (clang, -O0):
<backup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xe9c(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x60(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1050 <rename@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backup>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
lea    0xea1(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcat@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <rename@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"~\00"
define i32 @backup(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [80 x i8]
%5 = alloca i8*
store i8* %0, i8** %3
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%10 = call i32 @strcat(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%12 = call i32 @unlink(i8* %11)
%13 = load i8*, i8** %3
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%15 = call i32 @rename(i8* %13, i8* %14)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [2 x i8] c"~\00"
define i32 @backup(i8* %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @unlink(i8* %3)
%7 = call i32 @rename(i8* %0, i8* %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ print_info(int, char *, int);
void print_state(int pid) { print_info(pid, "state", 11); }


x86 assembly (clang, -O0):
<print_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0xb,%edx
call   1030 <print_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_state>:
lea    0xee9(%rip),%rsi
mov    $0xb,%edx
jmp    1030 <print_info@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"state\00"
define void @print_state(i32 %0) {
%2 = tail call i32 @print_info(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 11)
ret void
}
void printBluetooth() {}


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

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

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

LLVM IR (-O2):
define void @printBluetooth() {
ret void
}
void ff_hevc_v_loop_filter_luma_12_ssse3() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_v_loop_filter_luma_12_ssse3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: bin2c [-cz] <input_file> <output_file>\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"usage: bin2c [-cz] <input_file> <output_file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"usage: bin2c [-cz] <input_file> <output_file>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
unsigned int f42(unsigned int x, unsigned long int y) {
  return (x >> y) | (x << (8 * sizeof(unsigned int) - y));
}


x86 assembly (clang, -O0):
<f42>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f42>:
mov    %rsi,%rcx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f42(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 = trunc i64 %6 to i32
%8 = lshr i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %9, %12
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f42(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = lshr i32 %0, %3
%5 = sub i32 32, %3
%6 = shl i32 %0, %5
%7 = or i32 %6, %4
ret i32 %7
}
int foo(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 42
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 42
}
void omp_set_num_threads(const int n) {}


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

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

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

LLVM IR (-O2):
define void @omp_set_num_threads(i32 %0) {
ret void
}
int do_div(int av1, int av3) { return (av3 ? (av1 / av3) : 0); }


x86 assembly (clang, -O0):
<do_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1123 <do_div+0x23>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
jmp    112d <do_div+0x2d>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <do_div+0x2d>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_div>:
test   %esi,%esi
je     110a <do_div+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @do_div(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ out_of_memory();
void *safe_malloc(size_t size) {
  void *tmp;
  tmp = malloc(size);
  if (tmp == NULL && size > 0) {
    out_of_memory();
  }
  return tmp;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <safe_malloc+0x36>
cmpq   $0x0,-0x8(%rbp)
jbe    1156 <safe_malloc+0x36>
mov    $0x0,%al
call   1030 <out_of_memory@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1140 <safe_malloc+0x20>
test   %r14,%r14
jne    1140 <safe_malloc+0x20>
xor    %eax,%eax
call   1030 <out_of_memory@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ugt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @out_of_memory()
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @out_of_memory()
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Type definitions */
struct t_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ delete_at(struct t_list *, int);
int get_top_int(struct t_list *);
int pop_int(struct t_list *plist) {
  int ret = get_top_int(plist);
  delete_at(plist, 1);
  return ret;
}


x86 assembly (clang, -O0):
<pop_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_top_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <delete_at@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_int>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <get_top_int@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <delete_at@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.t_list = type { i32 }
define i32 @pop_int(%struct.t_list* %0) {
%2 = alloca %struct.t_list*
%3 = alloca i32
store %struct.t_list* %0, %struct.t_list** %2
%4 = load %struct.t_list*, %struct.t_list** %2
%5 = call i32 @get_top_int(%struct.t_list* %4)
store i32 %5, i32* %3
%6 = load %struct.t_list*, %struct.t_list** %2
%7 = call i32 @delete_at(%struct.t_list* %6, i32 1)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.t_list = type { i32 }
define i32 @pop_int(%struct.t_list* %0) {
%2 = tail call i32 @get_top_int(%struct.t_list* %0)
%3 = tail call i32 @delete_at(%struct.t_list* %0, i32 1)
ret i32 %2
}
float deg_to_rad(float angle) {
  return ((float)((angle * 3.14159265358979323846) / 180.0));
}


x86 assembly (clang, -O0):
<deg_to_rad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg_to_rad>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @deg_to_rad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x400921FB54442D18
%6 = fdiv double %5, 1.800000e+02
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @deg_to_rad(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FB54442D18
%4 = fdiv double %3, 1.800000e+02
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
int8_t min(int8_t in1, int8_t in2) {
  if (in1 > in2) {
    return in2;
  } else {
    return in1;
  }
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <min+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp sgt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %5
store i64 %10, i64* %3
br label %13
11: ; preds = %2
%12 = load i64, i64* %4
store i64 %12, i64* %3
br label %13
13: ; preds = %11, %9
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_Absyn_Exp *Cyc_Tcutil_deep_copy_exp(int, struct Cyc_Absyn_Exp *);
struct Cyc_Absyn_Exp *Cyc_Toc_deep_copy(struct Cyc_Absyn_Exp *e) {
  struct Cyc_Absyn_Exp *_T0;
  _T0 = Cyc_Tcutil_deep_copy_exp(1, e);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_Toc_deep_copy>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <Cyc_Tcutil_deep_copy_exp@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Toc_deep_copy(%struct.Cyc_Absyn_Exp* %0) {
%2 = alloca %struct.Cyc_Absyn_Exp*
%3 = alloca %struct.Cyc_Absyn_Exp*
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %2
%4 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %2
%5 = call %struct.Cyc_Absyn_Exp* @Cyc_Tcutil_deep_copy_exp(i32 1, %struct.Cyc_Absyn_Exp* %4)
store %struct.Cyc_Absyn_Exp* %5, %struct.Cyc_Absyn_Exp** %3
%6 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %3
ret %struct.Cyc_Absyn_Exp* %6
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Toc_deep_copy(%struct.Cyc_Absyn_Exp* %0) {
%2 = tail call %struct.Cyc_Absyn_Exp* @Cyc_Tcutil_deep_copy_exp(i32 1, %struct.Cyc_Absyn_Exp* %0)
ret %struct.Cyc_Absyn_Exp* %2
}
/* Variables and functions */
int /*<<< orphan*/ pmfMK(double, double, double *, int, double *);
void pmfMK_R_wrapper(double *m, double *w, double *beta, int *betaLen,
                     double *prob) {
  pmfMK(*m, *w, beta, *betaLen, prob);
}


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

x86 assembly (clang, -O2):
<pmfMK_R_wrapper>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
mov    (%rcx),%esi
mov    %rdx,%rdi
mov    %r8,%rdx
jmp    1030 <pmfMK@plt>

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

LLVM IR (-O2):
define void @pmfMK_R_wrapper(double* nocapture %0, double* nocapture %1, double* %2, i32* nocapture %3, double* %4) {
%6 = load double, double* %0
%7 = load double, double* %1
%8 = load i32, i32* %3
%9 = tail call i32 @pmfMK(double %6, double %7, double* %2, i32 %8, double* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpu_advance_time(int);
void cpu_nop() { cpu_advance_time((1) << 2); }


x86 assembly (clang, -O0):
<cpu_nop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <cpu_advance_time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_nop>:
mov    $0x4,%edi
jmp    1030 <cpu_advance_time@plt>

LLVM IR (-O0):
define void @cpu_nop() {
%1 = call i32 @cpu_advance_time(i32 4)
ret void
}

LLVM IR (-O2):
define void @cpu_nop() {
%1 = tail call i32 @cpu_advance_time(i32 4)
ret void
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_write_byte(int, int);
int KIONIX_ACCEL_wuf_timer(int wuf_timer) {
  int status;
  if (KIONIX_ACCEL_write_byte(0x29, wuf_timer) == 0) {
    status = 0;
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_wuf_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x29,%edi
call   1030 <KIONIX_ACCEL_write_byte@plt>
cmp    $0x0,%rax
jne    113e <KIONIX_ACCEL_wuf_timer+0x2e>
movl   $0x0,-0x8(%rbp)
jmp    1145 <KIONIX_ACCEL_wuf_timer+0x35>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_wuf_timer>:
push   %rax
mov    %edi,%esi
mov    $0x29,%edi
call   1030 <KIONIX_ACCEL_write_byte@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_wuf_timer(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @KIONIX_ACCEL_write_byte(i32 41, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %3
br label %9
8: ; preds = %1
store i32 1, i32* %3
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_wuf_timer(i32 %0) {
%2 = tail call i64 @KIONIX_ACCEL_write_byte(i32 41, i32 %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
float signf(float f) { return (f < 0.f) ? -1.f : 1.f; }


x86 assembly (clang, -O0):
<signf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm3
movss  0xee6(%rip),%xmm2
xorps  %xmm1,%xmm1
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<signf>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
lea    0xeee(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @signf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, float -1.000000e+00, float 1.000000e+00
ret float %6
}

LLVM IR (-O2):
define float @signf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = select i1 %2, float -1.000000e+00, float 1.000000e+00
ret float %3
}
/* Variables and functions */
double cos(double);
double sin(double);
double f(double x) { return x * sin(x) - 5 * x - cos(x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  0xec9(%rip),%xmm1
movsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
call   1040 <cos@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @sin(double %4)
%6 = load double, double* %2
%7 = fmul double 5.000000e+00, %6
%8 = fneg double %7
%9 = call double @llvm.fmuladd.f64(double %3, double %5, double %8)
%10 = load double, double* %2
%11 = call double @cos(double %10)
%12 = fsub double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @sin(double %0)
%3 = fmul double %0, -5.000000e+00
%4 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %3)
%5 = tail call double @cos(double %0)
%6 = fsub double %4, %5
ret double %6
}
void foo588(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo588(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_unsigned_less_than(void) {
  gen_pop();
  gen_call("_ult");
}


x86 assembly (clang, -O0):
<gen_unsigned_less_than>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_unsigned_less_than>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"_ult\00"
define void @gen_unsigned_less_than() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"_ult\00"
define void @gen_unsigned_less_than() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
long longpar(var, def)
char *var;
long def;
{
  register char *res = getpar(var);
  return (res ? atol(res) : def);
}


x86 assembly (clang, -O0):
<longpar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <getpar@plt>
cltq
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1162 <longpar+0x42>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <atol@plt>
cltq
mov    %rax,-0x20(%rbp)
jmp    116a <longpar+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<longpar>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <getpar@plt>
test   %eax,%eax
je     113c <longpar+0x1c>
movslq %eax,%rdi
xor    %eax,%eax
call   1040 <atol@plt>
movslq %eax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @longpar(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 i8*, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @getpar to i32 (i8*, ...)*)(i8* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @atol to i32 (i8*, ...)*)(i8* %13)
%15 = sext i32 %14 to i64
br label %18
16: ; preds = %2
%17 = load i64, i64* %4
br label %18
18: ; preds = %16, %12
%19 = phi i64 [ %15, %12 ], [ %17, %16 ]
ret i64 %19
}

LLVM IR (-O2):
define i64 @longpar(i8* %0, i64 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getpar to i32 (i8*, ...)*)(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atol to i32 (i8*, ...)*)(i8* %7)
%9 = sext i32 %8 to i64
br label %10
10: ; preds = %2, %5
%11 = phi i64 [ %9, %5 ], [ %1, %2 ]
ret i64 %11
}
int rlxd_size(void) { return (105); }


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

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

LLVM IR (-O0):
define i32 @rlxd_size() {
ret i32 105
}

LLVM IR (-O2):
define i32 @rlxd_size() {
ret i32 105
}