xunge/DecIR huggingface dataset:
void __attribute__((no)) foo2(int *a) {
  int i;
  for (i = 0; i < 100; i++) {
    a[i] = 0;
    a[i + 2] = -1;
    a[i + 3] = -2;
  }
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    115e <foo2+0x5e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movl   $0xfffffffe,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <foo2+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
mov    $0x4,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movq   $0x0,-0x10(%rdi,%rax,4)
movq   $0xffffffffffffffff,-0x8(%rdi,%rax,4)
ff ff
movl   $0xfffffffe,(%rdi,%rax,4)
add    $0x2,%rax
cmp    $0x68,%rax
jne    1110 <foo2+0x10>
ret

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

LLVM IR (-O2):
define void @foo2(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %15, %2 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
store i32 0, i32* %4
%5 = add nuw nsw i64 %3, 2
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 -1, i32* %6
%7 = add nuw nsw i64 %3, 3
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 -2, i32* %8
%9 = or i64 %3, 1
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 0, i32* %10
%11 = add nuw nsw i64 %3, 3
%12 = getelementptr inbounds i32, i32* %0, i64 %11
store i32 -1, i32* %12
%13 = add nuw nsw i64 %3, 4
%14 = getelementptr inbounds i32, i32* %0, i64 %13
store i32 -2, i32* %14
%15 = add nuw nsw i64 %3, 2
%16 = icmp eq i64 %15, 100
br i1 %16, label %17, label %2
17: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void st_memcpy(void *s1, const void *s2, int n) { memcpy(s1, s2, n); }


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

x86 assembly (clang, -O2):
<st_memcpy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @st_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @st_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, int, char *);
void MadLibs(char animalName[], char place[], char verb[], int time,
             char timeUnit[]) {
  printf("One day, a %s went to %s and %s another %s for %d %s.\n", animalName,
         place, verb, animalName, time, timeUnit);
}


x86 assembly (clang, -O0):
<MadLibs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x28(%rbp),%rax
lea    0xeb6(%rip),%rdi
mov    %rax,(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MadLibs>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %r8,(%rsp)
lea    0xed8(%rip),%rdi
mov    %rsi,%r8
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [55 x i8] c"One day, a %s went to %s and %s another %s for %d %s.\0A\00"
define void @MadLibs(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %6
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i8* %13, i8* %14, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"One day, a %s went to %s and %s another %s for %d %s.\0A\00"
define void @MadLibs(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2, i8* %0, i32 %3, i8* %4)
ret void
}
/* Type definitions */
struct sembuf {
  int sem_num;
  int sem_op;
  scalar_t__ sem_flg;
};

/* Variables and functions */
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void sem_signal(int semid, int sem_num, int val) {
  struct sembuf op;
  op.sem_num = sem_num;
  op.sem_op = val;
  op.sem_flg = 0;
  semop(semid, &op, 1);
}


x86 assembly (clang, -O0):
<sem_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_signal>:
sub    $0x18,%rsp
mov    %esi,0x8(%rsp)
mov    %edx,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
define void @sem_signal(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.sembuf
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %7, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %6
%11 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %7, i32 0, i32 1
store i32 %10, i32* %11
%12 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %7, i32 0, i32 2
store i64 0, i64* %12
%13 = load i32, i32* %4
%14 = call i32 @semop(i32 %13, %struct.sembuf* %7, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
define void @sem_signal(i32 %0, i32 %1, i32 %2) {
%4 = alloca %struct.sembuf
%5 = bitcast %struct.sembuf* %4 to i8*
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i64 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i64 0, i32 1
store i32 %2, i32* %7
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i64 0, i32 2
store i64 0, i64* %8
%9 = call i32 @semop(i32 %0, %struct.sembuf* %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void out_of_mem(void) {
  syslog(LOG_ERR, "out of memory");
  exit(2);
}


x86 assembly (clang, -O0):
<out_of_mem>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <syslog@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<out_of_mem>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <syslog@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [14 x i8] c"out of memory\00"
define void @out_of_mem() {
%1 = load i32, i32* @LOG_ERR
%2 = call i32 @syslog(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [14 x i8] c"out of memory\00"
define void @out_of_mem() {
%1 = load i32, i32* @LOG_ERR
%2 = tail call i32 @syslog(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
double my_creal(double _Complex x) { return ((double *)&x)[0]; }


x86 assembly (clang, -O0):
<my_creal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @my_creal(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = bitcast { double, double }* %3 to double*
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
ret double %8
}

LLVM IR (-O2):
define double @my_creal(double returned %0, double %1) {
ret double %0
}
void bar(void) { *(char *)0 = 0; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @bar() {
store i8 0, i8* null
ret void
}

LLVM IR (-O2):
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ GL_BITMAP;
int /*<<< orphan*/ GL_COLOR_INDEX;
int /*<<< orphan*/ __glDrawPixels_size(int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/);
GLint __glBitmap_size(GLsizei w, GLsizei h) {
  return __glDrawPixels_size(GL_COLOR_INDEX, GL_BITMAP, w, h);
}


x86 assembly (clang, -O0):
<__glBitmap_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
call   1030 <__glDrawPixels_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glBitmap_size>:
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2ec4(%rip),%rax
mov    (%rax),%esi
jmp    1030 <__glDrawPixels_size@plt>

LLVM IR (-O0):
@GL_COLOR_INDEX = global i32 0
@GL_BITMAP = global i32 0
define i32 @__glBitmap_size(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @GL_COLOR_INDEX
%6 = load i32, i32* @GL_BITMAP
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @__glDrawPixels_size(i32 %5, i32 %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
@GL_COLOR_INDEX = global i32 0
@GL_BITMAP = global i32 0
define i32 @__glBitmap_size(i32 %0, i32 %1) {
%3 = load i32, i32* @GL_COLOR_INDEX
%4 = load i32, i32* @GL_BITMAP
%5 = tail call i32 @__glDrawPixels_size(i32 %3, i32 %4, i32 %0, i32 %1)
ret i32 %5
}
void drv_base_contrast(int contrast) {}


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

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

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

LLVM IR (-O2):
define void @drv_base_contrast(i32 %0) {
ret void
}
/* Variables and functions */
int isdigit(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ im_a_minion_01();
int /*<<< orphan*/ im_a_minion_02();
void testFuncMultipleStatementNot(void) {
  int a = 10U;
  if (a < 10U) {
    im_a_minion_01();
  } else {
    im_a_minion_02();
  }
  testFuncMultipleStatementNot();
}


x86 assembly (clang, -O0):
<testFuncMultipleStatementNot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jae    1155 <testFuncMultipleStatementNot+0x25>
mov    $0x0,%al
call   1040 <im_a_minion_01@plt>
jmp    115c <testFuncMultipleStatementNot+0x2c>
mov    $0x0,%al
call   1050 <im_a_minion_02@plt>
call   1030 <testFuncMultipleStatementNot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFuncMultipleStatementNot>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <im_a_minion_02@plt>
jmp    1120 <testFuncMultipleStatementNot+0x10>

LLVM IR (-O0):
define void @testFuncMultipleStatementNot() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @im_a_minion_01()
br label %8
6: ; preds = %0
%7 = call i32 (...) @im_a_minion_02()
br label %8
8: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
define void @testFuncMultipleStatementNot() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @im_a_minion_02()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, unsigned int *, int);
void put4(void *dest, unsigned int val) {
  memcpy(dest, &val, sizeof(unsigned int));
}


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

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

LLVM IR (-O0):
define void @put4(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 = call i32 @memcpy(i8* %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @put4(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_PW5_PIN() { set_io_bit(0x40, 5); }


x86 assembly (clang, -O0):
<TOSH_SET_PW5_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0x5,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_PW5_PIN>:
mov    $0x40,%edi
mov    $0x5,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_PW5_PIN() {
%1 = call i32 @set_io_bit(i32 64, i32 5)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_PW5_PIN() {
%1 = tail call i32 @set_io_bit(i32 64, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rec_three_way_qsort(double *, size_t);
int /*<<< orphan*/ shuffle(double *, size_t);
void three_way_qsort(double *array, size_t size) {
  shuffle(array, size);
  rec_three_way_qsort(array, size);
}


x86 assembly (clang, -O0):
<three_way_qsort>:
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 <shuffle@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <rec_three_way_qsort@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @three_way_qsort(double* %0, i64 %1) {
%3 = alloca double*
%4 = alloca i64
store double* %0, double** %3
store i64 %1, i64* %4
%5 = load double*, double** %3
%6 = load i64, i64* %4
%7 = call i32 @shuffle(double* %5, i64 %6)
%8 = load double*, double** %3
%9 = load i64, i64* %4
%10 = call i32 @rec_three_way_qsort(double* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @three_way_qsort(double* %0, i64 %1) {
%3 = tail call i32 @shuffle(double* %0, i64 %1)
%4 = tail call i32 @rec_three_way_qsort(double* %0, i64 %1)
ret void
}
int main() {
  int *p;
  int a[3] = {1, 2, 3};
  p = &(*(a + 1));
  return *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [3 x i32]
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
void warmup_loop(unsigned long limit) {
  int index;
  for (index = 0; index < limit; index++) {
    __asm__("nop");
  }
}


x86 assembly (clang, -O0):
<warmup_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    112c <warmup_loop+0x2c>
nop
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <warmup_loop+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<warmup_loop>:
test   %rdi,%rdi
je     1117 <warmup_loop+0x17>
cs nopw 0x0(%rax,%rax,1)
nop
nop
add    $0xffffffffffffffff,%rdi
jne    1110 <warmup_loop+0x10>
ret

LLVM IR (-O0):
define void @warmup_loop(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i64, i64* %2
%8 = icmp ult i64 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %4
br label %10
10: ; preds = %9
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @warmup_loop(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ 0, %1 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%5 = add nuw i64 %4, 1
%6 = icmp eq i64 %5, %0
br i1 %6, label %7, label %3
7: ; preds = %3, %1
ret void
}
void ff_hevc_put_hevc_bi_qpel_h48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_h48_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void pipe_cleanup(void) {
  close(STDIN_FILENO);
  wait(NULL);
}


x86 assembly (clang, -O0):
<pipe_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <wait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe_cleanup>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <close@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <wait@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define void @pipe_cleanup() {
%1 = load i32, i32* @STDIN_FILENO
%2 = call i32 @close(i32 %1)
%3 = call i32 @wait(i32* null)
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define void @pipe_cleanup() {
%1 = load i32, i32* @STDIN_FILENO
%2 = tail call i32 @close(i32 %1)
%3 = tail call i32 @wait(i32* null)
ret void
}
void Cstart(void) { return; }


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

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

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

LLVM IR (-O2):
define void @Cstart() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int *pivector(int dim) {
  int *vec;
  vec = (int *)malloc(dim * sizeof(int));
  if (!vec)
    printf("memory allocation error, pivector\n");
  return vec;
}


x86 assembly (clang, -O0):
<pivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <pivector+0x35>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pivector>:
push   %rbx
shl    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113d <pivector+0x1d>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [34 x i8] c"memory allocation error, pivector\00"
define i32* @pivector(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = inttoptr i64 %3 to i32*
ret i32* %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XSizeHints;

/* Variables and functions */
void set_XSizeHints_y(void *_p, int _v) { ((XSizeHints *)_p)->y = (int)_v; }


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

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

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

LLVM IR (-O2):
define void @set_XSizeHints_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct callFunctionItemWithArg {
  int dummy;
};

/* Variables and functions */
struct callFunctionItemWithArg *AddFunctionToCallListWithArgWithContext(
    void *, char const *, int, void (*)(void *, void *),
    struct callFunctionItemWithArg *, int /*<<< orphan*/ *);
struct callFunctionItemWithArg *
AddFunctionToCallListWithArg(void *theEnv, const char *name, int priority,
                             void (*func)(void *, void *),
                             struct callFunctionItemWithArg *head) {
  return AddFunctionToCallListWithArgWithContext(theEnv, name, priority, func,
                                                 head, NULL);
}


x86 assembly (clang, -O0):
<AddFunctionToCallListWithArg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <AddFunctionToCallListWithArgWithContext@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddFunctionToCallListWithArg>:
xor    %r9d,%r9d
jmp    1030 <AddFunctionToCallListWithArgWithContext@plt>

LLVM IR (-O0):
%struct.callFunctionItemWithArg = type { i32 }
define %struct.callFunctionItemWithArg* @AddFunctionToCallListWithArg(i8* %0, i8* %1, i32 %2, void (i8*, i8*)* %3, %struct.callFunctionItemWithArg* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca void (i8*, i8*)*
%10 = alloca %struct.callFunctionItemWithArg*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store void (i8*, i8*)* %3, void (i8*, i8*)** %9
store %struct.callFunctionItemWithArg* %4, %struct.callFunctionItemWithArg** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load void (i8*, i8*)*, void (i8*, i8*)** %9
%15 = load %struct.callFunctionItemWithArg*, %struct.callFunctionItemWithArg** %10
%16 = call %struct.callFunctionItemWithArg* @AddFunctionToCallListWithArgWithContext(i8* %11, i8* %12, i32 %13, void (i8*, i8*)* %14, %struct.callFunctionItemWithArg* %15, i32* null)
ret %struct.callFunctionItemWithArg* %16
}

LLVM IR (-O2):
%struct.callFunctionItemWithArg = type { i32 }
define %struct.callFunctionItemWithArg* @AddFunctionToCallListWithArg(i8* %0, i8* %1, i32 %2, void (i8*, i8*)* %3, %struct.callFunctionItemWithArg* %4) {
%6 = tail call %struct.callFunctionItemWithArg* @AddFunctionToCallListWithArgWithContext(i8* %0, i8* %1, i32 %2, void (i8*, i8*)* %3, %struct.callFunctionItemWithArg* %4, i32* null)
ret %struct.callFunctionItemWithArg* %6
}
/* Variables and functions */
int musbgm_stopall(int);
int mus_bgm_stopall(int time) { return musbgm_stopall(time); }


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

x86 assembly (clang, -O2):
<mus_bgm_stopall>:
jmp    1030 <musbgm_stopall@plt>

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

LLVM IR (-O2):
define i32 @mus_bgm_stopall(i32 %0) {
%2 = tail call i32 @musbgm_stopall(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ logBacktraceString(char *);
void logBacktrace(void) { logBacktraceString("not supported"); }


x86 assembly (clang, -O0):
<logBacktrace>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <logBacktraceString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<logBacktrace>:
lea    0xee9(%rip),%rdi
jmp    1030 <logBacktraceString@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"not supported\00"
define void @logBacktrace() {
%1 = call i32 @logBacktraceString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"not supported\00"
define void @logBacktrace() {
%1 = tail call i32 @logBacktraceString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void RESHAPE(context_in, major_in, context_out, major_out, first_proc,
             nprow_new, npcol_new) int *context_in,
    *context_out, *first_proc, *major_in, *major_out, *nprow_new, *npcol_new;
{
  Creshape(*context_in, *major_in, context_out, *major_out, *first_proc,
           *nprow_new, *npcol_new);
}


x86 assembly (clang, -O0):
<RESHAPE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%rax
mov    (%rax),%r9d
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <Creshape@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RESHAPE>:
push   %rax
mov    0x10(%rsp),%rax
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rcx),%ecx
mov    (%r8),%r8d
mov    (%r9),%r9d
mov    (%rax),%eax
mov    %eax,(%rsp)
xor    %eax,%eax
call   1030 <Creshape@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @RESHAPE(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i32*, i32** %10
%20 = load i32*, i32** %11
%21 = load i32, i32* %20
%22 = load i32*, i32** %12
%23 = load i32, i32* %22
%24 = load i32*, i32** %13
%25 = load i32, i32* %24
%26 = load i32*, i32** %14
%27 = load i32, i32* %26
%28 = call i32 (i32, i32, i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @Creshape to i32 (i32, i32, i32*, i32, i32, i32, i32, ...)*)(i32 %16, i32 %18, i32* %19, i32 %21, i32 %23, i32 %25, i32 %27)
ret void
}

LLVM IR (-O2):
define void @RESHAPE(i32* nocapture %0, i32* nocapture %1, i32* %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32* nocapture %6) {
%8 = load i32, i32* %0
%9 = load i32, i32* %1
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = tail call i32 (i32, i32, i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @Creshape to i32 (i32, i32, i32*, i32, i32, i32, i32, ...)*)(i32 %8, i32 %9, i32* %2, i32 %10, i32 %11, i32 %12, i32 %13)
ret void
}
/* Variables and functions */
unsigned int xatoull(char const *);
unsigned int xatou(const char *str) { return xatoull(str); }


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

x86 assembly (clang, -O2):
<xatou>:
jmp    1030 <xatoull@plt>

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

LLVM IR (-O2):
define i32 @xatou(i8* %0) {
%2 = tail call i32 @xatoull(i8* %0)
ret i32 %2
}
/* Variables and functions */
unsigned int index(const unsigned int i, const unsigned int j,
                   const unsigned jstride, const unsigned first_padding) {
  return i + j * jstride + first_padding;
}


x86 assembly (clang, -O0):
<index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index>:
imul   %edx,%esi
lea    (%rsi,%rdi,1),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @index(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = mul i32 %10, %11
%13 = add i32 %9, %12
%14 = load i32, i32* %8
%15 = add i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @index(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul i32 %2, %1
%6 = add i32 %5, %0
%7 = add i32 %6, %3
ret i32 %7
}
/* Type definitions */
struct bpf_flow_keys {
  int /*<<< orphan*/ n_proto;
};
struct __sk_buff {
  struct bpf_flow_keys *flow_keys;
};

/* Variables and functions */
int parse_eth_proto(struct __sk_buff *, int /*<<< orphan*/);
__attribute__((section("flow_dissector"), used)) int
_dissect(struct __sk_buff *skb) {
  struct bpf_flow_keys *keys = skb->flow_keys;
  return parse_eth_proto(skb, keys->n_proto);
}


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

x86 assembly (clang, -O2):
<_dissect>:
mov    (%rdi),%rax
mov    (%rax),%esi
jmp    1030 <parse_eth_proto@plt>

LLVM IR (-O0):
%struct.__sk_buff = type { %struct.bpf_flow_keys* }
%struct.bpf_flow_keys = type { i32 }
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.__sk_buff*)* @_dissect to i8*)], section "llvm.metadata"
define i32 @_dissect(%struct.__sk_buff* %0) section "flow_dissector" {
%2 = alloca %struct.__sk_buff*
%3 = alloca %struct.bpf_flow_keys*
store %struct.__sk_buff* %0, %struct.__sk_buff** %2
%4 = load %struct.__sk_buff*, %struct.__sk_buff** %2
%5 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %4, i32 0, i32 0
%6 = load %struct.bpf_flow_keys*, %struct.bpf_flow_keys** %5
store %struct.bpf_flow_keys* %6, %struct.bpf_flow_keys** %3
%7 = load %struct.__sk_buff*, %struct.__sk_buff** %2
%8 = load %struct.bpf_flow_keys*, %struct.bpf_flow_keys** %3
%9 = getelementptr inbounds %struct.bpf_flow_keys, %struct.bpf_flow_keys* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @parse_eth_proto(%struct.__sk_buff* %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.__sk_buff = type { %struct.bpf_flow_keys* }
%struct.bpf_flow_keys = type { i32 }
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.__sk_buff*)* @_dissect to i8*)], section "llvm.metadata"
define i32 @_dissect(%struct.__sk_buff* %0) section "flow_dissector" {
%2 = getelementptr inbounds %struct.__sk_buff, %struct.__sk_buff* %0, i64 0, i32 0
%3 = load %struct.bpf_flow_keys*, %struct.bpf_flow_keys** %2
%4 = getelementptr inbounds %struct.bpf_flow_keys, %struct.bpf_flow_keys* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @parse_eth_proto(%struct.__sk_buff* %0, i32 %5)
ret i32 %6
}
/* Variables and functions */
int shutdown(int, int);
int socket_shutdown(int fd, int how) { return shutdown(fd, how); }


x86 assembly (clang, -O0):
<socket_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_shutdown>:
jmp    1030 <shutdown@plt>

LLVM IR (-O0):
define i32 @socket_shutdown(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 = call i32 @shutdown(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @socket_shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
ret i32 %3
}
extern int mdp_ppp_do_blit(struct mdp_info *mdp, struct mdp_blit_req *req,
                           struct file *src_file, unsigned long src_start,
                           unsigned long src_len, struct file *dst_file,
                           unsigned long dst_start, unsigned long dst_len) {
  return 0;
}


x86 assembly (clang, -O0):
<mdp_ppp_do_blit>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mdp_info = type opaque
%struct.mdp_blit_req = type opaque
%struct.file = type opaque
define i32 @mdp_ppp_do_blit(%struct.mdp_info* %0, %struct.mdp_blit_req* %1, %struct.file* %2, i64 %3, i64 %4, %struct.file* %5, i64 %6, i64 %7) {
%9 = alloca %struct.mdp_info*
%10 = alloca %struct.mdp_blit_req*
%11 = alloca %struct.file*
%12 = alloca i64
%13 = alloca i64
%14 = alloca %struct.file*
%15 = alloca i64
%16 = alloca i64
store %struct.mdp_info* %0, %struct.mdp_info** %9
store %struct.mdp_blit_req* %1, %struct.mdp_blit_req** %10
store %struct.file* %2, %struct.file** %11
store i64 %3, i64* %12
store i64 %4, i64* %13
store %struct.file* %5, %struct.file** %14
store i64 %6, i64* %15
store i64 %7, i64* %16
ret i32 0
}

LLVM IR (-O2):
%struct.mdp_info = type opaque
%struct.mdp_blit_req = type opaque
%struct.file = type opaque
define i32 @mdp_ppp_do_blit(%struct.mdp_info* nocapture readnone %0, %struct.mdp_blit_req* nocapture readnone %1, %struct.file* nocapture readnone %2, i64 %3, i64 %4, %struct.file* nocapture readnone %5, i64 %6, i64 %7) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ test(int);
int main() {
  int dst = 32;
  if (test(dst) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <test@plt>
cmp    $0x0,%rax
je     114f <main+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20,%edi
call   1040 <test@plt>
test   %rax,%rax
jne    1134 <main+0x14>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 32, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @test(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @test(i32 32)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
int main(void) {
  int i = 41;
  if (i++ > 41) {
    return 99;
  } else {
    return i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x29,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x29,%eax
jle    1132 <main+0x32>
movl   $0x63,-0x4(%rbp)
jmp    1138 <main+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int readInt32(FILE *f) {
  int v = 0;
  v |= fgetc(f);
  v |= fgetc(f) << 8;
  v |= fgetc(f) << 16;
  v |= fgetc(f) << 24;
  return v;
}


x86 assembly (clang, -O0):
<readInt32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt32>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <fgetc@plt>
mov    %eax,%r14d
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %r14d,%ebp
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
mov    %r15,%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readInt32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
%6 = load i32, i32* %3
%7 = or i32 %6, %5
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @fgetc(i32* %8)
%10 = shl i32 %9, 8
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
%13 = load i32*, i32** %2
%14 = call i32 @fgetc(i32* %13)
%15 = shl i32 %14, 16
%16 = load i32, i32* %3
%17 = or i32 %16, %15
store i32 %17, i32* %3
%18 = load i32*, i32** %2
%19 = call i32 @fgetc(i32* %18)
%20 = shl i32 %19, 24
%21 = load i32, i32* %3
%22 = or i32 %21, %20
store i32 %22, i32* %3
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @readInt32(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = tail call i32 @fgetc(i32* %0)
%7 = shl i32 %6, 16
%8 = or i32 %5, %7
%9 = tail call i32 @fgetc(i32* %0)
%10 = shl i32 %9, 24
%11 = or i32 %8, %10
ret i32 %11
}
void quat_irotate(float q[4], float a, float x, float y, float z) {
  quat_rotate(q, a, x, y, z, q);
}


x86 assembly (clang, -O0):
<quat_irotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x18(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
mov    -0x8(%rbp),%rsi
mov    $0x4,%al
call   1030 <quat_rotate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_irotate>:
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm2,%xmm2
cvtss2sd %xmm3,%xmm3
mov    %rdi,%rsi
mov    $0x4,%al
jmp    1030 <quat_rotate@plt>

LLVM IR (-O0):
define void @quat_irotate(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float*, float** %6
%12 = load float, float* %7
%13 = fpext float %12 to double
%14 = load float, float* %8
%15 = fpext float %14 to double
%16 = load float, float* %9
%17 = fpext float %16 to double
%18 = load float, float* %10
%19 = fpext float %18 to double
%20 = load float*, float** %6
%21 = call i32 (float*, double, double, double, double, float*, ...) bitcast (i32 (...)* @quat_rotate to i32 (float*, double, double, double, double, float*, ...)*)(float* %11, double %13, double %15, double %17, double %19, float* %20)
ret void
}

LLVM IR (-O2):
define void @quat_irotate(float* %0, float %1, float %2, float %3, float %4) {
%6 = fpext float %1 to double
%7 = fpext float %2 to double
%8 = fpext float %3 to double
%9 = fpext float %4 to double
%10 = tail call i32 (float*, double, double, double, double, float*, ...) bitcast (i32 (...)* @quat_rotate to i32 (float*, double, double, double, double, float*, ...)*)(float* %0, double %6, double %7, double %8, double %9, float* %0)
ret void
}
double divr(double a, double b, double c, double d) {
  return (a * c + b * d) / (c * c + d * d);
}


x86 assembly (clang, -O0):
<divr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
movsd  -0x20(%rbp),%xmm2
mulsd  -0x20(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divr>:
unpcklpd %xmm3,%xmm1
unpcklpd %xmm3,%xmm3
mulpd  %xmm1,%xmm3
unpcklpd %xmm2,%xmm0
unpcklpd %xmm2,%xmm2
mulpd  %xmm2,%xmm0
addpd  %xmm3,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @divr(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = load double, double* %6
%12 = load double, double* %8
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %9, double %10, double %13)
%15 = load double, double* %7
%16 = load double, double* %7
%17 = load double, double* %8
%18 = load double, double* %8
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %15, double %16, double %19)
%21 = fdiv double %14, %20
ret double %21
}

LLVM IR (-O2):
define double @divr(double %0, double %1, double %2, double %3) {
%5 = insertelement <2 x double> poison, double %3, i64 0
%6 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> zeroinitializer
%7 = insertelement <2 x double> poison, double %1, i64 0
%8 = insertelement <2 x double> %7, double %3, i64 1
%9 = fmul <2 x double> %6, %8
%10 = insertelement <2 x double> poison, double %0, i64 0
%11 = insertelement <2 x double> %10, double %2, i64 1
%12 = insertelement <2 x double> poison, double %2, i64 0
%13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer
%14 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <2 x double> %13, <2 x double> %9)
%15 = extractelement <2 x double> %14, i64 0
%16 = extractelement <2 x double> %14, i64 1
%17 = fdiv double %15, %16
ret double %17
}