xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ expand(char *, char *);
int main(void) {
  char s1[] = "-a-z,A-Z0-9-a-z0-9a-b-c";
  char s2[1000];
  expand(s1, s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1030 <expand@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x408,%rsp
movaps 0xee2(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x632d622d61392d,%rax
mov    %rax,0x10(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
call   1030 <expand@plt>
xor    %eax,%eax
add    $0x408,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [24 x i8] c"-a-z,A-Z0-9-a-z0-9a-b-c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [24 x i8]
%3 = alloca [1000 x i8]
store i32 0, i32* %1
%4 = bitcast [24 x i8]* %2 to i8*
%5 = getelementptr inbounds [24 x i8], [24 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%7 = call i32 @expand(i8* %5, i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [24 x i8] c"-a-z,A-Z0-9-a-z0-9a-b-c\00"
define i32 @main() {
%1 = alloca [24 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [24 x i8], [24 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @expand(i8* %3, i8* %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ checkDivisible(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Algorithm start, please wait...\n");
  for (int i = 1;; i++) {
    if (checkDivisible(i)) {
      printf("Evenly divisible test passed. End\n");
      return 0;
    }
  }
  printf("Algorithm Error, you shouldn't be here anyway.\n");
  return -1;
}


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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <checkDivisible@plt>
cmp    $0x0,%rax
je     116f <main+0x4f>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    1174 <main+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <main+0x29>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1040 <checkDivisible@plt>
add    $0x1,%ebx
test   %rax,%rax
je     1140 <main+0x20>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Algorithm start, please wait...\0A\00"
@.str.1 = [35 x i8] c"Evenly divisible test passed. End\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
br label %8
8: ; preds = %15, %2
%9 = load i32, i32* %6
%10 = call i64 @checkDivisible(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
14: ; preds = %8
br label %15
15: ; preds = %14
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
store i32 %17, i32* %6
br label %8
}

LLVM IR (-O2):
@str = [32 x i8] c"Algorithm start, please wait...\00"
@str.2 = [34 x i8] c"Evenly divisible test passed. End\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %4, %2
%5 = phi i32 [ 1, %2 ], [ %8, %4 ]
%6 = tail call i64 @checkDivisible(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %4, label %9
9: ; preds = %4
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void console_cursor_type(int block) {
  putchar(0x1b);
  if (block) {
    putchar('x');
  } else {
    putchar('y');
  }
  putchar('4');
}


x86 assembly (clang, -O0):
<console_cursor_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1b,%edi
call   1030 <putchar@plt>
cmpl   $0x0,-0x4(%rbp)
je     113e <console_cursor_type+0x2e>
mov    $0x78,%edi
call   1030 <putchar@plt>
jmp    1148 <console_cursor_type+0x38>
mov    $0x79,%edi
call   1030 <putchar@plt>
mov    $0x34,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_cursor_type>:
push   %rbx
mov    %edi,%ebx
mov    $0x1b,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
test   %ebx,%ebx
sete   %dil
or     $0x78,%edi
call   1030 <putchar@plt>
mov    $0x34,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @console_cursor_type(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @putchar(i8 signext 27)
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @putchar(i8 signext 120)
br label %10
8: ; preds = %1
%9 = call i32 @putchar(i8 signext 121)
br label %10
10: ; preds = %8, %6
%11 = call i32 @putchar(i8 signext 52)
ret void
}

LLVM IR (-O2):
define void @console_cursor_type(i32 %0) {
%2 = tail call i32 @putchar(i8 signext 27)
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8 121, i8 120
%5 = tail call i32 @putchar(i8 signext %4)
%6 = tail call i32 @putchar(i8 signext 52)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void thread_sleep(int milliseconds) { usleep(milliseconds * 1000); }


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

x86 assembly (clang, -O2):
<thread_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @thread_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Type definitions */
struct libvirtentry {
  int dummy;
};

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(struct libvirtentry **, int /*<<< orphan*/, int);
struct libvirtentry **newentries() {
  struct libvirtentry **new =
      (struct libvirtentry **)malloc(sizeof(struct libvirtentry *) * 1024);
  memset(new, 0, sizeof(struct libvirtentry *) * 1024);
  *new = NULL;
  return new;
}


x86 assembly (clang, -O0):
<newentries>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newentries>:
push   %rbx
mov    $0x2000,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1030 <memset@plt>
movq   $0x0,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.libvirtentry = type { i32 }
define %struct.libvirtentry** @newentries() {
%1 = alloca %struct.libvirtentry**
%2 = call i64 @malloc(i32 8192)
%3 = inttoptr i64 %2 to %struct.libvirtentry**
store %struct.libvirtentry** %3, %struct.libvirtentry*** %1
%4 = load %struct.libvirtentry**, %struct.libvirtentry*** %1
%5 = call i32 @memset(%struct.libvirtentry** %4, i32 0, i32 8192)
%6 = load %struct.libvirtentry**, %struct.libvirtentry*** %1
store %struct.libvirtentry* null, %struct.libvirtentry** %6
%7 = load %struct.libvirtentry**, %struct.libvirtentry*** %1
ret %struct.libvirtentry** %7
}

LLVM IR (-O2):
%struct.libvirtentry = type { i32 }
define %struct.libvirtentry** @newentries() {
%1 = tail call i64 @malloc(i32 8192)
%2 = inttoptr i64 %1 to %struct.libvirtentry**
%3 = tail call i32 @memset(%struct.libvirtentry** %2, i32 0, i32 8192)
store %struct.libvirtentry* null, %struct.libvirtentry** %2
ret %struct.libvirtentry** %2
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void lmc_checkize(char *result, char *s) {
  snprintf(result, 1023, "%s-check", s);
}


x86 assembly (clang, -O0):
<lmc_checkize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x3ff,%esi
lea    0xecc(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmc_checkize>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rdx
mov    $0x3ff,%esi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s-check\00"
define void @lmc_checkize(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 @snprintf(i8* %5, i32 1023, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s-check\00"
define void @lmc_checkize(i8* %0, i8* %1) {
%3 = tail call i32 @snprintf(i8* %0, i32 1023, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cgsynor();
int /*<<< orphan*/ gentext();
void genior(void) {
  gentext();
  cgsynor();
}


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

x86 assembly (clang, -O2):
<genior>:
push   %rax
xor    %eax,%eax
call   1030 <gentext@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cgsynor@plt>

LLVM IR (-O0):
define void @genior() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @cgsynor()
ret void
}

LLVM IR (-O2):
define void @genior() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @cgsynor()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int,
                           int /*<<< orphan*/);
void add_run(int class, int win, int lost) {
  FILE *file;
  file = fopen("Stats.txt", "a");
  fprintf(file, " %d %d %d %d", class, win, lost, 0);
  fclose(file);
}


x86 assembly (clang, -O0):
<add_run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    0xeb8(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xe9f(%rip),%rsi
xor    %r9d,%r9d
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_run>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
lea    0xeba(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbp
lea    0xeb0(%rip),%rsi
mov    %rax,%rdi
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
xor    %r9d,%r9d
call   1040 <fprintf@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Stats.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [13 x i8] c" %d %d %d %d\00"
define void @add_run(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %7
%9 = load i32*, i32** %7
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 0)
%14 = load i32*, i32** %7
%15 = call i32 @fclose(i32* %14)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Stats.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [13 x i8] c" %d %d %d %d\00"
define void @add_run(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 0)
%6 = tail call i32 @fclose(i32* %4)
ret void
}
short ltohs(short in) { return in; }


x86 assembly (clang, -O0):
<ltohs>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i16 @ltohs(i16 returned signext %0) {
ret i16 %0
}
int find_square_root(int num) {
  int sqrt;
  if (num <= 0) {
    return (0);
  }
  sqrt = 1;
  while (sqrt * sqrt < num) {
    ++sqrt;
  }
  if (sqrt * sqrt > num) {
    return (0);
  }
  return (sqrt);
}


x86 assembly (clang, -O0):
<find_square_root>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <find_square_root+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1164 <find_square_root+0x64>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1142 <find_square_root+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <find_square_root+0x24>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    115e <find_square_root+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    1164 <find_square_root+0x64>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_square_root>:
xor    %eax,%eax
test   %edi,%edi
jle    1123 <find_square_root+0x23>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %edi,%ecx
jl     1110 <find_square_root+0x10>
xor    %edx,%edx
cmp    %edi,%ecx
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @find_square_root(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = mul nsw i32 %4, %4
%6 = icmp slt i32 %5, %0
%7 = add nuw nsw i32 %4, 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = icmp sgt i32 %5, %0
%10 = select i1 %9, i32 0, i32 %4
br label %11
11: ; preds = %8, %1
%12 = phi i32 [ 0, %1 ], [ %10, %8 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fdopen(int, char *);
FILE *read_line(int socket_fd) {
  FILE *stream;
  stream = fdopen(socket_fd, "r");
  if (stream == NULL)
    return NULL;
  return stream;
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <fdopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1146 <read_line+0x36>
movq   $0x0,-0x8(%rbp)
jmp    114e <read_line+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
lea    0xee9(%rip),%rsi
jmp    1030 <fdopen@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i32* @read_line(i32 %0) {
%2 = tail call i32* @fdopen(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t net_get_rack(uint32_t ip) { return ip >> 8; }


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

x86 assembly (clang, -O2):
<net_get_rack>:
mov    %edi,%eax
sar    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @net_get_rack(i32 %0) {
%2 = ashr i32 %0, 8
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ glBindTexture(unsigned int, unsigned int);
void BindTexture(unsigned int tgt, unsigned int t) { glBindTexture(tgt, t); }


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

x86 assembly (clang, -O2):
<BindTexture>:
jmp    1030 <glBindTexture@plt>

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

LLVM IR (-O2):
define void @BindTexture(i32 %0, i32 %1) {
%3 = tail call i32 @glBindTexture(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int inb(unsigned int);
int b1_rx_full(unsigned int base) { return inb(base + 0x02) & 0x1; }


x86 assembly (clang, -O0):
<b1_rx_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x2,%edi
call   1030 <inb@plt>
and    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b1_rx_full>:
push   %rax
add    $0x2,%edi
call   1030 <inb@plt>
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @b1_rx_full(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 2
%5 = call i32 @inb(i32 %4)
%6 = and i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @b1_rx_full(i32 %0) {
%2 = add i32 %0, 2
%3 = tail call i32 @inb(i32 %2)
%4 = and i32 %3, 1
ret i32 %4
}
unsigned twoxbr_generic_input_fmts() { return (1 << 0) | (1 << 1); }


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

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

LLVM IR (-O0):
define i32 @twoxbr_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @twoxbr_generic_input_fmts() {
ret i32 3
}
int main() {
  int i;
  int a, b;
  a = b = 1;
  i = (a == 1) || (b == 1);
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x11(%rbp)
je     1132 <main+0x32>
cmpl   $0x1,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int rand();
int get_random_number() { return rand() % 10; }


x86 assembly (clang, -O0):
<get_random_number>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_number>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_random_number() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 10
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_random_number() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 10
ret i32 %2
}
int bpf_detach_tracepoint(const char *tp_category, const char *tp_name) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @bpf_detach_tracepoint(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int popcount_byte(int byte) {
  int ones = 0;
  for (int i = 0; i < 8; i++)
    ones += (byte >> i) & 1;
  return ones;
}


x86 assembly (clang, -O0):
<popcount_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    113e <popcount_byte+0x3e>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <popcount_byte+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount_byte>:
mov    %edi,%eax
and    $0x1,%eax
mov    %edi,%ecx
shr    %ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x2,%eax
and    $0x1,%eax
add    %ecx,%eax
mov    %edi,%ecx
shr    $0x3,%ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x4,%eax
and    $0x1,%eax
add    %ecx,%eax
mov    %edi,%ecx
shr    $0x5,%ecx
and    $0x1,%ecx
add    %eax,%ecx
mov    %edi,%eax
shr    $0x6,%eax
and    $0x1,%eax
add    %ecx,%eax
shr    $0x7,%edi
and    $0x1,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @popcount_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %4
%11 = ashr i32 %9, %10
%12 = and i32 %11, 1
%13 = load i32, i32* %3
%14 = add nsw i32 %13, %12
store i32 %14, i32* %3
br label %15
15: ; preds = %8
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @popcount_byte(i32 %0) {
%2 = and i32 %0, 1
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1
%5 = add nuw nsw i32 %4, %2
%6 = lshr i32 %0, 2
%7 = and i32 %6, 1
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %0, 3
%10 = and i32 %9, 1
%11 = add nuw nsw i32 %10, %8
%12 = lshr i32 %0, 4
%13 = and i32 %12, 1
%14 = add nuw nsw i32 %13, %11
%15 = lshr i32 %0, 5
%16 = and i32 %15, 1
%17 = add nuw nsw i32 %16, %14
%18 = lshr i32 %0, 6
%19 = and i32 %18, 1
%20 = add nuw nsw i32 %19, %17
%21 = lshr i32 %0, 7
%22 = and i32 %21, 1
%23 = add nuw nsw i32 %22, %20
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ empty_log(char *);
void d_quit() { empty_log("quit\n"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"quit\0A\00"
define void @d_quit() {
%1 = tail call i32 @empty_log(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core6_swap(char *, int);
void U_EMRPOLYLINETO16_swap(char *record, int torev) {
  core6_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYLINETO16_swap>:
jmp    1030 <core6_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRPOLYLINETO16_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core6_swap(i8* %0, i32 %1)
ret void
}
void up_netinitialize(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_action_group_list_actions() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint8_t ym_get_port(uint8_t channel) {
  assert(channel <= 5);
  return channel / 3;
}


x86 assembly (clang, -O0):
<ym_get_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ym_get_port>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x6,%ebx
setl   %dil
call   1030 <assert@plt>
movslq %ebx,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ym_get_port(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 5
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 3
ret i32 %8
}

LLVM IR (-O2):
define i32 @ym_get_port(i32 %0) {
%2 = icmp slt i32 %0, 6
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = sdiv i32 %0, 3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sync_inst();
void cwai() { sync_inst(); }


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

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

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

LLVM IR (-O2):
define void @cwai() {
%1 = tail call i32 (...) @sync_inst()
ret void
}
OP(dd, f1) {
  illegal_1();
  op_f1();
}


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 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_f1@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 (...) @illegal_1()
%7 = call i32 (...) @op_f1()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f1()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ mcfioC_Rewind(int);
void mcfio_rewind_(int *stream) { mcfioC_Rewind(*stream); }


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

x86 assembly (clang, -O2):
<mcfio_rewind_>:
mov    (%rdi),%edi
jmp    1030 <mcfioC_Rewind@plt>

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

LLVM IR (-O2):
define void @mcfio_rewind_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @mcfioC_Rewind(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Invalid arguments\nUsage: ./sendip CLIENTIPADDR PORTNO\n");
}


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

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

LLVM IR (-O0):
@.str = [55 x i8] c"Invalid arguments\0AUsage: ./sendip CLIENTIPADDR PORTNO\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [54 x i8] c"Invalid arguments\0AUsage: ./sendip CLIENTIPADDR PORTNO\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("options:\n"
         "    -i <input file>           this option is mandatory\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"options:\0A -i <input file> this option is mandatory\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [64 x i8] c"options:\0A -i <input file> this option is mandatory\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ dpotrf_(char *, int *, double *, int *, int *);
int call_dpotrf(char uplo, int n, double *a, int lda) {
  int info = 0;
  dpotrf_(&uplo, &n, a, &lda, &info);
  return info;
}


x86 assembly (clang, -O0):
<call_dpotrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x1(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
call   1030 <dpotrf_@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_dpotrf>:
sub    $0x18,%rsp
mov    %dil,0xb(%rsp)
mov    %esi,0x14(%rsp)
mov    %ecx,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xb(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1030 <dpotrf_@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @call_dpotrf(i8 signext %0, i32 %1, double* %2, i32 %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %3, i32* %7
%9 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%10 = call i32 @dpotrf_(i8* %5, i32* %6, double* %2, i32* %7, i32* %8)
%11 = load i32, i32* %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
main() {
  extern const char *strs[];
  int i;
  for (i = 0; strs[i]; i++)
    printf("strs[%d] = %s\n", i, strs[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
mov    0x2ebf(%rip),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     1168 <main+0x58>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rcx
mov    0x2ea6(%rip),%rax
mov    (%rax,%rcx,8),%rdx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@strs = external global [0 x i8*]
@.str = [15 x i8] c"strs[%d] = %s\0A\00"
define i32 @main() {
%1 = load i8*, i8** getelementptr inbounds ([0 x i8*], [0 x i8*]* @strs, i64 0, i64 0)
%2 = icmp eq i8* %1, null
br i1 %2, label %12, label %3
3: ; preds = %0, %3
%4 = phi i64 [ %8, %3 ], [ 0, %0 ]
%5 = phi i8* [ %10, %3 ], [ %1, %0 ]
%6 = trunc i64 %4 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %5)
%8 = add nuw i64 %4, 1
%9 = getelementptr inbounds [0 x i8*], [0 x i8*]* @strs, i64 0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %3
12: ; preds = %3, %0
ret i32 0
}
void function_empty_real_date_end() {}


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

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

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

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

/* Variables and functions */
uint32_t rotl(uint32_t x, int shift) {
  return (x << shift) | (x >> (sizeof(x) * 8 - shift));
}


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
movslq -0x8(%rbp),%rsi
mov    $0x20,%ecx
sub    %rsi,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = ashr i32 %8, %12
%14 = or i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void prefetch2(volatile void *p) {
  asm volatile("prefetcht2 %[p]" : [p] "+m"(*(volatile char *)p));
}


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

x86 assembly (clang, -O2):
<prefetch2>:
prefetcht2 (%rdi)
ret

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

LLVM IR (-O2):
define void @prefetch2(i8* %0) {
tail call void asm sideeffect "prefetcht2 $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i8* elementtype(i8) %0)
ret void
}
void ap94_pci_setup_wmac_led_pin(unsigned wmac, int pin) {}


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

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

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

LLVM IR (-O2):
define void @ap94_pci_setup_wmac_led_pin(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_3d_window();
int vis5d_print_window(void) {
  print_3d_window();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @vis5d_print_window() {
%1 = call i32 (...) @print_3d_window()
ret i32 0
}

LLVM IR (-O2):
define i32 @vis5d_print_window() {
%1 = tail call i32 (...) @print_3d_window()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap_uint32(uint32_t val) {
  val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF);
  return val;
}


x86 assembly (clang, -O0):
<swap_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_uint32>:
mov    %edi,%eax
bswap  %eax
ror    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @swap_uint32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, -16711936
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 16711935
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @swap_uint32(i32 %0) {
%2 = shl i32 %0, 8
%3 = and i32 %2, -16711936
%4 = lshr i32 %0, 8
%5 = and i32 %4, 16711935
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ lua_lua2C(int);
int /*<<< orphan*/ lua_pushstring(int /*<<< orphan*/);
int /*<<< orphan*/ tostring(int /*<<< orphan*/);
void luaI_tostring(void) { lua_pushstring(tostring(lua_lua2C(1))); }


x86 assembly (clang, -O0):
<luaI_tostring>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <lua_lua2C@plt>
mov    %eax,%edi
call   1030 <tostring@plt>
mov    %eax,%edi
call   1050 <lua_pushstring@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaI_tostring>:
push   %rax
mov    $0x1,%edi
call   1040 <lua_lua2C@plt>
mov    %eax,%edi
call   1030 <tostring@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushstring@plt>

LLVM IR (-O0):
define void @luaI_tostring() {
%1 = call i32 @lua_lua2C(i32 1)
%2 = call i32 @tostring(i32 %1)
%3 = call i32 @lua_pushstring(i32 %2)
ret void
}

LLVM IR (-O2):
define void @luaI_tostring() {
%1 = tail call i32 @lua_lua2C(i32 1)
%2 = tail call i32 @tostring(i32 %1)
%3 = tail call i32 @lua_pushstring(i32 %2)
ret void
}
void __asan_report_store2() {}


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

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

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

LLVM IR (-O2):
define void @__asan_report_store2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setClientId(int, int);
void setup_chuck(int chuck___0) {
  {
    { setClientId(chuck___0, chuck___0); }
    return;
  }
}


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

x86 assembly (clang, -O2):
<setup_chuck>:
mov    %edi,%esi
jmp    1030 <setClientId@plt>

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

LLVM IR (-O2):
define void @setup_chuck(i32 %0) {
%2 = tail call i32 @setClientId(i32 %0, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void tableFree(void *closure, void *p, size_t size) {
  ((void)closure);
  ((void)size);
  free(p);
}


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

x86 assembly (clang, -O2):
<tableFree>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @tableFree(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 = load i64, i64* %6
%9 = load i8*, i8** %5
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @tableFree(i8* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @free(i8* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
bool in_range(const uint8_t c, const uint8_t min, const uint8_t max) {
  return (c >= min && c <= max);
}


x86 assembly (clang, -O0):
<in_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jl     1131 <in_range+0x31>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_range>:
cmp    %rsi,%rdi
setge  %al
cmp    %rdx,%rdi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @in_range(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp sge i64 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %6
%13 = icmp sle i64 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @in_range(i64 %0, i64 %1, i64 %2) {
%4 = icmp sge i64 %0, %1
%5 = icmp sle i64 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ msg(char *, char *, int, char *);
int fmsg(char *t, char *fn, int line, char *m) {
  msg(t, fn, line, m);
  exit(1);
}


x86 assembly (clang, -O0):
<fmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<fmsg>:
push   %rax
call   1040 <msg@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @fmsg(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @msg(i8* %0, i8* %1, i32 %2, i8* %3)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int strcmp(char *, char *);
int scmp(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<scmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @scmp(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @scmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}