xunge/DecIR huggingface dataset:
void __break(void) {
  static volatile int dummy;
  dummy += 1;
}


x86 assembly (clang, -O0):
<__break>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__break>:
addl   $0x1,0x2f1d(%rip)
ret

LLVM IR (-O0):
@__break.dummy = internal global i32 0
define void @__break() {
%1 = load volatile i32, i32* @__break.dummy
%2 = add nsw i32 %1, 1
store volatile i32 %2, i32* @__break.dummy
ret void
}

LLVM IR (-O2):
@__break.dummy = internal global i32 0
define void @__break() {
%1 = load volatile i32, i32* @__break.dummy
%2 = add nsw i32 %1, 1
store volatile i32 %2, i32* @__break.dummy
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inScan();
int /*<<< orphan*/ letterGrades();
int /*<<< orphan*/ printHeader();
int /*<<< orphan*/ printResults();
int /*<<< orphan*/ printf(char *);
int main() {
  inScan();
  printf("\n");
  printHeader();
  printResults();
  printf("\n\n\n");
  letterGrades();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <inScan@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <printHeader@plt>
mov    $0x0,%al
call   1050 <printResults@plt>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <letterGrades@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <inScan@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1070 <printHeader@plt>
xor    %eax,%eax
call   1060 <printResults@plt>
lea    0xe79(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1080 <letterGrades@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [4 x i8] c"\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @inScan()
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @printHeader()
%5 = call i32 (...) @printResults()
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @letterGrades()
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @inScan()
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (...) @printHeader()
%4 = tail call i32 (...) @printResults()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @letterGrades()
ret i32 0
}
int ehPrimo(int num) {
  int i;
  for (i = 2; i * i <= num; i++) {
    if (num % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ehPrimo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114d <ehPrimo+0x4d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113a <ehPrimo+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <ehPrimo+0x54>
jmp    113f <ehPrimo+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <ehPrimo+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehPrimo>:
mov    $0x1,%ecx
cmp    $0x4,%edi
jl     1125 <ehPrimo+0x25>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1128 <ehPrimo+0x28>
add    $0x1,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jle    1110 <ehPrimo+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ehPrimo(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %11, label %6
3: ; preds = %6
%4 = mul nsw i32 %10, %10
%5 = icmp sgt i32 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %10, %3 ], [ 2, %1 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
%10 = add nuw nsw i32 %7, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int /*<<< orphan*/, int /*<<< orphan*/, ...);
void set_nodelay_mode() {
  int termflags;
  termflags = fcntl(0, F_GETFL);
  termflags |= O_NONBLOCK;
  fcntl(0, F_SETFL, termflags);
}


x86 assembly (clang, -O0):
<set_nodelay_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
xor    %edi,%edi
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nodelay_mode>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%esi
xor    %edi,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rcx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @set_nodelay_mode() {
%1 = alloca i32
%2 = load i32, i32* @F_GETFL
%3 = call i32 (i32, i32, ...) @fcntl(i32 0, i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* @O_NONBLOCK
%5 = load i32, i32* %1
%6 = or i32 %5, %4
store i32 %6, i32* %1
%7 = load i32, i32* @F_SETFL
%8 = load i32, i32* %1
%9 = call i32 (i32, i32, ...) @fcntl(i32 0, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @set_nodelay_mode() {
%1 = load i32, i32* @F_GETFL
%2 = tail call i32 (i32, i32, ...) @fcntl(i32 0, i32 %1)
%3 = load i32, i32* @O_NONBLOCK
%4 = or i32 %3, %2
%5 = load i32, i32* @F_SETFL
%6 = tail call i32 (i32, i32, ...) @fcntl(i32 0, i32 %5, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void stop_alrm_handler(int sig) { exit(0); }


x86 assembly (clang, -O0):
<stop_alrm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<stop_alrm_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @stop_alrm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @stop_alrm_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ sortFirst(int *, int);
void sortArray(int *array, int length) {
  while (sortFirst(array, length))
    ;
}


x86 assembly (clang, -O0):
<sortArray>:
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 <sortFirst@plt>
cmp    $0x0,%rax
je     113a <sortArray+0x2a>
jmp    111f <sortArray+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortArray>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <sortFirst@plt>
test   %rax,%rax
jne    1120 <sortArray+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @sortArray(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @sortFirst(i32* %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
void f4(int *x) {
  for (int j = 0; j < 16; ++j)
    x[j] += 1;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1138 <f4+0x38>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <f4+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
pcmpeqd %xmm0,%xmm0
movdqu (%rdi),%xmm1
movdqu 0x10(%rdi),%xmm2
movdqu 0x20(%rdi),%xmm3
movdqu 0x30(%rdi),%xmm4
psubd  %xmm0,%xmm1
movdqu %xmm1,(%rdi)
psubd  %xmm0,%xmm2
movdqu %xmm2,0x10(%rdi)
psubd  %xmm0,%xmm3
movdqu %xmm3,0x20(%rdi)
psubd  %xmm0,%xmm4
movdqu %xmm4,0x30(%rdi)
ret

LLVM IR (-O0):
define void @f4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %11
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @f4(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = add nsw <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = bitcast i32* %6 to <4 x i32>*
%8 = load <4 x i32>, <4 x i32>* %7
%9 = add nsw <4 x i32> %8, <i32 1, i32 1, i32 1, i32 1>
%10 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %10
%11 = getelementptr inbounds i32, i32* %0, i64 8
%12 = bitcast i32* %11 to <4 x i32>*
%13 = load <4 x i32>, <4 x i32>* %12
%14 = add nsw <4 x i32> %13, <i32 1, i32 1, i32 1, i32 1>
%15 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> %14, <4 x i32>* %15
%16 = getelementptr inbounds i32, i32* %0, i64 12
%17 = bitcast i32* %16 to <4 x i32>*
%18 = load <4 x i32>, <4 x i32>* %17
%19 = add nsw <4 x i32> %18, <i32 1, i32 1, i32 1, i32 1>
%20 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> %19, <4 x i32>* %20
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_hexa(int byte) { printf("      %02x", byte); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c" %02x\00"
define void @print_hexa(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int add_int_data(struct buffer *, int, unsigned int);
int add_frame_caps_avp(struct buffer *buf, unsigned int caps) {
  return add_int_data(buf, 3, caps);
}


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

x86 assembly (clang, -O2):
<add_frame_caps_avp>:
mov    %esi,%edx
mov    $0x3,%esi
jmp    1030 <add_int_data@plt>

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

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @add_frame_caps_avp(%struct.buffer* %0, i32 %1) {
%3 = tail call i32 @add_int_data(%struct.buffer* %0, i32 3, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int strlen(char *str) {
  printf("%s\n", str);
  int i = 0;
  while (*(str + i) != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1156 <strlen+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <strlen+0x23>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1130 <strlen+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @strlen(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %3, %1
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
ret i32 %10
}
/* Variables and functions */
int *dynCastOrNull(int /*<<< orphan*/);
int /*<<< orphan*/ getNull();
void testTrackNull() {
  int *casted = dynCastOrNull(getNull());
  *casted = 1;
}


x86 assembly (clang, -O0):
<testTrackNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getNull@plt>
mov    %eax,%edi
call   1030 <dynCastOrNull@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTrackNull>:
push   %rax
xor    %eax,%eax
call   1040 <getNull@plt>
mov    %eax,%edi
call   1030 <dynCastOrNull@plt>
movl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @testTrackNull() {
%1 = alloca i32*
%2 = call i32 (...) @getNull()
%3 = call i32* @dynCastOrNull(i32 %2)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
store i32 1, i32* %4
ret void
}

LLVM IR (-O2):
define void @testTrackNull() {
%1 = tail call i32 (...) @getNull()
%2 = tail call i32* @dynCastOrNull(i32 %1)
store i32 1, i32* %2
ret void
}
/* Variables and functions */
char *f();
void dmi_scan_machine(void) {
  char *p = f(), *q;
  for (q = p; q < p + 10; q++)
    ;
}


x86 assembly (clang, -O0):
<dmi_scan_machine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <f@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0xa,%rcx
cmp    %rcx,%rax
jae    1156 <dmi_scan_machine+0x46>
jmp    1145 <dmi_scan_machine+0x35>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <dmi_scan_machine+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dmi_scan_machine() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @f()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
store i8* %4, i8** %2
br label %5
5: ; preds = %11, %0
%6 = load i8*, i8** %2
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i64 10
%9 = icmp ult i8* %6, %8
br i1 %9, label %10, label %14
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @dmi_scan_machine() {
%1 = tail call i8* (...) @f()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ sleep_millis(int /*<<< orphan*/);
int /*<<< orphan*/ to_cell(int /*<<< orphan*/);
void primitive_sleep_impl(void) { sleep_millis(to_cell(dpop())); }


x86 assembly (clang, -O0):
<primitive_sleep_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <to_cell@plt>
mov    %eax,%edi
call   1040 <sleep_millis@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_sleep_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <to_cell@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sleep_millis@plt>

LLVM IR (-O0):
define void @primitive_sleep_impl() {
%1 = call i32 (...) @dpop()
%2 = call i32 @to_cell(i32 %1)
%3 = call i32 @sleep_millis(i32 %2)
ret void
}

LLVM IR (-O2):
define void @primitive_sleep_impl() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i32 @to_cell(i32 %1)
%3 = tail call i32 @sleep_millis(i32 %2)
ret void
}
int test_bit(unsigned int nr, unsigned long *bitmap) {
  unsigned long offset = nr / (sizeof(unsigned long) * 8);
  unsigned long bit = nr & ((sizeof(unsigned long) * 8) - 1);
  return (bitmap[offset] >> bit) & 1;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x6,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x3,%eax
and    $0xfffffff8,%eax
mov    (%rsi,%rax,1),%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = udiv i64 %8, 64
store i64 %9, i64* %5
%10 = load i32, i32* %3
%11 = zext i32 %10 to i64
%12 = and i64 %11, 63
store i64 %12, i64* %6
%13 = load i64*, i64** %4
%14 = load i64, i64* %5
%15 = getelementptr inbounds i64, i64* %13, i64 %14
%16 = load i64, i64* %15
%17 = load i64, i64* %6
%18 = lshr i64 %16, %17
%19 = and i64 %18, 1
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i64* nocapture %1) {
%3 = zext i32 %0 to i64
%4 = lshr i64 %3, 6
%5 = and i64 %3, 63
%6 = getelementptr inbounds i64, i64* %1, i64 %4
%7 = load i64, i64* %6
%8 = lshr i64 %7, %5
%9 = trunc i64 %8 to i32
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void LogClose() { closelog(); }


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

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

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

LLVM IR (-O2):
define void @LogClose() {
%1 = tail call i32 (...) @closelog()
ret void
}
long lgcd(long a, long b) {
  while (b) {
    long t = b;
    b = a % b;
    a = t;
  }
  return a;
}


x86 assembly (clang, -O0):
<lgcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <lgcd+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    110c <lgcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <lgcd+0x35>
mov    %rsi,%rdx
jmp    111d <lgcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <lgcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <lgcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <lgcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @lgcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = srem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t readw(const void *addr) { return *((volatile uint16_t *)addr); }


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

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

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

LLVM IR (-O2):
define i32 @readw(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int vcpio_id(char *blk) {
  if ((strncmp(blk, "070701", sizeof("070701") - 1) != 0))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<vcpio_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1147 <vcpio_id+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <vcpio_id+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcpio_id>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"070701\00"
define i32 @vcpio_id(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
int _state_data_get_size_frac_data(void *item) {
  return *(unsigned char *)item;
}


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

x86 assembly (clang, -O2):
<_state_data_get_size_frac_data>:
movzbl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @_state_data_get_size_frac_data(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage(void) {
  fprintf(stderr, "Usage: "
                  "usbmon [-i usbN] [-f0|-fu|-fh] [-a0|-a1|-am] [-s len]\n");
  exit(2);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"Usage: usbmon [-i usbN] [-f0|-fu|-fh] [-a0|-a1|-am] [-s len]\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"Usage: usbmon [-i usbN] [-f0|-fu|-fh] [-a0|-a1|-am] [-s len]\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
void cli_quit(struct state *context, struct debug_state *dbg_state,
              char **args) {}


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

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

LLVM IR (-O0):
%struct.state = type opaque
%struct.debug_state = type opaque
define void @cli_quit(%struct.state* %0, %struct.debug_state* %1, i8** %2) {
%4 = alloca %struct.state*
%5 = alloca %struct.debug_state*
%6 = alloca i8**
store %struct.state* %0, %struct.state** %4
store %struct.debug_state* %1, %struct.debug_state** %5
store i8** %2, i8*** %6
ret void
}

LLVM IR (-O2):
%struct.state = type opaque
%struct.debug_state = type opaque
define void @cli_quit(%struct.state* nocapture %0, %struct.debug_state* nocapture %1, i8** nocapture %2) {
ret void
}
int isupper(int c) { return (unsigned int)c - 'A' < 26; }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
cmp    $0x1a,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub i32 %3, 65
%5 = icmp ult i32 %4, 26
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int gca_cmp_double(const void *aa, const void *bb) {
  const double a = *(const double *)aa;
  const double b = *(const double *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp_double(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
store double %9, double* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fcmp ogt double %13, %14
%16 = zext i1 %15 to i32
%17 = load double, double* %6
%18 = load double, double* %5
%19 = fcmp ogt double %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_cmp_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp ogt double %4, %6
%8 = zext i1 %7 to i32
%9 = fcmp ogt double %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ strcasecmp;

/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ showprompt();
int main() {
  char input[64];
  do {
    showprompt();
    gets(input);
    puts("Someday I must implement that function..");
  } while ((strcasecmp)("quit", input));
  puts("Oh! Apparently I did!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <showprompt@plt>
lea    -0x50(%rbp),%rdi
call   1050 <gets@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
lea    -0x50(%rbp),%rax
cmp    $0x0,%eax
jne    113f <main+0xf>
lea    0xebf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsp,%rbx
lea    0xebf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <showprompt@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
test   %ebx,%ebx
jne    1150 <main+0x20>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Someday I must implement that function..\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [22 x i8] c"Oh! Apparently I did!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = call i32 (...) @showprompt()
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%10 = ptrtoint i8* %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %8
%13 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"Someday I must implement that function..\00"
@.str.2 = [22 x i8] c"Oh! Apparently I did!\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = ptrtoint [64 x i8]* %1 to i64
%4 = trunc i64 %3 to i32
%5 = icmp eq i32 %4, 0
br label %6
6: ; preds = %6, %0
%7 = call i32 (...) @showprompt()
%8 = call i32 @gets(i8* %2)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br i1 %5, label %10, label %6
10: ; preds = %6
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct clad_pool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clad_free(struct clad_pool *);
scalar_t__ clad_pool_freelast(struct clad_pool *);
void *clad_pool_free(struct clad_pool *me) {
  while (clad_pool_freelast(me) > 0)
    ;
  clad_free(me);
  return NULL;
}


x86 assembly (clang, -O0):
<clad_pool_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clad_pool_freelast@plt>
cmp    $0x0,%rax
jle    1144 <clad_pool_free+0x24>
jmp    112c <clad_pool_free+0xc>
mov    -0x8(%rbp),%rdi
call   1030 <clad_free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_pool_free>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <clad_pool_freelast@plt>
test   %rax,%rax
jg     1130 <clad_pool_free+0x10>
mov    %rbx,%rdi
call   1030 <clad_free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.clad_pool = type { i32 }
define i8* @clad_pool_free(%struct.clad_pool* %0) {
%2 = alloca %struct.clad_pool*
store %struct.clad_pool* %0, %struct.clad_pool** %2
br label %3
3: ; preds = %7, %1
%4 = load %struct.clad_pool*, %struct.clad_pool** %2
%5 = call i64 @clad_pool_freelast(%struct.clad_pool* %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load %struct.clad_pool*, %struct.clad_pool** %2
%10 = call i32 @clad_free(%struct.clad_pool* %9)
ret i8* null
}

LLVM IR (-O2):
%struct.clad_pool = type { i32 }
define noalias i8* @clad_pool_free(%struct.clad_pool* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @clad_pool_freelast(%struct.clad_pool* %0)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @clad_free(%struct.clad_pool* %0)
ret i8* null
}
int imax(int a, int b) { return ((a) > (b)) ? (a) : (b); }


x86 assembly (clang, -O0):
<imax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <imax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @imax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void tegra_pm_clear_cpu_in_lp2(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra_pm_clear_cpu_in_lp2() {
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *chop_filename(const char *target) {
  char *last_slash = strrchr(target, '/');
  if (!last_slash)
    last_slash = strrchr(target, '\\');
  if (last_slash)
    return last_slash + 1;
  else
    return target;
}


x86 assembly (clang, -O0):
<chop_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114b <chop_filename+0x3b>
mov    -0x10(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1167 <chop_filename+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116f <chop_filename+0x5f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop_filename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
jne    1130 <chop_filename+0x20>
mov    %rbx,%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @chop_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i8* @strrchr(i8* %10, i8 signext 92)
store i8* %11, i8** %4
br label %12
12: ; preds = %9, %1
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8* %17, i8** %2
br label %20
18: ; preds = %12
%19 = load i8*, i8** %3
store i8* %19, i8** %2
br label %20
20: ; preds = %18, %15
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @chop_filename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %2, %1 ], [ %5, %4 ]
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* %0, i8* %9
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ forced_memcpy(void *, char *, int);
void copy_shellcode(void *dst) {
  forced_memcpy(dst, "\xc3", (sizeof("\xc3") - 1));
}


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

x86 assembly (clang, -O2):
<copy_shellcode>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <forced_memcpy@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\C3\00"
define void @copy_shellcode(i8* %0) {
%2 = tail call i32 @forced_memcpy(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chmod(char *, int);
int /*<<< orphan*/ umask(int);
int main() {
  umask(0000);
  chmod("hello2", 0777);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <umask@plt>
lea    0xec3(%rip),%rdi
mov    $0x1ff,%esi
call   1040 <chmod@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <umask@plt>
lea    0xed1(%rip),%rdi
mov    $0x1ff,%esi
call   1040 <chmod@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hello2\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @umask(i32 0)
%3 = call i32 @chmod(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 511)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hello2\00"
define i32 @main() {
%1 = tail call i32 @umask(i32 0)
%2 = tail call i32 @chmod(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 511)
ret i32 0
}
void _citrus_NONE_ctype_uninit(void *cl) {}


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

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

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

LLVM IR (-O2):
define void @_citrus_NONE_ctype_uninit(i8* nocapture %0) {
ret void
}
__attribute__((no)) int crash3(int a) {
  *((int *)0xdead) = a;
  return a * 4;
}


x86 assembly (clang, -O0):
<crash3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xdead,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash3>:
mov    %edi,0xdead
lea    0x0(,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @crash3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* inttoptr (i64 57005 to i32*)
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 4
ret i32 %5
}

LLVM IR (-O2):
define i32 @crash3(i32 %0) {
store i32 %0, i32* inttoptr (i64 57005 to i32*)
%2 = shl nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _TIFFsetByteArray(void **, void *, long);
void _TIFFsetFloatArray(float **fpp, float *fp, long n) {
  _TIFFsetByteArray((void **)fpp, (void *)fp, n * sizeof(float));
}


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

x86 assembly (clang, -O2):
<_TIFFsetFloatArray>:
shl    $0x2,%rdx
jmp    1030 <_TIFFsetByteArray@plt>

LLVM IR (-O0):
define void @_TIFFsetFloatArray(float** %0, float* %1, i64 %2) {
%4 = alloca float**
%5 = alloca float*
%6 = alloca i64
store float** %0, float*** %4
store float* %1, float** %5
store i64 %2, i64* %6
%7 = load float**, float*** %4
%8 = bitcast float** %7 to i8**
%9 = load float*, float** %5
%10 = bitcast float* %9 to i8*
%11 = load i64, i64* %6
%12 = mul i64 %11, 4
%13 = call i32 @_TIFFsetByteArray(i8** %8, i8* %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @_TIFFsetFloatArray(float** %0, float* %1, i64 %2) {
%4 = bitcast float** %0 to i8**
%5 = bitcast float* %1 to i8*
%6 = shl i64 %2, 2
%7 = tail call i32 @_TIFFsetByteArray(i8** %4, i8* %5, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _compilerrt_abort_impl(char const *, int, char const *);
void __my_abort(const char *file, int line, const char *func) {
  _compilerrt_abort_impl(file, line, func);
}


x86 assembly (clang, -O0):
<__my_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <_compilerrt_abort_impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__my_abort>:
jmp    1030 <_compilerrt_abort_impl@plt>

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

LLVM IR (-O2):
define void @__my_abort(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @_compilerrt_abort_impl(i8* %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DOS_mem_init();
int DOS_init(void) {
  DOS_mem_init();
  return 1;
}


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

x86 assembly (clang, -O2):
<DOS_init>:
push   %rax
xor    %eax,%eax
call   1030 <DOS_mem_init@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @DOS_init() {
%1 = call i32 (...) @DOS_mem_init()
ret i32 1
}

LLVM IR (-O2):
define i32 @DOS_init() {
%1 = tail call i32 (...) @DOS_mem_init()
ret i32 1
}
void ADCComparatorConfigure(unsigned long ulBase, unsigned long ulComp,
                            unsigned long ulConfig) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000E00 + (ulComp * 4)))) =
      ulConfig;
}


x86 assembly (clang, -O0):
<ADCComparatorConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0xe00,%rax
mov    -0x10(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCComparatorConfigure>:
mov    %rdx,0xe00(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @ADCComparatorConfigure(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* %6
%8 = load i64, i64* %4
%9 = add i64 %8, 3584
%10 = load i64, i64* %5
%11 = mul i64 %10, 4
%12 = add i64 %9, %11
%13 = inttoptr i64 %12 to i64*
store volatile i64 %7, i64* %13
ret void
}

LLVM IR (-O2):
define void @ADCComparatorConfigure(i64 %0, i64 %1, i64 %2) {
%4 = add i64 %0, 3584
%5 = shl i64 %1, 2
%6 = add i64 %4, %5
%7 = inttoptr i64 %6 to i64*
store volatile i64 %2, i64* %7
ret void
}
/* Variables and functions */
scalar_t__ getchar();
int MySAR_readconsole(char *mline) {
  char *p = mline;
  while ((*p = (char)getchar()) != '\n')
    if (*p)
      p++;
  *p = '\0';
  return 1;
}


x86 assembly (clang, -O0):
<MySAR_readconsole>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0xa,%eax
je     115b <MySAR_readconsole+0x4b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <MySAR_readconsole+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <MySAR_readconsole+0x14>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MySAR_readconsole>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,(%rbx)
test   %al,%al
je     1120 <MySAR_readconsole+0x10>
cmp    $0xa,%al
je     1137 <MySAR_readconsole+0x27>
add    $0x1,%rbx
jmp    1120 <MySAR_readconsole+0x10>
movb   $0x0,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @MySAR_readconsole(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %8, %7 ], [ %0, %1 ]
br label %4
4: ; preds = %2, %4
%5 = tail call i64 (...) @getchar()
%6 = trunc i64 %5 to i8
store i8 %6, i8* %3
switch i8 %6, label %7 [
i8 10, label %9
i8 0, label %4
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
9: ; preds = %4
store i8 0, i8* %3
ret i32 1
}