xunge/DecIR huggingface dataset:
/* Variables and functions */
int atoi(unsigned char *);
scalar_t__ strncasecmp(unsigned char *, char *, int);
int strtol(unsigned char *, int /*<<< orphan*/ *, int);
int parseInteger(unsigned char tempbuf[]) {
  if (strncasecmp(tempbuf, "0X", 2) == 0) {
    return strtol(tempbuf + 2, NULL, 16);
  }
  return atoi(tempbuf);
}


x86 assembly (clang, -O0):
<parseInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%rax
jne    1179 <parseInteger+0x49>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %eax,-0x4(%rbp)
jmp    1185 <parseInteger+0x55>
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseInteger>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncasecmp@plt>
test   %rax,%rax
je     1153 <parseInteger+0x23>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <atoi@plt>
add    $0x2,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
pop    %rbx
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"0X\00"
define i32 @parseInteger(i8* nocapture %0) {
%2 = tail call i64 @strncasecmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = tail call i32 @strtol(i8* nocapture %5, i32* null, i32 16)
br label %9
7: ; preds = %1
%8 = tail call i32 @atoi(i8* %0)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %6, %4 ], [ %8, %7 ]
ret i32 %10
}
int check_ascii_compliance(const char *input, unsigned int input_len) {
  unsigned int i = 0;
  while (i < input_len && !(input[i] & 0x80))
    i++;
  return i == input_len;
}


x86 assembly (clang, -O0):
<check_ascii_compliance>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jae    113e <check_ascii_compliance+0x3e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114e <check_ascii_compliance+0x4e>
jmp    115c <check_ascii_compliance+0x5c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <check_ascii_compliance+0x12>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ascii_compliance>:
test   %esi,%esi
je     1123 <check_ascii_compliance+0x23>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rcx,1)
js     1125 <check_ascii_compliance+0x25>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <check_ascii_compliance+0x10>
mov    %eax,%ecx
jmp    1125 <check_ascii_compliance+0x25>
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %esi,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @check_ascii_compliance(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %22, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = and i32 %16, 128
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
br label %20
20: ; preds = %10, %6
%21 = phi i1 [ false, %6 ], [ %19, %10 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i32, i32* %5
%24 = add i32 %23, 1
store i32 %24, i32* %5
br label %6
25: ; preds = %20
%26 = load i32, i32* %5
%27 = load i32, i32* %4
%28 = icmp eq i32 %26, %27
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @check_ascii_compliance(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp sgt i8 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %2
%17 = phi i32 [ 0, %2 ], [ %15, %14 ], [ %1, %11 ]
%18 = icmp eq i32 %17, %1
%19 = zext i1 %18 to i32
ret i32 %19
}
/* Variables and functions */
scalar_t__ INT_MAX;
scalar_t__ INT_MIN;
int arith_good(double test) {
  return ((test <= (double)(INT_MAX)) && (test >= (double)(INT_MIN)));
}


x86 assembly (clang, -O0):
<arith_good>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
mov    0x2ed3(%rip),%rax
cvtsi2sdq (%rax),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jb     1144 <arith_good+0x44>
movsd  -0x8(%rbp),%xmm0
mov    0x2eab(%rip),%rax
cvtsi2sdq (%rax),%xmm1
ucomisd %xmm1,%xmm0
setae  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arith_good>:
mov    0x2ee1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
ucomisd %xmm0,%xmm1
setae  %al
mov    0x2ec6(%rip),%rcx
xorps  %xmm1,%xmm1
cvtsi2sdq (%rcx),%xmm1
ucomisd %xmm1,%xmm0
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i64 0
@INT_MIN = global i64 0
define i32 @arith_good(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i64, i64* @INT_MAX
%5 = sitofp i64 %4 to double
%6 = fcmp ole double %3, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load double, double* %2
%9 = load i64, i64* @INT_MIN
%10 = sitofp i64 %9 to double
%11 = fcmp oge double %8, %10
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@INT_MAX = global i64 0
@INT_MIN = global i64 0
define i32 @arith_good(double %0) {
%2 = load i64, i64* @INT_MAX
%3 = sitofp i64 %2 to double
%4 = fcmp oge double %3, %0
%5 = load i64, i64* @INT_MIN
%6 = sitofp i64 %5 to double
%7 = fcmp ole double %6, %0
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
char *google_map_get_map_key(char *);
char *google_map_station_get_map_key(char *application_name) {
  return google_map_get_map_key(application_name);
}


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

x86 assembly (clang, -O2):
<google_map_station_get_map_key>:
jmp    1030 <google_map_get_map_key@plt>

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

LLVM IR (-O2):
define i8* @google_map_station_get_map_key(i8* %0) {
%2 = tail call i8* @google_map_get_map_key(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ testboard();
int /*<<< orphan*/ testbuilder();
int /*<<< orphan*/ testcell();
int /*<<< orphan*/ testplayer();
int main() {
  testbuilder();
  testboard();
  testcell();
  testplayer();
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <testbuilder@plt>
mov    $0x0,%al
call   1060 <testboard@plt>
mov    $0x0,%al
call   1030 <testcell@plt>
mov    $0x0,%al
call   1040 <testplayer@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <testbuilder@plt>
xor    %eax,%eax
call   1060 <testboard@plt>
xor    %eax,%eax
call   1030 <testcell@plt>
xor    %eax,%eax
call   1040 <testplayer@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testbuilder()
%3 = call i32 (...) @testboard()
%4 = call i32 (...) @testcell()
%5 = call i32 (...) @testplayer()
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testbuilder()
%2 = tail call i32 (...) @testboard()
%3 = tail call i32 (...) @testcell()
%4 = tail call i32 (...) @testplayer()
ret i32 1
}
void swap(int *a, int *b) {
  int x = *a;
  *a = *b;
  *b = x;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void write_function_name(FILE *filep, char *base_name) {
  fprintf(filep, "static void %s(m68ki_cpu_core *m68k)\n", base_name);
}


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

x86 assembly (clang, -O2):
<write_function_name>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"static void %s(m68ki_cpu_core *m68k)\0A\00"
define void @write_function_name(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"static void %s(m68ki_cpu_core *m68k)\0A\00"
define void @write_function_name(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
char *convert(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char const *argv[]) {
  char *aout;
  aout = convert(123);
  printf("%s\n", aout);
  getchar();
  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    $0x7b,%edi
call   1030 <convert@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7b,%edi
call   1030 <convert@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
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 = call i8* @convert(i32 123)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @convert(i32 123)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf22(int f, int n) { return (cbuf(f, n, 22)); }


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

x86 assembly (clang, -O2):
<cbuf22>:
mov    $0x16,%edx
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf22(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 @cbuf(i32 %5, i32 %6, i32 22)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf22(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 22)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("cd   \n /mnt/ProgFS/QtPalmtop/bin/bomberclone");
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"cd \0A /mnt/ProgFS/QtPalmtop/bin/bomberclone\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"cd \0A /mnt/ProgFS/QtPalmtop/bin/bomberclone\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void Reserved_Handler4(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reserved_Handler4>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Reserved_Handler4+0x9>
jmp    1109 <Reserved_Handler4+0x9>

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

LLVM IR (-O0):
define void @Reserved_Handler4() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Reserved_Handler4() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct drm_file {
  int dummy;
};
struct drm_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DRM_DEBUG(char *);
int drm_noop(struct drm_device *dev, void *data, struct drm_file *file_priv) {
  DRM_DEBUG("\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @drm_noop(%struct.drm_device* %0, i8* %1, %struct.drm_file* %2) {
%4 = alloca %struct.drm_device*
%5 = alloca i8*
%6 = alloca %struct.drm_file*
store %struct.drm_device* %0, %struct.drm_device** %4
store i8* %1, i8** %5
store %struct.drm_file* %2, %struct.drm_file** %6
%7 = call i32 @DRM_DEBUG(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
@.str = [2 x i8] c"\0A\00"
define i32 @drm_noop(%struct.drm_device* nocapture readnone %0, i8* nocapture readnone %1, %struct.drm_file* nocapture readnone %2) {
%4 = tail call i32 @DRM_DEBUG(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ inicio();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
main() {
  system("title Jogo da velha - maik@maikbasso.com.br");
  system("color 03");
  inicio();
  printf("\n\n\n");
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <system@plt>
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
mov    $0x0,%al
call   1050 <inicio@plt>
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [44 x i8] c"title Jogo da velha - maik@maikbasso.com.br\00"
@.str.1 = [9 x i8] c"color 03\00"
@.str.2 = [4 x i8] c"\0A\0A\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @inicio()
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"title Jogo da velha - maik@maikbasso.com.br\00"
@.str.1 = [9 x i8] c"color 03\00"
@.str.3 = [6 x i8] c"pause\00"
@str = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @inicio()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
char *XLocaleOfIM() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @XLocaleOfIM() {
ret i8* undef
}
/* Variables and functions */
double get_rand_double(double, double);
int MetropolisTest(double likelihood_last, double likelihood_new) {
  double prob;
  if (likelihood_new >= likelihood_last)
    return (1);
  else if ((prob = get_rand_double(0.0, 1.0)) <
           likelihood_new / likelihood_last)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<MetropolisTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     113e <MetropolisTest+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    117d <MetropolisTest+0x6d>
xorps  %xmm0,%xmm0
movsd  0xeb7(%rip),%xmm1
call   1030 <get_rand_double@plt>
movaps %xmm0,%xmm1
movsd  %xmm1,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1176 <MetropolisTest+0x66>
movl   $0x1,-0x4(%rbp)
jmp    117d <MetropolisTest+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MetropolisTest>:
mov    $0x1,%eax
ucomisd %xmm0,%xmm1
jae    1155 <MetropolisTest+0x45>
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  0xed3(%rip),%xmm1
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm0,%xmm0
call   1030 <get_rand_double@plt>
movsd  0x10(%rsp),%xmm1
divsd  0x8(%rsp),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @MetropolisTest(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %5
%8 = load double, double* %4
%9 = fcmp oge double %7, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %19
11: ; preds = %2
%12 = call double @get_rand_double(double 0.000000e+00, double 1.000000e+00)
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %4
%15 = fdiv double %13, %14
%16 = fcmp olt double %12, %15
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 1, i32* %3
br label %19
18: ; preds = %11
store i32 0, i32* %3
br label %19
19: ; preds = %18, %17, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @MetropolisTest(double %0, double %1) {
%3 = fcmp ult double %1, %0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call double @get_rand_double(double 0.000000e+00, double 1.000000e+00)
%6 = fdiv double %1, %0
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %2
%10 = phi i32 [ 1, %2 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int COLORS;
int check_color(int color) {
  if (color >= COLORS || color < -2) {
    return -1;
  } else {
    return color;
  }
}


x86 assembly (clang, -O0):
<check_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ecf(%rip),%rcx
cmp    (%rcx),%eax
jge    1123 <check_color+0x23>
cmpl   $0xfffffffe,-0x8(%rbp)
jge    112f <check_color+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1135 <check_color+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_color>:
mov    0x2ed9(%rip),%rax
cmp    %edi,(%rax)
mov    $0xffffffff,%ecx
mov    %edi,%eax
cmovle %ecx,%eax
cmp    $0xfffffffe,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
@COLORS = global i32 0
define i32 @check_color(i32 %0) {
%2 = load i32, i32* @COLORS
%3 = icmp sle i32 %2, %0
%4 = icmp slt i32 %0, -2
%5 = or i1 %4, %3
%6 = select i1 %5, i32 -1, i32 %0
ret i32 %6
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCGETS;
int ioctl(int, int /*<<< orphan*/, struct termios *);
int isatty(int fd) {
  struct termios term;
  int istty = ioctl(fd, TCGETS, &term);
  return istty == 0;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.termios
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @TCGETS
%7 = call i32 @ioctl(i32 %5, i32 %6, %struct.termios* %3)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @isatty(i32 %0) {
%2 = alloca %struct.termios
%3 = bitcast %struct.termios* %2 to i8*
%4 = load i32, i32* @TCGETS
%5 = call i32 @ioctl(i32 %0, i32 %4, %struct.termios* %2)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int *unknown1();
int *unknown2();
void unknown_alias_Bad() {
  int *x = unknown1();
  int *y = unknown2();
  if (*x < *y) {
    int a[10];
    a[10] = 0;
  }
}


x86 assembly (clang, -O0):
<unknown_alias_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0x0,%al
call   1030 <unknown1@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <unknown2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    1157 <unknown_alias_Bad+0x37>
movl   $0x0,-0x18(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @unknown_alias_Bad() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca [10 x i32]
%4 = call i32* (...) @unknown1()
store i32* %4, i32** %1
%5 = call i32* (...) @unknown2()
store i32* %5, i32** %2
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 10
store i32 0, i32* %12
br label %13
13: ; preds = %11, %0
ret void
}

LLVM IR (-O2):
define void @unknown_alias_Bad() {
%1 = tail call i32* (...) @unknown1()
%2 = tail call i32* (...) @unknown2()
ret void
}
/* Variables and functions */
double f_d_cup(double);
double f_dd_cup1(double X) {
  return (f_d_cup(X + 0.03) - f_d_cup(X - 0.03)) / 0.06;
}


x86 assembly (clang, -O0):
<f_dd_cup1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <f_d_cup@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <f_d_cup@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_dd_cup1>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
movsd  0xeda(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <f_d_cup@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xec5(%rip),%xmm0
call   1030 <f_d_cup@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
divsd  0xeb6(%rip),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f_dd_cup1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 3.000000e-02
%5 = call double @f_d_cup(double %4)
%6 = load double, double* %2
%7 = fsub double %6, 3.000000e-02
%8 = call double @f_d_cup(double %7)
%9 = fsub double %5, %8
%10 = fdiv double %9, 6.000000e-02
ret double %10
}

LLVM IR (-O2):
define double @f_dd_cup1(double %0) {
%2 = fadd double %0, 3.000000e-02
%3 = tail call double @f_d_cup(double %2)
%4 = fadd double %0, -3.000000e-02
%5 = tail call double @f_d_cup(double %4)
%6 = fsub double %3, %5
%7 = fdiv double %6, 6.000000e-02
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void sighand(int sig) {
  printf("Im executing signal handler in thread %ld\n", pthread_self());
}


x86 assembly (clang, -O0):
<sighand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighand>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Im executing signal handler in thread %ld\0A\00"
define void @sighand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pthread_self()
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Im executing signal handler in thread %ld\0A\00"
define void @sighand(i32 %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wprintw(int /*<<< orphan*/ *, char const *, int, int);
int ii_wprintw(WINDOW *win, const char *fmt, int i, int j) {
  return (wprintw(win, fmt, i, j));
}


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

x86 assembly (clang, -O2):
<ii_wprintw>:
jmp    1030 <wprintw@plt>

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

LLVM IR (-O2):
define i32 @ii_wprintw(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @wprintw(i32* %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
size_t get_data_tag_in_UnderlyingInstrument(size_t __tag) {
  switch (__tag) {
  case 362:
    return 363;
  case 364:
    return 365;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_data_tag_in_UnderlyingInstrument>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x16a,%rax
je     1136 <get_data_tag_in_UnderlyingInstrument+0x36>
jmp    1121 <get_data_tag_in_UnderlyingInstrument+0x21>
mov    -0x18(%rbp),%rax
sub    $0x16c,%rax
je     1143 <get_data_tag_in_UnderlyingInstrument+0x43>
jmp    1150 <get_data_tag_in_UnderlyingInstrument+0x50>
movq   $0x16b,-0x8(%rbp)
jmp    1158 <get_data_tag_in_UnderlyingInstrument+0x58>
movq   $0x16d,-0x8(%rbp)
jmp    1158 <get_data_tag_in_UnderlyingInstrument+0x58>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_data_tag_in_UnderlyingInstrument>:
xor    %eax,%eax
cmp    $0x16c,%rdi
mov    $0x16d,%ecx
cmovne %rax,%rcx
cmp    $0x16a,%rdi
mov    $0x16b,%eax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
define i64 @get_data_tag_in_UnderlyingInstrument(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %7 [
i64 362, label %5
i64 364, label %6
]
5: ; preds = %1
store i64 363, i64* %2
br label %8
6: ; preds = %1
store i64 365, i64* %2
br label %8
7: ; preds = %1
store i64 0, i64* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i64, i64* %2
ret i64 %9
}

LLVM IR (-O2):
define i64 @get_data_tag_in_UnderlyingInstrument(i64 %0) {
%2 = icmp eq i64 %0, 364
%3 = select i1 %2, i64 365, i64 0
%4 = icmp eq i64 %0, 362
%5 = select i1 %4, i64 363, i64 %3
ret i64 %5
}
int fun351() { return 351; }


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

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

LLVM IR (-O0):
define i32 @fun351() {
ret i32 351
}

LLVM IR (-O2):
define i32 @fun351() {
ret i32 351
}
/* Type definitions */
struct substrate_parallelism_profile {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/
substrate_parallelism_profile_idump(int /*<<< orphan*/ *,
                                    struct substrate_parallelism_profile *,
                                    int /*<<< orphan*/);
void substrate_parallelism_profile_dump(
    FILE *output_stream, struct substrate_parallelism_profile *pp) {
  substrate_parallelism_profile_idump(output_stream, pp, 0);
}


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

x86 assembly (clang, -O2):
<substrate_parallelism_profile_dump>:
xor    %edx,%edx
jmp    1030 <substrate_parallelism_profile_idump@plt>

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

LLVM IR (-O2):
%struct.substrate_parallelism_profile = type { i32 }
define void @substrate_parallelism_profile_dump(i32* %0, %struct.substrate_parallelism_profile* %1) {
%3 = tail call i32 @substrate_parallelism_profile_idump(i32* %0, %struct.substrate_parallelism_profile* %1, i32 0)
ret void
}
void *memset(void *s_vp, int c, unsigned long n) {
  unsigned i;
  char *s = s_vp;
  for (i = 0; i < n; ++i)
    s[i] = c;
  return s_vp;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1148 <memset+0x48>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111e <memset+0x1e>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %rdi,%rax
test   %rdx,%rdx
je     111c <memset+0x1c>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %sil,(%rax,%rcx,1)
add    $0x1,%ecx
cmp    %rdx,%rcx
jb     1110 <memset+0x10>
ret

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

LLVM IR (-O2):
define i8* @memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %6, i8* %9
%10 = add nuw nsw i64 %8, 1
%11 = and i64 %10, 4294967295
%12 = icmp ult i64 %11, %2
br i1 %12, label %7, label %13
13: ; preds = %7, %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ iptables_do_command(char *);
void iptables_fw_clear_authservers(void) {
  iptables_do_command("-t filter -F "
                      "WiFiDog_AuthServers");
  iptables_do_command("-t nat -F "
                      "WiFiDog_AuthServers");
}


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

x86 assembly (clang, -O2):
<iptables_fw_clear_authservers>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <iptables_do_command@plt>
lea    0xefd(%rip),%rdi
pop    %rax
jmp    1030 <iptables_do_command@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"-t filter -F WiFiDog_AuthServers\00"
@.str.1 = [30 x i8] c"-t nat -F WiFiDog_AuthServers\00"
define void @iptables_fw_clear_authservers() {
%1 = call i32 @iptables_do_command(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @iptables_do_command(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"-t filter -F WiFiDog_AuthServers\00"
@.str.1 = [30 x i8] c"-t nat -F WiFiDog_AuthServers\00"
define void @iptables_fw_clear_authservers() {
%1 = tail call i32 @iptables_do_command(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @iptables_do_command(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long get_error_values(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
unsigned long ERR_peek_error(void) {
  return (get_error_values(0, NULL, NULL, NULL, NULL));
}


x86 assembly (clang, -O0):
<ERR_peek_error>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rsi
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <get_error_values@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_peek_error>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <get_error_values@plt>

LLVM IR (-O0):
define i64 @ERR_peek_error() {
%1 = call i64 @get_error_values(i32 0, i32* null, i32* null, i32* null, i32* null)
ret i64 %1
}

LLVM IR (-O2):
define i64 @ERR_peek_error() {
%1 = tail call i64 @get_error_values(i32 0, i32* null, i32* null, i32* null, i32* null)
ret i64 %1
}
int main() {
  int z;
  int i = 0, j = 0;
  while (i < 10) {
    i++;
    j = 2 * i;
  }
  z = i + j;
  return z;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    113a <main+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <main+0x19>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1e,%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 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = mul nsw i32 2, %11
store i32 %12, i32* %4
br label %5
13: ; preds = %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 30
}
/* Variables and functions */
int close(int);
int spiClose(int fileDescriptor) { return close(fileDescriptor); }


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

x86 assembly (clang, -O2):
<spiClose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @spiClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t SwapByteBits(uint8_t cInput) {
  uint8_t nResult = 0;
  for (int i = 0; i < 8; i++) {
    nResult = nResult << 1;
    nResult |= (cInput & 1);
    cInput = cInput >> 1;
  }
  return (nResult);
}


x86 assembly (clang, -O0):
<SwapByteBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    114b <SwapByteBits+0x4b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <SwapByteBits+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapByteBits>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @SwapByteBits(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 = %17, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %3
%10 = shl i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = and i32 %11, 1
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = ashr i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %8
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @SwapByteBits(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
int periodic_timer_expired(struct timeval *t_timeout, unsigned us) { return 0; }


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

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

LLVM IR (-O0):
%struct.timeval = type opaque
define i32 @periodic_timer_expired(%struct.timeval* %0, i32 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type opaque
define i32 @periodic_timer_expired(%struct.timeval* nocapture readnone %0, i32 %1) {
ret i32 0
}
int pixtype2(type)
int type;
{
  switch (type) {
  case 'A':
    return 6;
  case 'B':
    return 6;
  case 'X':
    return 6;
  case 'I':
    return 1;
  case 'K':
    return 3;
  case 'U':
    return 7;
  case 'J':
    return 2;
  case 'V':
    return 8;
  case 'L':
    return 6;
  case 'E':
    return 4;
  case 'D':
    return 5;
  }
  return -1;
}


x86 assembly (clang, -O0):
<pixtype2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x17,%eax
ja     11b4 <pixtype2+0xb4>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x6,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0x6,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0x6,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0x1,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0x3,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0x7,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0x2,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0x8,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0x6,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0x4,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0x5,-0x4(%rbp)
jmp    11bb <pixtype2+0xbb>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixtype2>:
add    $0xffffffbf,%edi
mov    $0xffffffff,%eax
cmp    $0x17,%edi
ja     111a <pixtype2+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @pixtype2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %16 [
i32 65, label %5
i32 66, label %6
i32 88, label %7
i32 73, label %8
i32 75, label %9
i32 85, label %10
i32 74, label %11
i32 86, label %12
i32 76, label %13
i32 69, label %14
i32 68, label %15
]
5: ; preds = %1
store i32 6, i32* %2
br label %17
6: ; preds = %1
store i32 6, i32* %2
br label %17
7: ; preds = %1
store i32 6, i32* %2
br label %17
8: ; preds = %1
store i32 1, i32* %2
br label %17
9: ; preds = %1
store i32 3, i32* %2
br label %17
10: ; preds = %1
store i32 7, i32* %2
br label %17
11: ; preds = %1
store i32 2, i32* %2
br label %17
12: ; preds = %1
store i32 8, i32* %2
br label %17
13: ; preds = %1
store i32 6, i32* %2
br label %17
14: ; preds = %1
store i32 4, i32* %2
br label %17
15: ; preds = %1
store i32 5, i32* %2
br label %17
16: ; preds = %1
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@switch.table.pixtype2 = [24 x i32] [i32 6, i32 6, i32 -1, i32 5, i32 4, i32 -1, i32 -1, i32 -1, i32 1, i32 2, i32 3, i32 6, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 7, i32 8, i32 -1, i32 6]
define i32 @pixtype2(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 24
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [24 x i32], [24 x i32]* @switch.table.pixtype2, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
float atan2f(float, float);
float atan2pif(float x, float y) {
  return atan2f(x, y) / 3.14159265358979323846f;
}


x86 assembly (clang, -O0):
<atan2pif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2f@plt>
movss  0xec7(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2pif>:
push   %rax
call   1030 <atan2f@plt>
divss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atan2pif(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @atan2f(float %5, float %6)
%8 = fdiv float %7, 0x400921FB60000000
ret float %8
}

LLVM IR (-O2):
define float @atan2pif(float %0, float %1) {
%3 = tail call float @atan2f(float %0, float %1)
%4 = fdiv float %3, 0x400921FB60000000
ret float %4
}