xunge/DecIR huggingface dataset:
void clrbrd(char b[64]) {
  int i, j;
  for (i = 0; i < 8; i++)
    for (j = 0; j < 8; j++)
      b[i * 8 + j] = '-';
  b[27] = b[36] = '*';
  b[28] = b[35] = 'O';
}


x86 assembly (clang, -O0):
<clrbrd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    115f <clrbrd+0x5f>
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    114c <clrbrd+0x4c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
add    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x2d,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <clrbrd+0x20>
jmp    1151 <clrbrd+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clrbrd+0xf>
mov    -0x8(%rbp),%rax
movb   $0x2a,0x24(%rax)
mov    -0x8(%rbp),%rax
movb   $0x2a,0x1b(%rax)
mov    -0x8(%rbp),%rax
movb   $0x4f,0x23(%rax)
mov    -0x8(%rbp),%rax
movb   $0x4f,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrbrd>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,(%rdi)
movw   $0x4f2a,0x1b(%rdi)
movw   $0x2a4f,0x23(%rdi)
ret

LLVM IR (-O0):
define void @clrbrd(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %27
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %20, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 8
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, 8
%16 = load i32, i32* %4
%17 = add nsw i32 %15, %16
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %13, i64 %18
store i8 45, i8* %19
br label %20
20: ; preds = %12
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %9
23: ; preds = %9
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i64 36
store i8 42, i8* %29
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 27
store i8 42, i8* %31
%32 = load i8*, i8** %2
%33 = getelementptr inbounds i8, i8* %32, i64 35
store i8 79, i8* %33
%34 = load i8*, i8** %2
%35 = getelementptr inbounds i8, i8* %34, i64 28
store i8 79, i8* %35
ret void
}

LLVM IR (-O2):
define void @clrbrd(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 36
store i8 42, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 27
store i8 42, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 35
store i8 79, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 28
store i8 79, i8* %5
ret void
}
int findfirst(int *a, int n, int val) {
  int i;
  for (i = 0; i < n; i++) {
    if (a[i] == val)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<findfirst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <findfirst+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <findfirst+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <findfirst+0x5a>
jmp    1145 <findfirst+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <findfirst+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findfirst>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <findfirst+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <findfirst+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <findfirst+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @findfirst(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void string_print(void *s) { printf("%s", (const char *)s); }


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

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

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

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

/* Variables and functions */
struct token *buscar_token(struct lista_de_tokens *p_lista,
                           struct token *p_token) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.lista_de_tokens = type { i32 }
%struct.token = type { i32 }
define %struct.token* @buscar_token(%struct.lista_de_tokens* %0, %struct.token* %1) {
%3 = alloca %struct.lista_de_tokens*
%4 = alloca %struct.token*
store %struct.lista_de_tokens* %0, %struct.lista_de_tokens** %3
store %struct.token* %1, %struct.token** %4
ret %struct.token* null
}

LLVM IR (-O2):
%struct.lista_de_tokens = type { i32 }
%struct.token = type { i32 }
define noalias %struct.token* @buscar_token(%struct.lista_de_tokens* nocapture readnone %0, %struct.token* nocapture readnone %1) {
ret %struct.token* null
}
void x86_64_cmos_write(unsigned char addr, unsigned int value) {
  x86_64_outb(0x70, addr);
  asm volatile("jmp 1f; 1: jmp 1f; 1:");
  x86_64_outb(0x71, value);
  asm volatile("jmp 1f; 1: jmp 1f; 1:");
}


x86 assembly (clang, -O0):
<x86_64_cmos_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%esi
mov    $0x70,%edi
mov    $0x0,%al
call   1030 <x86_64_outb@plt>
jmp    1136 <x86_64_cmos_write+0x26>
jmp    113b <x86_64_cmos_write+0x2b>
mov    -0x8(%rbp),%esi
mov    $0x71,%edi
mov    $0x0,%al
call   1030 <x86_64_outb@plt>
jmp    114f <x86_64_cmos_write+0x3f>
jmp    1154 <x86_64_cmos_write+0x44>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_64_cmos_write>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
mov    $0x70,%edi
xor    %eax,%eax
call   1030 <x86_64_outb@plt>
jmp    1123 <x86_64_cmos_write+0x13>
jmp    1125 <x86_64_cmos_write+0x15>
mov    $0x71,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <x86_64_outb@plt>
jmp    1135 <x86_64_cmos_write+0x25>
jmp    1137 <x86_64_cmos_write+0x27>
pop    %rbx
ret

LLVM IR (-O0):
define void @x86_64_cmos_write(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @x86_64_outb to i32 (i32, i32, ...)*)(i32 112, i32 %6)
%8 = load i32, i32* %4
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @x86_64_outb to i32 (i32, i32, ...)*)(i32 113, i32 %8)
ret void
}

LLVM IR (-O2):
define void @x86_64_cmos_write(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @x86_64_outb to i32 (i32, i32, ...)*)(i32 112, i32 %3)
tail call void asm sideeffect "jmp 1f; 1: jmp 1f; 1:", "~{dirflag},~{fpsr},~{flags}"()
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @x86_64_outb to i32 (i32, i32, ...)*)(i32 113, i32 %1)
tail call void asm sideeffect "jmp 1f; 1: jmp 1f; 1:", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int lifted_a(unsigned int *);
int unlifted_a(unsigned int *);
unsigned unlifted_b(unsigned *x) { return unlifted_a(x) + lifted_a(x) + *x; }


x86 assembly (clang, -O0):
<unlifted_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlifted_a@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lifted_a@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
add    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlifted_b>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <unlifted_a@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <lifted_a@plt>
add    %ebp,%eax
add    (%rbx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @unlifted_b(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @unlifted_a(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @lifted_a(i32* %5)
%7 = add nsw i32 %4, %6
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = add i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @unlifted_b(i32* %0) {
%2 = tail call i32 @unlifted_a(i32* %0)
%3 = tail call i32 @lifted_a(i32* %0)
%4 = add nsw i32 %3, %2
%5 = load i32, i32* %0
%6 = add i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printPart(int *el, int len) {
  int i;
  for (i = 0; i < len; i++)
    printf("%d ", el[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<printPart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printPart+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printPart+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPart>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printPart+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printPart+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printPart(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void rtc_hal_read(uint8_t address, void *data_out, size_t num_bytes) {}


x86 assembly (clang, -O0):
<rtc_hal_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rtc_hal_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @rtc_hal_read(i32 %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void read(int n, int nums[]) {
  int i;
  for (i = 0; i < n * n; i++) {
    scanf("%d", &nums[i]);
  }
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    1161 <read+0x51>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb2(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <read+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %r15
push   %r14
push   %rbx
imul   %edi,%edi
test   %edi,%edi
je     1145 <read+0x35>
mov    %rsi,%rbx
mov    %edi,%r15d
lea    0xed7(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <read+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @read(i32 %0, i32* %1) {
%3 = mul i32 %0, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = zext i32 %3 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret void
}
int numvalue(char c) { return c - '0'; }


x86 assembly (clang, -O0):
<numvalue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numvalue>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @numvalue(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @numvalue(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_imm_op();
int /*<<< orphan*/ arm_memio_ldr(int /*<<< orphan*/);
void arm_ldr_imm() { arm_memio_ldr(arm_memio_imm_op()); }


x86 assembly (clang, -O0):
<arm_ldr_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_memio_imm_op@plt>
mov    %eax,%edi
call   1030 <arm_memio_ldr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_ldr_imm>:
push   %rax
xor    %eax,%eax
call   1040 <arm_memio_imm_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_memio_ldr@plt>

LLVM IR (-O0):
define void @arm_ldr_imm() {
%1 = call i32 (...) @arm_memio_imm_op()
%2 = call i32 @arm_memio_ldr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_ldr_imm() {
%1 = tail call i32 (...) @arm_memio_imm_op()
%2 = tail call i32 @arm_memio_ldr(i32 %1)
ret void
}
int main(void) {}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
char *getLine(FILE *fp) {
  char *line = (char *)malloc(256);
  fgets(line, 256, fp);
  return line;
}


x86 assembly (clang, -O0):
<getLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x100,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1030 <fgets@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLine>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x100,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x100,%esi
mov    %r14,%rdx
call   1030 <fgets@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @getLine(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i32* %0, i32** %2
%4 = call i64 @malloc(i32 256)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32*, i32** %2
%8 = call i32 @fgets(i8* %6, i32 256, i32* %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @getLine(i32* nocapture %0) {
%2 = tail call i64 @malloc(i32 256)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @fgets(i8* %3, i32 256, i32* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(float);
int main() {
  float a = 2, b = 3;
  a /= b;
  print("a 0.666667");
  printid(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xea5(%rip),%rdi
call   1030 <print@plt>
movss  -0x8(%rbp),%xmm0
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <print@plt>
movss  0xecb(%rip),%xmm0
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"a 0.666667\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 2.000000e+00, float* %2
store float 3.000000e+00, float* %3
%4 = load float, float* %3
%5 = load float, float* %2
%6 = fdiv float %5, %4
store float %6, float* %2
%7 = call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = load float, float* %2
%9 = call i32 @printid(float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"a 0.666667\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(float 0x3FE5555560000000)
ret i32 0
}
/* Variables and functions */
int strcmp(void const *, void const *);
int cmp(const void *a, const void *b) { return strcmp(a, b); }


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

x86 assembly (clang, -O2):
<cmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
unsigned guess_century(unsigned year) {
  if (year < 80)
    year += 100;
  return year;
}


x86 assembly (clang, -O0):
<guess_century>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x50,-0x4(%rbp)
jae    111a <guess_century+0x1a>
mov    -0x4(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<guess_century>:
lea    0x64(%rdi),%eax
cmp    $0x50,%edi
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @guess_century(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 80
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add i32 %6, 100
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @guess_century(i32 %0) {
%2 = icmp ult i32 %0, 80
%3 = add i32 %0, 100
%4 = select i1 %2, i32 %3, i32 %0
ret i32 %4
}
/* Variables and functions */
size_t strlen(char const *const);
size_t cc_str_len(char const *const restrict str) {
  return (str) ? strlen(str) : 0;
}


x86 assembly (clang, -O0):
<cc_str_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <cc_str_len+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <cc_str_len+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <cc_str_len+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_str_len>:
test   %rdi,%rdi
je     111a <cc_str_len+0xa>
jmp    1030 <strlen@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @cc_str_len(i8* noalias %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i64 [ %7, %5 ], [ 0, %8 ]
ret i64 %10
}

LLVM IR (-O2):
define i64 @cc_str_len(i8* noalias %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ GetInterval(int *, int *, int *, int);
int /*<<< orphan*/ arithmetic_encode(int, int, int, int /*<<< orphan*/ *);
void ArithEncodeSymbol(int symbol, int *counters, int totalCount, FILE *oFp) {
  int low, high;
  GetInterval(&low, &high, counters, symbol);
  arithmetic_encode(low, high, totalCount, oFp);
}


x86 assembly (clang, -O0):
<ArithEncodeSymbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    -0x24(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <GetInterval@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1030 <arithmetic_encode@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ArithEncodeSymbol>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %rsi,%rdx
mov    %edi,%ecx
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <GetInterval@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <arithmetic_encode@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @ArithEncodeSymbol(i32 %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%11 = load i32*, i32** %6
%12 = load i32, i32* %5
%13 = call i32 @GetInterval(i32* %9, i32* %10, i32* %11, i32 %12)
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = load i32, i32* %7
%17 = load i32*, i32** %8
%18 = call i32 @arithmetic_encode(i32 %14, i32 %15, i32 %16, i32* %17)
ret void
}

LLVM IR (-O2):
define void @ArithEncodeSymbol(i32 %0, i32* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %5 to i8*
%8 = bitcast i32* %6 to i8*
%9 = call i32 @GetInterval(i32* %5, i32* %6, i32* %1, i32 %0)
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @arithmetic_encode(i32 %10, i32 %11, i32 %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flop();
int /*<<< orphan*/ plot();
int main() {
label:
  plot();
  flop();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <main+0x9>
mov    $0x0,%al
call   1040 <plot@plt>
mov    $0x0,%al
call   1030 <flop@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
br label %1
1: ; preds = %0
%2 = call i32 (...) @plot()
%3 = call i32 (...) @flop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @plot()
%2 = tail call i32 (...) @flop()
ret i32 0
}
/* Variables and functions */
void *ch_flightstick_pro_init(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @ch_flightstick_pro_init() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @ch_flightstick_pro_init() {
ret i8* null
}
/* Type definitions */
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int);
char *get_unamebyid(int uid) {
  struct passwd *pw;
  pw = getpwuid(uid);
  if (!pw) {
    return NULL;
  }
  return pw->pw_name;
}


x86 assembly (clang, -O0):
<get_unamebyid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113f <get_unamebyid+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    114a <get_unamebyid+0x3a>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unamebyid>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1120 <get_unamebyid+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @get_unamebyid(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.passwd*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call %struct.passwd* @getpwuid(i32 %5)
store %struct.passwd* %6, %struct.passwd** %4
%7 = load %struct.passwd*, %struct.passwd** %4
%8 = icmp ne %struct.passwd* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %14
10: ; preds = %1
%11 = load %struct.passwd*, %struct.passwd** %4
%12 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i32 0, i32 0
%13 = load i8*, i8** %12
store i8* %13, i8** %2
br label %14
14: ; preds = %10, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @get_unamebyid(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
void foo263() {}


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

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

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

LLVM IR (-O2):
define void @foo263() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, short, char, short, short);
signed short test_func_fn(signed char a1, signed short a2, signed char a3,
                          signed short a4) {
  signed short result;
  result = a1 + a2 + a3 + a4;
  printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
  return result;
}


x86 assembly (clang, -O0):
<test_func_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dl,%cl
mov    %si,%dx
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cl,-0x5(%rbp)
mov    %ax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
movswl -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0xa(%rbp)
mov    -0x1(%rbp),%sil
mov    -0x4(%rbp),%dx
mov    -0x5(%rbp),%cl
mov    -0x8(%rbp),%ax
lea    0xe9e(%rip),%rdi
movsbl %sil,%esi
movswl %dx,%edx
movsbl %cl,%ecx
movswl %ax,%r8d
movswl -0xa(%rbp),%r9d
call   1030 <printf@plt>
movswl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_fn>:
push   %rbx
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    (%rsi,%rdx,1),%eax
add    %ecx,%eax
add    %r8d,%eax
movswl %ax,%ebx
lea    0xed4(%rip),%rdi
mov    %ebx,%r9d
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%d %d %d %d: %d\0A\00"
define signext i16 @test_func_fn(i8 signext %0, i16 signext %1, i8 signext %2, i16 signext %3) {
%5 = alloca i8
%6 = alloca i16
%7 = alloca i8
%8 = alloca i16
%9 = alloca i16
store i8 %0, i8* %5
store i16 %1, i16* %6
store i8 %2, i8* %7
store i16 %3, i16* %8
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = load i16, i16* %6
%13 = sext i16 %12 to i32
%14 = add nsw i32 %11, %13
%15 = load i8, i8* %7
%16 = sext i8 %15 to i32
%17 = add nsw i32 %14, %16
%18 = load i16, i16* %8
%19 = sext i16 %18 to i32
%20 = add nsw i32 %17, %19
%21 = trunc i32 %20 to i16
store i16 %21, i16* %9
%22 = load i8, i8* %5
%23 = load i16, i16* %6
%24 = load i8, i8* %7
%25 = load i16, i16* %8
%26 = load i16, i16* %9
%27 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %22, i16 signext %23, i8 signext %24, i16 signext %25, i16 signext %26)
%28 = load i16, i16* %9
ret i16 %28
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d %d %d %d: %d\0A\00"
define signext i16 @test_func_fn(i8 signext %0, i16 signext %1, i8 signext %2, i16 signext %3) {
%5 = sext i8 %0 to i16
%6 = add i16 %5, %1
%7 = sext i8 %2 to i16
%8 = add i16 %6, %7
%9 = add i16 %8, %3
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %0, i16 signext %1, i8 signext %2, i16 signext %3, i16 signext %9)
ret i16 %9
}
/* Variables and functions */
char nuc(int);
int xs128();
void prepare_line(char *l) {
  do {
    if (*l == 'n')
      *l = nuc(xs128() & 0x3);
  } while (*(++l));
}


x86 assembly (clang, -O0):
<prepare_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x6e,%eax
jne    1155 <prepare_line+0x35>
mov    $0x0,%al
call   1030 <xs128@plt>
mov    %eax,%edi
and    $0x3,%edi
call   1040 <nuc@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    115a <prepare_line+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,0x1(%rax)
jne    112c <prepare_line+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_line>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
add    $0x1,%rbx
jmp    113b <prepare_line+0x1b>
nopl   0x0(%rax)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1155 <prepare_line+0x35>
cmp    $0x6e,%al
jne    1130 <prepare_line+0x10>
xor    %eax,%eax
call   1030 <xs128@plt>
and    $0x3,%eax
mov    %eax,%edi
call   1040 <nuc@plt>
mov    %al,-0x1(%rbx)
jmp    1130 <prepare_line+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @prepare_line(i8* nocapture %0) {
%2 = load i8, i8* %0
br label %3
3: ; preds = %11, %1
%4 = phi i8 [ %13, %11 ], [ %2, %1 ]
%5 = phi i8* [ %12, %11 ], [ %0, %1 ]
%6 = icmp eq i8 %4, 110
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = tail call i32 (...) @xs128()
%9 = and i32 %8, 3
%10 = tail call signext i8 @nuc(i32 %9)
store i8 %10, i8* %5
br label %11
11: ; preds = %3, %7
%12 = getelementptr inbounds i8, i8* %5, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %3
15: ; preds = %11
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strlen(char const *);
int lenalphacmp(const char *s1, const char *s2) {
  int rval = strlen(s1) - strlen(s2);
  if (rval == 0)
    rval = strcmp(s1, s2);
  return rval;
}


x86 assembly (clang, -O0):
<lenalphacmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1169 <lenalphacmp+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenalphacmp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebp
je     1144 <lenalphacmp+0x24>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @lenalphacmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = sub nsw i32 %3, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %9
9: ; preds = %7, %2
%10 = phi i32 [ %8, %7 ], [ %5, %2 ]
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void TimerDisable(uint32_t ui32Base, uint32_t ui32Timer) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000000C))) &=
      ~(ui32Timer & (0x00000001 | 0x00000100));
}


x86 assembly (clang, -O0):
<TimerDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x101,%eax
xor    $0xffffffff,%eax
movslq %eax,%rdx
mov    -0x4(%rbp),%eax
add    $0xc,%eax
cltq
mov    (%rax),%rcx
and    %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerDisable>:
not    %esi
or     $0xfffffefe,%esi
movslq %esi,%rax
movslq %edi,%rcx
and    %rax,0xc(%rcx)
ret

LLVM IR (-O0):
define void @TimerDisable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 257
%7 = xor i32 %6, -1
%8 = sext i32 %7 to i64
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 12
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %8
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @TimerDisable(i32 %0, i32 %1) {
%3 = and i32 %1, 257
%4 = xor i32 %3, -1
%5 = sext i32 %4 to i64
%6 = add nsw i32 %0, 12
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
__attribute__((weak)) void I2CIntHandler(void) {}


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

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

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

LLVM IR (-O2):
define weak void @I2CIntHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CC2420CsmaP__Resource__granted();
void CC2420ControlP__Resource__granted(void) {
  CC2420CsmaP__Resource__granted();
}


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

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

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

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

/* Variables and functions */
int BIO_write(int /*<<< orphan*/ *, char const *, size_t);
int print_bio(const char *str, size_t len, void *bp) {
  return BIO_write((BIO *)bp, str, len);
}


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

x86 assembly (clang, -O2):
<print_bio>:
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rax,%rdi
jmp    1030 <BIO_write@plt>

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

LLVM IR (-O2):
define i32 @print_bio(i8* %0, i64 %1, i8* %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i32 @BIO_write(i32* %4, i8* %0, i64 %1)
ret i32 %5
}
double signf(const double a) {
  if (a > 0)
    return 1.0;
  if (a < 0)
    return -1.0;
  return 1;
}


x86 assembly (clang, -O0):
<signf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112d <signf+0x2d>
movsd  0xedd(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115a <signf+0x5a>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114d <signf+0x4d>
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115a <signf+0x5a>
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<signf>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm2
cmpltsd %xmm0,%xmm1
movsd  0xeea(%rip),%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @signf(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store double -1.000000e+00, double* %2
br label %12
11: ; preds = %7
store double 1.000000e+00, double* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load double, double* %2
ret double %13
}

LLVM IR (-O2):
define double @signf(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, double -1.000000e+00, double 1.000000e+00
%5 = select i1 %2, double 1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
void *dlvsym(void *, char const *, char *);
void *dlvsym_glibc_private(void *handle, const char *name) {
  return dlvsym(handle, name, "GLIBC_PRIVATE");
}


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

x86 assembly (clang, -O2):
<dlvsym_glibc_private>:
lea    0xee9(%rip),%rdx
jmp    1030 <dlvsym@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"GLIBC_PRIVATE\00"
define i8* @dlvsym_glibc_private(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @dlvsym(i8* %5, i8* %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"GLIBC_PRIVATE\00"
define i8* @dlvsym_glibc_private(i8* %0, i8* %1) {
%3 = tail call i8* @dlvsym(i8* %0, i8* %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_alpha(void) {
  record_linux_param_description(
      "tcp_naive_reno.c", "alpha",
      "AI increment size of window (in unit of pkt/round trip time)");
}


x86 assembly (clang, -O0):
<module_param_desc_alpha>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
lea    0xeee(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_alpha>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
lea    0xef2(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"tcp_naive_reno.c\00"
@.str.1 = [6 x i8] c"alpha\00"
@.str.2 = [61 x i8] c"AI increment size of window (in unit of pkt/round trip time)\00"
define void @module_param_desc_alpha() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"tcp_naive_reno.c\00"
@.str.1 = [6 x i8] c"alpha\00"
@.str.2 = [61 x i8] c"AI increment size of window (in unit of pkt/round trip time)\00"
define void @module_param_desc_alpha() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int mmio_get_cpsr();
int /*<<< orphan*/ mmio_set_cpsr(int);
void interrupt_fast_enable(void) { mmio_set_cpsr(mmio_get_cpsr() & ~(1 << 6)); }


x86 assembly (clang, -O0):
<interrupt_fast_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mmio_get_cpsr@plt>
mov    %eax,%edi
and    $0xffffffbf,%edi
call   1030 <mmio_set_cpsr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_fast_enable>:
push   %rax
xor    %eax,%eax
call   1040 <mmio_get_cpsr@plt>
and    $0xffffffbf,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <mmio_set_cpsr@plt>

LLVM IR (-O0):
define void @interrupt_fast_enable() {
%1 = call i32 (...) @mmio_get_cpsr()
%2 = and i32 %1, -65
%3 = call i32 @mmio_set_cpsr(i32 %2)
ret void
}

LLVM IR (-O2):
define void @interrupt_fast_enable() {
%1 = tail call i32 (...) @mmio_get_cpsr()
%2 = and i32 %1, -65
%3 = tail call i32 @mmio_set_cpsr(i32 %2)
ret void
}
/* Type definitions */
struct bst_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct bst_data *);
void bst_cleanup_task(void *group_data, void *task_data) {
  struct bst_data *data = (struct bst_data *)task_data;
  free(data);
}


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

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

LLVM IR (-O0):
%struct.bst_data = type { i32 }
define void @bst_cleanup_task(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.bst_data*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.bst_data*
store %struct.bst_data* %7, %struct.bst_data** %5
%8 = load %struct.bst_data*, %struct.bst_data** %5
%9 = call i32 @free(%struct.bst_data* %8)
ret void
}

LLVM IR (-O2):
%struct.bst_data = type { i32 }
define void @bst_cleanup_task(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to %struct.bst_data*
%4 = tail call i32 @free(%struct.bst_data* %3)
ret void
}
void ARGBPolynomialRow_AVX2() {}


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

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

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

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