xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ malloc(int);
int main() {
  char *some_memory;
  char *scan_ptr;
  some_memory = (char *)malloc((1024));
  if (some_memory == NULL)
    exit(EXIT_FAILURE);
  scan_ptr = some_memory;
  while (1) {
    *scan_ptr = '\0';
    scan_ptr++;
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <main+0x36>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
jmp    115e <main+0x3e>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x400,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1139 <main+0x19>
movb   $0x0,(%rax)
add    $0x1,%rax
jmp    1130 <main+0x10>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 1024)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %0
%12 = load i8*, i8** %2
store i8* %12, i8** %3
br label %13
13: ; preds = %11, %13
%14 = load i8*, i8** %3
store i8 0, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %3
br label %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 @malloc(i32 1024)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
6: ; preds = %0
%7 = inttoptr i64 %1 to i8*
br label %8
8: ; preds = %8, %6
%9 = phi i8* [ %7, %6 ], [ %10, %8 ]
store i8 0, i8* %9
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %8
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(int, int, int, int, int, int, int, int, int, int, int,
                         int, int, int, int, int /*<<< orphan*/);
int main(void) {
  check_vect();
  main1(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
mov    $0xf,%edi
mov    $0xe,%esi
mov    $0xd,%edx
mov    $0xc,%ecx
mov    $0xb,%r8d
mov    $0xa,%r9d
xor    %eax,%eax
movl   $0x9,(%rsp)
movl   $0x8,0x8(%rsp)
movl   $0x7,0x10(%rsp)
movl   $0x6,0x18(%rsp)
movl   $0x5,0x20(%rsp)
movl   $0x4,0x28(%rsp)
movl   $0x3,0x30(%rsp)
movl   $0x2,0x38(%rsp)
movl   $0x1,0x40(%rsp)
movl   $0x0,0x48(%rsp)
call   1040 <main1@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    $0xf,%edi
mov    $0xe,%esi
mov    $0xd,%edx
mov    $0xc,%ecx
mov    $0xb,%r8d
mov    $0xa,%r9d
push   $0x0
push   $0x1
push   $0x2
push   $0x3
push   $0x4
push   $0x5
push   $0x6
push   $0x7
push   $0x8
push   $0x9
call   1040 <main1@plt>
add    $0x50,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @check_vect()
%3 = call i32 @main1(i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_vect()
%2 = tail call i32 @main1(i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0)
ret i32 0
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int get_random_num() {
  static int r = 1;
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return tv.tv_sec + (r++);
}


x86 assembly (clang, -O0):
<get_random_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
mov    0x2efa(%rip),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,0x2eef(%rip)
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_num>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <gettimeofday@plt>
mov    0x2eff(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2ef6(%rip)
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@get_random_num.r = internal global i32 1
define i32 @get_random_num() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @get_random_num.r
%7 = add nsw i32 %6, 1
store i32 %7, i32* @get_random_num.r
%8 = add nsw i32 %5, %6
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timezone = type { i32 }
@get_random_num.r = internal unnamed_addr global i32 1
define i32 @get_random_num() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* @get_random_num.r
%9 = add nsw i32 %8, 1
store i32 %9, i32* @get_random_num.r
%10 = add nsw i32 %8, %7
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR5F_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR5F_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR5F_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int getpagesize();
int get_standard_page_size() { return (getpagesize()); }


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

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

LLVM IR (-O0):
define i32 @get_standard_page_size() {
%1 = call i32 (...) @getpagesize()
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_standard_page_size() {
%1 = tail call i32 (...) @getpagesize()
ret i32 %1
}
/* Variables and functions */
unsigned long __arch_clear_user(void *, unsigned long);
unsigned long __clear_user(void *to, unsigned long n) {
  return __arch_clear_user(to, n);
}


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

x86 assembly (clang, -O2):
<__clear_user>:
jmp    1030 <__arch_clear_user@plt>

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

LLVM IR (-O2):
define i64 @__clear_user(i8* %0, i64 %1) {
%3 = tail call i64 @__arch_clear_user(i8* %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
scalar_t__ rand();
void init(double *src, int n) {
  for (int i = 0; i < n; i++)
    src[i] = (double)rand();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <init+0x49>
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <init+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114e <init+0x3e>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <init+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @init(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = call i64 (...) @rand()
%12 = sitofp i64 %11 to double
%13 = load double*, double** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* %13, i64 %15
store double %12, double* %16
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @init(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = tail call i64 (...) @rand()
%10 = sitofp i64 %9 to double
%11 = getelementptr inbounds double, double* %0, i64 %8
store double %10, double* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
bar(x) int x;
{ return fib(x); }


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

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

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @fib to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @fib to i32 (i32, ...)*)(i32 %0)
ret i32 %2
}
/* Variables and functions */
int asal_mi(int);
int asal_sayisi(int ilk, int son) {
  int i;
  int S = 0;
  for (i = ilk; i <= son; i++) {
    if (asal_mi(i) == 1)
      S++;
  }
  return S;
}


x86 assembly (clang, -O0):
<asal_sayisi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1164 <asal_sayisi+0x54>
mov    -0xc(%rbp),%edi
call   1030 <asal_mi@plt>
cmp    $0x1,%eax
jne    1151 <asal_sayisi+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <asal_sayisi+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <asal_sayisi+0x1b>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asal_sayisi>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
cmp    %esi,%edi
jg     1149 <asal_sayisi+0x39>
mov    %esi,%r14d
mov    %edi,%ebp
add    $0x1,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
call   1030 <asal_mi@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebx
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1130 <asal_sayisi+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @asal_sayisi(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %11, %4 ], [ %0, %2 ]
%7 = tail call i32 @asal_mi(i32 %6)
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %5, %9
%11 = add i32 %6, 1
%12 = icmp eq i32 %6, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %14
}
int bar(int a) { return a * 42; }


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

x86 assembly (clang, -O2):
<bar>:
imul   $0x2a,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = mul nsw i32 %0, 42
ret i32 %2
}
void pthread_key_delete() {}


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

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

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

LLVM IR (-O2):
define void @pthread_key_delete() {
ret void
}
char *procprt_SGID_e(struct tstat *curstat, int avgval, int nsecs) {
  return "-       ";
}


x86 assembly (clang, -O0):
<procprt_SGID_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [9 x i8] c"- \00"
define i8* @procprt_SGID_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [9 x i8] c"- \00"
define i8* @procprt_SGID_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int less(int a, int b) { return a < b; }


x86 assembly (clang, -O0):
<less>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<less>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @less(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @less(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ generate_sin_table();
int main(int argc, char *argv[]) {
  generate_sin_table();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @generate_sin_table()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @generate_sin_table()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char *);
void update_error(char *err) { error("%s", err); }


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

x86 assembly (clang, -O2):
<update_error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <error@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @update_error(i8* %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ checkForDuplicate(char *, int *);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char array[100];
  scanf("%s", array);
  int alphabet[26] = {0};
  checkForDuplicate(array, alphabet);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
lea    -0x70(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x68,%edx
call   1040 <memset@plt>
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <checkForDuplicate@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
lea    0xed1(%rip),%rdi
lea    0x70(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x60(%rsp)
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <checkForDuplicate@plt>
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [26 x i32]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = bitcast [26 x i32]* %2 to i8*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 0
%8 = call i32 @checkForDuplicate(i8* %6, i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [26 x i32]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = bitcast [26 x i32]* %2 to i8*
%6 = getelementptr inbounds [26 x i32], [26 x i32]* %2, i64 0, i64 0
%7 = call i32 @checkForDuplicate(i8* %3, i32* %6)
ret void
}
/* Variables and functions */
int multiply(int, int, void *, void *, void *);
int run_mul_c(void *data, int n) {
  int offset = n * n * 4;
  return multiply(n, n, data, data + offset, data + offset * 2);
}


x86 assembly (clang, -O0):
<run_mul_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rax
add    %rax,%rcx
mov    -0x8(%rbp),%r8
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%r8
call   1030 <multiply@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_mul_c>:
mov    %rdi,%rdx
mov    %esi,%r8d
imul   %r8d,%r8d
lea    0x0(,%r8,4),%ecx
add    %rdi,%rcx
shl    $0x3,%r8d
add    %rdi,%r8
mov    %esi,%edi
jmp    1030 <multiply@plt>

LLVM IR (-O0):
define i32 @run_mul_c(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = mul nsw i32 %8, 4
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = load i8*, i8** %3
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr i8, i8* %13, i64 %15
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = mul nsw i32 %18, 2
%20 = sext i32 %19 to i64
%21 = getelementptr i8, i8* %17, i64 %20
%22 = call i32 @multiply(i32 %10, i32 %11, i8* %12, i8* %16, i8* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @run_mul_c(i8* %0, i32 %1) {
%3 = mul nsw i32 %1, %1
%4 = shl nsw i32 %3, 2
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* %0, i64 %5
%7 = shl nsw i32 %3, 3
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* %0, i64 %8
%10 = tail call i32 @multiply(i32 %1, i32 %1, i8* %0, i8* %6, i8* %9)
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ __pgrp;
};
typedef TYPE_1__ posix_spawnattr_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int posix_spawnattr_setpgroup(posix_spawnattr_t *attr, pid_t pgroup) {
  attr->__pgrp = pgroup;
  return 0;
}


x86 assembly (clang, -O0):
<posix_spawnattr_setpgroup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32 @posix_spawnattr_setpgroup(%struct.TYPE_3__* %0, i32 %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
store i32 %5, i32* %7
ret i32 0
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32 @posix_spawnattr_setpgroup(%struct.TYPE_3__* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i32 %1, i32* %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strlen(char *);
void strlen_constant2(char x) {
  char a[] = "123";
  clang_analyzer_eval(strlen(a) == 3);
  a[0] = x;
  clang_analyzer_eval(strlen(a) == 3);
}


x86 assembly (clang, -O0):
<strlen_constant2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_constant2>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movl   $0x333231,0x4(%rsp)
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <clang_analyzer_eval@plt>
mov    %bl,0x4(%rsp)
mov    %r14,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <clang_analyzer_eval@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.strlen_constant2.a = [4 x i8] c"123\00"
define void @strlen_constant2(i8 signext %0) {
%2 = alloca i8
%3 = alloca [4 x i8]
store i8 %0, i8* %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = icmp eq i32 %6, 3
%8 = zext i1 %7 to i32
%9 = call i32 @clang_analyzer_eval(i32 %8)
%10 = load i8, i8* %2
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %10, i8* %11
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = icmp eq i32 %13, 3
%15 = zext i1 %14 to i32
%16 = call i32 @clang_analyzer_eval(i32 %15)
ret void
}

LLVM IR (-O2):
define void @strlen_constant2(i8 signext %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 3355185, i32* %2
%4 = call i32 @strlen(i8* %3)
%5 = icmp eq i32 %4, 3
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
store i8 %0, i8* %3
%8 = call i32 @strlen(i8* %3)
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @clang_analyzer_eval(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void nombre(const char *nombre) { printf("Hola, %s\n", nombre); }


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

x86 assembly (clang, -O2):
<nombre>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hola, %s\0A\00"
define void @nombre(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct stat {
  scalar_t__ st_nlink;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void file__print_nlink(struct stat *st) { printf("%2d ", (int)st->st_nlink); }


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

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

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

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [5 x i8] c"%2d \00"
define void @file__print_nlink(%struct.stat* nocapture %0) {
%2 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int is_aligned_memory(void *v, int alignment) {
  return (((size_t)v) & (alignment - 1)) == 0;
}


x86 assembly (clang, -O0):
<is_aligned_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_aligned_memory>:
add    $0xffffffff,%esi
movslq %esi,%rcx
xor    %eax,%eax
test   %rdi,%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_aligned_memory(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = and i64 %6, %9
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_aligned_memory(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = and i64 %5, %3
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ serial_puts(char *);
void bogus_hf(void) {
  serial_puts("Bogus HF exception, spinning ... \n");
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<bogus_hf>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <serial_puts@plt>
jmp    1120 <bogus_hf+0x10>

x86 assembly (clang, -O2):
<bogus_hf>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <serial_puts@plt>
nopl   (%rax)
jmp    1120 <bogus_hf+0x10>

LLVM IR (-O0):
@.str = [35 x i8] c"Bogus HF exception, spinning ... \0A\00"
define void @bogus_hf() {
%1 = call i32 @serial_puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
@.str = [35 x i8] c"Bogus HF exception, spinning ... \0A\00"
define void @bogus_hf() {
%1 = tail call i32 @serial_puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
br label %2
}
/* Type definitions */
struct gdev_time {
  int dummy;
};

/* Variables and functions */
scalar_t__ gdev_time_eqz(struct gdev_time *);
scalar_t__ gdev_time_gtz(struct gdev_time *);
int gdev_time_gez(struct gdev_time *p) {
  return gdev_time_gtz(p) || gdev_time_eqz(p);
}


x86 assembly (clang, -O0):
<gdev_time_gez>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gdev_time_gtz@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <gdev_time_gez+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <gdev_time_eqz@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdev_time_gez>:
push   %rbx
mov    %rdi,%rbx
call   1030 <gdev_time_gtz@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <gdev_time_gez+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <gdev_time_eqz@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.gdev_time = type { i32 }
define i32 @gdev_time_gez(%struct.gdev_time* %0) {
%2 = alloca %struct.gdev_time*
store %struct.gdev_time* %0, %struct.gdev_time** %2
%3 = load %struct.gdev_time*, %struct.gdev_time** %2
%4 = call i64 @gdev_time_gtz(%struct.gdev_time* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load %struct.gdev_time*, %struct.gdev_time** %2
%8 = call i64 @gdev_time_eqz(%struct.gdev_time* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.gdev_time = type { i32 }
define i32 @gdev_time_gez(%struct.gdev_time* %0) {
%2 = tail call i64 @gdev_time_gtz(%struct.gdev_time* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @gdev_time_eqz(%struct.gdev_time* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ SA1Absolute(int);
int /*<<< orphan*/ TRB8(int /*<<< orphan*/);
void Op1CM1(void) { TRB8(SA1Absolute(3)); }


x86 assembly (clang, -O0):
<Op1CM1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
call   1040 <TRB8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op1CM1>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <TRB8@plt>

LLVM IR (-O0):
define void @Op1CM1() {
%1 = call i32 @SA1Absolute(i32 3)
%2 = call i32 @TRB8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op1CM1() {
%1 = tail call i32 @SA1Absolute(i32 3)
%2 = tail call i32 @TRB8(i32 %1)
ret void
}
int checkspe(char chchar, char schar[]) {
  int i;
  for (i = 0; schar[i] != '\0'; i++) {
    if (chchar == schar[i])
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkspe>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1161 <checkspe+0x61>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114e <checkspe+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1168 <checkspe+0x68>
jmp    1153 <checkspe+0x53>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <checkspe+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkspe>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <checkspe+0x20>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1121 <checkspe+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <checkspe+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @checkspe(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %1, i64 %13
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %13, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = icmp eq i8 %11, %0
%13 = add nuw i64 %10, 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %2
%15 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ print_prgname();
void ioerror(const char *str) {
  print_prgname();
  perror(str);
}


x86 assembly (clang, -O0):
<ioerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <print_prgname@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioerror>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <print_prgname@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <perror@plt>

LLVM IR (-O0):
define void @ioerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @print_prgname()
%4 = load i8*, i8** %2
%5 = call i32 @perror(i8* %4)
ret void
}

LLVM IR (-O2):
define void @ioerror(i8* nocapture %0) {
%2 = tail call i32 (...) @print_prgname()
%3 = tail call i32 @perror(i8* %0)
ret void
}
/* Type definitions */
struct S2 {
  int dummy;
};
typedef struct S2 S1;

/* Variables and functions */
int foo(struct S2 *);
int incompatible_call(int which, struct S1 *s1, struct S2 *s2) {
  if (which == 1)
    return foo(s1);
  else
    foo(s2);
}


x86 assembly (clang, -O0):
<incompatible_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    113e <incompatible_call+0x2e>
mov    -0x10(%rbp),%rdi
call   1030 <foo@plt>
mov    %eax,-0x4(%rbp)
jmp    1147 <incompatible_call+0x37>
mov    -0x18(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incompatible_call>:
cmp    $0x1,%edi
jne    111d <incompatible_call+0xd>
mov    %rsi,%rdi
jmp    1030 <foo@plt>
mov    %rdx,%rdi
jmp    1030 <foo@plt>

LLVM IR (-O0):
%struct.S1 = type opaque
%struct.S2 = type { i32 }
define i32 @incompatible_call(i32 %0, %struct.S1* %1, %struct.S2* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.S1*
%7 = alloca %struct.S2*
store i32 %0, i32* %5
store %struct.S1* %1, %struct.S1** %6
store %struct.S2* %2, %struct.S2** %7
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load %struct.S1*, %struct.S1** %6
%12 = bitcast %struct.S1* %11 to %struct.S2*
%13 = call i32 @foo(%struct.S2* %12)
store i32 %13, i32* %4
br label %17
14: ; preds = %3
%15 = load %struct.S2*, %struct.S2** %7
%16 = call i32 @foo(%struct.S2* %15)
br label %17
17: ; preds = %10, %14
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
%struct.S1 = type opaque
%struct.S2 = type { i32 }
define i32 @incompatible_call(i32 %0, %struct.S1* %1, %struct.S2* %2) {
%4 = icmp eq i32 %0, 1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = bitcast %struct.S1* %1 to %struct.S2*
%7 = tail call i32 @foo(%struct.S2* %6)
br label %10
8: ; preds = %3
%9 = tail call i32 @foo(%struct.S2* %2)
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ %7, %5 ], [ undef, %8 ]
ret i32 %11
}
/* Type definitions */
struct stat {
  double st_mtime;
};

/* Variables and functions */
int stat(char const *, struct stat *);
double OGGetFileTime(const char *file) {
  struct stat buff;
  int r = stat(file, &buff);
  if (r < 0) {
    return -1;
  }
  return buff.st_mtime;
}


x86 assembly (clang, -O0):
<OGGetFileTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1148 <OGGetFileTime+0x38>
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1152 <OGGetFileTime+0x42>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OGGetFileTime>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
js     1124 <OGGetFileTime+0x14>
movsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xed4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.stat = type { double }
define double @OGGetFileTime(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store double -1.000000e+00, double* %2
br label %14
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load double, double* %12
store double %13, double* %2
br label %14
14: ; preds = %11, %10
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
%struct.stat = type { double }
define double @OGGetFileTime(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load double, double* %6
%8 = select i1 %5, double -1.000000e+00, double %7
ret double %8
}
void testCheck(int *a) {
  if (a) {
    ;
  }
  *a = 1;
}


x86 assembly (clang, -O0):
<testCheck>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <testCheck+0x18>
jmp    1118 <testCheck+0x18>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCheck>:
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @testCheck(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
%7 = load i32*, i32** %2
store i32 1, i32* %7
ret void
}

LLVM IR (-O2):
define void @testCheck(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Log(char *);
int /*<<< orphan*/ abort();
void SegV() {
  Log("Segmentation Fault caused abort");
  abort();
}


x86 assembly (clang, -O0):
<SegV>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<SegV>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Segmentation Fault caused abort\00"
define void @SegV() {
%1 = call i32 @Log(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Segmentation Fault caused abort\00"
define void @SegV() {
%1 = tail call i32 @Log(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
void foo2e() {}


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

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

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

LLVM IR (-O2):
define void @foo2e() {
ret void
}
int parity(unsigned long x) {
  int n = 0;
  while (x != 0) {
    if (x & 1)
      ++n;
    x >>= 1;
  }
  return n % 2;
}


x86 assembly (clang, -O0):
<parity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <parity+0x46>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1135 <parity+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <parity+0xf>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity>:
xor    %eax,%eax
test   %rdi,%rdi
je     1126 <parity+0x26>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <parity+0x10>
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @parity(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i64, i64* %2
%9 = and i64 %8, 1
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %7
%15 = load i64, i64* %2
%16 = lshr i64 %15, 1
store i64 %16, i64* %2
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
%19 = srem i32 %18, 2
ret i32 %19
}

LLVM IR (-O2):
define i32 @parity(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %7, %4
%9 = lshr i64 %5, 1
%10 = icmp ult i64 %5, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = and i32 %8, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 0, %1 ], [ %12, %11 ]
ret i32 %14
}
int test_imm_13int64_midword_reg(long long val) {
  return ((val >> 16) & (0x13 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_13int64_midword_reg>:
test   $0x130000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_13int64_midword_reg(i64 %0) {
%2 = and i64 %0, 1245184
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void XGetInputFocus() {}


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

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

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

LLVM IR (-O2):
define void @XGetInputFocus() {
ret void
}
/* Type definitions */
struct rtattr {
  int dummy;
};
struct qdisc_util {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int hfsc_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) {
  return -1;
}


x86 assembly (clang, -O0):
<hfsc_print_opt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @hfsc_print_opt(%struct.qdisc_util* %0, i32* %1, %struct.rtattr* %2) {
%4 = alloca %struct.qdisc_util*
%5 = alloca i32*
%6 = alloca %struct.rtattr*
store %struct.qdisc_util* %0, %struct.qdisc_util** %4
store i32* %1, i32** %5
store %struct.rtattr* %2, %struct.rtattr** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.qdisc_util = type { i32 }
%struct.rtattr = type { i32 }
define i32 @hfsc_print_opt(%struct.qdisc_util* nocapture readnone %0, i32* nocapture readnone %1, %struct.rtattr* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *program) {
  fprintf(stderr, "Usage:\t%s <lstfile>\n", program);
  fprintf(stderr, "\toption\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed1(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage:\09%s <lstfile>\0A\00"
@.str.1 = [9 x i8] c"\09option\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}