xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
double wfa_timeval2double(struct timeval *);
double wfa_ftime_diff(struct timeval *t1, struct timeval *t2) {
  double dtime;
  dtime = wfa_timeval2double(t2) - wfa_timeval2double(t1);
  return dtime;
}


x86 assembly (clang, -O0):
<wfa_ftime_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <wfa_timeval2double@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <wfa_timeval2double@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfa_ftime_diff>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <wfa_timeval2double@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <wfa_timeval2double@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define double @wfa_ftime_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
%5 = alloca double
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = call double @wfa_timeval2double(%struct.timeval* %6)
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = call double @wfa_timeval2double(%struct.timeval* %8)
%10 = fsub double %7, %9
store double %10, double* %5
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define double @wfa_ftime_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = tail call double @wfa_timeval2double(%struct.timeval* %1)
%4 = tail call double @wfa_timeval2double(%struct.timeval* %0)
%5 = fsub double %3, %4
ret double %5
}
/* Variables and functions */
scalar_t__ iscntrl(int);
char *cc2str(char *p, int c) {
  if (iscntrl(c)) {
    p[0] = '^';
    p[1] = c | 0x40;
    p[2] = 0;
  } else {
    p[0] = c;
    p[1] = 0;
  }
  return (p);
}


x86 assembly (clang, -O0):
<cc2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
je     1154 <cc2str+0x44>
mov    -0x8(%rbp),%rax
movb   $0x5e,(%rax)
mov    -0xc(%rbp),%eax
or     $0x40,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x2(%rax)
jmp    1167 <cc2str+0x57>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc2str>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <iscntrl@plt>
test   %rax,%rax
je     1131 <cc2str+0x21>
movb   $0x5e,(%rbx)
or     $0x40,%bpl
movb   $0x0,0x2(%rbx)
jmp    1136 <cc2str+0x26>
mov    %bpl,(%rbx)
xor    %ebp,%ebp
mov    %bpl,0x1(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @cc2str(i8* returned writeonly %0, i32 %1) {
%3 = tail call i64 @iscntrl(i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
store i8 94, i8* %0
%6 = trunc i32 %1 to i8
%7 = or i8 %6, 64
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 0, i8* %8
br label %11
9: ; preds = %2
%10 = trunc i32 %1 to i8
store i8 %10, i8* %0
br label %11
11: ; preds = %9, %5
%12 = phi i8 [ 0, %9 ], [ %7, %5 ]
%13 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %12, i8* %13
ret i8* %0
}
unsigned long long unsignedlonglong_ignoring_signedlongint(unsigned long long x,
                                                           signed long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlonglong_ignoring_signedlongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlonglong_ignoring_signedlongint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_signedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
void i2d_RSAPrivateKey_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_RSAPrivateKey_bio() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outw(long, long);
void pwstore(long port, long value) { outw(value, port); }


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

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

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

LLVM IR (-O2):
define void @pwstore(i64 %0, i64 %1) {
%3 = tail call i32 @outw(i64 %1, i64 %0)
ret void
}
void __clear_cache(void *a, void *b) {}


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

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

LLVM IR (-O0):
define void @__clear_cache(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 @__clear_cache(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int fnRecPow(int iX, int iN) {
  if (0 == iN)
    return 1;
  else if (1 == iN)
    return iX;
  else
    return (iX * fnRecPow(iX, iN - 1));
}


x86 assembly (clang, -O0):
<fnRecPow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jne    1135 <fnRecPow+0x25>
movl   $0x1,-0x4(%rbp)
jmp    116d <fnRecPow+0x5d>
mov    $0x1,%eax
cmp    -0xc(%rbp),%eax
jne    114e <fnRecPow+0x3e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <fnRecPow+0x5d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <fnRecPow@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnRecPow>:
mov    %edi,%eax
mov    $0x1,%ecx
test   %esi,%esi
je     111f <fnRecPow+0x1f>
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%esi
je     1124 <fnRecPow+0x24>
add    $0xffffffff,%esi
imul   %eax,%ecx
test   %esi,%esi
jne    1110 <fnRecPow+0x10>
mov    $0x1,%eax
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @fnRecPow(i32 %0, i32 %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i32 [ 1, %2 ], [ %8, %6 ]
%5 = phi i32 [ %1, %2 ], [ %7, %6 ]
switch i32 %5, label %6 [
i32 0, label %9
i32 1, label %10
]
6: ; preds = %3
%7 = add nsw i32 %5, -1
%8 = mul nsw i32 %4, %0
br label %3
9: ; preds = %3
br label %10
10: ; preds = %3, %9
%11 = phi i32 [ 1, %9 ], [ %0, %3 ]
%12 = mul nsw i32 %11, %4
ret i32 %12
}
void kasan_check_read(const void *p, unsigned int size) {}


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

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

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

LLVM IR (-O2):
define void @kasan_check_read(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int f(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int size = 6;
  int vector[6] = {1, 1, 1, 1, 1, 9};
  printf("%d\n", f(vector, size));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <f@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <f@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.vector = [6 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 9]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @f(i32* %3, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int CHAR_BIT;
uint16_t swapBytes(uint16_t val) {
  uint16_t ret_val;
  uint8_t *ptr = (uint8_t *)&val;
  ret_val = *ptr << CHAR_BIT | *(ptr + 1);
  return ret_val;
}


x86 assembly (clang, -O0):
<swapBytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    0x2ec4(%rip),%rcx
mov    (%rcx),%ecx
shl    %cl,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @swapBytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
store i32* %2, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i32, i32* @CHAR_BIT
%8 = shl i32 %6, %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = or i32 %8, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @swapBytes(i32 %0) {
ret i32 poison
}
void UpdateProgress(int sofar, int total) {}


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

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

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

LLVM IR (-O2):
define void @UpdateProgress(i32 %0, i32 %1) {
ret void
}
void foo_1_1_2_1_2_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_1_2_2_1() {
ret void
}
void userfaultfd_unmap_complete(struct mm_struct *mm, struct list_head *uf) {}


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

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

LLVM IR (-O0):
%struct.mm_struct = type opaque
%struct.list_head = type opaque
define void @userfaultfd_unmap_complete(%struct.mm_struct* %0, %struct.list_head* %1) {
%3 = alloca %struct.mm_struct*
%4 = alloca %struct.list_head*
store %struct.mm_struct* %0, %struct.mm_struct** %3
store %struct.list_head* %1, %struct.list_head** %4
ret void
}

LLVM IR (-O2):
%struct.mm_struct = type opaque
%struct.list_head = type opaque
define void @userfaultfd_unmap_complete(%struct.mm_struct* nocapture %0, %struct.list_head* nocapture %1) {
ret void
}
extern int JMarray_idx(const int J, const int M) { return J * J + J + M; }


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

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

LLVM IR (-O0):
define i32 @JMarray_idx(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* %3
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @JMarray_idx(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = add nsw i32 %3, %0
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;
struct hostent {
  scalar_t__ h_addr;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
struct hostent *gethostbyname(char const *);
int /*<<< orphan*/ perror(char *);
u_long lookup(const char *host) {
  struct hostent *hp;
  if ((hp = gethostbyname(host)) == NULL) {
    perror("gethostbyname");
    exit(-1);
  }
  return *(u_long *)hp->h_addr;
}


x86 assembly (clang, -O0):
<lookup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gethostbyname@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1169 <lookup+0x39>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup>:
push   %rax
call   1030 <gethostbyname@plt>
test   %rax,%rax
je     1142 <lookup+0x12>
mov    (%rax),%rax
mov    (%rax),%eax
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.hostent = type { i64 }
@.str = [14 x i8] c"gethostbyname\00"
define i32 @lookup(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.hostent*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.hostent* @gethostbyname(i8* %4)
store %struct.hostent* %5, %struct.hostent** %3
%6 = icmp eq %struct.hostent* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
%11 = load %struct.hostent*, %struct.hostent** %3
%12 = getelementptr inbounds %struct.hostent, %struct.hostent* %11, i32 0, i32 0
%13 = load i64, i64* %12
%14 = inttoptr i64 %13 to i32*
%15 = load i32, i32* %14
ret i32 %15
}

LLVM IR (-O2):
%struct.hostent = type { i64 }
@.str = [14 x i8] c"gethostbyname\00"
define i32 @lookup(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
%3 = icmp eq %struct.hostent* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
%8 = getelementptr inbounds %struct.hostent, %struct.hostent* %2, i64 0, i32 0
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* %10
ret i32 %11
}
char max(char a, char b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jle    112c <max+0x2c>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <max+0x33>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @max(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
br label %16
13: ; preds = %2
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @max(i8 signext %0, i8 signext %1) {
%3 = icmp sgt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ AuxAdiDdiSafeRead(scalar_t__, int);
uint32_t DDI32RegRead(uint32_t ui32Base, uint32_t ui32Reg) {
  ;
  ;
  return AuxAdiDdiSafeRead(ui32Base + ui32Reg, 4);
}


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

x86 assembly (clang, -O2):
<DDI32RegRead>:
add    %rsi,%rdi
mov    $0x4,%esi
jmp    1030 <AuxAdiDdiSafeRead@plt>

LLVM IR (-O0):
define i64 @DDI32RegRead(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
%8 = call i64 @AuxAdiDdiSafeRead(i64 %7, i32 4)
ret i64 %8
}

LLVM IR (-O2):
define i64 @DDI32RegRead(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = tail call i64 @AuxAdiDdiSafeRead(i64 %3, i32 4)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(1, "abcdef", 6);
  write(2, "ABCDEF", 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xed5(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
mov    $0x2,%edi
lea    0xec6(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x6,%edx
call   1030 <write@plt>
lea    0xed9(%rip),%rsi
mov    $0x2,%edi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"abcdef\00"
@.str.1 = [7 x i8] c"ABCDEF\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%2 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
ret i32 0
}
void rt_barrier_sync(void) { ; }


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

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

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

LLVM IR (-O2):
define void @rt_barrier_sync() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dd_div(double *, double const *, double *);
void dd_div_d_dd(double a, const double *b, double *c) {
  double aa[2];
  aa[0] = a;
  aa[1] = 0.0;
  dd_div(aa, b, c);
}


x86 assembly (clang, -O0):
<dd_div_d_dd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <dd_div@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_div_d_dd>:
sub    $0x18,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
movsd  %xmm0,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
call   1030 <dd_div@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @dd_div_d_dd(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca [2 x double]
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double, double* %4
%9 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
store double %8, double* %9
%10 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 1
store double 0.000000e+00, double* %10
%11 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%12 = load double*, double** %5
%13 = load double*, double** %6
%14 = call i32 @dd_div(double* %11, double* %12, double* %13)
ret void
}

LLVM IR (-O2):
define void @dd_div_d_dd(double %0, double* %1, double* %2) {
%4 = alloca [2 x double]
%5 = bitcast [2 x double]* %4 to i8*
%6 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
store double %0, double* %6
%7 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 1
store double 0.000000e+00, double* %7
%8 = call i32 @dd_div(double* %6, double* %1, double* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pnp_set_enable(int, int);
int /*<<< orphan*/ pnp_set_iobase0(int, int);
int /*<<< orphan*/ pnp_set_logical_device(int, int);
void pc87360_enable_serial(void) {
  pnp_set_logical_device(0x2e, 0x03);
  pnp_set_enable(0x2e, 1);
  pnp_set_iobase0(0x2e, 0x3f8);
}


x86 assembly (clang, -O0):
<pc87360_enable_serial>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2e,%edi
mov    $0x3,%esi
call   1030 <pnp_set_logical_device@plt>
mov    $0x2e,%edi
mov    $0x1,%esi
call   1040 <pnp_set_enable@plt>
mov    $0x2e,%edi
mov    $0x3f8,%esi
call   1050 <pnp_set_iobase0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc87360_enable_serial>:
push   %rax
mov    $0x2e,%edi
mov    $0x3,%esi
call   1030 <pnp_set_logical_device@plt>
mov    $0x2e,%edi
mov    $0x1,%esi
call   1040 <pnp_set_enable@plt>
mov    $0x2e,%edi
mov    $0x3f8,%esi
pop    %rax
jmp    1050 <pnp_set_iobase0@plt>

LLVM IR (-O0):
define void @pc87360_enable_serial() {
%1 = call i32 @pnp_set_logical_device(i32 46, i32 3)
%2 = call i32 @pnp_set_enable(i32 46, i32 1)
%3 = call i32 @pnp_set_iobase0(i32 46, i32 1016)
ret void
}

LLVM IR (-O2):
define void @pc87360_enable_serial() {
%1 = tail call i32 @pnp_set_logical_device(i32 46, i32 3)
%2 = tail call i32 @pnp_set_enable(i32 46, i32 1)
%3 = tail call i32 @pnp_set_iobase0(i32 46, i32 1016)
ret void
}
void AIBV_plant_IMPL_AIBV_finish_control_loop() {}


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

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

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

LLVM IR (-O2):
define void @AIBV_plant_IMPL_AIBV_finish_control_loop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_adcimm(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_lsrs_imm(int, int, int);
void emit_shrsr(int t, int sr) {
  emit_andimm(sr, ~1, sr);
  emit_lsrs_imm(t, 1, t);
  emit_adcimm(sr, 0, sr);
}


x86 assembly (clang, -O0):
<emit_shrsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0xfffffffe,%esi
call   1050 <emit_andimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    $0x1,%esi
call   1040 <emit_lsrs_imm@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
xor    %esi,%esi
call   1030 <emit_adcimm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_shrsr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0xfffffffe,%esi
mov    %ebx,%edx
call   1050 <emit_andimm@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %ebp,%edx
call   1040 <emit_lsrs_imm@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <emit_adcimm@plt>

LLVM IR (-O0):
define void @emit_shrsr(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 = load i32, i32* %4
%7 = call i32 @emit_andimm(i32 %5, i32 -2, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @emit_lsrs_imm(i32 %8, i32 1, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @emit_adcimm(i32 %11, i32 0, i32 %12)
ret void
}

LLVM IR (-O2):
define void @emit_shrsr(i32 %0, i32 %1) {
%3 = tail call i32 @emit_andimm(i32 %1, i32 -2, i32 %1)
%4 = tail call i32 @emit_lsrs_imm(i32 %0, i32 1, i32 %0)
%5 = tail call i32 @emit_adcimm(i32 %1, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int yahoo_M1ObfuscatedTableCommon(int, int, unsigned char *);
int yahoo_f01_53(int Salt, int Parameter) {
  static unsigned char LUT[32] = {
      0x1A, 0x0E, 0x0A, 0x17, 0x1F, 0x08, 0x10, 0x14, 0x0C, 0x0F, 0x09,
      0x1C, 0x06, 0x18, 0x1E, 0x12, 0x15, 0x00, 0x11, 0x13, 0x0D, 0x01,
      0x0B, 0x03, 0x16, 0x19, 0x05, 0x1D, 0x02, 0x07, 0x04, 0x1B,
  };
  return yahoo_M1ObfuscatedTableCommon(Salt, Parameter, LUT);
}


x86 assembly (clang, -O0):
<yahoo_f01_53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0x2f05(%rip),%rdx
call   1030 <yahoo_M1ObfuscatedTableCommon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_53>:
lea    0x2f19(%rip),%rdx
jmp    1030 <yahoo_M1ObfuscatedTableCommon@plt>

LLVM IR (-O0):
@yahoo_f01_53.LUT = internal global [32 x i8] c"\1A\0E\0A\17\1F\08\10\14\0C\0F\09\1C\06\18\1E\12\15\00\11\13\0D\01\0B\03\16\19\05\1D\02\07\04\1B"
define i32 @yahoo_f01_53(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 @yahoo_M1ObfuscatedTableCommon(i32 %5, i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_53.LUT, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@yahoo_f01_53.LUT = internal global [32 x i8] c"\1A\0E\0A\17\1F\08\10\14\0C\0F\09\1C\06\18\1E\12\15\00\11\13\0D\01\0B\03\16\19\05\1D\02\07\04\1B"
define i32 @yahoo_f01_53(i32 %0, i32 %1) {
%3 = tail call i32 @yahoo_M1ObfuscatedTableCommon(i32 %0, i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_53.LUT, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
char *strrchr(char *, char);
char *get_filename_ext(char *filename) {
  char *dot = strrchr(filename, '.');
  if (!dot || dot == filename)
    return NULL;
  return dot + 1;
}


x86 assembly (clang, -O0):
<get_filename_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <get_filename_ext+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1154 <get_filename_ext+0x44>
movq   $0x0,-0x8(%rbp)
jmp    1160 <get_filename_ext+0x50>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename_ext>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
xor    %edx,%edx
cmp    %rbx,%rax
cmovne %rcx,%rdx
test   %rax,%rax
cmovne %rdx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_filename_ext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = select i1 %5, i8* null, i8* %6
ret i8* %7
}
/* Variables and functions */
int __C_isspace(int);
int isspace(int c) { return __C_isspace(c); }


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

x86 assembly (clang, -O2):
<isspace>:
jmp    1030 <__C_isspace@plt>

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = tail call i32 @__C_isspace(i32 %0)
ret i32 %2
}
void led_off(int led) {
  (*(volatile unsigned long *)(0xE0028000 + 0x14)) |= led;
}


x86 assembly (clang, -O0):
<led_off>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    $0xe0028014,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0xe0028014,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_off>:
movslq %edi,%rax
mov    $0xe0028014,%ecx
or     %rax,(%rcx)
ret

LLVM IR (-O0):
define void @led_off(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = load volatile i64, i64* inttoptr (i64 3758260244 to i64*)
%6 = or i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 3758260244 to i64*)
ret void
}

LLVM IR (-O2):
define void @led_off(i32 %0) {
%2 = sext i32 %0 to i64
%3 = load volatile i64, i64* inttoptr (i64 3758260244 to i64*)
%4 = or i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 3758260244 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpuCheckIrq();
int /*<<< orphan*/ cpuSetStartArray();
void cpuBranchCheck(bool takeBranch) {
  cpuCheckIrq();
  if (!takeBranch)
    cpuSetStartArray();
}


x86 assembly (clang, -O0):
<cpuBranchCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <cpuCheckIrq@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1143 <cpuBranchCheck+0x23>
mov    $0x0,%al
call   1030 <cpuSetStartArray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuBranchCheck>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <cpuCheckIrq@plt>
test   %ebx,%ebx
je     1130 <cpuBranchCheck+0x10>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1030 <cpuSetStartArray@plt>

LLVM IR (-O0):
define void @cpuBranchCheck(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cpuCheckIrq()
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (...) @cpuSetStartArray()
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @cpuBranchCheck(i32 %0) {
%2 = tail call i32 (...) @cpuCheckIrq()
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @cpuSetStartArray()
br label %6
6: ; preds = %4, %1
ret void
}
void foo179() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @solveBig() {
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c;
  while (c = getchar() != EOF)
    printf("%d\n", c);
  printf("%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x8(%rbp)
test   $0x1,%al
jne    115b <main+0x3b>
jmp    116f <main+0x4f>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%rax
je     1159 <main+0x39>
lea    0xec2(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea0(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
store i32 %7, i32* %2
br i1 %6, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %3
11: ; preds = %3
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %9, label %4
4: ; preds = %0, %4
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = tail call i64 (...) @getchar()
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %4
9: ; preds = %4, %0
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
long long NumofSheep(int a) {
  long long n = 3;
  while (a--) {
    n = (n - 1) * 2;
  }
  return n;
}


x86 assembly (clang, -O0):
<NumofSheep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x3,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1138 <NumofSheep+0x38>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <NumofSheep+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumofSheep>:
test   %edi,%edi
je     1118 <NumofSheep+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <NumofSheep+0x1e>
mov    $0x3,%eax
jmp    113f <NumofSheep+0x3f>
mov    $0x3,%eax
ret
and    $0xfffffff8,%edi
mov    $0x3,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%rax
add    $0xfffffffffffffe02,%rax
add    $0xfffffff8,%edi
jne    1130 <NumofSheep+0x30>
test   %ecx,%ecx
je     115c <NumofSheep+0x5c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    %rax,%rax
add    $0xfffffffffffffffe,%rax
add    $0xffffffff,%ecx
jne    1150 <NumofSheep+0x50>
ret

LLVM IR (-O0):
define i64 @NumofSheep(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 3, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i64, i64* %3
%10 = sub nsw i64 %9, 1
%11 = mul nsw i64 %10, 2
store i64 %11, i64* %3
br label %4
12: ; preds = %4
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @NumofSheep(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %27, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %16, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i64 [ 3, %7 ], [ %13, %9 ]
%11 = phi i32 [ 0, %7 ], [ %14, %9 ]
%12 = shl i64 %10, 8
%13 = add i64 %12, -510
%14 = add i32 %11, 8
%15 = icmp eq i32 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %3
%17 = phi i64 [ undef, %3 ], [ %13, %9 ]
%18 = phi i64 [ 3, %3 ], [ %13, %9 ]
%19 = icmp eq i32 %5, 0
br i1 %19, label %27, label %20
20: ; preds = %16, %20
%21 = phi i64 [ %24, %20 ], [ %18, %16 ]
%22 = phi i32 [ %25, %20 ], [ 0, %16 ]
%23 = shl i64 %21, 1
%24 = add i64 %23, -2
%25 = add i32 %22, 1
%26 = icmp eq i32 %25, %5
br i1 %26, label %27, label %20
27: ; preds = %16, %20, %1
%28 = phi i64 [ 3, %1 ], [ %17, %16 ], [ %24, %20 ]
ret i64 %28
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR6C_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR6C_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR6C_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putstr(char *);
void display_color(char nb) {
  my_putstr("\033[0;32m");
  my_putchar(nb + 48);
  my_putstr("\033[0m");
}


x86 assembly (clang, -O0):
<display_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xecb(%rip),%rdi
call   1040 <my_putstr@plt>
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
movsbl %al,%edi
call   1030 <my_putchar@plt>
lea    0xeb8(%rip),%rdi
call   1040 <my_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_color>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <my_putstr@plt>
add    $0x30,%bl
movsbl %bl,%edi
call   1030 <my_putchar@plt>
lea    0xec7(%rip),%rdi
pop    %rbx
jmp    1040 <my_putstr@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[0;32m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @display_color(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @my_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 48
%7 = trunc i32 %6 to i8
%8 = call i32 @my_putchar(i8 signext %7)
%9 = call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[0;32m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define void @display_color(i8 signext %0) {
%2 = tail call i32 @my_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = add i8 %0, 48
%4 = tail call i32 @my_putchar(i8 signext %3)
%5 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int ac, char **av) {
  printf("test6\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"test6\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_qsort(void **, int (*)(void const *, void const *),
                            int /*<<< orphan*/, int);
void sortPointers(void **vals, int total_elems,
                  int (*cmp)(const void *, const void *)) {
  do_qsort(vals, cmp, 0, total_elems - 1);
}


x86 assembly (clang, -O0):
<sortPointers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
xor    %edx,%edx
call   1030 <do_qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortPointers>:
lea    -0x1(%rsi),%ecx
mov    %rdx,%rsi
xor    %edx,%edx
jmp    1030 <do_qsort@plt>

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

LLVM IR (-O2):
define void @sortPointers(i8** %0, i32 %1, i32 (i8*, i8*)* %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @do_qsort(i8** %0, i32 (i8*, i8*)* %2, i32 0, i32 %4)
ret void
}
void jump_space(char **p) {
  while (**p == ' ' || **p == '\t') {
    (*p)++;
  }
  return;
}


x86 assembly (clang, -O0):
<jump_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1133 <jump_space+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1143 <jump_space+0x43>
jmp    1156 <jump_space+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <jump_space+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump_space>:
mov    (%rdi),%rax
jmp    1113 <jump_space+0x13>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,(%rdi)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
cmp    $0x20,%cl
je     1110 <jump_space+0x10>
cmp    $0x9,%cl
je     1110 <jump_space+0x10>
ret

LLVM IR (-O0):
define void @jump_space(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %17, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 32
br i1 %8, label %15, label %9
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 9
br label %15
15: ; preds = %9, %3
%16 = phi i1 [ true, %3 ], [ %14, %9 ]
br i1 %16, label %17, label %21
17: ; preds = %15
%18 = load i8**, i8*** %2
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
br label %3
21: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @jump_space(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 9, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
ret void
}
int foo(int n, unsigned m) {
  if (n < m)
    return 2;
  else
    return 3;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1122 <foo+0x22>
movl   $0x2,-0x4(%rbp)
jmp    1129 <foo+0x29>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    %esi,%edi
mov    $0x3,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 2, i32 3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ hang();
int /*<<< orphan*/ ledOn();
int /*<<< orphan*/ printf1(char *, int);
void exit(int exitCode) {
  if (exitCode > 0)
    ledOn();
  printf1("Exit with code %d. Halting.", exitCode);
  hang();
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114c <exit+0x1c>
mov    $0x0,%al
call   1040 <ledOn@plt>
mov    -0x4(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf1@plt>
mov    $0x0,%al
call   1050 <hang@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jle    113e <exit+0xe>
xor    %eax,%eax
call   1040 <ledOn@plt>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf1@plt>
xor    %eax,%eax
call   1050 <hang@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Exit with code %d. Halting.\00"
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @ledOn()
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = call i32 @printf1(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 (...) @hang()
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"Exit with code %d. Halting.\00"
define void @exit(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @ledOn()
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @printf1(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 (...) @hang()
unreachable
}