xunge/DecIR huggingface dataset:
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ test_clear_page_dirty(struct page *);
__attribute__((always_)) void clear_page_dirty(struct page *page) {
  test_clear_page_dirty(page);
}


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

x86 assembly (clang, -O2):
<clear_page_dirty>:
jmp    1030 <test_clear_page_dirty@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @clear_page_dirty(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = load %struct.page*, %struct.page** %2
%4 = call i32 @test_clear_page_dirty(%struct.page* %3)
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @clear_page_dirty(%struct.page* %0) {
%2 = tail call i32 @test_clear_page_dirty(%struct.page* %0)
ret void
}
void orr_5(int *a) {
  for (int i = 0; i < 1024; i++)
    a[i] |= 0x56005600;
}


x86 assembly (clang, -O0):
<orr_5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jge    113e <orr_5+0x3e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
or     $0x56005600,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <orr_5+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<orr_5>:
xor    %eax,%eax
movaps 0xef7(%rip),%xmm0
nopl   0x0(%rax)
movups (%rdi,%rax,4),%xmm1
movups 0x10(%rdi,%rax,4),%xmm2
movups 0x20(%rdi,%rax,4),%xmm3
movups 0x30(%rdi,%rax,4),%xmm4
orps   %xmm0,%xmm1
orps   %xmm0,%xmm2
movups %xmm1,(%rdi,%rax,4)
movups %xmm2,0x10(%rdi,%rax,4)
orps   %xmm0,%xmm3
orps   %xmm0,%xmm4
movups %xmm3,0x20(%rdi,%rax,4)
movups %xmm4,0x30(%rdi,%rax,4)
add    $0x10,%rax
cmp    $0x400,%rax
jne    1110 <orr_5+0x10>
ret

LLVM IR (-O0):
define void @orr_5(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1024
br i1 %6, label %7, label %17
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
%12 = load i32, i32* %11
%13 = or i32 %12, 1442862592
store i32 %13, i32* %11
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @orr_5(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %25, %2 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = bitcast i32* %4 to <4 x i32>*
%6 = load <4 x i32>, <4 x i32>* %5
%7 = getelementptr inbounds i32, i32* %4, i64 4
%8 = bitcast i32* %7 to <4 x i32>*
%9 = load <4 x i32>, <4 x i32>* %8
%10 = or <4 x i32> %6, <i32 1442862592, i32 1442862592, i32 1442862592, i32 1442862592>
%11 = or <4 x i32> %9, <i32 1442862592, i32 1442862592, i32 1442862592, i32 1442862592>
%12 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> %10, <4 x i32>* %12
%13 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %13
%14 = or i64 %3, 8
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = bitcast i32* %15 to <4 x i32>*
%17 = load <4 x i32>, <4 x i32>* %16
%18 = getelementptr inbounds i32, i32* %15, i64 4
%19 = bitcast i32* %18 to <4 x i32>*
%20 = load <4 x i32>, <4 x i32>* %19
%21 = or <4 x i32> %17, <i32 1442862592, i32 1442862592, i32 1442862592, i32 1442862592>
%22 = or <4 x i32> %20, <i32 1442862592, i32 1442862592, i32 1442862592, i32 1442862592>
%23 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> %21, <4 x i32>* %23
%24 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> %22, <4 x i32>* %24
%25 = add nuw nsw i64 %3, 16
%26 = icmp eq i64 %25, 1024
br i1 %26, label %27, label %2
27: ; preds = %2
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
char *getfilename(const char *path) {
  char *i = strrchr(path, '/');
  if (i)
    return i + 1;
  return (char *)path;
}


x86 assembly (clang, -O0):
<getfilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <getfilename+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <getfilename+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfilename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getfilename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @getfilename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int __mp_logaddr(void *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__mp_logaddr(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double lerp(double, double, double);
double blerp(double c00, double c10, double c01, double c11, double tx,
             double ty) {
  return lerp(lerp(c00, c10, tx), lerp(c01, c11, tx), ty);
}


x86 assembly (clang, -O0):
<blerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <lerp@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <lerp@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
call   1030 <lerp@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blerp>:
sub    $0x28,%rsp
movsd  %xmm5,0x20(%rsp)
movsd  %xmm4,(%rsp)
movsd  %xmm3,0x18(%rsp)
movsd  %xmm2,0x10(%rsp)
movaps %xmm4,%xmm2
call   1030 <lerp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  (%rsp),%xmm2
call   1030 <lerp@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
movsd  0x20(%rsp),%xmm2
add    $0x28,%rsp
jmp    1030 <lerp@plt>

LLVM IR (-O0):
define double @blerp(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %11
%16 = call double @lerp(double %13, double %14, double %15)
%17 = load double, double* %9
%18 = load double, double* %10
%19 = load double, double* %11
%20 = call double @lerp(double %17, double %18, double %19)
%21 = load double, double* %12
%22 = call double @lerp(double %16, double %20, double %21)
ret double %22
}

LLVM IR (-O2):
define double @blerp(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @lerp(double %0, double %1, double %4)
%8 = tail call double @lerp(double %2, double %3, double %4)
%9 = tail call double @lerp(double %7, double %8, double %5)
ret double %9
}
/* Variables and functions */
char b_dim(char *, char *);
signed char intr_wrap_163(signed char p1, signed char p2) {
  return b_dim(&p1, &p2);
}


x86 assembly (clang, -O0):
<intr_wrap_163>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
call   1030 <b_dim@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_163>:
push   %rax
mov    %dil,0x7(%rsp)
mov    %sil,0x6(%rsp)
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
call   1030 <b_dim@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @intr_wrap_163(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call signext i8 @b_dim(i8* %3, i8* %4)
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @intr_wrap_163(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call signext i8 @b_dim(i8* %3, i8* %4)
ret i8 %5
}
int clearBitsFromMsb(int n, int i) {
  int mask = (1 << i) - 1;
  return n & mask;
}


x86 assembly (clang, -O0):
<clearBitsFromMsb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBitsFromMsb>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @clearBitsFromMsb(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* %4
%7 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = and i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @clearBitsFromMsb(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ magicSquareOrNot(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  do {
    scanf("%d", &n);
  } while ((n < 0) && (n > 1000));
  magicSquareOrNot(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    115b <main+0x3b>
cmpl   $0x3e8,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    112f <main+0xf>
mov    -0x8(%rbp),%edi
call   1040 <magicSquareOrNot@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <magicSquareOrNot@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %5
5: ; preds = %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 1000
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br i1 %12, label %3, label %13
13: ; preds = %11
%14 = load i32, i32* %2
%15 = call i32 @magicSquareOrNot(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @magicSquareOrNot(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void char_pad(char *s, char *c, int n) {
  while (strlen(s) < n)
    strcat(s, c);
}


x86 assembly (clang, -O0):
<char_pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    -0x14(%rbp),%eax
jge    1157 <char_pad+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
jmp    1133 <char_pad+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_pad>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
nopl   0x0(%rax)
call   1030 <strlen@plt>
cmp    %ebp,%eax
jge    1149 <char_pad+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rdi
jmp    1130 <char_pad+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @char_pad(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
br label %7
7: ; preds = %12, %3
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @strcat(i8* %13, i8* %14)
br label %7
16: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @char_pad(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, %2
br i1 %5, label %6, label %10
6: ; preds = %3, %6
%7 = tail call i32 @strcat(i8* %0, i8* %1)
%8 = tail call i32 @strlen(i8* %0)
%9 = icmp slt i32 %8, %2
br i1 %9, label %6, label %10
10: ; preds = %6, %3
ret void
}
int musbgm_getpos(int no) {
  printf("%s not implemented\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<musbgm_getpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.musbgm_getpos = [14 x i8] c"musbgm_getpos\00"
define i32 @musbgm_getpos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.musbgm_getpos, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"%s not implemented\0A\00"
@__func__.musbgm_getpos = [14 x i8] c"musbgm_getpos\00"
define i32 @musbgm_getpos(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.musbgm_getpos, i64 0, i64 0))
ret i32 0
}
void history(void) { printf(1, "hola%s/n"); }


x86 assembly (clang, -O0):
<history>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<history>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"hola%s/n\00"
define void @history() {
%1 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"hola%s/n\00"
define void @history() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logGC();
int /*<<< orphan*/ play_check(int);
int /*<<< orphan*/ vmemGCfirst();
int /*<<< orphan*/ vmemGCfourth();
int /*<<< orphan*/ vmemGCsecond();
int /*<<< orphan*/ vmemGCthird();
void vmemGC() {
  play_check(1);
  vmemGCfirst();
  play_check(1);
  vmemGCsecond();
  play_check(1);
  vmemGCthird();
  play_check(1);
  vmemGCfourth();
  play_check(1);
  logGC();
}


x86 assembly (clang, -O0):
<vmemGC>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1080 <play_check@plt>
mov    $0x0,%al
call   1040 <vmemGCfirst@plt>
mov    $0x1,%edi
call   1080 <play_check@plt>
mov    $0x0,%al
call   1030 <vmemGCsecond@plt>
mov    $0x1,%edi
call   1080 <play_check@plt>
mov    $0x0,%al
call   1060 <vmemGCthird@plt>
mov    $0x1,%edi
call   1080 <play_check@plt>
mov    $0x0,%al
call   1050 <vmemGCfourth@plt>
mov    $0x1,%edi
call   1080 <play_check@plt>
mov    $0x0,%al
call   1070 <logGC@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmemGC>:
push   %rax
mov    $0x1,%edi
call   1080 <play_check@plt>
xor    %eax,%eax
call   1040 <vmemGCfirst@plt>
mov    $0x1,%edi
call   1080 <play_check@plt>
xor    %eax,%eax
call   1030 <vmemGCsecond@plt>
mov    $0x1,%edi
call   1080 <play_check@plt>
xor    %eax,%eax
call   1060 <vmemGCthird@plt>
mov    $0x1,%edi
call   1080 <play_check@plt>
xor    %eax,%eax
call   1050 <vmemGCfourth@plt>
mov    $0x1,%edi
call   1080 <play_check@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <logGC@plt>

LLVM IR (-O0):
define void @vmemGC() {
%1 = call i32 @play_check(i32 1)
%2 = call i32 (...) @vmemGCfirst()
%3 = call i32 @play_check(i32 1)
%4 = call i32 (...) @vmemGCsecond()
%5 = call i32 @play_check(i32 1)
%6 = call i32 (...) @vmemGCthird()
%7 = call i32 @play_check(i32 1)
%8 = call i32 (...) @vmemGCfourth()
%9 = call i32 @play_check(i32 1)
%10 = call i32 (...) @logGC()
ret void
}

LLVM IR (-O2):
define void @vmemGC() {
%1 = tail call i32 @play_check(i32 1)
%2 = tail call i32 (...) @vmemGCfirst()
%3 = tail call i32 @play_check(i32 1)
%4 = tail call i32 (...) @vmemGCsecond()
%5 = tail call i32 @play_check(i32 1)
%6 = tail call i32 (...) @vmemGCthird()
%7 = tail call i32 @play_check(i32 1)
%8 = tail call i32 (...) @vmemGCfourth()
%9 = tail call i32 @play_check(i32 1)
%10 = tail call i32 (...) @logGC()
ret void
}
__attribute__((no, noclone)) unsigned __int128 t176_5mul(unsigned __int128 x) {
  unsigned __int128 r;
  if (__builtin_mul_overflow(x, (unsigned __int128)(25), &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t176_5mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    $0x19,%ecx
mul    %rcx
mov    %rax,%rsi
mov    -0x50(%rbp),%rax
seto   %dl
mov    %dl,-0x41(%rbp)
mul    %rcx
mov    %rax,%rcx
mov    -0x41(%rbp),%al
add    %rsi,%rdx
setb   %sil
or     %sil,%al
mov    %rcx,-0x40(%rbp)
mov    %rdx,-0x38(%rbp)
test   $0x1,%al
jne    1179 <t176_5mul+0x69>
jmp    1180 <t176_5mul+0x70>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t176_5mul>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    $0x19,%esi
mul    %rsi
mov    %rax,%rcx
mov    %rdi,%rax
seto   %dil
mul    %rsi
mov    %rax,%r14
mov    %rdx,%rbx
add    %rcx,%rbx
setb   %al
or     %dil,%al
cmp    $0x1,%al
jne    1146 <t176_5mul+0x36>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t176_5mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %11, i128 25)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t176_5mul(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %6, i128 25)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void bf_destroy_array(char *prog_array) { free(prog_array); }


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

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

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

LLVM IR (-O2):
define void @bf_destroy_array(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_CLOEXEC;
int mkostemp(char *, int /*<<< orphan*/);
int /*<<< orphan*/ unlink(char *);
int create_tmpfile_cloexec(char *tmpname) {
  int fd;
  fd = mkostemp(tmpname, O_CLOEXEC);
  if (fd >= 0)
    unlink(tmpname);
  return fd;
}


x86 assembly (clang, -O0):
<create_tmpfile_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <mkostemp@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1154 <create_tmpfile_cloexec+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_tmpfile_cloexec>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1040 <mkostemp@plt>
mov    %eax,%ebp
test   %eax,%eax
js     1142 <create_tmpfile_cloexec+0x22>
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_CLOEXEC = global i32 0
define i32 @create_tmpfile_cloexec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_CLOEXEC
%6 = call i32 @mkostemp(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @unlink(i8* %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@O_CLOEXEC = global i32 0
define i32 @create_tmpfile_cloexec(i8* %0) {
%2 = load i32, i32* @O_CLOEXEC
%3 = tail call i32 @mkostemp(i8* %0, i32 %2)
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @unlink(i8* %0)
br label %7
7: ; preds = %5, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void fatal1(char *s, char *t) {
  char buf[100];
  sprintf(buf, s, t);
  fatal(buf);
}


x86 assembly (clang, -O0):
<fatal1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <sprintf@plt>
lea    -0x80(%rbp),%rdi
call   1040 <fatal@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatal1>:
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <fatal@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @fatal1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [100 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i32 @fatal(i8* %10)
ret void
}

LLVM IR (-O2):
define void @fatal1(i8* nocapture %0, i8* %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 @fatal(i8* %4)
ret void
}
void ar5312_time_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ar5312_time_init() {
ret void
}
/* Variables and functions */
unsigned char proto_assembleFrame(unsigned char *, unsigned short *,
                                  unsigned char *, int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *);
unsigned char protoX_reboot(unsigned char *buf, unsigned short *bufSize,
                            unsigned char *gatewayId) {
  return proto_assembleFrame(buf, bufSize, gatewayId, 0x00, 0x34, 0, NULL);
}


x86 assembly (clang, -O0):
<protoX_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %r9d,%r9d
mov    $0x34,%r8d
xor    %eax,%eax
mov    %r9d,%ecx
movq   $0x0,(%rsp)
call   1030 <proto_assembleFrame@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protoX_reboot>:
push   %rax
movq   $0x0,(%rsp)
xor    %ecx,%ecx
mov    $0x34,%r8d
xor    %r9d,%r9d
call   1030 <proto_assembleFrame@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @protoX_reboot(i8* %0, i16* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i16*
%6 = alloca i8*
store i8* %0, i8** %4
store i16* %1, i16** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i16*, i16** %5
%9 = load i8*, i8** %6
%10 = call zeroext i8 @proto_assembleFrame(i8* %7, i16* %8, i8* %9, i32 0, i32 52, i32 0, i32* null)
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @protoX_reboot(i8* %0, i16* %1, i8* %2) {
%4 = tail call zeroext i8 @proto_assembleFrame(i8* %0, i16* %1, i8* %2, i32 0, i32 52, i32 0, i32* null)
ret i8 %4
}
void foo345(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo345(i32 %0) {
ret void
}
/* Type definitions */
struct mloop_idle {
  int dummy;
};

/* Variables and functions */
int mloop__unref_any(struct mloop_idle *);
__attribute__((visibility("default"))) int
mloop_idle_unref(struct mloop_idle *self) {
  return mloop__unref_any(self);
}


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

x86 assembly (clang, -O2):
<mloop_idle_unref>:
jmp    1030 <mloop__unref_any@plt>

LLVM IR (-O0):
%struct.mloop_idle = type { i32 }
define i32 @mloop_idle_unref(%struct.mloop_idle* %0) {
%2 = alloca %struct.mloop_idle*
store %struct.mloop_idle* %0, %struct.mloop_idle** %2
%3 = load %struct.mloop_idle*, %struct.mloop_idle** %2
%4 = call i32 @mloop__unref_any(%struct.mloop_idle* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.mloop_idle = type { i32 }
define i32 @mloop_idle_unref(%struct.mloop_idle* %0) {
%2 = tail call i32 @mloop__unref_any(%struct.mloop_idle* %0)
ret i32 %2
}
/* Variables and functions */
double c_dnrm2(int, double *, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double x[] = {1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0};
  int N = 8;
  int strideX = 1;
  double l2 = c_dnrm2(N, x, strideX);
  printf("L2-norm: %lf\n", l2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x8,-0x44(%rbp)
movl   $0x1,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1050 <c_dnrm2@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edi
mov    $0x1,%edx
call   1040 <c_dnrm2@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -4.000000e+00, double 5.000000e+00, double -6.000000e+00, double 7.000000e+00, double -8.000000e+00]
@.str = [14 x i8] c"L2-norm: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 8, i32* %2
store i32 1, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @c_dnrm2(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double -2.000000e+00, double 3.000000e+00, double -4.000000e+00, double 5.000000e+00, double -6.000000e+00, double 7.000000e+00, double -8.000000e+00]
@.str = [14 x i8] c"L2-norm: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @c_dnrm2(i32 8, double* %3, i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void replace_spaces(char *s) {
  while (*s) {
    if (*s == ' ')
      *s = '-';
    s++;
  }
}


x86 assembly (clang, -O0):
<replace_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <replace_spaces+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    112c <replace_spaces+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x2d,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <replace_spaces+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_spaces>:
jmp    1117 <replace_spaces+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x2d,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x20,%al
je     1110 <replace_spaces+0x10>
test   %al,%al
jne    1113 <replace_spaces+0x13>
ret

LLVM IR (-O0):
define void @replace_spaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %14, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = load i8*, i8** %2
store i8 45, i8* %13
br label %14
14: ; preds = %12, %7
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %2
br label %3
17: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @replace_spaces(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 32, label %5
]
5: ; preds = %2
store i8 45, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add();
int /*<<< orphan*/ foo(int /*<<< orphan*/);
int /*<<< orphan*/ mul(int);
int main() {
  foo(add());
  int n = 1000;
  mul(n);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <add@plt>
mov    %eax,%edi
call   1040 <foo@plt>
mov    $0x3e8,%edi
call   1050 <mul@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @add()
%3 = call i32 @foo(i32 %2)
store i32 1000, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @mul(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @add()
%2 = tail call i32 @foo(i32 %1)
%3 = tail call i32 @mul(i32 1000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Test 1 is running.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [19 x i8] c"Test 1 is running.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int XSupportsLocale() {}


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

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

LLVM IR (-O0):
define i32 @XSupportsLocale() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XSupportsLocale() {
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int main(void) {
  int32_t i;
  *(uint32_t *)(0xA0000000) = 0x3FF;
  while (1) {
    for (i = 0; i < 0x2FFFFF; i++)
      ;
    *(uint32_t *)(0xA0000000) ^= 0x3FF;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0xa0000000,%eax
movl   $0x3ff,(%rax)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2fffff,-0x8(%rbp)
jge    113d <main+0x3d>
jmp    112f <main+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111d <main+0x1d>
mov    $0xa0000000,%eax
mov    (%rax),%ecx
xor    $0x3ff,%ecx
mov    $0xa0000000,%eax
mov    %ecx,(%rax)
jmp    1116 <main+0x16>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1023, i32* inttoptr (i64 2684354560 to i32*)
br label %3
3: ; preds = %0, %11
store i32 0, i32* %2
br label %4
4: ; preds = %8, %3
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 3145727
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = load i32, i32* inttoptr (i64 2684354560 to i32*)
%13 = xor i32 %12, 1023
store i32 %13, i32* inttoptr (i64 2684354560 to i32*)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
unsigned xrop3_250_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D | T;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_250_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_250_0_0>:
shl    $0x8,%esi
lea    0xff(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @xrop3_250_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = or i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @xrop3_250_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, 255
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ get_misc();
int /*<<< orphan*/ get_priorities();
int /*<<< orphan*/ get_uname();
int /*<<< orphan*/ get_user_info();
int /*<<< orphan*/ set_indent();
void init(void) {
  set_indent();
  get_uname();
  get_user_info();
  get_misc();
  get_priorities();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <set_indent@plt>
mov    $0x0,%al
call   1070 <get_uname@plt>
mov    $0x0,%al
call   1060 <get_user_info@plt>
mov    $0x0,%al
call   1030 <get_misc@plt>
mov    $0x0,%al
call   1050 <get_priorities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1040 <set_indent@plt>
xor    %eax,%eax
call   1070 <get_uname@plt>
xor    %eax,%eax
call   1060 <get_user_info@plt>
xor    %eax,%eax
call   1030 <get_misc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <get_priorities@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @set_indent()
%2 = call i32 (...) @get_uname()
%3 = call i32 (...) @get_user_info()
%4 = call i32 (...) @get_misc()
%5 = call i32 (...) @get_priorities()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @set_indent()
%2 = tail call i32 (...) @get_uname()
%3 = tail call i32 (...) @get_user_info()
%4 = tail call i32 (...) @get_misc()
%5 = tail call i32 (...) @get_priorities()
ret void
}
void f(int x, int *out) { *out = x; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @f(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
store i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32* nocapture writeonly %1) {
store i32 %0, i32* %1
ret void
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  {
    state[0UL] = (input[0UL] + 914778474UL) - 981234615UL;
    if (state[0UL] & 1UL) {
      state[0UL] += state[0UL];
    } else {
      state[0UL] += state[0UL];
      state[0UL] += state[0UL];
    }
    output[0UL] = state[0UL] - 505297367UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x3686696a,%rax
sub    $0x3a7c73b7,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1146 <RandomFunc+0x46>
mov    -0x18(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    115e <RandomFunc+0x5e>
mov    -0x18(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
sub    $0x1e1e39d7,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0xfffffffffc09f5b3,%rax
add    (%rdi),%rax
mov    %eax,%edx
and    $0x1,%dl
mov    $0x2,%cl
sub    %dl,%cl
shl    %cl,%rax
add    $0xffffffffe1e1c629,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
%9 = add i64 %8, 914778474
%10 = sub i64 %9, 981234615
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%13 = load i64, i64* %12
%14 = and i64 %13, 1
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%18 = load i64, i64* %17
%19 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%20 = load i64, i64* %19
%21 = add i64 %20, %18
store i64 %21, i64* %19
br label %33
22: ; preds = %2
%23 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%24 = load i64, i64* %23
%25 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%26 = load i64, i64* %25
%27 = add i64 %26, %24
store i64 %27, i64* %25
%28 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%29 = load i64, i64* %28
%30 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%31 = load i64, i64* %30
%32 = add i64 %31, %29
store i64 %32, i64* %30
br label %33
33: ; preds = %22, %16
%34 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%35 = load i64, i64* %34
%36 = sub i64 %35, 505297367
%37 = load i64*, i64** %4
%38 = getelementptr inbounds i64, i64* %37, i64 0
store i64 %36, i64* %38
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, -66456141
%5 = and i64 %4, 1
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i64 2, i64 1
%8 = shl i64 %4, %7
%9 = add i64 %8, -505297367
store i64 %9, i64* %1
ret void
}
char *strrchr(const char *s, int c) {
  const char *p = s + strlen(s);
  do {
    if (*p == (char)c)
      return (char *)p;
  } while (--p >= s);
  return ((void *)0);
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1160 <strrchr+0x50>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1183 <strrchr+0x73>
jmp    1165 <strrchr+0x55>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
cmp    -0x10(%rbp),%rax
jae    113e <strrchr+0x2e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    %rbx,%rax
movsbl %bpl,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rax),%edx
cmp    %edx,%ecx
je     1142 <strrchr+0x32>
add    $0xffffffffffffffff,%rax
cmp    %rbx,%rax
jae    1130 <strrchr+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = shl i32 %1, 24
%6 = ashr exact i32 %5, 24
br label %7
7: ; preds = %12, %2
%8 = phi i8* [ %4, %2 ], [ %13, %12 ]
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %6, %10
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %8, i64 -1
%14 = icmp ult i8* %13, %0
br i1 %14, label %15, label %7
15: ; preds = %12, %7
%16 = phi i8* [ %8, %7 ], [ null, %12 ]
ret i8* %16
}
/* Variables and functions */
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int /*<<< orphan*/ sqrt(float);
int main() {
  float n;
  printf("Enter N: ");
  scanf("%f", &n);
  int x = floor(sqrt(n)) + 1;
  printf("The next perfect square is %d", (x * x));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
call   1050 <sqrt@plt>
mov    %eax,%edi
call   1060 <floor@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1050 <sqrt@plt>
mov    %eax,%edi
call   1060 <floor@plt>
lea    0x1(%rax),%esi
imul   %esi,%esi
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Enter N: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [30 x i8] c"The next perfect square is %d\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call i32 @sqrt(float %5)
%7 = call i32 @floor(i32 %6)
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Enter N: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [30 x i8] c"The next perfect square is %d\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = call i32 @sqrt(float %5)
%7 = call i32 @floor(i32 %6)
%8 = add nsw i32 %7, 1
%9 = mul nsw i32 %8, %8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}