xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(void) {
  int par0 = 0x1983;
  foo(par0);
  return par0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 6531)
ret i32 6531
}
/* Variables and functions */
scalar_t__ distance_posdir_point(double *, double *, double *, double *);
int posdir_outside_of_sphere(double *position, double *direction,
                             double *center, double radius) {
  double distance;
  if (distance_posdir_point(position, direction, center, &distance))
    return -1;
  if (distance > radius)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<posdir_outside_of_sphere>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x30(%rbp),%rcx
call   1030 <distance_posdir_point@plt>
cmp    $0x0,%rax
je     1154 <posdir_outside_of_sphere+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <posdir_outside_of_sphere+0x67>
movsd  -0x30(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1170 <posdir_outside_of_sphere+0x60>
movl   $0x1,-0x4(%rbp)
jmp    1177 <posdir_outside_of_sphere+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<posdir_outside_of_sphere>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rcx
call   1030 <distance_posdir_point@plt>
movsd  0x10(%rsp),%xmm0
xor    %ecx,%ecx
ucomisd 0x8(%rsp),%xmm0
seta   %cl
neg    %rax
sbb    %eax,%eax
or     %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @posdir_outside_of_sphere(double* %0, double* %1, double* %2, double %3) {
%5 = alloca i32
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca double
%10 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store double* %2, double** %8
store double %3, double* %9
%11 = load double*, double** %6
%12 = load double*, double** %7
%13 = load double*, double** %8
%14 = call i64 @distance_posdir_point(double* %11, double* %12, double* %13, double* %10)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %4
store i32 -1, i32* %5
br label %23
17: ; preds = %4
%18 = load double, double* %10
%19 = load double, double* %9
%20 = fcmp ogt double %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 1, i32* %5
br label %23
22: ; preds = %17
store i32 0, i32* %5
br label %23
23: ; preds = %22, %21, %16
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @posdir_outside_of_sphere(double* %0, double* %1, double* %2, double %3) {
%5 = alloca double
%6 = bitcast double* %5 to i8*
%7 = call i64 @distance_posdir_point(double* %0, double* %1, double* %2, double* %5)
%8 = icmp eq i64 %7, 0
%9 = load double, double* %5
%10 = fcmp ogt double %9, %3
%11 = zext i1 %10 to i32
%12 = select i1 %8, i32 %11, i32 -1
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x9c() {
  Assert_real((isbdigit(156) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              785, ("isbdigit should be 0 for 0x9c"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x9c>:
push   %rax
mov    $0x9c,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x311,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0x9c\00"
define void @t_isbdigit_0x9c() {
%1 = tail call i64 @isbdigit(i32 156)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 785, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
r() {}


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

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

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

LLVM IR (-O2):
define i32 @r() {
ret i32 undef
}
/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int mutt_strncasecmp(const char *a, const char *b, size_t l) {
  return strncasecmp(a ? a : "", b ? b : "", l);
}


x86 assembly (clang, -O0):
<mutt_strncasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <mutt_strncasecmp+0x2c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    114c <mutt_strncasecmp+0x3c>
lea    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    114c <mutt_strncasecmp+0x3c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116c <mutt_strncasecmp+0x5c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    117c <mutt_strncasecmp+0x6c>
lea    0xe8d(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    117c <mutt_strncasecmp+0x6c>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncasecmp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutt_strncasecmp>:
test   %rdi,%rdi
lea    0xee6(%rip),%rax
cmove  %rax,%rdi
test   %rsi,%rsi
cmove  %rax,%rsi
jmp    1030 <strncasecmp@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @mutt_strncasecmp(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
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i8*, i8** %4
br label %12
11: ; preds = %3
br label %12
12: ; preds = %11, %9
%13 = phi i8* [ %10, %9 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %11 ]
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i8*, i8** %5
br label %19
18: ; preds = %12
br label %19
19: ; preds = %18, %16
%20 = phi i8* [ %17, %16 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %18 ]
%21 = load i64, i64* %6
%22 = call i32 @strncasecmp(i8* %13, i8* %20, i64 %21)
ret i32 %22
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @mutt_strncasecmp(i8* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %0, null
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%6 = icmp eq i8* %1, null
%7 = select i1 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%8 = tail call i32 @strncasecmp(i8* %5, i8* %7, i64 %2)
ret i32 %8
}
OP(fd, bf) { op_bf(); }


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 <op_bf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_bf@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 (...) @op_bf()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_bf()
ret i32 undef
}
unsigned int GPMCErrAddrGet(unsigned int baseAddr) {
  unsigned int retVal;
  retVal = ((*((volatile unsigned int *)(baseAddr + (0x44)))) & (0x7FFFFFFFu));
  return (retVal);
}


x86 assembly (clang, -O0):
<GPMCErrAddrGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCErrAddrGet>:
add    $0x44,%edi
mov    $0x7fffffff,%eax
and    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @GPMCErrAddrGet(i32 %0) {
%2 = add i32 %0, 68
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 2147483647
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ slib_func();
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  slib_func();
  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)
mov    $0x0,%al
call   1030 <slib_func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = load i8**, i8*** %5
%8 = call i32 (...) @slib_func()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @slib_func()
ret i32 0
}
/* Variables and functions */
int getpid();
int sw(int a) {
  switch (a) {
  case 1:
    return 2;
  case 2:
    return 1;
  case 3:
  default:
    break;
  }
  return getpid();
}


x86 assembly (clang, -O0):
<sw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1151 <sw+0x41>
jmp    112f <sw+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     115d <sw+0x4d>
jmp    1140 <sw+0x30>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1169 <sw+0x59>
jmp    116e <sw+0x5e>
movl   $0x2,-0x4(%rbp)
jmp    117d <sw+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    117d <sw+0x6d>
jmp    116e <sw+0x5e>
jmp    1173 <sw+0x63>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sw>:
cmp    $0x1,%edi
je     1120 <sw+0x10>
cmp    $0x2,%edi
jne    1126 <sw+0x16>
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret
xor    %eax,%eax
jmp    1030 <getpid@plt>

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

LLVM IR (-O2):
define i32 @sw(i32 %0) {
switch i32 %0, label %3 [
i32 1, label %5
i32 2, label %2
]
2: ; preds = %1
br label %5
3: ; preds = %1
%4 = tail call i32 (...) @getpid()
br label %5
5: ; preds = %1, %3, %2
%6 = phi i32 [ %4, %3 ], [ 1, %2 ], [ 2, %1 ]
ret i32 %6
}
int func(int arr[10]) { return arr[0]; }


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

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

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

LLVM IR (-O2):
define i32 @func(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int f277(int *);
int f278(int *p) { return f277(p); }


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

x86 assembly (clang, -O2):
<f278>:
jmp    1030 <f277@plt>

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

LLVM IR (-O2):
define i32 @f278(i32* %0) {
%2 = tail call i32 @f277(i32* %0)
ret i32 %2
}
/* Type definitions */
struct nfa {
  int dummy;
};
struct globs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ nfa_dump(int /*<<< orphan*/, struct nfa const *, int);
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ stdout;
void globs_dump(const struct globs *g, const char *gexp, int state) {
  printf("glob '%s' compiled to:\n", gexp);
  nfa_dump(stdout, (const struct nfa *)g, state);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<globs_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1050 <nfa_dump@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<globs_dump>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rdi,%rbx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e94(%rip),%r14
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <nfa_dump@plt>
mov    (%r14),%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fflush@plt>

LLVM IR (-O0):
%struct.globs = type { i32 }
%struct.nfa = type { i32 }
@.str = [24 x i8] c"glob '%s' compiled to:\0A\00"
@stdout = global i32 0
define void @globs_dump(%struct.globs* %0, i8* %1, i32 %2) {
%4 = alloca %struct.globs*
%5 = alloca i8*
%6 = alloca i32
store %struct.globs* %0, %struct.globs** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @stdout
%10 = load %struct.globs*, %struct.globs** %4
%11 = bitcast %struct.globs* %10 to %struct.nfa*
%12 = load i32, i32* %6
%13 = call i32 @nfa_dump(i32 %9, %struct.nfa* %11, i32 %12)
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
ret void
}

LLVM IR (-O2):
%struct.globs = type { i32 }
%struct.nfa = type { i32 }
@.str = [24 x i8] c"glob '%s' compiled to:\0A\00"
@stdout = global i32 0
define void @globs_dump(%struct.globs* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = load i32, i32* @stdout
%6 = bitcast %struct.globs* %0 to %struct.nfa*
%7 = tail call i32 @nfa_dump(i32 %5, %struct.nfa* %6, i32 %2)
%8 = load i32, i32* @stdout
%9 = tail call i32 @fflush(i32 %8)
ret void
}
void BinaryFiles__swap_bytes64(unsigned long long *value) {
  unsigned long long result =
      (((*value & 0xff) << 56) + ((*value & 0xff00) << 40) +
       ((*value & 0xff0000) << 24) + ((*value & 0xff000000) << 8) +
       ((*value >> 8) & 0xff000000) + ((*value >> 24) & 0xff0000) +
       ((*value >> 40) & 0xff00) + ((*value >> 56) & 0xff));
  *value = result;
}


x86 assembly (clang, -O0):
<BinaryFiles__swap_bytes64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0xff,%rax
shl    $0x38,%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
and    $0xff00,%rcx
shl    $0x28,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
and    $0xff0000,%rcx
shl    $0x18,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rdx
movabs $0xff000000,%rcx
and    (%rdx),%rcx
shl    $0x8,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shr    $0x8,%rcx
movabs $0xff000000,%rdx
and    %rdx,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shr    $0x18,%rcx
and    $0xff0000,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shr    $0x28,%rcx
and    $0xff00,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shr    $0x38,%rcx
and    $0xff,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @BinaryFiles__swap_bytes64(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = load i64, i64* %4
%6 = and i64 %5, 255
%7 = shl i64 %6, 56
%8 = load i64*, i64** %2
%9 = load i64, i64* %8
%10 = and i64 %9, 65280
%11 = shl i64 %10, 40
%12 = add i64 %7, %11
%13 = load i64*, i64** %2
%14 = load i64, i64* %13
%15 = and i64 %14, 16711680
%16 = shl i64 %15, 24
%17 = add i64 %12, %16
%18 = load i64*, i64** %2
%19 = load i64, i64* %18
%20 = and i64 %19, 4278190080
%21 = shl i64 %20, 8
%22 = add i64 %17, %21
%23 = load i64*, i64** %2
%24 = load i64, i64* %23
%25 = lshr i64 %24, 8
%26 = and i64 %25, 4278190080
%27 = add i64 %22, %26
%28 = load i64*, i64** %2
%29 = load i64, i64* %28
%30 = lshr i64 %29, 24
%31 = and i64 %30, 16711680
%32 = add i64 %27, %31
%33 = load i64*, i64** %2
%34 = load i64, i64* %33
%35 = lshr i64 %34, 40
%36 = and i64 %35, 65280
%37 = add i64 %32, %36
%38 = load i64*, i64** %2
%39 = load i64, i64* %38
%40 = lshr i64 %39, 56
%41 = and i64 %40, 255
%42 = add i64 %37, %41
store i64 %42, i64* %3
%43 = load i64, i64* %3
%44 = load i64*, i64** %2
store i64 %43, i64* %44
ret void
}

LLVM IR (-O2):
define void @BinaryFiles__swap_bytes64(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i64 @llvm.bswap.i64(i64 %2)
store i64 %3, i64* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
void readChar2(char *variableAddress, char headerMessage[]) {
  printf("%s", headerMessage);
  *variableAddress = fgetc(stdin);
  __fpurge(stdin);
}


x86 assembly (clang, -O0):
<readChar2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <fgetc@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readChar2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e9e(%rip),%r14
mov    (%r14),%edi
call   1050 <fgetc@plt>
mov    %al,(%rbx)
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__fpurge@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define void @readChar2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stdin
%8 = call signext i8 @fgetc(i32 %7)
%9 = load i8*, i8** %3
store i8 %8, i8* %9
%10 = load i32, i32* @stdin
%11 = call i32 @__fpurge(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define void @readChar2(i8* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = load i32, i32* @stdin
%5 = tail call signext i8 @fgetc(i32 %4)
store i8 %5, i8* %0
%6 = load i32, i32* @stdin
%7 = tail call i32 @__fpurge(i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fclose(int /*<<< orphan*/ *);
int dlib_fclose(void *self) { return fclose((FILE *)self); }


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

x86 assembly (clang, -O2):
<dlib_fclose>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define i32 @dlib_fclose(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ RAND_MAX;

/* Variables and functions */
scalar_t__ rand();
double rand_double() {
  return ((double)rand() / ((double)(RAND_MAX) + (double)(1)));
}


x86 assembly (clang, -O0):
<rand_double>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_double() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+00
ret double %3
}

LLVM IR (-O2):
define double @rand_double() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ memThrow(int);
void *realloc(void *, unsigned int);
void *Sys_MemResize(void *p, unsigned newsize) {
  void *ret = realloc(p, newsize);
  memThrow(0 == ret);
  return ret;
}


x86 assembly (clang, -O0):
<Sys_MemResize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <memThrow@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_MemResize>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1030 <memThrow@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Sys_MemResize(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @realloc(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* null, %9
%11 = zext i1 %10 to i32
%12 = call i32 @memThrow(i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define i8* @Sys_MemResize(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @memThrow(i32 %5)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ core(unsigned char *, unsigned char const *,
                        unsigned char const *, unsigned char const *,
                        int /*<<< orphan*/);
int crypto_core_salsa20_tweet(unsigned char *out, const unsigned char *in,
                              const unsigned char *k, const unsigned char *c) {
  core(out, in, k, c, 0);
  return 0;
}


x86 assembly (clang, -O0):
<crypto_core_salsa20_tweet>:
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 <core@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @crypto_core_salsa20_tweet(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @core(i8* %0, i8* %1, i8* %2, i8* %3, i32 0)
ret i32 0
}
void __Fini_Argv(void) {}


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

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

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

LLVM IR (-O2):
define void @__Fini_Argv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sort(float *, long);
void arrayf_sort(float *a, int n) { sort(a, (long)n); }


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

x86 assembly (clang, -O2):
<arrayf_sort>:
movslq %esi,%rsi
jmp    1030 <sort@plt>

LLVM IR (-O0):
define void @arrayf_sort(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load float*, float** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = call i32 @sort(float* %5, i64 %7)
ret void
}

LLVM IR (-O2):
define void @arrayf_sort(float* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i32 @sort(float* %0, i64 %3)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int __syscall_sched_rr_get_interval(int /*<<< orphan*/, struct timespec *);
int sched_rr_get_interval(pid_t pid, struct timespec *tp) {
  return (__syscall_sched_rr_get_interval(pid, tp));
}


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

x86 assembly (clang, -O2):
<sched_rr_get_interval>:
jmp    1030 <__syscall_sched_rr_get_interval@plt>

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

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @sched_rr_get_interval(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @__syscall_sched_rr_get_interval(i32 %0, %struct.timespec* %1)
ret i32 %3
}
/* Variables and functions */
int _rtl_mkdir_(char *, char *);
int strlen(char *);
int rtl_mkdirp(char *path) { return _rtl_mkdir_(path, path + strlen(path)); }


x86 assembly (clang, -O0):
<rtl_mkdirp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdi
cltq
add    %rax,%rsi
call   1030 <_rtl_mkdir_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl_mkdirp>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rsi
add    %rbx,%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <_rtl_mkdir_@plt>

LLVM IR (-O0):
define i32 @rtl_mkdirp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
%9 = call i32 @_rtl_mkdir_(i8* %3, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @rtl_mkdirp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = tail call i32 @_rtl_mkdir_(i8* %0, i8* %4)
ret i32 %5
}
test01(const char *s2) { return __builtin_strcmp("abc", s2); }


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

x86 assembly (clang, -O2):
<test01>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i32 @test01(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %0)
ret i32 %2
}
void __DELETE_java_io_InvalidClassException(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_io_InvalidClassException(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void XSyncValueSubtract() {}


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

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

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

LLVM IR (-O2):
define void @XSyncValueSubtract() {
ret void
}
int main() {
  unsigned char arg = 0x01;
  unsigned char out = 0;
  __asm__("rolb $1, %%al;" : "=a"(out) : "a"(arg));
  return (out == 0x02);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
mov    -0x5(%rbp),%al
rol    %al
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%al
rol    %al
xor    %ecx,%ecx
cmp    $0x2,%al
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 1, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = call i8 asm "rolb $$1, %al;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "rolb $$1, %al;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8 1)
%2 = icmp eq i8 %1, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
size_t is_mysql_comment(const char *cs, const size_t len, size_t pos) {
  if (pos + 2 >= len) {
    return 0;
  }
  if (cs[pos + 2] != '!') {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_mysql_comment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x2,%rax
cmp    -0x18(%rbp),%rax
jb     112f <is_mysql_comment+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    115a <is_mysql_comment+0x5a>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl 0x2(%rax,%rcx,1),%eax
cmp    $0x21,%eax
je     1152 <is_mysql_comment+0x52>
movq   $0x0,-0x8(%rbp)
jmp    115a <is_mysql_comment+0x5a>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_mysql_comment>:
add    $0x2,%rdx
xor    %eax,%eax
cmp    %rsi,%rdx
jae    1112 <is_mysql_comment+0x12>
cmpb   $0x21,(%rdi,%rdx,1)
sete   %al
ret

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

LLVM IR (-O2):
define i64 @is_mysql_comment(i8* nocapture %0, i64 %1, i64 %2) {
%4 = add i64 %2, 2
%5 = icmp ult i64 %4, %1
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 %4
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 33
%10 = zext i1 %9 to i64
br label %11
11: ; preds = %6, %3
%12 = phi i64 [ 0, %3 ], [ %10, %6 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ cs2dcb();
void cs2dcb_(void) { cs2dcb(); }


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

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

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

LLVM IR (-O2):
define void @cs2dcb_() {
%1 = tail call i32 (...) @cs2dcb()
ret void
}
const char *contains(const char *s, char c) {
  const char *p = s;
  while (*p != 0) {
    if (*p == c)
      return p;
    p++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <contains+0x57>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <contains+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <contains+0x5f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1116 <contains+0x16>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contains>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <contains+0x21>
mov    %rdi,%rax
nopl   0x0(%rax)
cmp    %sil,%cl
je     1123 <contains+0x23>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <contains+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @contains(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8 [ %11, %9 ], [ %3, %2 ]
%7 = phi i8* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i8 %6, %1
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i8* [ null, %2 ], [ null, %9 ], [ %7, %5 ]
ret i8* %14
}
int f(int n) { return -13; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 -13
}
/* Variables and functions */
int putcbyte(int);
int putcword(int w) {
  int adr;
  adr = putcbyte(w >> 8);
  putcbyte(w);
  return adr;
}


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

x86 assembly (clang, -O2):
<putcword>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
sar    $0x8,%edi
call   1030 <putcbyte@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <putcbyte@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @putcword(i32 %0) {
%2 = ashr i32 %0, 8
%3 = tail call i32 @putcbyte(i32 %2)
%4 = tail call i32 @putcbyte(i32 %0)
ret i32 %3
}
void SV_Frame(int msec) {}


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

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

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

LLVM IR (-O2):
define void @SV_Frame(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testReadingFile(char const *);
int /*<<< orphan*/ testReadingFileError(char const *);
int main(int argc, const char *argv[]) {
  const char *path = argv[0];
  testReadingFile(path);
  testReadingFileError(path);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <testReadingFile@plt>
mov    -0x18(%rbp),%rdi
call   1040 <testReadingFileError@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    (%rsi),%rbx
mov    %rbx,%rdi
call   1030 <testReadingFile@plt>
mov    %rbx,%rdi
call   1040 <testReadingFileError@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @testReadingFile(i8* %10)
%12 = load i8*, i8** %6
%13 = call i32 @testReadingFileError(i8* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @testReadingFile(i8* %3)
%5 = tail call i32 @testReadingFileError(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ curve25519_crypto_scalarmult(unsigned char *,
                                                unsigned char const *,
                                                unsigned char const *);
int curve25519_dh(unsigned char *s, const unsigned char *pk,
                  const unsigned char *sk) {
  curve25519_crypto_scalarmult(s, sk, pk);
  return 0;
}


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

x86 assembly (clang, -O2):
<curve25519_dh>:
push   %rax
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
call   1030 <curve25519_crypto_scalarmult@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @curve25519_dh(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @curve25519_crypto_scalarmult(i8* %0, i8* %2, i8* %1)
ret i32 0
}
void *test_anti_range_120(long n) {
  extern void *alloc_anti_range_120(long) __attribute__((alloc_size(1)));
  if ((-0x7fffffffffffffffL - 1) + 2 <= n && n <= 0)
    n = (-0x7fffffffffffffffL - 1) + 2 - 1;
  return alloc_anti_range_120(n);
}


x86 assembly (clang, -O0):
<test_anti_range_120>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000002,%rax
cmp    -0x8(%rbp),%rax
jg     1149 <test_anti_range_120+0x39>
cmpq   $0x0,-0x8(%rbp)
jg     1149 <test_anti_range_120+0x39>
movabs $0x8000000000000001,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_120@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_120>:
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
lea    (%rdi,%rax,1),%rcx
lea    0x1(%rax),%rdx
add    $0x3,%rax
cmp    %rdx,%rcx
cmovb  %rax,%rdi
jmp    1030 <alloc_anti_range_120@plt>

LLVM IR (-O0):
define i8* @test_anti_range_120(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 -9223372036854775806, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 -9223372036854775807, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_120(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_120(i64 %0) {
%2 = add i64 %0, 9223372036854775806
%3 = icmp ult i64 %2, 9223372036854775807
%4 = select i1 %3, i64 -9223372036854775807, i64 %0
%5 = tail call i8* @alloc_anti_range_120(i64 %4)
ret i8* %5
}
p(z) { putchar("UniBwM"[z % 6]); }


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
movslq %edx,%rcx
lea    0xed0(%rip),%rax
movsbl (%rax,%rcx,1),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
movslq %edi,%rax
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cltq
lea    0xec9(%rip),%rcx
movsbl (%rax,%rcx,1),%edi
xor    %eax,%eax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"UniBwM\00"
define i32 @p(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 6
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [7 x i8], [7 x i8]* @.str, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"UniBwM\00"
define i32 @p(i32 %0) {
%2 = srem i32 %0, 6
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [7 x i8], [7 x i8]* @.str, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %6)
ret i32 undef
}
/* Type definitions */
struct group {
  int dummy;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
struct group *getgrgid(gid_t gid) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
%struct.group = type { i32 }
define noalias %struct.group* @getgrgid(i32 %0) {
ret %struct.group* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printdiv(int w) {
  int i;
  char c = '-';
  for (i = 0; i < w; i++)
    printf("%c", c);
  printf("\n");
}


x86 assembly (clang, -O0):
<printdiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x2d,-0x9(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1152 <printdiv+0x42>
movsbl -0x9(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <printdiv+0x16>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printdiv>:
push   %rbx
test   %edi,%edi
jle    112f <printdiv+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printdiv+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printdiv(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 @putchar(i32 45)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i32 10)
ret void
}
void XQueryBestTile() {}


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

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

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

LLVM IR (-O2):
define void @XQueryBestTile() {
ret void
}