xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int stackPop(int S[]) {
  int j = S[0]--;
  assert(j > 0);
  return S[j];
}


x86 assembly (clang, -O0):
<stackPop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%eax
mov    %eax,%edx
add    $0xffffffff,%edx
mov    %edx,(%rcx)
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stackPop>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq (%rdi),%rbx
xor    %edi,%edi
test   %rbx,%rbx
setg   %dil
lea    -0x1(%rbx),%eax
mov    %eax,(%r14)
call   1030 <assert@plt>
mov    (%r14,%rbx,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @stackPop(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = add nsw i32 %6, -1
store i32 %7, i32* %5
store i32 %6, i32* %3
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32*, i32** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @stackPop(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, -1
store i32 %3, i32* %0
%4 = icmp sgt i32 %2, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void EPIIntUnregister(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x400D0000);
  IntDisable(69);
  IntUnregister(69);
}


x86 assembly (clang, -O0):
<EPIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x400d0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x45,%edi
call   1030 <IntDisable@plt>
mov    $0x45,%edi
call   1050 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntUnregister>:
push   %rax
xor    %eax,%eax
cmp    $0x400d0000,%rdi
sete   %al
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x45,%edi
call   1030 <IntDisable@plt>
mov    $0x45,%edi
pop    %rax
jmp    1050 <IntUnregister@plt>

LLVM IR (-O0):
define void @EPIIntUnregister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074593792
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = call i32 @IntDisable(i32 69)
%8 = call i32 @IntUnregister(i32 69)
ret void
}

LLVM IR (-O2):
define void @EPIIntUnregister(i64 %0) {
%2 = icmp eq i64 %0, 1074593792
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = tail call i32 @IntDisable(i32 69)
%6 = tail call i32 @IntUnregister(i32 69)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void itoa(int i, char *a) { snprintf(a, sizeof(a), "%i", i); }


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x8,%esi
lea    0xece(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
mov    %edi,%ecx
lea    0xee7(%rip),%rdx
mov    %rsi,%rdi
mov    $0x8,%esi
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @itoa(i32 %0, i8* %1) {
%3 = tail call i32 @snprintf(i8* %1, i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *read_defect_data_10_data(uint8_t *data) { return data + 4; }


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

x86 assembly (clang, -O2):
<read_defect_data_10_data>:
lea    0x10(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @read_defect_data_10_data(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
ret i32* %2
}
/* Variables and functions */
void *compare_tval_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_tval_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_tval_context() {
ret i8* null
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
uint64_t fib(int64_t n) {
  if (n <= 2) {
    return 1;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x3,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x4,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 5
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *realloc(void *, size_t);
void *urealloc(void *p, size_t l) {
  void *r = realloc(p, l);
  if (!r)
    abort();
  return r;
}


x86 assembly (clang, -O0):
<urealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <urealloc+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<urealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     112d <urealloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @urealloc(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 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @urealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int AdditiveSequence(int, int /*<<< orphan*/, int, int *);
int Fib2(int n, int *counter) {
  (*counter)++;
  return AdditiveSequence(n, 0, 1, counter);
}


x86 assembly (clang, -O0):
<Fib2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <AdditiveSequence@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fib2>:
mov    %rsi,%rcx
addl   $0x1,(%rsi)
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <AdditiveSequence@plt>

LLVM IR (-O0):
define i32 @Fib2(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 = load i32, i32* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32*, i32** %4
%10 = call i32 @AdditiveSequence(i32 %8, i32 0, i32 1, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @Fib2(i32 %0, i32* %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = tail call i32 @AdditiveSequence(i32 %0, i32 0, i32 1, i32* %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void printFn(void *data) {
  if (data)
    printf("%d\n", *(int *)data);
  else
    printf("%p\n", data);
}


x86 assembly (clang, -O0):
<printFn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <printFn+0x2f>
mov    -0x8(%rbp),%rax
movslq (%rax),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <printFn+0x3f>
mov    -0x8(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printFn>:
test   %rdi,%rdi
je     1124 <printFn+0x14>
movslq (%rdi),%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xed9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%p\0A\00"
define void @printFn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %15
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%p\0A\00"
define void @printFn(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %11
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* null)
br label %11
11: ; preds = %9, %3
ret void
}
int delrackletter(int ch, int size, char letters[size]) {
  int i;
  for (i = 0; i < size; i++) {
    if (*(letters + i) == ch) {
      letters[i] = 0x20;
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<delrackletter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <delrackletter+0x61>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    -0x8(%rbp),%eax
jne    114e <delrackletter+0x4e>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
jmp    1168 <delrackletter+0x68>
jmp    1153 <delrackletter+0x53>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <delrackletter+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delrackletter>:
test   %esi,%esi
jle    1121 <delrackletter+0x21>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movsbl (%rdx,%rcx,1),%esi
cmp    %edi,%esi
je     1124 <delrackletter+0x24>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <delrackletter+0x10>
xor    %eax,%eax
ret
movb   $0x20,(%rdx,%rcx,1)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @delrackletter(i32 %0, i32 %1, i8* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %16
%8 = phi i64 [ 0, %5 ], [ %17, %16 ]
%9 = getelementptr inbounds i8, i8* %2, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %16
13: ; preds = %7
%14 = and i64 %8, 4294967295
%15 = getelementptr inbounds i8, i8* %2, i64 %14
store i8 32, i8* %15
br label %19
16: ; preds = %7
%17 = add nuw nsw i64 %8, 1
%18 = icmp eq i64 %17, %6
br i1 %18, label %19, label %7
19: ; preds = %16, %3, %13
%20 = phi i32 [ 1, %13 ], [ 0, %3 ], [ 0, %16 ]
ret i32 %20
}
/* Variables and functions */
int print(int /*<<< orphan*/, char const *, unsigned long *);
void print_serial(const char *fmt, ...) {
  int len;
  register unsigned long *varg = (unsigned long *)(&fmt);
  *varg++;
  len = print(0, fmt, varg);
}


x86 assembly (clang, -O0):
<print_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %edi,%edi
call   1030 <print@plt>
mov    %eax,-0xc(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_serial>:
push   %rax
mov    %rdi,%rsi
mov    %rdi,(%rsp)
lea    0x8(%rsp),%rdx
xor    %edi,%edi
call   1030 <print@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @print_serial(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64*
store i8* %0, i8** %2
%5 = bitcast i8** %2 to i64*
store i64* %5, i64** %4
%6 = load i64*, i64** %4
%7 = getelementptr inbounds i64, i64* %6, i32 1
store i64* %7, i64** %4
%8 = load i64, i64* %6
%9 = load i8*, i8** %2
%10 = load i64*, i64** %4
%11 = call i32 @print(i32 0, i8* %9, i64* %10)
store i32 %11, i32* %3
ret void
}

LLVM IR (-O2):
define void @print_serial(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = getelementptr inbounds i8*, i8** %2, i64 1
%4 = bitcast i8** %3 to i64*
%5 = call i32 @print(i32 0, i8* %0, i64* %4)
ret void
}
/* Variables and functions */
unsigned long cris_swapnwbrlz(unsigned long);
unsigned long __ffs(unsigned long word) { return cris_swapnwbrlz(~word); }


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

x86 assembly (clang, -O2):
<__ffs>:
not    %rdi
jmp    1030 <cris_swapnwbrlz@plt>

LLVM IR (-O0):
define i64 @__ffs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i64 @cris_swapnwbrlz(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @__ffs(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 @cris_swapnwbrlz(i64 %2)
ret i64 %3
}
void __both(void) {}


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

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

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

LLVM IR (-O2):
define void @__both() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ KVM_GET_VCPU_MMAP_SIZE;
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int kvm_get_vcpu_mmap_size(int fd) {
  return ioctl(fd, KVM_GET_VCPU_MMAP_SIZE, 0);
}


x86 assembly (clang, -O0):
<kvm_get_vcpu_mmap_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kvm_get_vcpu_mmap_size>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@KVM_GET_VCPU_MMAP_SIZE = global i32 0
define i32 @kvm_get_vcpu_mmap_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @KVM_GET_VCPU_MMAP_SIZE
%5 = call i32 @ioctl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@KVM_GET_VCPU_MMAP_SIZE = global i32 0
define i32 @kvm_get_vcpu_mmap_size(i32 %0) {
%2 = load i32, i32* @KVM_GET_VCPU_MMAP_SIZE
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from vforked-prog...\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Hello from vforked-prog...\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Hello from vforked-prog...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned char YM2612_read(const unsigned short port) {
  volatile unsigned char *pb;
  pb = (unsigned char *)0xA04000;
  return pb[port & 3];
}


x86 assembly (clang, -O0):
<YM2612_read>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xa04000,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzwl -0x2(%rbp),%ecx
and    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<YM2612_read>:
and    $0x3,%edi
mov    0xa04000(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @YM2612_read(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8*
store i16 %0, i16* %2
store i8* inttoptr (i64 10502144 to i8*), i8** %3
%4 = load i8*, i8** %3
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = and i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %4, i64 %8
%10 = load volatile i8, i8* %9
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @YM2612_read(i16 zeroext %0) {
%2 = and i16 %0, 3
%3 = zext i16 %2 to i64
%4 = getelementptr inbounds i8, i8* inttoptr (i64 10502144 to i8*), i64 %3
%5 = load volatile i8, i8* %4
ret i8 %5
}
/* Variables and functions */
long abs(long);
int main() { return !(abs(15L) == 15L); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <abs@plt>
cmp    $0xf,%rax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @abs(i64 15)
%3 = icmp eq i64 %2, 15
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_30uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x30 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_30uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 48
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned f3(unsigned x, unsigned short y) {
  if (y == 0)
    return x;
  y &= 8 * 4 - 1;
  return (x << y) | (x >> (8 * 4 - y));
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
cmp    $0x0,%eax
jne    1126 <f3+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <f3+0x51>
movzwl -0xa(%rbp),%eax
and    $0x1f,%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%eax
movzwl -0xa(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%edx
movzwl -0xa(%rbp),%esi
mov    $0x20,%ecx
sub    %esi,%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
test   %esi,%esi
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %4
store i16 %1, i16* %5
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %26
11: ; preds = %2
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = and i32 %13, 31
%15 = trunc i32 %14 to i16
store i16 %15, i16* %5
%16 = load i32, i32* %4
%17 = load i16, i16* %5
%18 = zext i16 %17 to i32
%19 = shl i32 %16, %18
%20 = load i32, i32* %4
%21 = load i16, i16* %5
%22 = zext i16 %21 to i32
%23 = sub nsw i32 32, %22
%24 = lshr i32 %20, %23
%25 = or i32 %19, %24
store i32 %25, i32* %3
br label %26
26: ; preds = %11, %9
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i16 zeroext %1) {
%3 = icmp eq i16 %1, 0
%4 = zext i16 %1 to i32
%5 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 %4)
%6 = select i1 %3, i32 %0, i32 %5
ret i32 %6
}
void WitTim_lc898122_sharp(unsigned short UsWitTim_lc898122_sharp) {
  unsigned long UlLopIdx, UlWitCyc;
  UlWitCyc =
      (unsigned long)((float)UsWitTim_lc898122_sharp / 0.00004166F / (float)12);
  for (UlLopIdx = 0; UlLopIdx < UlWitCyc; UlLopIdx++) {
    ;
  }
}


x86 assembly (clang, -O0):
<WitTim_lc898122_sharp>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  0xee5(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xedd(%rip),%xmm1
divss  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttss2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movss  0xec6(%rip),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1181 <WitTim_lc898122_sharp+0x81>
jmp    1170 <WitTim_lc898122_sharp+0x70>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    115d <WitTim_lc898122_sharp+0x5d>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @WitTim_lc898122_sharp(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i64
%4 = alloca i64
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = uitofp i16 %5 to float
%7 = fdiv float %6, 0x3F05D782C0000000
%8 = fdiv float %7, 1.200000e+01
%9 = fptoui float %8 to i64
store i64 %9, i64* %4
store i64 0, i64* %3
br label %10
10: ; preds = %15, %1
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %18
14: ; preds = %10
br label %15
15: ; preds = %14
%16 = load i64, i64* %3
%17 = add i64 %16, 1
store i64 %17, i64* %3
br label %10
18: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @WitTim_lc898122_sharp(i16 zeroext %0) {
ret void
}
unsigned int f1(unsigned int x, int y) {
  return (x << y) | (x >> ((-y) & (8 * 4 - 1)));
}


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

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

LLVM IR (-O0):
define i32 @f1(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 0, %9
%11 = and i32 %10, 31
%12 = lshr i32 %8, %11
%13 = or i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 0, %1
%5 = and i32 %4, 31
%6 = lshr i32 %0, %5
%7 = or i32 %6, %3
ret i32 %7
}
void RTZipCompFinish(void) {}


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

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

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

LLVM IR (-O2):
define void @RTZipCompFinish() {
ret void
}
/* Variables and functions */
int genrand_real2();
int get_random(int n) { return (int)(n * genrand_real2()); }


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <genrand_real2@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <genrand_real2@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_random(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @genrand_real2()
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_random(i32 %0) {
%2 = tail call i32 (...) @genrand_real2()
%3 = mul nsw i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_f2u32(float);
int /*<<< orphan*/ rgph_u32x4_murmur32v_u32(int /*<<< orphan*/, uintptr_t,
                                            int /*<<< orphan*/ *);
void rgph_u32x4_murmur32v_f32(float value, uintptr_t seed, uint32_t *h) {
  rgph_u32x4_murmur32v_u32(rgph_f2u32(value), seed, h);
}


x86 assembly (clang, -O0):
<rgph_u32x4_murmur32v_f32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <rgph_f2u32@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <rgph_u32x4_murmur32v_u32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32x4_murmur32v_f32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <rgph_f2u32@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <rgph_u32x4_murmur32v_u32@plt>

LLVM IR (-O0):
define void @rgph_u32x4_murmur32v_f32(float %0, i64 %1, i32* %2) {
%4 = alloca float
%5 = alloca i64
%6 = alloca i32*
store float %0, float* %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load float, float* %4
%8 = call i32 @rgph_f2u32(float %7)
%9 = load i64, i64* %5
%10 = load i32*, i32** %6
%11 = call i32 @rgph_u32x4_murmur32v_u32(i32 %8, i64 %9, i32* %10)
ret void
}

LLVM IR (-O2):
define void @rgph_u32x4_murmur32v_f32(float %0, i64 %1, i32* %2) {
%4 = tail call i32 @rgph_f2u32(float %0)
%5 = tail call i32 @rgph_u32x4_murmur32v_u32(i32 %4, i64 %1, i32* %2)
ret void
}
int main(int agrs, char **argv) { return 0; }


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
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
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t, int /*<<< orphan*/);
void print_words(size_t num_words, uint32_t buffer[num_words]) {
  size_t word_i;
  for (word_i = 0; word_i < num_words; word_i++) {
    printf("%2lu: %#x\n", word_i, buffer[word_i]);
  }
}


x86 assembly (clang, -O0):
<print_words>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1162 <print_words+0x52>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <print_words+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_words>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1148 <print_words+0x38>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xed4(%rip),%r12
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%edx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <print_words+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%2lu: %#x\0A\00"
define void @print_words(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i64
store i64 %0, i64* %3
store i32* %1, i32** %4
%6 = load i64, i64* %3
store i64 0, i64* %5
br label %7
7: ; preds = %18, %2
%8 = load i64, i64* %5
%9 = load i64, i64* %3
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i64, i64* %5
%13 = load i32*, i32** %4
%14 = load i64, i64* %5
%15 = getelementptr inbounds i32, i32* %13, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %12, i32 %16)
br label %18
18: ; preds = %11
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %7
21: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%2lu: %#x\0A\00"
define void @print_words(i64 %0, i32* nocapture %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %5, i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int posix_spawn(int /*<<< orphan*/ *, char *, int /*<<< orphan*/ *,
                int /*<<< orphan*/ *, char **, char **);
int main(void) {
  pid_t pid = 0;
  static char *argv_new[] = {NULL};
  static char *env_new[] = {NULL};
  return posix_spawn(&pid, "/tmp/nowhere", NULL, NULL, argv_new, env_new);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    0x2ef4(%rip),%r8
lea    0x2ef5(%rip),%r9
mov    %rcx,%rdx
call   1030 <posix_spawn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rsi
lea    0x2f09(%rip),%r8
lea    0x2f0a(%rip),%r9
lea    0x4(%rsp),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <posix_spawn@plt>
pop    %rcx
ret

LLVM IR (-O0):
@main.argv_new = internal global [1 x i8*] zeroinitializer
@main.env_new = internal global [1 x i8*] zeroinitializer
@.str = [13 x i8] c"/tmp/nowhere\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @posix_spawn(i32* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @main.argv_new, i64 0, i64 0), i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @main.env_new, i64 0, i64 0))
ret i32 %3
}

LLVM IR (-O2):
@main.argv_new = internal global [1 x i8*] zeroinitializer
@main.env_new = internal global [1 x i8*] zeroinitializer
@.str = [13 x i8] c"/tmp/nowhere\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @posix_spawn(i32* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @main.argv_new, i64 0, i64 0), i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @main.env_new, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
char const *fmt_human(long, int);
scalar_t__ get_swap_info(long *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
const char *swap_total(void) {
  long total;
  if (get_swap_info(&total, NULL, NULL)) {
    return NULL;
  }
  return fmt_human(total * 1024, 1024);
}


x86 assembly (clang, -O0):
<swap_total>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1040 <get_swap_info@plt>
cmp    $0x0,%rax
je     114f <swap_total+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1165 <swap_total+0x45>
mov    -0x10(%rbp),%rdi
shl    $0xa,%rdi
mov    $0x400,%esi
call   1030 <fmt_human@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_total>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <get_swap_info@plt>
test   %rax,%rax
jne    1150 <swap_total+0x30>
mov    0x8(%rsp),%rdi
shl    $0xa,%rdi
mov    $0x400,%esi
call   1030 <fmt_human@plt>
mov    %rax,%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @swap_total() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 @get_swap_info(i64* %2, i32* null, i32* null)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8* null, i8** %1
br label %10
6: ; preds = %0
%7 = load i64, i64* %2
%8 = mul nsw i64 %7, 1024
%9 = call i8* @fmt_human(i64 %8, i32 1024)
store i8* %9, i8** %1
br label %10
10: ; preds = %6, %5
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
define i8* @swap_total() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i64 @get_swap_info(i64* %1, i32* null, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i64, i64* %1
%7 = shl nsw i64 %6, 10
%8 = call i8* @fmt_human(i64 %7, i32 1024)
br label %9
9: ; preds = %0, %5
%10 = phi i8* [ %8, %5 ], [ null, %0 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ terminate();
void sigterm_handler(int sig) {
  terminate();
  exit(1);
}


x86 assembly (clang, -O0):
<sigterm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <terminate@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigterm_handler>:
push   %rax
xor    %eax,%eax
call   1030 <terminate@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sigterm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @terminate()
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sigterm_handler(i32 %0) {
%2 = tail call i32 (...) @terminate()
%3 = tail call i32 @exit(i32 1)
unreachable
}
__attribute((visibility("protected"))) void protected() {}


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

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

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

LLVM IR (-O2):
define protected void @protected() {
ret void
}
/* Variables and functions */
char *must_malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
char *must_strsave(char *str) {
  size_t l;
  char *answer;
  l = strlen(str);
  answer = must_malloc(l + 1);
  strcpy(answer, str);
  return answer;
}


x86 assembly (clang, -O0):
<must_strsave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <must_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<must_strsave>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <must_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @must_strsave(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @must_malloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
define i8* @must_strsave(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @must_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ fseek(void *, long long, int);
int /*<<< orphan*/ ftello(void *);
off_t stream_seek(void *priv, long long pos, int whence) {
  fseek(priv, pos, whence);
  return ftello(priv);
}


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

x86 assembly (clang, -O2):
<stream_seek>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ftello@plt>

LLVM IR (-O0):
define i32 @stream_seek(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @fseek(i8* %7, i64 %8, i32 %9)
%11 = load i8*, i8** %4
%12 = call i32 @ftello(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @stream_seek(i8* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i32 @fseek(i8* %0, i64 %1, i32 %2)
%5 = tail call i32 @ftello(i8* %0)
ret i32 %5
}
int side_nc(int side) {
  switch (side) {
  case 1:
    return (3);
  case 2:
    return (7);
  case 3:
    return (5);
  case 4:
    return (1);
  }
}


x86 assembly (clang, -O0):
<side_nc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     115b <side_nc+0x5b>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x3,-0x4(%rbp)
jmp    115b <side_nc+0x5b>
movl   $0x7,-0x4(%rbp)
jmp    115b <side_nc+0x5b>
movl   $0x5,-0x4(%rbp)
jmp    115b <side_nc+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<side_nc>:
add    $0xfffffffe,%edi
mov    $0x3,%eax
cmp    $0x2,%edi
ja     111a <side_nc+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @side_nc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
]
5: ; preds = %1
store i32 3, i32* %2
br label %9
6: ; preds = %1
store i32 7, i32* %2
br label %9
7: ; preds = %1
store i32 5, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %5, %6, %7, %8, %1
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@switch.table.side_nc = [3 x i32] [i32 7, i32 5, i32 1]
define i32 @side_nc(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.side_nc, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 3, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ square_euclidean_distance(double const *, double const *,
                                             int);
double euclidean_distance(const double *a, const double *b, int k) {
  return sqrt(square_euclidean_distance(a, b, k));
}


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

x86 assembly (clang, -O2):
<euclidean_distance>:
push   %rax
call   1040 <square_euclidean_distance@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @euclidean_distance(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = call i32 @square_euclidean_distance(double* %7, double* %8, i32 %9)
%11 = call double @sqrt(i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @euclidean_distance(double* %0, double* %1, i32 %2) {
%4 = tail call i32 @square_euclidean_distance(double* %0, double* %1, i32 %2)
%5 = tail call double @sqrt(i32 %4)
ret double %5
}
int foo(unsigned short x) {
  unsigned short y;
  y = x > 32767 ? x - 32768 : 0;
  return y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x7fff,%eax
jle    112b <foo+0x2b>
movzwl -0x2(%rbp),%eax
sub    $0x8000,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <foo+0x35>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <foo+0x35>
mov    -0x8(%rbp),%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movswl %di,%eax
xor    $0xffff8000,%edi
sar    $0xf,%eax
and    %edi,%eax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i32 @foo(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = icmp sgt i32 %5, 32767
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
%10 = sub nsw i32 %9, 32768
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %7
%13 = phi i32 [ %10, %7 ], [ 0, %11 ]
%14 = trunc i32 %13 to i16
store i16 %14, i16* %3
%15 = load i16, i16* %3
%16 = zext i16 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @foo(i16 zeroext %0) {
%2 = icmp slt i16 %0, 0
%3 = xor i16 %0, -32768
%4 = select i1 %2, i16 %3, i16 0
%5 = zext i16 %4 to i32
ret i32 %5
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ corrupt_pac(struct __test_metadata *);
void wrapper_corrupt_pac(struct __test_metadata *_metadata,
                         struct __fixture_variant_metadata *variant) {
  corrupt_pac(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_corrupt_pac>:
jmp    1030 <corrupt_pac@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_corrupt_pac(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @corrupt_pac(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_corrupt_pac(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @corrupt_pac(%struct.__test_metadata* %0)
ret void
}
int _dup2(oldd, newd) {
  oldd |= 64;
  return __xdup(oldd, newd);
}


x86 assembly (clang, -O0):
<_dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     $0x40,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <__xdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dup2>:
or     $0x40,%edi
xor    %eax,%eax
jmp    1030 <__xdup@plt>

LLVM IR (-O0):
define i32 @_dup2(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 = or i32 %5, 64
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @__xdup to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @_dup2(i32 %0, i32 %1) {
%3 = or i32 %0, 64
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__xdup to i32 (i32, i32, ...)*)(i32 %3, i32 %1)
ret i32 %4
}