xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strdup(char const *);
char *xxstrdup(const char *s) { return (strdup(s)); }


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

x86 assembly (clang, -O2):
<xxstrdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @xxstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
char *getLevelFilenameFromBasename(int /*<<< orphan*/);
int /*<<< orphan*/ getSingleLevelBasename(int);
char *getSingleLevelFilename(int nr) {
  return getLevelFilenameFromBasename(getSingleLevelBasename(nr));
}


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

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

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

LLVM IR (-O2):
define i8* @getSingleLevelFilename(i32 %0) {
%2 = tail call i32 @getSingleLevelBasename(i32 %0)
%3 = tail call i8* @getLevelFilenameFromBasename(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double r, s, c;
  scanf("%lf", &r);
  s = r * r * 3.14;
  c = 2 * 3.14 * r;
  printf("Area: %lf\n", s);
  printf("Perimeter: %lf", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xeb7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe9e(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xefb(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xeb5(%rip),%xmm0
mulsd  0xeb5(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [11 x i8] c"Area: %lf\0A\00"
@.str.2 = [15 x i8] c"Perimeter: %lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = fmul double %8, 3.140000e+00
store double %9, double* %3
%10 = load double, double* %2
%11 = fmul double 6.280000e+00, %10
store double %11, double* %4
%12 = load double, double* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double %12)
%14 = load double, double* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [11 x i8] c"Area: %lf\0A\00"
@.str.2 = [15 x i8] c"Perimeter: %lf\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, %4
%6 = fmul double %5, 3.140000e+00
%7 = fmul double %4, 6.280000e+00
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double %6)
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
void menu_msgbox_open(char *msg) { return; }


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

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

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

LLVM IR (-O2):
define void @menu_msgbox_open(i8* nocapture %0) {
ret void
}
/* Variables and functions */
void *mm_realloc(void *ptr, size_t size) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @mm_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @mm_realloc(i8* nocapture readnone %0, i64 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
void on_release() { printf("button released, %d\n", time(NULL)); }


x86 assembly (clang, -O0):
<on_release>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_release>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"button released, %d\0A\00"
define void @on_release() {
%1 = call i32 @time(i32* null)
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"button released, %d\0A\00"
define void @on_release() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void AVOID_EMPTY_UNIT_WARNING_BY_GCC_EVPORT() {}


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

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

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

LLVM IR (-O2):
define void @AVOID_EMPTY_UNIT_WARNING_BY_GCC_EVPORT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void delayMicroseconds(unsigned int us) {
  usleep(us);
  return;
}


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

x86 assembly (clang, -O2):
<delayMicroseconds>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @delayMicroseconds(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x81() {
  Assert_real((isascii(129) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              650, ("isascii should be 0 for 0x81"));
}


x86 assembly (clang, -O0):
<t_isascii_0x81>:
push   %rbp
mov    %rsp,%rbp
mov    $0x81,%edi
call   1030 <isascii@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28a,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x81>:
push   %rax
mov    $0x81,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x81\00"
define void @t_isascii_0x81() {
%1 = call i64 @isascii(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0x81\00"
define void @t_isascii_0x81() {
%1 = tail call i64 @isascii(i32 129)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 650, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xd4() {
  Assert_real((isdigit(212) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              1065, ("isdigit should be 0 for 0xd4"));
}


x86 assembly (clang, -O0):
<t_isdigit_0xd4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd4,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x429,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0xd4>:
push   %rax
mov    $0xd4,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x429,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xd4\00"
define void @t_isdigit_0xd4() {
%1 = call i64 @isdigit(i32 212)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1065, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xd4\00"
define void @t_isdigit_0xd4() {
%1 = tail call i64 @isdigit(i32 212)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1065, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
int aanum(int ch) {
  const static int aacvs[] = {999, 0,  3,  4,  3,  6,  13, 7,  8,
                              9,   21, 11, 10, 12, 2,  21, 14, 5,
                              1,   15, 16, 21, 19, 17, 21, 18, 6};
  return (isalpha(ch) ? aacvs[ch & 31] : 20);
}


x86 assembly (clang, -O0):
<aanum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     1148 <aanum+0x38>
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0xec3(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <aanum+0x45>
mov    $0x14,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <aanum+0x45>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aanum>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
je     112c <aanum+0x1c>
and    $0x1f,%ebx
lea    0xed9(%rip),%rax
mov    (%rax,%rbx,4),%eax
pop    %rbx
ret
mov    $0x14,%eax
pop    %rbx
ret

LLVM IR (-O0):
@aanum.aacvs = internal constant [27 x i32] [i32 999, i32 0, i32 3, i32 4, i32 3, i32 6, i32 13, i32 7, i32 8, i32 9, i32 21, i32 11, i32 10, i32 12, i32 2, i32 21, i32 14, i32 5, i32 1, i32 15, i32 16, i32 21, i32 19, i32 17, i32 21, i32 18, i32 6]
define i32 @aanum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, 31
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [27 x i32], [27 x i32]* @aanum.aacvs, i64 0, i64 %9
%11 = load i32, i32* %10
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %6
%14 = phi i32 [ %11, %6 ], [ 20, %12 ]
ret i32 %14
}

LLVM IR (-O2):
@aanum.aacvs = internal unnamed_addr constant [27 x i32] [i32 999, i32 0, i32 3, i32 4, i32 3, i32 6, i32 13, i32 7, i32 8, i32 9, i32 21, i32 11, i32 10, i32 12, i32 2, i32 21, i32 14, i32 5, i32 1, i32 15, i32 16, i32 21, i32 19, i32 17, i32 21, i32 18, i32 6]
define i32 @aanum(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = and i32 %0, 31
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [27 x i32], [27 x i32]* @aanum.aacvs, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 20, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int usage(char *exec) {
  int rc = 0;
  printf("Usage: %s [start|stop|restart|status]\n", exec);
  return rc;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: %s [start|stop|restart|status]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage: %s [start|stop|restart|status]\0A\00"
define i32 @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scrambleTheStack(int);
int /*<<< orphan*/ test();
int main(void) {
  scrambleTheStack(200);
  test();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc8,%edi
call   1030 <scrambleTheStack@plt>
xor    %eax,%eax
call   1040 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @scrambleTheStack(i32 200)
%3 = call i32 (...) @test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @scrambleTheStack(i32 200)
%2 = tail call i32 (...) @test()
ret i32 0
}
int int_ret() {
  int a = 3;
  a = 3 / a;
  return a;
}


x86 assembly (clang, -O0):
<int_ret>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
mov    $0x3,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_ret() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = sdiv i32 3, %2
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @int_ret() {
ret i32 1
}
/* Variables and functions */
int *mmod(int /*<<< orphan*/);
int /*<<< orphan*/ umod(int *);
int g(int *x) {
  (void)umod(x);
  (void)umod(mmod(umod(x)));
  return *x;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <umod@plt>
mov    -0x8(%rbp),%rdi
call   1040 <umod@plt>
mov    %eax,%edi
call   1030 <mmod@plt>
mov    %rax,%rdi
call   1040 <umod@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    %rdi,%rbx
call   1040 <umod@plt>
mov    %rbx,%rdi
call   1040 <umod@plt>
mov    %eax,%edi
call   1030 <mmod@plt>
mov    %rax,%rdi
call   1040 <umod@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @g(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @umod(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @umod(i32* %5)
%7 = call i32* @mmod(i32 %6)
%8 = call i32 @umod(i32* %7)
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @g(i32* %0) {
%2 = tail call i32 @umod(i32* %0)
%3 = tail call i32 @umod(i32* %0)
%4 = tail call i32* @mmod(i32 %3)
%5 = tail call i32 @umod(i32* %4)
%6 = load i32, i32* %0
ret i32 %6
}
void read_attenuation_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @read_attenuation_adios_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_puts(char *);
void console_clear() {
  console_puts("\n\n\n\n\n\n\n\n\n\n"
               "\n\n\n\n\n\n\n\n\n\n"
               "\n\n\n\n\n\n\n\n\n\n"
               "\n\n\n\n\n\n\n\n\n\n"
               "\n\n\n\n\n\n\n\n\n\n"
               "\n\n\n\n\n\n\n\n\n\n"
               "\n\n\n\n\n\n\n\n\n\n");
}


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

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

LLVM IR (-O0):
@.str = [71 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define void @console_clear() {
%1 = call i32 @console_puts(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define void @console_clear() {
%1 = tail call i32 @console_puts(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}
double calcCCPVol(float radius, float height) {
  return (3.14 * (radius * radius)) * height;
}


x86 assembly (clang, -O0):
<calcCCPVol>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xedc(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcCCPVol>:
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm2
mulsd  0xef0(%rip),%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @calcCCPVol(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = fmul float %5, %6
%8 = fpext float %7 to double
%9 = fmul double 3.140000e+00, %8
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = fmul double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @calcCCPVol(float %0, float %1) {
%3 = fmul float %0, %0
%4 = fpext float %3 to double
%5 = fmul double %4, 3.140000e+00
%6 = fpext float %1 to double
%7 = fmul double %5, %6
ret double %7
}
int maptype(int t) {
  switch (t) {
  case 1:
  case 2:
  case 3:
  case 4:
    return (1);
  case 8:
    return (3);
  default:
    return ((-1));
  }
}


x86 assembly (clang, -O0):
<maptype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffff,%eax
sub    $0x4,%eax
jb     112f <maptype+0x2f>
jmp    111e <maptype+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
je     113b <maptype+0x3b>
jmp    1147 <maptype+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <maptype+0x4e>
movl   $0x3,-0x4(%rbp)
jmp    114e <maptype+0x4e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@switch.table.maptype = [8 x i32] [i32 1, i32 1, i32 1, i32 1, i32 -1, i32 -1, i32 -1, i32 3]
define i32 @maptype(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.maptype, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
};

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(unsigned int);
void random_init() {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  srand((unsigned int)tp.tv_usec + (unsigned int)getpid());
}


x86 assembly (clang, -O0):
<random_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0xc(%rbp),%edi
add    %eax,%edi
call   1050 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_init>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
add    %eax,%ebx
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i64 }
define void @random_init() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = call i64 (...) @getpid()
%7 = trunc i64 %6 to i32
%8 = add i32 %5, %7
%9 = call i32 @srand(i32 %8)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64 }
define void @random_init() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = tail call i64 (...) @getpid()
%8 = trunc i64 %7 to i32
%9 = add i32 %8, %6
%10 = tail call i32 @srand(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void test() { foo(7); }


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

x86 assembly (clang, -O2):
<test>:
mov    $0x7,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 @foo(i32 7)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @foo(i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s2circyz(float, float, float, float, int, float);
void s2circyz_(float *px, float *py, float *pz, float *r, int *nseg,
               float *asp) {
  s2circyz(*px, *py, *pz, *r, *nseg, *asp);
}


x86 assembly (clang, -O0):
<s2circyz_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm3
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
movss  (%rax),%xmm4
call   1030 <s2circyz@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2circyz_>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  (%rdx),%xmm2
movss  (%rcx),%xmm3
mov    (%r8),%edi
movss  (%r9),%xmm4
jmp    1030 <s2circyz@plt>

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

LLVM IR (-O2):
define void @s2circyz_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, i32* nocapture %4, float* nocapture %5) {
%7 = load float, float* %0
%8 = load float, float* %1
%9 = load float, float* %2
%10 = load float, float* %3
%11 = load i32, i32* %4
%12 = load float, float* %5
%13 = tail call i32 @s2circyz(float %7, float %8, float %9, float %10, i32 %11, float %12)
ret void
}
int x36_process_syn(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x36_process_syn(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void even_handler(void *arg) { printf("Goodbye from Evens!\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Goodbye from Evens!\0A\00"
define void @even_handler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Goodbye from Evens!\00"
define void @even_handler(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
double f4_cb_send_pre_int_int_int_int_int_int_long(double (*cb)(int, int, int,
                                                                int, int, int,
                                                                long)) {
  long r = 33;
  return cb(8, 9, 10, 11, 12, 13, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_int_int_int_int_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x21,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%r10
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
mov    $0xc,%r8d
mov    $0xd,%r9d
mov    %r10,(%rsp)
call   *%rax
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_int_int_int_int_long>:
push   %rax
mov    %rdi,%rax
movq   $0x21,(%rsp)
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
mov    $0xc,%r8d
mov    $0xd,%r9d
call   *%rax
addsd  0xeca(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_int_int_int_int_long(double (i32, i32, i32, i32, i32, i32, i64)* %0) {
%2 = alloca double (i32, i32, i32, i32, i32, i32, i64)*
%3 = alloca i64
store double (i32, i32, i32, i32, i32, i32, i64)* %0, double (i32, i32, i32, i32, i32, i32, i64)** %2
store i64 33, i64* %3
%4 = load double (i32, i32, i32, i32, i32, i32, i64)*, double (i32, i32, i32, i32, i32, i32, i64)** %2
%5 = load i64, i64* %3
%6 = call double %4(i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i64 %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_int_int_int_int_long(double (i32, i32, i32, i32, i32, i32, i64)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i64 33)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
bool is_vowel(char character) {
  switch (character) {
  case 'a':
  case 'e':
  case 'i':
  case 'o':
  case 'u':
    return true;
    break;
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<is_vowel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x61,%eax
je     1163 <is_vowel+0x63>
jmp    111f <is_vowel+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x65,%eax
je     1163 <is_vowel+0x63>
jmp    1130 <is_vowel+0x30>
mov    -0xc(%rbp),%eax
sub    $0x69,%eax
je     1163 <is_vowel+0x63>
jmp    1141 <is_vowel+0x41>
mov    -0xc(%rbp),%eax
sub    $0x6f,%eax
je     1163 <is_vowel+0x63>
jmp    1152 <is_vowel+0x52>
mov    -0xc(%rbp),%eax
sub    $0x75,%eax
jne    116f <is_vowel+0x6f>
jmp    1163 <is_vowel+0x63>
movl   $0x1,-0x4(%rbp)
jmp    1176 <is_vowel+0x76>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_vowel>:
add    $0xffffff9f,%edi
ror    %edi
xor    %eax,%eax
cmp    $0xa,%edi
ja     1119 <is_vowel+0x19>
movslq %edi,%rax
lea    0xeea(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @is_vowel(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 97, label %6
i32 101, label %6
i32 105, label %6
i32 111, label %6
i32 117, label %6
]
6: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.is_vowel = [11 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1]
define i32 @is_vowel(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -97
%4 = tail call i32 @llvm.fshl.i32(i32 %3, i32 %3, i32 31)
%5 = icmp ult i32 %4, 11
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.is_vowel, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
void SPIDataPut(unsigned long ulBase, unsigned long ulData) {
  while (!((*((volatile unsigned long *)(ulBase + 0x00000130))) & 0x00000002)) {
  }
  (*((volatile unsigned long *)(ulBase + 0x00000138))) = ulData;
}


x86 assembly (clang, -O0):
<SPIDataPut>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x130(%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1131 <SPIDataPut+0x31>
jmp    1136 <SPIDataPut+0x36>
jmp    110c <SPIDataPut+0xc>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x138(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPIDataPut>:
testq  $0x2,0x130(%rdi)
je     1100 <SPIDataPut>
mov    %rsi,0x138(%rdi)
ret

LLVM IR (-O0):
define void @SPIDataPut(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %5
5: ; preds = %13, %2
%6 = load i64, i64* %3
%7 = add i64 %6, 304
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 2
%11 = icmp ne i64 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i64, i64* %4
%16 = load i64, i64* %3
%17 = add i64 %16, 312
%18 = inttoptr i64 %17 to i64*
store volatile i64 %15, i64* %18
ret void
}

LLVM IR (-O2):
define void @SPIDataPut(i64 %0, i64 %1) {
%3 = add i64 %0, 304
%4 = inttoptr i64 %3 to i64*
br label %5
5: ; preds = %5, %2
%6 = load volatile i64, i64* %4
%7 = and i64 %6, 2
%8 = icmp eq i64 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
%10 = add i64 %0, 312
%11 = inttoptr i64 %10 to i64*
store volatile i64 %1, i64* %11
ret void
}
void arm_pld_imm() {}


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

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

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

LLVM IR (-O2):
define void @arm_pld_imm() {
ret void
}
double aa_stat_x2z(double x, double mu, double sigma) {
  return (x - mu) / sigma;
}


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

x86 assembly (clang, -O2):
<aa_stat_x2z>:
subsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @aa_stat_x2z(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = load double, double* %6
%11 = fdiv double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @aa_stat_x2z(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fdiv double %4, %2
ret double %5
}
unsigned int arikkei_int_hash(const void *data) {
  unsigned int hval, p;
  hval = 0;
  p = (unsigned int)((const char *)data - (const char *)0);
  while (p) {
    hval ^= p;
    p /= 17;
  }
  return hval;
}


x86 assembly (clang, -O0):
<arikkei_int_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x0,%rax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1141 <arikkei_int_hash+0x41>
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x11,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
jmp    111a <arikkei_int_hash+0x1a>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arikkei_int_hash>:
xor    %eax,%eax
test   %edi,%edi
je     1123 <arikkei_int_hash+0x23>
mov    $0xf0f0f0f1,%ecx
nopl   0x0(%rax,%rax,1)
xor    %edi,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x24,%rdx
cmp    $0x10,%edi
mov    %edx,%edi
ja     1110 <arikkei_int_hash+0x10>
ret

LLVM IR (-O0):
define i32 @arikkei_int_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i64
%7 = sub i64 %6, 0
%8 = trunc i64 %7 to i32
store i32 %8, i32* %4
br label %9
9: ; preds = %12, %1
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = xor i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = udiv i32 %16, 17
store i32 %17, i32* %4
br label %9
18: ; preds = %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @arikkei_int_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ %3, %1 ]
%7 = phi i32 [ %8, %5 ], [ 0, %1 ]
%8 = xor i32 %6, %7
%9 = udiv i32 %6, 17
%10 = icmp ult i32 %6, 17
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %8, %5 ]
ret i32 %12
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x;
  int r = rand();
  if (0 <= r) {
    x = 42;
  } else {
    x = 7;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%eax
jg     1147 <main+0x37>
movl   $0x2a,-0x14(%rbp)
jmp    114e <main+0x3e>
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
mov    $0x2a,%ecx
mov    $0x7,%eax
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp sgt i32 %3, -1
%5 = select i1 %4, i32 42, i32 7
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  char str[] = "prashant";
  reverse(str);
  printf("%s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x9(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x9(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x746e616873617270,%rax
61 6e 74
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [9 x i8] c"prashant\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = bitcast [9 x i8]* %1 to i8*
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = call i32 @reverse(i8* %3)
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [9 x i8] c"prashant\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int heap_max(int *);
int /*<<< orphan*/ heapify(int *, int, int /*<<< orphan*/);
int pop_heap_max(int array[], int heap_size) {
  int max = heap_max(array);
  array[0] = array[heap_size];
  heapify(array, heap_size - 1, 0);
  return max;
}


x86 assembly (clang, -O0):
<pop_heap_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <heap_max@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
xor    %edx,%edx
call   1040 <heapify@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop_heap_max>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <heap_max@plt>
mov    %eax,%r14d
movslq %ebp,%rsi
mov    (%rbx,%rsi,4),%eax
mov    %eax,(%rbx)
add    $0xffffffff,%esi
mov    %rbx,%rdi
xor    %edx,%edx
call   1040 <heapify@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pop_heap_max(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @heap_max(i32* %6)
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 %12, i32* %14
%15 = load i32*, i32** %3
%16 = load i32, i32* %4
%17 = sub nsw i32 %16, 1
%18 = call i32 @heapify(i32* %15, i32 %17, i32 0)
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @pop_heap_max(i32* %0, i32 %1) {
%3 = tail call i32 @heap_max(i32* %0)
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
store i32 %6, i32* %0
%7 = add nsw i32 %1, -1
%8 = tail call i32 @heapify(i32* %0, i32 %7, i32 0)
ret i32 %3
}
/* Variables and functions */
int MS_INVALIDATE;
int MS_SYNC;
int msync(void *, size_t, int);
int memzone_sync_all(void *addr, size_t len) {
  return (msync(addr, len, MS_SYNC | MS_INVALIDATE));
}


x86 assembly (clang, -O0):
<memzone_sync_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rax
or     (%rax),%edx
call   1030 <msync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memzone_sync_all>:
mov    0x2ec1(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
jmp    1030 <msync@plt>

LLVM IR (-O0):
@MS_SYNC = global i32 0
@MS_INVALIDATE = global i32 0
define i32 @memzone_sync_all(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @MS_SYNC
%8 = load i32, i32* @MS_INVALIDATE
%9 = or i32 %7, %8
%10 = call i32 @msync(i8* %5, i64 %6, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@MS_SYNC = global i32 0
@MS_INVALIDATE = global i32 0
define i32 @memzone_sync_all(i8* %0, i64 %1) {
%3 = load i32, i32* @MS_SYNC
%4 = load i32, i32* @MS_INVALIDATE
%5 = or i32 %4, %3
%6 = tail call i32 @msync(i8* %0, i64 %1, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: coinflip [-q]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: coinflip [-q]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: coinflip [-q]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ lineprint2(char *, long, unsigned char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, unsigned char);
void ind_zpiy(char *outf, long ctr, unsigned char *op, char *str) {
  char buf[256];
  sprintf(buf, "%-4s ($%02X),Y", str, *(op + 1));
  lineprint2(outf, ctr, op, buf);
}


x86 assembly (clang, -O0):
<ind_zpiy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rax
lea    0xeaf(%rip),%rsi
movzbl 0x1(%rax),%ecx
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x120(%rbp),%rcx
call   1030 <lineprint2@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind_zpiy>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
movzbl 0x1(%rdx),%eax
lea    0xebe(%rip),%rsi
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rcx,%rdx
mov    %eax,%ecx
call   1040 <sprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
call   1030 <lineprint2@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%-4s ($%02X),Y\00"
define void @ind_zpiy(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [256 x i8]
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %8
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %11, i8 zeroext %14)
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = load i8*, i8** %7
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%20 = call i32 @lineprint2(i8* %16, i64 %17, i8* %18, i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%-4s ($%02X),Y\00"
define void @ind_zpiy(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = getelementptr inbounds i8, i8* %2, i64 1
%8 = load i8, i8* %7
%9 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3, i8 zeroext %8)
%10 = call i32 @lineprint2(i8* %0, i64 %1, i8* %2, i8* %6)
ret void
}