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

/* Variables and functions */
int RNApaln_cmdline_parser2(int, char **, struct RNApaln_args_info *,
                            int /*<<< orphan*/, int, int);
int RNApaln_cmdline_parser(int argc, char **argv,
                           struct RNApaln_args_info *args_info) {
  return RNApaln_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<RNApaln_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <RNApaln_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNApaln_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <RNApaln_cmdline_parser2@plt>

LLVM IR (-O0):
%struct.RNApaln_args_info = type { i32 }
define i32 @RNApaln_cmdline_parser(i32 %0, i8** %1, %struct.RNApaln_args_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.RNApaln_args_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.RNApaln_args_info* %2, %struct.RNApaln_args_info** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.RNApaln_args_info*, %struct.RNApaln_args_info** %6
%10 = call i32 @RNApaln_cmdline_parser2(i32 %7, i8** %8, %struct.RNApaln_args_info* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.RNApaln_args_info = type { i32 }
define i32 @RNApaln_cmdline_parser(i32 %0, i8** %1, %struct.RNApaln_args_info* %2) {
%4 = tail call i32 @RNApaln_cmdline_parser2(i32 %0, i8** %1, %struct.RNApaln_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
void RTAvlrGCPtrGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrGCPtrGet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void genPar(int n) {
  int i, par;
  for (i = 0; i < n; i++) {
    par = 2 * i;
    printf("%d ", par);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<genPar>:
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    1156 <genPar+0x46>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <genPar+0x12>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genPar>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1154 <genPar+0x34>
mov    %edi,%ebx
lea    0xecf(%rip),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x2,%ebp
add    $0xffffffff,%ebx
jne    1140 <genPar+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @genPar(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 = %14, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i32, i32* %3
%11 = mul nsw i32 2, %10
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %9
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %5
17: ; preds = %5
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @genPar(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = shl nuw nsw i32 %4, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
void *realloc(void *pointer, size_t size) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @realloc(i8* nocapture readnone %0, i64 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void gt_abort(char *msg) {
  if (msg)
    fprintf(stderr, "%s", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<gt_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <gt_abort+0x30>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<gt_abort>:
push   %rax
test   %rdi,%rdi
je     113e <gt_abort+0x1e>
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @gt_abort(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
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @gt_abort(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
%7 = tail call i32 @exit(i32 1)
unreachable
}
int main(void) {
  5 / 0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ term_init();
int /*<<< orphan*/ term_write(char *);
void kernel_main() {
  term_init();
  term_write("Test.\n");
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <term_init@plt>
lea    0xece(%rip),%rdi
call   1030 <term_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
xor    %eax,%eax
call   1040 <term_init@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <term_write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Test.\0A\00"
define void @kernel_main() {
%1 = call i32 (...) @term_init()
%2 = call i32 @term_write(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Test.\0A\00"
define void @kernel_main() {
%1 = tail call i32 (...) @term_init()
%2 = tail call i32 @term_write(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isprint(int);
int /*<<< orphan*/ isspace(int);
int isgraph(int c) { return isprint(c) && !isspace(c); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1158 <isgraph+0x38>
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
push   %rbx
mov    %edi,%ebx
call   1040 <isprint@plt>
test   %rax,%rax
je     113f <isgraph+0x1f>
mov    %ebx,%edi
call   1030 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isprint(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isspace(i32 %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @isspace(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
int wmf_palettesize(int size) {
  size = size;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @wmf_palettesize(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_face_header(char *, char *);
void fgmvwrite_face_header_(char *nfaces, char *ncells) {
  gmvwrite_face_header(nfaces, ncells);
}


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

x86 assembly (clang, -O2):
<fgmvwrite_face_header_>:
jmp    1030 <gmvwrite_face_header@plt>

LLVM IR (-O0):
define void @fgmvwrite_face_header_(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @gmvwrite_face_header(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_face_header_(i8* %0, i8* %1) {
%3 = tail call i32 @gmvwrite_face_header(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void bug(double *Cref, char transb, int m, int n, int k, double a, double *A,
         int fdA, double *B, int fdB, double b, double *C, int fdC) {
  if (C != Cref)
    abort();
}


x86 assembly (clang, -O0):
<bug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    0x30(%rbp),%esi
mov    0x28(%rbp),%rsi
mov    0x20(%rbp),%esi
mov    0x18(%rbp),%rsi
mov    0x10(%rbp),%esi
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    0x28(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1160 <bug+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug>:
push   %rax
cmp    %rdi,0x28(%rsp)
jne    111a <bug+0xa>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bug(double* %0, i8 signext %1, i32 %2, i32 %3, i32 %4, double %5, double* %6, i32 %7, double* %8, i32 %9, double %10, double* %11, i32 %12) {
%14 = alloca double*
%15 = alloca i8
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca double
%20 = alloca double*
%21 = alloca i32
%22 = alloca double*
%23 = alloca i32
%24 = alloca double
%25 = alloca double*
%26 = alloca i32
store double* %0, double** %14
store i8 %1, i8* %15
store i32 %2, i32* %16
store i32 %3, i32* %17
store i32 %4, i32* %18
store double %5, double* %19
store double* %6, double** %20
store i32 %7, i32* %21
store double* %8, double** %22
store i32 %9, i32* %23
store double %10, double* %24
store double* %11, double** %25
store i32 %12, i32* %26
%27 = load double*, double** %25
%28 = load double*, double** %14
%29 = icmp ne double* %27, %28
br i1 %29, label %30, label %32
30: ; preds = %13
%31 = call i32 (...) @abort()
unreachable
32: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @bug(double* readnone %0, i8 signext %1, i32 %2, i32 %3, i32 %4, double %5, double* nocapture readnone %6, i32 %7, double* nocapture readnone %8, i32 %9, double %10, double* readnone %11, i32 %12) {
%14 = icmp eq double* %11, %0
br i1 %14, label %17, label %15
15: ; preds = %13
%16 = tail call i32 (...) @abort()
unreachable
17: ; preds = %13
ret void
}
void *memcpy(void *d, const void *s, unsigned long t) {
  while (t--) {
    *((char *)d) = *((char *)s);
  }
  return d;
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     113a <memcpy+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1110 <memcpy+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
mov    %rdi,%rax
test   %rdx,%rdx
je     116e <memcpy+0x6e>
lea    -0x1(%rdx),%r8
mov    %rdx,%r9
and    $0x7,%r9
je     1131 <memcpy+0x31>
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
add    $0x1,%rdi
cmp    %rdi,%r9
jne    1120 <memcpy+0x20>
sub    %rdi,%rdx
cmp    $0x7,%r8
jb     116e <memcpy+0x6e>
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
movzbl (%rsi),%ecx
mov    %cl,(%rax)
add    $0xfffffffffffffff8,%rdx
jne    1140 <memcpy+0x40>
ret

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

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %31, label %5
5: ; preds = %3
%6 = add i64 %2, -1
%7 = and i64 %2, 7
%8 = icmp eq i64 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %5, %9
%10 = phi i64 [ %12, %9 ], [ %2, %5 ]
%11 = phi i64 [ %14, %9 ], [ 0, %5 ]
%12 = add i64 %10, -1
%13 = load i8, i8* %1
store i8 %13, i8* %0
%14 = add i64 %11, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %9
16: ; preds = %9, %5
%17 = phi i64 [ %2, %5 ], [ %12, %9 ]
%18 = icmp ult i64 %6, 7
br i1 %18, label %31, label %19
19: ; preds = %16, %19
%20 = phi i64 [ %28, %19 ], [ %17, %16 ]
%21 = load i8, i8* %1
store i8 %21, i8* %0
%22 = load i8, i8* %1
store i8 %22, i8* %0
%23 = load i8, i8* %1
store i8 %23, i8* %0
%24 = load i8, i8* %1
store i8 %24, i8* %0
%25 = load i8, i8* %1
store i8 %25, i8* %0
%26 = load i8, i8* %1
store i8 %26, i8* %0
%27 = load i8, i8* %1
store i8 %27, i8* %0
%28 = add i64 %20, -8
%29 = load i8, i8* %1
store i8 %29, i8* %0
%30 = icmp eq i64 %28, 0
br i1 %30, label %31, label %19
31: ; preds = %16, %19, %3
ret i8* %0
}
struct session *do_nop(struct session *ses, char *arg) {
  return ses;
}


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

x86 assembly (clang, -O2):
<do_nop>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.session = type opaque
define %struct.session* @do_nop(%struct.session* %0, i8* %1) {
%3 = alloca %struct.session*
%4 = alloca i8*
store %struct.session* %0, %struct.session** %3
store i8* %1, i8** %4
%5 = load %struct.session*, %struct.session** %3
ret %struct.session* %5
}

LLVM IR (-O2):
%struct.session = type opaque
define %struct.session* @do_nop(%struct.session* readnone returned %0, i8* nocapture readnone %1) {
ret %struct.session* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ sem_post(int /*<<< orphan*/ *);
void FF_ReleaseSemaphore(void *pSemaphore) {
  sem_t *pSem = (sem_t *)pSemaphore;
  sem_post(pSem);
}


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

x86 assembly (clang, -O2):
<FF_ReleaseSemaphore>:
jmp    1030 <sem_post@plt>

LLVM IR (-O0):
define void @FF_ReleaseSemaphore(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @sem_post(i32* %6)
ret void
}

LLVM IR (-O2):
define void @FF_ReleaseSemaphore(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @sem_post(i32* %2)
ret void
}
/* Variables and functions */
char *getenv(char *);
char *__mp_getenv(char *s) { return getenv(s); }


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

x86 assembly (clang, -O2):
<__mp_getenv>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @__mp_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ main();
void _start(void) {
  main();
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <main@plt>
jmp    111b <_start+0xb>

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

LLVM IR (-O0):
define void @_start() {
%1 = call i32 (...) @main()
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @main()
br label %2
2: ; preds = %2, %0
br label %2
}
t_font(s) char *s;
{ return atoi(s); }


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

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

LLVM IR (-O0):
define i32 @t_font(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @t_font(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %0)
ret i32 %2
}
void LOG(int priority, const char *err, ...) { return; }


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

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

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

LLVM IR (-O2):
define void @LOG(i32 %0, i8* nocapture %1, ...) {
ret void
}
void dap_exit_function(void) { return; }


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

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

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

LLVM IR (-O2):
define void @dap_exit_function() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ rhyme_name(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    puts("usage: the-name-game NAME\n");
    return 1;
  }
  rhyme_name(argv[1]);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    116c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <rhyme_name@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1133 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <rhyme_name@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"usage: the-name-game NAME\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 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @rhyme_name(i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [27 x i8] c"usage: the-name-game NAME\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @rhyme_name(i8* %8)
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %11
}
int execute_inotify_rm_watch() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_inotify_rm_watch() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_inotify_rm_watch() {
ret i32 0
}
void cpm3aux(void) { return; }


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

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

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

LLVM IR (-O2):
define void @cpm3aux() {
ret void
}
void invertVec(float v[3]) {
  v[0] *= -1.0f;
  v[1] *= -1.0f;
  v[2] *= -1.0f;
}


x86 assembly (clang, -O0):
<invertVec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xeec(%rip),%xmm0
mulss  (%rax),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0xed8(%rip),%xmm0
mulss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0xec2(%rip),%xmm0
mulss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<invertVec>:
movaps 0xef9(%rip),%xmm0
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm2
movss  0x8(%rdi),%xmm3
xorps  %xmm0,%xmm1
movss  %xmm1,(%rdi)
xorps  %xmm0,%xmm2
movss  %xmm2,0x4(%rdi)
xorps  %xmm0,%xmm3
movss  %xmm3,0x8(%rdi)
ret

LLVM IR (-O0):
define void @invertVec(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = fmul float %5, -1.000000e+00
store float %6, float* %4
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 1
%9 = load float, float* %8
%10 = fmul float %9, -1.000000e+00
store float %10, float* %8
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 2
%13 = load float, float* %12
%14 = fmul float %13, -1.000000e+00
store float %14, float* %12
ret void
}

LLVM IR (-O2):
define void @invertVec(float* nocapture %0) {
%2 = load float, float* %0
%3 = fneg float %2
store float %3, float* %0
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fneg float %5
store float %6, float* %4
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fneg float %8
store float %9, float* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t ToLE16(uint16_t value) { return value; }


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

x86 assembly (clang, -O2):
<ToLE16>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ToLE16(i32 returned %0) {
ret i32 %0
}
double f4_cb_send_pre_int_int_short(double (*cb)(int, int, short)) {
  short r = -22;
  return cb(8, 9, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0xffea,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x8,%edi
mov    $0x9,%esi
movswl -0xa(%rbp),%edx
call   *%rax
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_short>:
push   %rax
mov    %rdi,%rax
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xffffffea,%edx
call   *%rax
addsd  0xee3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_short(double (i32, i32, i16)* %0) {
%2 = alloca double (i32, i32, i16)*
%3 = alloca i16
store double (i32, i32, i16)* %0, double (i32, i32, i16)** %2
store i16 -22, i16* %3
%4 = load double (i32, i32, i16)*, double (i32, i32, i16)** %2
%5 = load i16, i16* %3
%6 = call double %4(i32 8, i32 9, i16 signext %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_short(double (i32, i32, i16)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, i16 signext -22)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
void *array_creator(size_t, size_t const *, size_t, void *, int /*<<< orphan*/);
void *array_map(size_t dim, const size_t *size, size_t v_size, void *array) {
  return array_creator(dim, size, v_size, array, 0);
}


x86 assembly (clang, -O0):
<array_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <array_creator@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_map>:
xor    %r8d,%r8d
jmp    1030 <array_creator@plt>

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

LLVM IR (-O2):
define i8* @array_map(i64 %0, i64* %1, i64 %2, i8* %3) {
%5 = tail call i8* @array_creator(i64 %0, i64* %1, i64 %2, i8* %3, i32 0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
int main() {
  unsigned char a = 0;
  while (a < 200) {
    printf("%3d\n", a);
    a++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0xc8,%eax
jge    114f <main+0x3f>
lea    0xec7(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1123 <main+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movzbl %bl,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%bl
cmp    $0xc8,%bl
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%3d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %2)
%4 = add nuw i8 %2, 1
%5 = icmp eq i8 %4, -56
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int do_970() { return 970; }


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

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

LLVM IR (-O0):
define i32 @do_970() {
ret i32 970
}

LLVM IR (-O2):
define i32 @do_970() {
ret i32 970
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float valor_prod;
  printf("Valor do produto: ");
  scanf("%f", &valor_prod);
  printf("Valor com desconto: %.2f", valor_prod - valor_prod * 0.12);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
lea    0xe91(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
lea    0xebd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Valor do produto: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Valor com desconto: %.2f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 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* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fneg double %8
%10 = call double @llvm.fmuladd.f64(double %9, double 1.200000e-01, double %6)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Valor do produto: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"Valor com desconto: %.2f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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 = fpext float %5 to double
%7 = fneg double %6
%8 = call double @llvm.fmuladd.f64(double %7, double 1.200000e-01, double %6)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char);
int main() {
  char c;
  int i = 0;
  for (i; i < 255; i++) {
    c = i;
    printf("%d - %c\n", i, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jge    115a <main+0x4a>
mov    -0xc(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    -0xc(%rbp),%esi
lea    0xebd(%rip),%rdi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
movsbl %bl,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d - %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = trunc i32 %2 to i8
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i8 signext %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
int timingattacks() { return 0; }


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

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

LLVM IR (-O0):
define i32 @timingattacks() {
ret i32 0
}

LLVM IR (-O2):
define i32 @timingattacks() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ assert(int);
int getpagesize();
int sysconf(int /*<<< orphan*/);
int main(void) {
  int page_size = getpagesize();
  assert(page_size == sysconf(_SC_PAGESIZE));
  assert(page_size == 0x10000 || page_size == 0x1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getpagesize@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x1,%al
cmpl   $0x10000,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1190 <main+0x60>
cmpl   $0x1000,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getpagesize@plt>
mov    %eax,%ebx
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
xor    %edi,%edi
cmp    %eax,%ebx
sete   %dil
call   1030 <assert@plt>
cmp    $0x10000,%ebx
sete   %al
cmp    $0x1000,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getpagesize()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @_SC_PAGESIZE
%6 = call i32 @sysconf(i32 %5)
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 65536
br i1 %11, label %15, label %12
12: ; preds = %0
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 4096
br label %15
15: ; preds = %12, %0
%16 = phi i1 [ true, %0 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getpagesize()
%2 = load i32, i32* @_SC_PAGESIZE
%3 = tail call i32 @sysconf(i32 %2)
%4 = icmp eq i32 %1, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp eq i32 %1, 65536
%8 = icmp eq i32 %1, 4096
%9 = or i1 %7, %8
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int main(void) {
  int y;
  f(&y);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @f(i32* %1)
ret i32 0
}
void exit_pi_state_list(struct task_struct *curr) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @exit_pi_state_list(%struct.task_struct* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
int errno;
scalar_t__ geteuid();
uid_t __sulong_posix_geteuid(void) {
  {
    int native_errno = errno;
    uid_t result = geteuid();
    if (result == (uid_t)-1) {
      result = (uid_t)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_geteuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <geteuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    114b <__sulong_posix_geteuid+0x3b>
xor    %eax,%eax
mov    0x2e9d(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2e8b(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_geteuid>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
xor    %eax,%eax
call   1030 <geteuid@plt>
movslq (%rbx),%rcx
neg    %rcx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i64 @__sulong_posix_geteuid() {
%1 = alloca i32
%2 = alloca i64
%3 = load i32, i32* @errno
store i32 %3, i32* %1
%4 = call i64 (...) @geteuid()
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = icmp eq i64 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %2
br label %11
11: ; preds = %7, %0
%12 = load i32, i32* %1
store i32 %12, i32* @errno
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
@errno = global i32 0
define i64 @__sulong_posix_geteuid() {
%1 = load i32, i32* @errno
%2 = tail call i64 (...) @geteuid()
%3 = icmp eq i64 %2, -1
%4 = load i32, i32* @errno
%5 = sub nsw i32 0, %4
%6 = sext i32 %5 to i64
%7 = select i1 %3, i64 %6, i64 %2
store i32 %1, i32* @errno
ret i64 %7
}
int reset_deassert(struct reset_ctl *reset_ctl) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.reset_ctl = type opaque
define i32 @reset_deassert(%struct.reset_ctl* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void derefI(int *p) { printf("%d\n", *p); }


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

x86 assembly (clang, -O2):
<derefI>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @derefI(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @derefI(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void RTAvlrooGCPtrRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrooGCPtrRemove() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int);
__m128i test_mm_slli_epi32_1(__m128i A) { return _mm_slli_epi32(A, -1); }


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

x86 assembly (clang, -O2):
<test_mm_slli_epi32_1>:
mov    $0xffffffff,%esi
jmp    1030 <_mm_slli_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_slli_epi32_1(i32 %0) {
%2 = tail call i32 @_mm_slli_epi32(i32 %0, i32 -1)
ret i32 %2
}
void bug3(void) {
  char *p = "Hello world\n";
  free(p);
  printf("%s:%s\n", __FUNCTION__, p);
}


x86 assembly (clang, -O0):
<bug3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdx
lea    0xec6(%rip),%rdi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug3>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xed6(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world\0A\00"
@.str.1 = [7 x i8] c"%s:%s\0A\00"
@__FUNCTION__.bug3 = [5 x i8] c"bug3\00"
define void @bug3() {
%1 = alloca i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.bug3, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world\0A\00"
@.str.1 = [7 x i8] c"%s:%s\0A\00"
@__FUNCTION__.bug3 = [5 x i8] c"bug3\00"
define void @bug3() {
tail call void @free(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.bug3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp2435r_clear_first(uint8_t *header) { header[2] &= ~0x1; }


x86 assembly (clang, -O0):
<rtp2435r_clear_first>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp2435r_clear_first>:
andb   $0xfe,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @rtp2435r_clear_first(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = and i32 %3, -2
store i32 %4, i32* %2
ret void
}
OP(op, cd) { CALL(); }


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

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @CALL()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @CALL()
ret i32 undef
}
/* Variables and functions */
int is_file_or_directory64(char *);
int IsValidDir(char *lpf) {
  if (is_file_or_directory64(lpf) == 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsValidDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_file_or_directory64@plt>
cmp    $0x1,%eax
jne    113a <IsValidDir+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <IsValidDir+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsValidDir>:
push   %rax
call   1030 <is_file_or_directory64@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @IsValidDir(i8* %0) {
%2 = tail call i32 @is_file_or_directory64(i8* %0)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}