xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("%d: %s\n", i, argv[i]);
  }
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void estes17() { printf("estes17 likes meals with lots of french fries.\n"); }


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"estes17 likes meals with lots of french fries.\0A\00"
define void @estes17() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"estes17 likes meals with lots of french fries.\00"
define void @estes17() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *jv_mem_alloc_unguarded(size_t sz) { return malloc(sz); }


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

x86 assembly (clang, -O2):
<jv_mem_alloc_unguarded>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @jv_mem_alloc_unguarded(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
float kill_denormal(int);
float finv_native(float f) { return kill_denormal(1 / f); }


x86 assembly (clang, -O0):
<finv_native>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <kill_denormal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finv_native>:
movss  0xee8(%rip),%xmm1
divss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
jmp    1030 <kill_denormal@plt>

LLVM IR (-O0):
define float @finv_native(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float 1.000000e+00, %3
%5 = fptosi float %4 to i32
%6 = call float @kill_denormal(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @finv_native(float %0) {
%2 = fdiv float 1.000000e+00, %0
%3 = fptosi float %2 to i32
%4 = tail call float @kill_denormal(i32 %3)
ret float %4
}
char hex_convert(char c) { return (c & 15) + (c >> 6) * 9; }


x86 assembly (clang, -O0):
<hex_convert>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movsbl -0x1(%rbp),%ecx
sar    $0x6,%ecx
imul   $0x9,%ecx,%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_convert>:
mov    %edi,%ecx
and    $0xf,%cl
sar    $0x6,%dil
movzbl %dil,%eax
lea    (%rax,%rax,8),%eax
add    %cl,%al
ret

LLVM IR (-O0):
define signext i8 @hex_convert(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 15
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = ashr i32 %7, 6
%9 = mul nsw i32 %8, 9
%10 = add nsw i32 %5, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @hex_convert(i8 signext %0) {
%2 = and i8 %0, 15
%3 = ashr i8 %0, 6
%4 = mul nsw i8 %3, 9
%5 = add nsw i8 %4, %2
ret i8 %5
}
int LOOP2(int x) {
  int i, j;
  for (i = 0; i < 10; i++)
    for (j = 0; j < 10; j++)
      x ^= x + (i & j);
  return x;
}


x86 assembly (clang, -O0):
<LOOP2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    115b <LOOP2+0x5b>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1148 <LOOP2+0x48>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
add    %ecx,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <LOOP2+0x1f>
jmp    114d <LOOP2+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <LOOP2+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @LOOP2(i32 %0) {
ret i32 25
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myfunc(int count) {
  int i;
  for (i = 0; i < count; i++) {
    printf("Hello Haskell\n");
  }
}


x86 assembly (clang, -O0):
<myfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <myfunc+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <myfunc+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfunc>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <myfunc+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebx
jne    1130 <myfunc+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello Haskell\0A\00"
define void @myfunc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello Haskell\00"
define void @myfunc(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ perror(char *);
void openFile(FILE **arq) {
  *arq = fopen("highScore.txt", "a+");
  if (*arq == NULL) {
    perror("Erro na abertura do arquivo");
  }
}


x86 assembly (clang, -O0):
<openFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1163 <openFile+0x43>
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openFile>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1141 <openFile+0x21>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
pop    %rbx
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"highScore.txt\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [28 x i8] c"Erro na abertura do arquivo\00"
define void @openFile(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32**, i32*** %2
store i32* %3, i32** %4
%5 = load i32**, i32*** %2
%6 = load i32*, i32** %5
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"highScore.txt\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [28 x i8] c"Erro na abertura do arquivo\00"
define void @openFile(i32** nocapture writeonly %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
void gdk_get_program_class() {}


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

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

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

LLVM IR (-O2):
define void @gdk_get_program_class() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int max(int a, int b) {
  printf("比较大小：a:%d 与 b:%d 的大小", a, b);
  return a > b ? a : b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1147 <max+0x37>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114d <max+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
cmp    %ebx,%ebp
cmovg  %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"\E6\AF\94\E8\BE\83\E5\A4\A7\E5\B0\8F\EF\BC\9Aa:%d \E4\B8\8E b:%d \E7\9A\84\E5\A4\A7\E5\B0\8F\00"
define i32 @max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %3
br label %15
13: ; preds = %2
%14 = load i32, i32* %4
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
@.str = [39 x i8] c"\E6\AF\94\E8\BE\83\E5\A4\A7\E5\B0\8F\EF\BC\9Aa:%d \E4\B8\8E b:%d \E7\9A\84\E5\A4\A7\E5\B0\8F\00"
define i32 @max(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
#pragma omp parallel num_threads(2)
  {
    printf("Outer Level - You will see this twice.\n");
#pragma omp parallel num_threads(2)
    {
      printf("Inner Level - You will NOT see this four times!  Important steps "
             "are not complete!\n");
    }
  }
  return 0;
}


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

LLVM IR (-O0):
@.str = [40 x i8] c"Outer Level - You will see this twice.\0A\00"
@.str.1 = [84 x i8] c"Inner Level - You will NOT see this four times! Important steps are not complete!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [39 x i8] c"Outer Level - You will see this twice.\00"
@str.2 = [83 x i8] c"Inner Level - You will NOT see this four times! Important steps are not complete!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void printStringVec(char **vectorIn) {
  for (int i = 0; vectorIn[i] != '\0'; i++) {
    printf("path[%d] : %s\n", i, vectorIn[i]);
  }
}


x86 assembly (clang, -O0):
<printStringVec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1161 <printStringVec+0x51>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printStringVec+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStringVec>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%rdx
test   %rdx,%rdx
je     114a <printStringVec+0x3a>
mov    %rdi,%r15
lea    0xed9(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%r15,%rbx,8),%rdx
add    $0x1,%rbx
test   %rdx,%rdx
jne    1130 <printStringVec+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"path[%d] : %s\0A\00"
define void @printStringVec(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = phi i8* [ %12, %5 ], [ %2, %1 ]
%8 = trunc i64 %6 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %7)
%10 = add nuw i64 %6, 1
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %4, label %5
}
/* Variables and functions */
unsigned int mk_rnd_ipv4(int);
unsigned int mk_rnd_north_american_ipv4(void) { return mk_rnd_ipv4(198); }


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

x86 assembly (clang, -O2):
<mk_rnd_north_american_ipv4>:
mov    $0xc6,%edi
jmp    1030 <mk_rnd_ipv4@plt>

LLVM IR (-O0):
define i32 @mk_rnd_north_american_ipv4() {
%1 = call i32 @mk_rnd_ipv4(i32 198)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mk_rnd_north_american_ipv4() {
%1 = tail call i32 @mk_rnd_ipv4(i32 198)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wborder(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int __darwin_wborder(WINDOW *w, uint32_t c1, uint32_t c2, uint32_t c3,
                     uint32_t c4, uint32_t c5, uint32_t c6, uint32_t c7,
                     uint32_t c8) {
  return wborder(w, c1, c2, c3, c4, c5, c6, c7, c8);
}


x86 assembly (clang, -O0):
<__darwin_wborder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%eax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <wborder@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__darwin_wborder>:
jmp    1030 <wborder@plt>

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

LLVM IR (-O2):
define i32 @__darwin_wborder(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = tail call i32 @wborder(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_count_cover(char *, int);
float expf(float);
float HMM_ExpF(float Float) {
  { _hmt_count_cover("HMM_ExpF", 482); };
  float Result = expf(Float);
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_ExpF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x1e2,%esi
call   1030 <_hmt_count_cover@plt>
movss  -0x4(%rbp),%xmm0
call   1040 <expf@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_ExpF>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0xed2(%rip),%rdi
mov    $0x1e2,%esi
call   1030 <_hmt_count_cover@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <expf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"HMM_ExpF\00"
define float @HMM_ExpF(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = call i32 @_hmt_count_cover(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 482)
%5 = load float, float* %2
%6 = call float @expf(float %5)
store float %6, float* %3
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
@.str = [9 x i8] c"HMM_ExpF\00"
define float @HMM_ExpF(float %0) {
%2 = tail call i32 @_hmt_count_cover(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 482)
%3 = tail call float @expf(float %0)
ret float %3
}
/* Type definitions */
struct connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Done(int);
void GotLoginError(struct connection *c, char *d) { Done(101); }


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

x86 assembly (clang, -O2):
<GotLoginError>:
mov    $0x65,%edi
jmp    1030 <Done@plt>

LLVM IR (-O0):
%struct.connection = type { i32 }
define void @GotLoginError(%struct.connection* %0, i8* %1) {
%3 = alloca %struct.connection*
%4 = alloca i8*
store %struct.connection* %0, %struct.connection** %3
store i8* %1, i8** %4
%5 = call i32 @Done(i32 101)
ret void
}

LLVM IR (-O2):
%struct.connection = type { i32 }
define void @GotLoginError(%struct.connection* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @Done(i32 101)
ret void
}
int patient_busy_handler(void *arg, int waiting_time) { return 1; }


x86 assembly (clang, -O0):
<patient_busy_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @patient_busy_handler(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
int do_pipe(cnt)
long cnt;
{ shell('|', cnt); }


x86 assembly (clang, -O0):
<do_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x7c,%edi
mov    $0x0,%al
call   1030 <shell@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_pipe>:
mov    %rdi,%rsi
mov    $0x7c,%edi
xor    %eax,%eax
jmp    1030 <shell@plt>

LLVM IR (-O0):
define i32 @do_pipe(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = call i32 (i32, i64, ...) bitcast (i32 (...)* @shell to i32 (i32, i64, ...)*)(i32 124, i64 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @do_pipe(i64 %0) {
%2 = tail call i32 (i32, i64, ...) bitcast (i32 (...)* @shell to i32 (i32, i64, ...)*)(i32 124, i64 %0)
ret i32 undef
}
/* Variables and functions */
int strlen(const char *str) {
  int i = 0;
  while (*(str++))
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
struct creatureList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct creatureList *);
void free_list_handle(struct creatureList *handle) {
  if (handle != NULL) {
    free(handle);
    handle = NULL;
  }
}


x86 assembly (clang, -O0):
<free_list_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <free_list_handle+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_list_handle>:
test   %rdi,%rdi
je     111a <free_list_handle+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.creatureList = type { i32 }
define void @free_list_handle(%struct.creatureList* %0) {
%2 = icmp eq %struct.creatureList* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.creatureList* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int re_search(bufp, string, size, startpos, range, regs)
struct re_pattern_buffer *bufp;
const char *string;
int size, startpos, range;
struct re_registers *regs;
{
  return re_search_2(bufp, (void *)0, 0, string, size, startpos, range, regs,
                     size);
}


x86 assembly (clang, -O0):
<re_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r11d
mov    -0x28(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
xor    %edx,%edx
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <re_search_2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_search>:
push   %rax
mov    %r9,%r10
mov    %r8d,%r11d
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
sub    $0x8,%rsp
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
push   %r8
push   %r10
push   %r11
call   1030 <re_search_2@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = alloca %struct.re_pattern_buffer*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.re_registers*
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store %struct.re_registers* %5, %struct.re_registers** %12
%13 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %7
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load %struct.re_registers*, %struct.re_registers** %12
%19 = load i32, i32* %9
%20 = call i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_search_2 to i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %13, i8* null, i32 0, i8* %14, i32 %15, i32 %16, i32 %17, %struct.re_registers* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type opaque
%struct.re_registers = type opaque
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = tail call i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, i32, %struct.re_registers*, i32, ...) bitcast (i32 (...)* @re_search_2 to i32 (%struct.re_pattern_buffer*, i8*, i32, i8*, i32, i32, i32, %struct.re_registers*, i32, ...)*)(%struct.re_pattern_buffer* %0, i8* null, i32 0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void log_error(const char *message) {
  if (message != NULL) {
    fprintf(stderr, "%s", message);
  }
  return;
}


x86 assembly (clang, -O0):
<log_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <log_error+0x30>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_error>:
test   %rdi,%rdi
je     112d <log_error+0x1d>
mov    %rdi,%rdx
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
jmp    1030 <fprintf@plt>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @log_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @log_error(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %3, %1
ret void
}
void test___atomic_compare_exchange_1(short *mem) {
  short expected = 1;
  short desired = 5;
  __atomic_compare_exchange(mem, &expected, &desired, 0, 4, 0);
}


x86 assembly (clang, -O0):
<test___atomic_compare_exchange_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x1,-0xa(%rbp)
movw   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xa(%rbp),%ax
mov    -0xc(%rbp),%dx
lock cmpxchg %dx,(%rcx)
mov    %ax,%cx
sete   %al
mov    %al,-0x11(%rbp)
mov    %cx,-0x10(%rbp)
test   $0x1,%al
jne    1142 <test___atomic_compare_exchange_1+0x42>
mov    -0x10(%rbp),%ax
mov    %ax,-0xa(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
mov    %al,-0xd(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_compare_exchange_1>:
mov    $0x5,%cx
mov    $0x1,%ax
lock cmpxchg %cx,(%rdi)
ret

LLVM IR (-O0):
define void @test___atomic_compare_exchange_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
%5 = alloca i8
store i16* %0, i16** %2
store i16 1, i16* %3
store i16 5, i16* %4
%6 = load i16*, i16** %2
%7 = load i16, i16* %3
%8 = load i16, i16* %4
%9 = cmpxchg i16* %6, i16 %7, i16 %8 acq_rel monotonic
%10 = extractvalue { i16, i1 } %9, 0
%11 = extractvalue { i16, i1 } %9, 1
br i1 %11, label %13, label %12
12: ; preds = %1
store i16 %10, i16* %3
br label %13
13: ; preds = %12, %1
%14 = zext i1 %11 to i8
store i8 %14, i8* %5
%15 = load i8, i8* %5
%16 = trunc i8 %15 to i1
ret void
}

LLVM IR (-O2):
define void @test___atomic_compare_exchange_1(i16* nocapture %0) {
%2 = cmpxchg i16* %0, i16 1, i16 5 acq_rel monotonic
ret void
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ stat(char const *, struct stat *);
off_t get_file_size(const char *filename) {
  struct stat statStruct;
  if (stat(filename, &statStruct) == 0) {
    return statStruct.st_size;
  } else {
    perror("stat() error");
    return -1;
  }
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    114e <get_file_size+0x2e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <get_file_size+0x41>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
jne    1133 <get_file_size+0x13>
mov    (%rsp),%eax
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [13 x i8] c"stat() error\00"
define i32 @get_file_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [13 x i8] c"stat() error\00"
define i32 @get_file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
br label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ -1, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ free_safe_mem_bucket(int);
void check_and_purge_safe_mem(void) {
  int n;
  for (n = 0; n < 128; n++)
    free_safe_mem_bucket(n);
}


x86 assembly (clang, -O0):
<check_and_purge_safe_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jge    1142 <check_and_purge_safe_mem+0x32>
mov    -0x4(%rbp),%edi
call   1030 <free_safe_mem_bucket@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <check_and_purge_safe_mem+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_and_purge_safe_mem>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <free_safe_mem_bucket@plt>
add    $0x1,%ebx
cmp    $0x80,%ebx
jne    1120 <check_and_purge_safe_mem+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @check_and_purge_safe_mem() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 128
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @free_safe_mem_bucket(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @check_and_purge_safe_mem() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @free_safe_mem_bucket(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOTTY;
int /*<<< orphan*/ errno;
char *ttyname(int fildes) {
  if (fildes <= 2) {
    return (const char *)"/dev/tty";
  }
  errno = ENOTTY;
  return NULL;
}


x86 assembly (clang, -O0):
<ttyname>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     1121 <ttyname+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    113b <ttyname+0x3b>
mov    0x2ec0(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea7(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttyname>:
cmp    $0x3,%edi
jge    110d <ttyname+0xd>
lea    0xef4(%rip),%rax
ret
mov    0x2ed4(%rip),%rax
mov    (%rax),%eax
mov    0x2ebb(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/tty\00"
@ENOTTY = global i32 0
@errno = global i32 0
define i8* @ttyname(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
%8 = load i32, i32* @ENOTTY
store i32 %8, i32* @errno
store i8* null, i8** %2
br label %9
9: ; preds = %7, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/tty\00"
@ENOTTY = global i32 0
@errno = global i32 0
define i8* @ttyname(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* @ENOTTY
store i32 %4, i32* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ null, %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool tsaf_has_randomaccess(const uint8_t *p_ts) { return !!(p_ts[5] & 0x40); }


x86 assembly (clang, -O0):
<tsaf_has_randomaccess>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsaf_has_randomaccess>:
mov    0x14(%rdi),%eax
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @tsaf_has_randomaccess(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, 64
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @tsaf_has_randomaccess(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = lshr i32 %3, 6
%5 = and i32 %4, 1
ret i32 %5
}
unsigned long _aic_read32(unsigned long addr) {
  unsigned long data;
  data = *(volatile unsigned *)addr;
  return data;
}


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

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

LLVM IR (-O0):
define i64 @_aic_read32(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = zext i32 %6 to i64
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @_aic_read32(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
%4 = zext i32 %3 to i64
ret i64 %4
}
int SDL_imageFilterMultByByteMMX(unsigned char *Src1, unsigned char *Dest,
                                 unsigned int SrcLength, unsigned char C) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterMultByByteMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SDL_imageFilterMultByByteMMX(i8* %0, i8* %1, i32 %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8 %3, i8* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @SDL_imageFilterMultByByteMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8 zeroext %3) {
ret i32 -1
}
float sumf(float a, float b) { return a + b; }


x86 assembly (clang, -O0):
<sumf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumf>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sumf(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* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @sumf(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Type definitions */
typedef int fexcept_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ fegetenv(int *);
int fegetexceptflag(fexcept_t *__flagp, int __excepts) {
  fexcept_t __fcsr;
  fegetenv(&__fcsr);
  *__flagp = __fcsr & __excepts & FE_ALL_EXCEPT;
  return 0;
}


x86 assembly (clang, -O0):
<fegetexceptflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <fegetenv@plt>
mov    -0x10(%rbp),%ecx
and    -0xc(%rbp),%ecx
mov    0x2eab(%rip),%rax
and    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fegetexceptflag>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x4(%rsp),%rdi
call   1030 <fegetenv@plt>
and    0x4(%rsp),%ebx
mov    0x2eb2(%rip),%rax
and    (%rax),%ebx
mov    %ebx,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @fegetexceptflag(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 @fegetenv(i32* %5)
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = and i32 %7, %8
%10 = load i32, i32* @FE_ALL_EXCEPT
%11 = and i32 %9, %10
%12 = load i32*, i32** %3
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @fegetexceptflag(i32* nocapture writeonly %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @fegetenv(i32* %3)
%6 = load i32, i32* %3
%7 = and i32 %6, %1
%8 = load i32, i32* @FE_ALL_EXCEPT
%9 = and i32 %7, %8
store i32 %9, i32* %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ initI2c();
void DISPLAYS_init(void) { initI2c(); }


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

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

LLVM IR (-O0):
define void @DISPLAYS_init() {
%1 = call i32 (...) @initI2c()
ret void
}

LLVM IR (-O2):
define void @DISPLAYS_init() {
%1 = tail call i32 (...) @initI2c()
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
int my_irint(double x) {
  int returner = (int)floor(x + 0.5);
  return returner;
}


x86 assembly (clang, -O0):
<my_irint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_irint>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @my_irint(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 5.000000e-01
%6 = call i64 @floor(double %5)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @my_irint(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call i64 @floor(double %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getuid();
int main() {
  getuid();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getuid()
ret i32 0
}
int mayor(int a, int b) {
  if (a > b) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<mayor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1122 <mayor+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <mayor+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mayor(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}