xunge/DecIR huggingface dataset:
char *addstr(char *dst, const char *src, int limit) {
  while (limit > 0 && *src) {
    *dst = *src;
    dst++;
    src++;
    limit--;
  }
  return dst;
}


x86 assembly (clang, -O0):
<addstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jle    112e <addstr+0x2e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    113e <addstr+0x3e>
jmp    1170 <addstr+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <addstr+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addstr>:
mov    %rdi,%rax
test   %edx,%edx
jle    1129 <addstr+0x29>
add    $0x1,%edx
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
test   %cl,%cl
je     1129 <addstr+0x29>
mov    %cl,(%rax)
add    $0x1,%rax
add    $0x1,%rsi
add    $0xffffffff,%edx
cmp    $0x1,%edx
jg     1110 <addstr+0x10>
ret

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

LLVM IR (-O2):
define i8* @addstr(i8* writeonly %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3, %11
%6 = phi i32 [ %14, %11 ], [ %2, %3 ]
%7 = phi i8* [ %13, %11 ], [ %1, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %5
store i8 %9, i8* %8
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = add nsw i32 %6, -1
%15 = icmp sgt i32 %6, 1
br i1 %15, label %5, label %16
16: ; preds = %5, %11, %3
%17 = phi i8* [ %0, %3 ], [ %12, %11 ], [ %8, %5 ]
ret i8* %17
}
/* Variables and functions */
int write_block(int, int, int, int /*<<< orphan*/);
int analogWrite(int pin, int value) { return write_block(4, pin, value, 0); }


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

x86 assembly (clang, -O2):
<analogWrite>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x4,%edi
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

LLVM IR (-O0):
define i32 @analogWrite(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 @write_block(i32 4, i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @analogWrite(i32 %0, i32 %1) {
%3 = tail call i32 @write_block(i32 4, i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
int main() {
  int t = time(NULL);
  printf("%d\n", t);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void _hs_text_memcpy(void *dest, size_t doff, const void *src, size_t soff,
                     size_t n) {
  memcpy(dest + (doff << 1), src + (soff << 1), n << 1);
}


x86 assembly (clang, -O0):
<_hs_text_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rax
shl    $0x1,%rax
add    %rax,%rsi
mov    -0x28(%rbp),%rdx
shl    $0x1,%rdx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hs_text_memcpy>:
lea    (%rdi,%rsi,2),%rdi
lea    (%rdx,%rcx,2),%rsi
lea    (%r8,%r8,1),%rdx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @_hs_text_memcpy(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i64, i64* %7
%13 = shl i64 %12, 1
%14 = getelementptr i8, i8* %11, i64 %13
%15 = load i8*, i8** %8
%16 = load i64, i64* %9
%17 = shl i64 %16, 1
%18 = getelementptr i8, i8* %15, i64 %17
%19 = load i64, i64* %10
%20 = shl i64 %19, 1
%21 = call i32 @memcpy(i8* %14, i8* %18, i64 %20)
ret void
}

LLVM IR (-O2):
define void @_hs_text_memcpy(i8* %0, i64 %1, i8* %2, i64 %3, i64 %4) {
%6 = shl i64 %1, 1
%7 = getelementptr i8, i8* %0, i64 %6
%8 = shl i64 %3, 1
%9 = getelementptr i8, i8* %2, i64 %8
%10 = shl i64 %4, 1
%11 = tail call i32 @memcpy(i8* %7, i8* %9, i64 %10)
ret void
}
int f(int v, int m) { return v > 0 ? f(v / 10, m * (v % 10 ? v % 10 : 1)) : m; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1189 <f+0x79>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1163 <f+0x53>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
jmp    1170 <f+0x60>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <f+0x60>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%eax
imul   %eax,%esi
call   1030 <f@plt>
mov    %eax,-0x18(%rbp)
jmp    118f <f+0x7f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %esi,%eax
test   %edi,%edi
jle    1142 <f+0x42>
mov    $0xcccccccd,%r8d
mov    $0x1,%r9d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %edi,%edx
sub    %ecx,%edx
cmove  %r9d,%edx
imul   %edx,%eax
cmp    $0x9,%edi
mov    %esi,%edi
ja     1120 <f+0x20>
ret

LLVM IR (-O0):
define i32 @f(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 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 10
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = srem i32 %11, 10
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %7
%15 = load i32, i32* %3
%16 = srem i32 %15, 10
br label %18
17: ; preds = %7
br label %18
18: ; preds = %17, %14
%19 = phi i32 [ %16, %14 ], [ 1, %17 ]
%20 = mul nsw i32 %10, %19
%21 = call i32 @f(i32 %9, i32 %20)
br label %24
22: ; preds = %2
%23 = load i32, i32* %4
br label %24
24: ; preds = %22, %18
%25 = phi i32 [ %21, %18 ], [ %23, %22 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = udiv i32 %6, 10
%8 = urem i32 %6, 10
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %8
%11 = mul nsw i32 %10, %5
%12 = icmp ult i32 %6, 10
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ %1, %2 ], [ %11, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void d() { puts("this is d()"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"this is d()\00"
define void @d() {
%1 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"this is d()\00"
define void @d() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
void __DELETE_java_util_Hashtable_2(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_util_Hashtable_2(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
bool __dbg_ports(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @__dbg_ports() {
ret i32 0
}
extern void SetUChar(unsigned char *chr) { *chr = 153; }


x86 assembly (clang, -O0):
<SetUChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x99,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetUChar>:
movb   $0x99,(%rdi)
ret

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

LLVM IR (-O2):
define void @SetUChar(i8* nocapture writeonly %0) {
store i8 -103, i8* %0
ret void
}
int main(int argc, const char *argv[]) {
  signed char i = 0;
  int a = 0;
  while (i < 10) {
    if (argc) {
      ++a;
    } else {
      --a;
    }
    ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0xa,%eax
jge    1158 <main+0x58>
cmpl   $0x0,-0x8(%rbp)
je     1142 <main+0x42>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114b <main+0x4b>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x11(%rbp),%al
add    $0x1,%al
mov    %al,-0x11(%rbp)
jmp    111d <main+0x1d>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void CreateEDistList1(Schema, A) struct univStruct *Schema;
struct Course *A;
{
  AssignCourseEDistList1First(A, 0);
}


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

x86 assembly (clang, -O2):
<CreateEDistList1>:
mov    %rsi,%rdi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <AssignCourseEDistList1First@plt>

LLVM IR (-O0):
%struct.univStruct = type opaque
%struct.Course = type opaque
define void @CreateEDistList1(%struct.univStruct* %0, %struct.Course* %1) {
%3 = alloca %struct.univStruct*
%4 = alloca %struct.Course*
store %struct.univStruct* %0, %struct.univStruct** %3
store %struct.Course* %1, %struct.Course** %4
%5 = load %struct.Course*, %struct.Course** %4
%6 = call i32 (%struct.Course*, i32, ...) bitcast (i32 (...)* @AssignCourseEDistList1First to i32 (%struct.Course*, i32, ...)*)(%struct.Course* %5, i32 0)
ret void
}

LLVM IR (-O2):
%struct.univStruct = type opaque
%struct.Course = type opaque
define void @CreateEDistList1(%struct.univStruct* nocapture readnone %0, %struct.Course* %1) {
%3 = tail call i32 (%struct.Course*, i32, ...) bitcast (i32 (...)* @AssignCourseEDistList1First to i32 (%struct.Course*, i32, ...)*)(%struct.Course* %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fib3(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int n;
  printf("N? ");
  scanf("%d", &n);
  fib3(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <fib3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fib3@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"N? \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fib3(i32 %5)
ret i32 0
}
/* Variables and functions */
int __builtin_arm_crc32w(int, int);
int crc32w(int a, int b) { return __builtin_arm_crc32w(a, b); }


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

x86 assembly (clang, -O2):
<crc32w>:
jmp    1030 <__builtin_arm_crc32w@plt>

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

LLVM IR (-O2):
define i32 @crc32w(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_arm_crc32w(i32 %0, i32 %1)
ret i32 %3
}
int do_365() { return 365; }


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

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

LLVM IR (-O0):
define i32 @do_365() {
ret i32 365
}

LLVM IR (-O2):
define i32 @do_365() {
ret i32 365
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void die(const char *msg) {
  fprintf(stderr, "Error: %s\n", msg);
  exit(0);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @die(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ boid_distance(int, int);
float sqrtf(int /*<<< orphan*/);
float boid_real_distance(int a, int b) { return sqrtf(boid_distance(a, b)); }


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

x86 assembly (clang, -O2):
<boid_real_distance>:
push   %rax
call   1040 <boid_distance@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @boid_real_distance(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 @boid_distance(i32 %5, i32 %6)
%8 = call float @sqrtf(i32 %7)
ret float %8
}

LLVM IR (-O2):
define float @boid_real_distance(i32 %0, i32 %1) {
%3 = tail call i32 @boid_distance(i32 %0, i32 %1)
%4 = tail call float @sqrtf(i32 %3)
ret float %4
}
int do_multi(int a, int b) { return a * b; }


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

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

LLVM IR (-O0):
define i32 @do_multi(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @do_multi(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ l1_cache_operate_on_line_range(int, unsigned int,
                                                  unsigned int);
__attribute__((always_)) void l1_cache_flush_range(unsigned addr,
                                                   unsigned size) {
  l1_cache_operate_on_line_range((4), addr, size);
}


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

x86 assembly (clang, -O2):
<l1_cache_flush_range>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x4,%edi
jmp    1030 <l1_cache_operate_on_line_range@plt>

LLVM IR (-O0):
define void @l1_cache_flush_range(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 @l1_cache_operate_on_line_range(i32 4, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @l1_cache_flush_range(i32 %0, i32 %1) {
%3 = tail call i32 @l1_cache_operate_on_line_range(i32 4, i32 %0, i32 %1)
ret void
}
void grab() {
  asm volatile("callq _grab\n\t"
               "_grab:\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<grab>:
push   %rbp
mov    %rsp,%rbp
call   1109 <_grab>

x86 assembly (clang, -O2):
<grab>:
call   1105 <_grab>

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

LLVM IR (-O2):
define void @grab() {
tail call void asm sideeffect "callq _grab\0A\09_grab:\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ EAGAIN;
int close(int);
scalar_t__ errno;
int safe_close(int fd) {
  int r;
  do
    r = close(fd);
  while (r == -1 && errno == EAGAIN);
  return r;
}


x86 assembly (clang, -O0):
<safe_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0xffffffff,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jne    114f <safe_close+0x3f>
mov    0x2ea4(%rip),%rax
mov    (%rax),%rax
mov    0x2e8a(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    111b <safe_close+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_close>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec2(%rip),%r14
mov    0x2eab(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1144 <safe_close+0x34>
mov    (%r15),%rcx
cmp    %rcx,(%r14)
je     1130 <safe_close+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EAGAIN = global i64 0
define i32 @safe_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i64, i64* @errno
%12 = load i64, i64* @EAGAIN
%13 = icmp eq i64 %11, %12
br label %14
14: ; preds = %10, %7
%15 = phi i1 [ false, %7 ], [ %13, %10 ]
br i1 %15, label %4, label %16
16: ; preds = %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@errno = global i64 0
@EAGAIN = global i64 0
define i32 @safe_close(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EAGAIN
%7 = icmp eq i64 %5, %6
%8 = select i1 %4, i1 %7, i1 false
br i1 %8, label %2, label %9
9: ; preds = %2
ret i32 %3
}
void g_list_copy() {}


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

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

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

LLVM IR (-O2):
define void @g_list_copy() {
ret void
}
int scamper_control_init_unix(const char *file) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @scamper_control_init_unix(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void mi_ta(void) {
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008 | 0x0001);
  udelay(100);
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008 | 0x0001 | 0x0004);
  udelay(100);
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008);
  udelay(100);
  (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
      (0x0008 | 0x0004);
  udelay(100);
}


x86 assembly (clang, -O0):
<mi_ta>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc000c20,%eax
movw   $0x9,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    $0xc000c20,%eax
movw   $0xd,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    $0xc000c20,%eax
movw   $0x8,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    $0xc000c20,%eax
movw   $0xc,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi_ta>:
push   %rax
movw   $0x9,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
movw   $0xd,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
movw   $0x8,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
movw   $0xc,0xc000c20
mov    $0x64,%edi
pop    %rax
jmp    1030 <udelay@plt>

LLVM IR (-O0):
define void @mi_ta() {
store volatile i16 9, i16* inttoptr (i64 201329696 to i16*)
%1 = call i32 @udelay(i32 100)
store volatile i16 13, i16* inttoptr (i64 201329696 to i16*)
%2 = call i32 @udelay(i32 100)
store volatile i16 8, i16* inttoptr (i64 201329696 to i16*)
%3 = call i32 @udelay(i32 100)
store volatile i16 12, i16* inttoptr (i64 201329696 to i16*)
%4 = call i32 @udelay(i32 100)
ret void
}

LLVM IR (-O2):
define void @mi_ta() {
store volatile i16 9, i16* inttoptr (i64 201329696 to i16*)
%1 = tail call i32 @udelay(i32 100)
store volatile i16 13, i16* inttoptr (i64 201329696 to i16*)
%2 = tail call i32 @udelay(i32 100)
store volatile i16 8, i16* inttoptr (i64 201329696 to i16*)
%3 = tail call i32 @udelay(i32 100)
store volatile i16 12, i16* inttoptr (i64 201329696 to i16*)
%4 = tail call i32 @udelay(i32 100)
ret void
}
__attribute__((__always___)) int _xbegin(void) {
  int ret = (~0u);
  asm volatile(".byte 0xc7,0xf8 ; .long 0" : "+a"(ret)::"memory");
  return ret;
}


x86 assembly (clang, -O0):
<_xbegin>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xbegin 1114 <_xbegin+0x14>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xbegin>:
mov    $0xffffffff,%eax
xbegin 110b <_xbegin+0xb>
ret

LLVM IR (-O0):
define i32 @_xbegin() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = call i32 asm sideeffect ".byte 0xc7,0xf8 ; .long 0", "={ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @_xbegin() {
%1 = tail call i32 asm sideeffect ".byte 0xc7,0xf8 ; .long 0", "={ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 -1)
ret i32 %1
}
/* Type definitions */
struct ccnl_relay_s {
  int dummy;
};

/* Variables and functions */
long ccnl_run_events();
unsigned long ccnl_arduino_run_events(struct ccnl_relay_s *relay) {
  long int usec = ccnl_run_events();
  return usec >= 0 ? usec / 1000 : 10;
}


x86 assembly (clang, -O0):
<ccnl_arduino_run_events>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <ccnl_run_events@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1149 <ccnl_arduino_run_events+0x39>
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
jmp    1157 <ccnl_arduino_run_events+0x47>
mov    $0xa,%eax
mov    %rax,-0x18(%rbp)
jmp    1157 <ccnl_arduino_run_events+0x47>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccnl_arduino_run_events>:
push   %rax
xor    %eax,%eax
call   1030 <ccnl_run_events@plt>
test   %rax,%rax
js     113d <ccnl_arduino_run_events+0x2d>
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x7,%rax
add    %rcx,%rax
pop    %rcx
ret
mov    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ccnl_relay_s = type { i32 }
define i64 @ccnl_arduino_run_events(%struct.ccnl_relay_s* %0) {
%2 = alloca %struct.ccnl_relay_s*
%3 = alloca i64
store %struct.ccnl_relay_s* %0, %struct.ccnl_relay_s** %2
%4 = call i64 (...) @ccnl_run_events()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = icmp sge i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = sdiv i64 %8, 1000
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %7
%12 = phi i64 [ %9, %7 ], [ 10, %10 ]
ret i64 %12
}

LLVM IR (-O2):
%struct.ccnl_relay_s = type { i32 }
define i64 @ccnl_arduino_run_events(%struct.ccnl_relay_s* nocapture readnone %0) {
%2 = tail call i64 (...) @ccnl_run_events()
%3 = icmp sgt i64 %2, -1
%4 = sdiv i64 %2, 1000
%5 = select i1 %3, i64 %4, i64 10
ret i64 %5
}
/* Type definitions */
struct robot {
  int dummy;
};

/* Variables and functions */
int loc_x(struct robot *);
int cmd_loc_x(struct robot *robot, int *args) { return loc_x(robot); }


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

x86 assembly (clang, -O2):
<cmd_loc_x>:
jmp    1030 <loc_x@plt>

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

LLVM IR (-O2):
%struct.robot = type { i32 }
define i32 @cmd_loc_x(%struct.robot* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @loc_x(%struct.robot* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_RET();
void do0xD9() { _I8080_RET(); }


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

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

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

LLVM IR (-O2):
define void @do0xD9() {
%1 = tail call i32 (...) @_I8080_RET()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ prf_addr(unsigned char *, unsigned char const *,
                            int /*<<< orphan*/ *);
int /*<<< orphan*/ set_hash_addr(int /*<<< orphan*/ *, int /*<<< orphan*/);
void wots_gen_sk(unsigned char *sk, const unsigned char *sk_seed,
                 uint32_t wots_addr[8]) {
  set_hash_addr(wots_addr, 0);
  prf_addr(sk, sk_seed, wots_addr);
}


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

x86 assembly (clang, -O2):
<wots_gen_sk>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
xor    %esi,%esi
call   1030 <set_hash_addr@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <prf_addr@plt>

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

LLVM IR (-O2):
define void @wots_gen_sk(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32 @set_hash_addr(i32* %2, i32 0)
%5 = tail call i32 @prf_addr(i8* %0, i8* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M142_f(char *s) {
  debug("M142_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M142_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M142_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M142_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M142_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M142_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M142_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ run_in_shell_no_cls(char *);
void pause_shell(void) { run_in_shell_no_cls("vifm-pause"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"vifm-pause\00"
define void @pause_shell() {
%1 = call i32 @run_in_shell_no_cls(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"vifm-pause\00"
define void @pause_shell() {
%1 = tail call i32 @run_in_shell_no_cls(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
int getchar(void) {
  while (!((*(volatile unsigned int *)((0x3FF0000 + 0xD008))) & 0x20))
    ;
  return (int)(*(volatile unsigned int *)((0x3FF0000 + 0xD010)));
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <getchar+0x9>
mov    $0x3ffd008,%eax
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1128 <getchar+0x28>
jmp    112d <getchar+0x2d>
jmp    1109 <getchar+0x9>
mov    $0x3ffd010,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
testl  $0x20,0x3ffd008
je     1100 <getchar>
mov    0x3ffd010,%eax
ret

LLVM IR (-O0):
define i32 @getchar() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%3 = and i32 %2, 32
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = load volatile i32, i32* inttoptr (i64 67096592 to i32*)
ret i32 %8
}

LLVM IR (-O2):
define i32 @getchar() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 67096584 to i32*)
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 67096592 to i32*)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int target_isinf(double);
int main() {
  printf("%d %d\n", target_isinf(1234.42), target_isinf(1.0 / 5.0e-324));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
call   1030 <target_isinf@plt>
mov    %eax,-0x8(%rbp)
movsd  0xeb9(%rip),%xmm0
call   1030 <target_isinf@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xed7(%rip),%xmm0
call   1030 <target_isinf@plt>
mov    %eax,%ebx
movsd  0xed0(%rip),%xmm0
call   1030 <target_isinf@plt>
lea    0xecc(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @target_isinf(double 1.234420e+03)
%3 = call i32 @target_isinf(double 0x7FF0000000000000)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @target_isinf(double 1.234420e+03)
%2 = tail call i32 @target_isinf(double 0x7FF0000000000000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ __gen_tempname(char *, int);
char *mkdtemp(char *template) {
  if (__gen_tempname(template, 2))
    template[0] = '\0';
  return template;
}


x86 assembly (clang, -O0):
<mkdtemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <__gen_tempname@plt>
cmp    $0x0,%rax
je     113b <mkdtemp+0x2b>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdtemp>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%esi
call   1030 <__gen_tempname@plt>
test   %rax,%rax
je     1126 <mkdtemp+0x16>
movb   $0x0,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @mkdtemp(i8* returned %0) {
%2 = tail call i64 @__gen_tempname(i8* %0, i32 2)
%3 = icmp eq i64 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %0
br label %5
5: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void print_delete(int number) { fprintf(stdout, "deleted: %d\n", number); }


x86 assembly (clang, -O0):
<print_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_delete>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"deleted: %d\0A\00"
define void @print_delete(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *my_memcpy(void *dst, const void *src, size_t len) {
  if (src == NULL || dst == NULL)
    return NULL;
  return memcpy(dst, src, len);
}


x86 assembly (clang, -O0):
<my_memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     113a <my_memcpy+0x2a>
cmpq   $0x0,-0x10(%rbp)
jne    1147 <my_memcpy+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1164 <my_memcpy+0x54>
mov    -0x10(%rbp),%rdi
mov    %rdi,-0x28(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_memcpy>:
xor    %eax,%eax
test   %rdi,%rdi
je     1129 <my_memcpy+0x19>
test   %rsi,%rsi
je     1129 <my_memcpy+0x19>
push   %rbx
mov    %rdi,%rbx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @my_memcpy(i8* writeonly %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
%5 = icmp eq i8* %0, null
%6 = or i1 %5, %4
br i1 %6, label %8, label %7
7: ; preds = %3
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
br label %8
8: ; preds = %3, %7
%9 = phi i8* [ %0, %7 ], [ null, %3 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ TextGoto(int, int);
int /*<<< orphan*/ TextString(char const *);
void TextStringAt(int x, int y, const char *s) {
  TextGoto(x, y);
  TextString(s);
}


x86 assembly (clang, -O0):
<TextStringAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <TextGoto@plt>
mov    -0x10(%rbp),%rdi
call   1040 <TextString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TextStringAt>:
push   %rbx
mov    %rdx,%rbx
call   1030 <TextGoto@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <TextString@plt>

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

LLVM IR (-O2):
define void @TextStringAt(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @TextGoto(i32 %0, i32 %1)
%5 = tail call i32 @TextString(i8* %2)
ret void
}
/* Variables and functions */
int pow(double, int);
int round(int);
int BMP085_Altitude(double lastPressureReading, double baseLinePressure) {
  return round(
      44330 * (1 - pow((lastPressureReading / baseLinePressure), (1 / 5.255))));
}


x86 assembly (clang, -O0):
<BMP085_Altitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
imul   $0xad2a,%eax,%edi
call   1040 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMP085_Altitude>:
push   %rax
divsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
imul   $0xad2a,%ecx,%edi
pop    %rax
jmp    1040 <round@plt>

LLVM IR (-O0):
define i32 @BMP085_Altitude(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
%8 = call i32 @pow(double %7, i32 0)
%9 = sub nsw i32 1, %8
%10 = mul nsw i32 44330, %9
%11 = call i32 @round(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @BMP085_Altitude(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call i32 @pow(double %3, i32 0)
%5 = sub nsw i32 1, %4
%6 = mul nsw i32 %5, 44330
%7 = tail call i32 @round(i32 %6)
ret i32 %7
}
int aux_type2size(int x) {
  if (x == 'C' || x == 'c' || x == 'A')
    return 1;
  else if (x == 'S' || x == 's')
    return 2;
  else if (x == 'I' || x == 'i' || x == 'f')
    return 4;
  else
    return 0;
}


x86 assembly (clang, -O0):
<aux_type2size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x43,-0x8(%rbp)
je     1125 <aux_type2size+0x25>
cmpl   $0x63,-0x8(%rbp)
je     1125 <aux_type2size+0x25>
cmpl   $0x41,-0x8(%rbp)
jne    1131 <aux_type2size+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1182 <aux_type2size+0x82>
cmpl   $0x53,-0x8(%rbp)
je     1145 <aux_type2size+0x45>
cmpl   $0x73,-0x8(%rbp)
jne    1151 <aux_type2size+0x51>
movl   $0x2,-0x4(%rbp)
jmp    1182 <aux_type2size+0x82>
cmpl   $0x49,-0x8(%rbp)
je     116f <aux_type2size+0x6f>
cmpl   $0x69,-0x8(%rbp)
je     116f <aux_type2size+0x6f>
cmpl   $0x66,-0x8(%rbp)
jne    117b <aux_type2size+0x7b>
movl   $0x4,-0x4(%rbp)
jmp    1182 <aux_type2size+0x82>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aux_type2size>:
lea    -0x41(%rdi),%ecx
cmp    $0x22,%ecx
ja     111e <aux_type2size+0x1e>
mov    $0x1,%eax
movabs $0x400000005,%rdx
bt     %rcx,%rdx
jae    111e <aux_type2size+0x1e>
ret
mov    %edi,%ecx
and    $0xffffffdf,%ecx
mov    $0x2,%eax
cmp    $0x53,%ecx
je     111d <aux_type2size+0x1d>
add    $0xffffffb7,%edi
cmp    $0x20,%edi
ja     114a <aux_type2size+0x4a>
mov    $0x4,%eax
movabs $0x120000001,%rcx
bt     %rdi,%rcx
jb     111d <aux_type2size+0x1d>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @aux_type2size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 67
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 99
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 65
br i1 %11, label %12, label %13
12: ; preds = %9, %6, %1
store i32 1, i32* %2
br label %31
13: ; preds = %9
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 83
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 115
br i1 %18, label %19, label %20
19: ; preds = %16, %13
store i32 2, i32* %2
br label %31
20: ; preds = %16
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 73
br i1 %22, label %29, label %23
23: ; preds = %20
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 105
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = load i32, i32* %3
%28 = icmp eq i32 %27, 102
br i1 %28, label %29, label %30
29: ; preds = %26, %23, %20
store i32 4, i32* %2
br label %31
30: ; preds = %26
store i32 0, i32* %2
br label %31
31: ; preds = %30, %29, %19, %12
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @aux_type2size(i32 %0) {
switch i32 %0, label %2 [
i32 99, label %7
i32 67, label %7
i32 65, label %7
]
2: ; preds = %1
%3 = and i32 %0, -33
%4 = icmp eq i32 %3, 83
br i1 %4, label %7, label %5
5: ; preds = %2
switch i32 %0, label %6 [
i32 105, label %7
i32 102, label %7
i32 73, label %7
]
6: ; preds = %5
br label %7
7: ; preds = %5, %5, %5, %2, %1, %1, %1, %6
%8 = phi i32 [ 0, %6 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 2, %2 ], [ 4, %5 ], [ 4, %5 ], [ 4, %5 ]
ret i32 %8
}