xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ kill_program(char *);
void *xcalloc(size_t n, size_t size) {
  void *p;
  if (!n)
    kill_program("xcalloc: can't allocate 0 bytes");
  p = calloc(n, size);
  if (!p)
    kill_program("xcalloc: failed to allocate");
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1147 <xcalloc+0x27>
lea    0xebe(%rip),%rdi
call   1040 <kill_program@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <xcalloc+0x4f>
lea    0xeb6(%rip),%rdi
call   1040 <kill_program@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %rdi,%rdi
jne    113b <xcalloc+0x1b>
lea    0xeca(%rip),%rdi
call   1040 <kill_program@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115a <xcalloc+0x3a>
lea    0xecb(%rip),%rdi
call   1040 <kill_program@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"xcalloc: can't allocate 0 bytes\00"
@.str.1 = [28 x i8] c"xcalloc: failed to allocate\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = icmp ne i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @kill_program(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = call i8* @calloc(i64 %11, i64 %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = icmp ne i8* %14, null
br i1 %15, label %18, label %16
16: ; preds = %10
%17 = call i32 @kill_program(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %10
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [32 x i8] c"xcalloc: can't allocate 0 bytes\00"
@.str.1 = [28 x i8] c"xcalloc: failed to allocate\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @kill_program(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @kill_program(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret i8* %7
}
/* Variables and functions */
long numa_node_size64_int(int, long long *);
long numa_node_size(int node, long *freep) {
  long long f2;
  long sz = numa_node_size64_int(node, &f2);
  if (freep)
    *freep = f2;
  return sz;
}


x86 assembly (clang, -O0):
<numa_node_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <numa_node_size64_int@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <numa_node_size+0x35>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numa_node_size>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <numa_node_size64_int@plt>
test   %rbx,%rbx
je     112f <numa_node_size+0x1f>
mov    0x8(%rsp),%rcx
mov    %rcx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @numa_node_size(i32 %0, i64* writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i64 @numa_node_size64_int(i32 %0, i64* %3)
%6 = icmp eq i64* %1, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = load i64, i64* %3
store i64 %8, i64* %1
br label %9
9: ; preds = %7, %2
ret i64 %5
}
/* Variables and functions */
double calculate_angle(int /*<<< orphan*/, int /*<<< orphan*/);
int test_zero_angle() { return 0.0 == calculate_angle(0, 0); }


x86 assembly (clang, -O0):
<test_zero_angle>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <calculate_angle@plt>
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_zero_angle>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <calculate_angle@plt>
xorpd  %xmm1,%xmm1
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_zero_angle() {
%1 = call double @calculate_angle(i32 0, i32 0)
%2 = fcmp oeq double 0.000000e+00, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @test_zero_angle() {
%1 = tail call double @calculate_angle(i32 0, i32 0)
%2 = fcmp oeq double %1, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned char enrange(unsigned char x) { return x & 0x0000003f; }


x86 assembly (clang, -O0):
<enrange>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x3f,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<enrange>:
mov    %edi,%eax
and    $0x3f,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @enrange(i8 zeroext %0) {
%2 = and i8 %0, 63
ret i8 %2
}
void nlm_br_write_unlock(unsigned int flags) {}


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

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

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

LLVM IR (-O2):
define void @nlm_br_write_unlock(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printLoop(int arr[], int n) {
  for (int i = 0; i < n; i++) {
    printf("%d\n", arr[i]);
  }
}


x86 assembly (clang, -O0):
<printLoop>:
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    1157 <printLoop+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printLoop+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLoop>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printLoop+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printLoop+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @printLoop(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 @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
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void WritePreProcessorUndefineExpression(FILE *out) {
  fputs("#undef X\n", out);
  fputs("#undef _\n", out);
  fputs("#undef s\n", out);
  return;
}


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

x86 assembly (clang, -O2):
<WritePreProcessorUndefineExpression>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xed6(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xec7(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"#undef X\0A\00"
@.str.1 = [10 x i8] c"#undef _\0A\00"
@.str.2 = [10 x i8] c"#undef s\0A\00"
define void @WritePreProcessorUndefineExpression(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32* %7)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"#undef X\0A\00"
@.str.1 = [10 x i8] c"#undef _\0A\00"
@.str.2 = [10 x i8] c"#undef s\0A\00"
define void @WritePreProcessorUndefineExpression(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 9, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 9, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 9, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int __copy_user_nocache(void *, void const *, unsigned int, int /*<<< orphan*/);
__attribute__((always_)) int
__copy_from_user_inatomic_nocache(void *dst, const void *src, unsigned size) {
  return __copy_user_nocache(dst, src, size, 0);
}


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

x86 assembly (clang, -O2):
<__copy_from_user_inatomic_nocache>:
xor    %ecx,%ecx
jmp    1030 <__copy_user_nocache@plt>

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

LLVM IR (-O2):
define i32 @__copy_from_user_inatomic_nocache(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @__copy_user_nocache(i8* %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
double between(double v, double Min, double Max) {
  return v < Min ? Min : (v > Max ? Max : v);
}


x86 assembly (clang, -O0):
<between>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <between+0x36>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1169 <between+0x69>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1155 <between+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    115f <between+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<between>:
minsd  %xmm0,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm3
andnpd %xmm2,%xmm3
andpd  %xmm1,%xmm0
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @between(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load double, double* %5
br label %22
12: ; preds = %3
%13 = load double, double* %4
%14 = load double, double* %6
%15 = fcmp ogt double %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load double, double* %6
br label %20
18: ; preds = %12
%19 = load double, double* %4
br label %20
20: ; preds = %18, %16
%21 = phi double [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi double [ %11, %10 ], [ %21, %20 ]
ret double %23
}

LLVM IR (-O2):
define double @between(double %0, double %1, double %2) {
%4 = fcmp olt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %2, double %0
%7 = select i1 %4, double %1, double %6
ret double %7
}
/* Variables and functions */
int strcmp(char const *const, char const *const);
int strstrcmp(const void *a, const void *b) {
  const char *const *x = a;
  const char *const *y = b;
  return strcmp(*x, *y);
}


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

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

LLVM IR (-O0):
define i32 @strstrcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @strstrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ printf(char *);
void *UTIL_malloc(size_t n) {
  void *ptr = (void *)malloc(n);
  if (ptr)
    return ptr;
  printf("Error : cannot allocate space\n");
  exit(1);
}


x86 assembly (clang, -O0):
<UTIL_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <UTIL_malloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<UTIL_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <UTIL_malloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error : cannot allocate space\0A\00"
define i8* @UTIL_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %3
ret i8* %10
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [30 x i8] c"Error : cannot allocate space\00"
define i8* @UTIL_malloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = inttoptr i64 %2 to i8*
ret i8* %5
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int fio_lo_put(char const *, char const *, char *);
int fio_append(const char *filename, const char *text) {
  return fio_lo_put(filename, text, "a");
}


x86 assembly (clang, -O0):
<fio_append>:
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 <fio_lo_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i32 @fio_append(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 @fio_lo_put(i8* %5, i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define i32 @fio_append(i8* %0, i8* %1) {
%3 = tail call i32 @fio_lo_put(i8* %0, i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
char *scan_configfile(char *);
char *get_printserver(void) { return scan_configfile("printserver"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"printserver\00"
define i8* @get_printserver() {
%1 = call i8* @scan_configfile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"printserver\00"
define i8* @get_printserver() {
%1 = tail call i8* @scan_configfile(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ GLXFBConfig;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ glXGetFBConfigAttrib(int /*<<< orphan*/ *const,
                                        int /*<<< orphan*/, int const, int *);
int puglX11GlGetAttrib(Display *const display, GLXFBConfig fb_config,
                       const int attrib) {
  int value = 0;
  glXGetFBConfigAttrib(display, fb_config, attrib, &value);
  return value;
}


x86 assembly (clang, -O0):
<puglX11GlGetAttrib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x14(%rbp),%rcx
call   1030 <glXGetFBConfigAttrib@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puglX11GlGetAttrib>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rcx
call   1030 <glXGetFBConfigAttrib@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @puglX11GlGetAttrib(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @glXGetFBConfigAttrib(i32* %0, i32 %1, i32 %2, i32* %4)
%7 = load i32, i32* %4
ret i32 %7
}
/* Variables and functions */
char *ck_malloc(size_t);
scalar_t__ ck_memcpy(char *, char const *, size_t);
char *ck_strddup(const char *from, const char *to) {
  size_t len = to - from;
  char *c = ck_malloc(len + 1);
  *(char *)ck_memcpy(c, from, len) = '\0';
  return c;
}


x86 assembly (clang, -O0):
<ck_strddup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <ck_malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <ck_memcpy@plt>
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ck_strddup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
sub    %rdi,%rbx
lea    0x1(%rbx),%rdi
call   1040 <ck_malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <ck_memcpy@plt>
movb   $0x0,(%rax)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ck_strddup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = add i64 %12, 1
%14 = call i8* @ck_malloc(i64 %13)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i8*, i8** %3
%17 = load i64, i64* %5
%18 = call i64 @ck_memcpy(i8* %15, i8* %16, i64 %17)
%19 = inttoptr i64 %18 to i8*
store i8 0, i8* %19
%20 = load i8*, i8** %6
ret i8* %20
}

LLVM IR (-O2):
define i8* @ck_strddup(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = add i64 %5, 1
%7 = tail call i8* @ck_malloc(i64 %6)
%8 = tail call i64 @ck_memcpy(i8* %7, i8* %0, i64 %5)
%9 = inttoptr i64 %8 to i8*
store i8 0, i8* %9
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ exitfn(int);
char *nullcheck(char *s) {
  if (!s)
    exitfn(1);
  return s;
}


x86 assembly (clang, -O0):
<nullcheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1131 <nullcheck+0x21>
mov    $0x1,%edi
call   1030 <exitfn@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullcheck>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1123 <nullcheck+0x13>
mov    $0x1,%edi
call   1030 <exitfn@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @nullcheck(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exitfn(i32 1)
br label %5
5: ; preds = %3, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void fat_string_copy(char *output, char *input, int length) {
  memset(output, '\0', length + 1);
  strncpy(output, input, length);
}


x86 assembly (clang, -O0):
<fat_string_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fat_string_copy>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x1(%r15),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define void @fat_string_copy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
%10 = call i32 @memset(i8* %7, i8 signext 0, i32 %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @strncpy(i8* %11, i8* %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @fat_string_copy(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i32 @memset(i8* %0, i8 signext 0, i32 %4)
%6 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("O_DIRECT not defined\n");
  return 1;
}


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>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"O_DIRECT not defined\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 ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [21 x i8] c"O_DIRECT not defined\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int /*<<< orphan*/ O_NDELAY;
int /*<<< orphan*/ exit(int);
int fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void nonblock(int s) {
  if (fcntl(s, F_SETFL, O_NDELAY) == -1) {
    perror("Noblock");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    0x2e8a(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
jne    1174 <nonblock+0x44>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonblock>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     114f <nonblock+0x1f>
pop    %rax
ret
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@O_NDELAY = global i32 0
@.str = [8 x i8] c"Noblock\00"
define void @nonblock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NDELAY
%6 = call i32 @fcntl(i32 %3, i32 %4, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@O_NDELAY = global i32 0
@.str = [8 x i8] c"Noblock\00"
define void @nonblock(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @O_NDELAY
%4 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}
/* Type definitions */
struct OnewireDevice {
  int dummy;
};

/* Variables and functions */
float ds18b20_read_temperature(struct OnewireDevice const *);
int /*<<< orphan*/ ds18b20_start_conversion(struct OnewireDevice const *);
scalar_t__ onewire_read_byte(struct OnewireDevice const *);
float ds18b20_get_temperature(const struct OnewireDevice *therm) {
  ds18b20_start_conversion(therm);
  while (onewire_read_byte(therm) == 0)
    ;
  return ds18b20_read_temperature(therm);
}


x86 assembly (clang, -O0):
<ds18b20_get_temperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ds18b20_start_conversion@plt>
mov    -0x8(%rbp),%rdi
call   1030 <onewire_read_byte@plt>
cmp    $0x0,%rax
jne    115d <ds18b20_get_temperature+0x2d>
jmp    1145 <ds18b20_get_temperature+0x15>
mov    -0x8(%rbp),%rdi
call   1040 <ds18b20_read_temperature@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds18b20_get_temperature>:
push   %rbx
mov    %rdi,%rbx
call   1050 <ds18b20_start_conversion@plt>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <onewire_read_byte@plt>
test   %rax,%rax
je     1140 <ds18b20_get_temperature+0x10>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <ds18b20_read_temperature@plt>

LLVM IR (-O0):
%struct.OnewireDevice = type { i32 }
define float @ds18b20_get_temperature(%struct.OnewireDevice* %0) {
%2 = alloca %struct.OnewireDevice*
store %struct.OnewireDevice* %0, %struct.OnewireDevice** %2
%3 = load %struct.OnewireDevice*, %struct.OnewireDevice** %2
%4 = call i32 @ds18b20_start_conversion(%struct.OnewireDevice* %3)
br label %5
5: ; preds = %9, %1
%6 = load %struct.OnewireDevice*, %struct.OnewireDevice** %2
%7 = call i64 @onewire_read_byte(%struct.OnewireDevice* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load %struct.OnewireDevice*, %struct.OnewireDevice** %2
%12 = call float @ds18b20_read_temperature(%struct.OnewireDevice* %11)
ret float %12
}

LLVM IR (-O2):
%struct.OnewireDevice = type { i32 }
define float @ds18b20_get_temperature(%struct.OnewireDevice* %0) {
%2 = tail call i32 @ds18b20_start_conversion(%struct.OnewireDevice* %0)
br label %3
3: ; preds = %3, %1
%4 = tail call i64 @onewire_read_byte(%struct.OnewireDevice* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = tail call float @ds18b20_read_temperature(%struct.OnewireDevice* %0)
ret float %7
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t next_subset(uint64_t x, uint64_t highbit) {
  uint64_t y = x & -x;
  uint64_t c = x + y;
  x = (((x ^ c) >> 2) / y) | c;
  if (x & highbit)
    x = ((x & (highbit - 1)) << 2) | 3;
  return x;
}


x86 assembly (clang, -O0):
<next_subset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x10(%rbp),%eax
sar    $0x2,%eax
cltd
idivl  -0xc(%rbp)
or     -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1156 <next_subset+0x56>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
shl    $0x2,%eax
or     $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_subset>:
mov    %edi,%eax
mov    %edi,%ecx
neg    %ecx
and    %edi,%ecx
lea    (%rcx,%rax,1),%edi
xor    %edi,%eax
sar    $0x2,%eax
cltd
idiv   %ecx
or     %edi,%eax
lea    -0x1(%rsi),%ecx
and    %eax,%ecx
test   %esi,%eax
lea    0x3(,%rcx,4),%ecx
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @next_subset(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = sub nsw i32 0, %8
%10 = and i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %3
%15 = load i32, i32* %6
%16 = xor i32 %14, %15
%17 = ashr i32 %16, 2
%18 = load i32, i32* %5
%19 = sdiv i32 %17, %18
%20 = load i32, i32* %6
%21 = or i32 %19, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = and i32 %22, %23
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %33
26: ; preds = %2
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = sub nsw i32 %28, 1
%30 = and i32 %27, %29
%31 = shl i32 %30, 2
%32 = or i32 %31, 3
store i32 %32, i32* %3
br label %33
33: ; preds = %26, %2
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @next_subset(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
%4 = and i32 %3, %0
%5 = add nsw i32 %4, %0
%6 = xor i32 %5, %0
%7 = ashr i32 %6, 2
%8 = sdiv i32 %7, %4
%9 = or i32 %8, %5
%10 = and i32 %9, %1
%11 = icmp eq i32 %10, 0
%12 = add i32 %1, 1073741823
%13 = and i32 %9, %12
%14 = shl i32 %13, 2
%15 = or i32 %14, 3
%16 = select i1 %11, i32 %9, i32 %15
ret i32 %16
}
/* Variables and functions */
int sqlite3StrNICmp(char const *, char const *, int);
int nocaseCollatingFunc(void *NotUsed, int nKey1, const void *pKey1, int nKey2,
                        const void *pKey2) {
  int r = sqlite3StrNICmp((const char *)pKey1, (const char *)pKey2,
                          (nKey1 < nKey2) ? nKey1 : nKey2);
  if (0 == r) {
    r = nKey1 - nKey2;
  }
  return r;
}


x86 assembly (clang, -O0):
<nocaseCollatingFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1151 <nocaseCollatingFunc+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    1157 <nocaseCollatingFunc+0x47>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%edx
call   1030 <sqlite3StrNICmp@plt>
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
cmp    -0x2c(%rbp),%eax
jne    117e <nocaseCollatingFunc+0x6e>
mov    -0xc(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocaseCollatingFunc>:
push   %rbx
mov    %rdx,%rdi
mov    %esi,%ebx
sub    %ecx,%ebx
cmovl  %esi,%ecx
mov    %r8,%rsi
mov    %ecx,%edx
call   1030 <sqlite3StrNICmp@plt>
test   %eax,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nocaseCollatingFunc(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i8*, i8** %8
%13 = load i8*, i8** %10
%14 = load i32, i32* %7
%15 = load i32, i32* %9
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %5
%18 = load i32, i32* %7
br label %21
19: ; preds = %5
%20 = load i32, i32* %9
br label %21
21: ; preds = %19, %17
%22 = phi i32 [ %18, %17 ], [ %20, %19 ]
%23 = call i32 @sqlite3StrNICmp(i8* %12, i8* %13, i32 %22)
store i32 %23, i32* %11
%24 = load i32, i32* %11
%25 = icmp eq i32 0, %24
br i1 %25, label %26, label %30
26: ; preds = %21
%27 = load i32, i32* %7
%28 = load i32, i32* %9
%29 = sub nsw i32 %27, %28
store i32 %29, i32* %11
br label %30
30: ; preds = %26, %21
%31 = load i32, i32* %11
ret i32 %31
}

LLVM IR (-O2):
define i32 @nocaseCollatingFunc(i8* nocapture readnone %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = icmp slt i32 %1, %3
%7 = select i1 %6, i32 %1, i32 %3
%8 = tail call i32 @sqlite3StrNICmp(i8* %2, i8* %4, i32 %7)
%9 = icmp eq i32 %8, 0
%10 = sub nsw i32 %1, %3
%11 = select i1 %9, i32 %10, i32 %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  (void)fprintf(stderr, "usage: tetris-bsd [-ps] [-k keys] [-l level]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"usage: tetris-bsd [-ps] [-k keys] [-l level]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"usage: tetris-bsd [-ps] [-k keys] [-l level]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ yogrt_set_fudge_factor(int);
int iyogrt_set_fudge_factor__(int *seconds) {
  yogrt_set_fudge_factor(*seconds);
  return *seconds;
}


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

x86 assembly (clang, -O2):
<iyogrt_set_fudge_factor__>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <yogrt_set_fudge_factor@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @iyogrt_set_fudge_factor__(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @yogrt_set_fudge_factor(i32 %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @iyogrt_set_fudge_factor__(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @yogrt_set_fudge_factor(i32 %2)
%4 = load i32, i32* %0
ret i32 %4
}
/* Variables and functions */
void *realloc(void *, size_t);
void *cfe_realloc(void *ptr, size_t size) { return realloc(ptr, size); }


x86 assembly (clang, -O0):
<cfe_realloc>:
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 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfe_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @cfe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double nexttowardl(long double x, long double y) {
  return __infer_nondet_long_double();
}


x86 assembly (clang, -O0):
<nexttowardl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @nexttowardl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}
void free_tokens(char **tokens) {
  int i;
  for (i = 0; tokens[i] && i < 1000; i++) {
    free(tokens[i]);
  }
  free(tokens);
}


x86 assembly (clang, -O0):
<free_tokens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
xor    %eax,%eax
cmpq   $0x0,(%rcx,%rdx,8)
mov    %al,-0xd(%rbp)
je     1148 <free_tokens+0x38>
cmpl   $0x3e8,-0xc(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1158 <free_tokens+0x48>
jmp    1177 <free_tokens+0x67>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <free_tokens+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_tokens>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     114f <free_tokens+0x3f>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <free@plt>
mov    0x8(%r14,%rbx,8),%rdi
test   %rdi,%rdi
je     114f <free_tokens+0x3f>
lea    0x1(%rbx),%rax
cmp    $0x3e7,%rbx
mov    %rax,%rbx
jb     1130 <free_tokens+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_tokens(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %2, %1 ]
tail call void @free(i8* %6)
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
%11 = icmp ult i64 %5, 999
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %4, label %13
13: ; preds = %4, %1
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ free(void *);
void tor_destroy(void *self) {
  assert(self);
  free(self);
}


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

x86 assembly (clang, -O2):
<tor_destroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @tor_destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @tor_destroy(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
char digit_to_hex(int digit) {
  static const char hex_char[16] = "0123456789abcdef";
  return hex_char[digit];
}


x86 assembly (clang, -O0):
<digit_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0xeee(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_to_hex>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@digit_to_hex.hex_char = internal constant [16 x i8] c"0123456789abcdef"
define signext i8 @digit_to_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [16 x i8], [16 x i8]* @digit_to_hex.hex_char, i64 0, i64 %4
%6 = load i8, i8* %5
ret i8 %6
}

LLVM IR (-O2):
@digit_to_hex.hex_char = internal unnamed_addr constant [16 x i8] c"0123456789abcdef"
define signext i8 @digit_to_hex(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [16 x i8], [16 x i8]* @digit_to_hex.hex_char, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ drawLowerLeg();
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ pawJoint(int);
void lowerLeg(int side) {
  glPushMatrix();
  drawLowerLeg();
  pawJoint(side);
  glPopMatrix();
}


x86 assembly (clang, -O0):
<lowerLeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
mov    $0x0,%al
call   1060 <drawLowerLeg@plt>
mov    -0x4(%rbp),%edi
call   1040 <pawJoint@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowerLeg>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
xor    %eax,%eax
call   1060 <drawLowerLeg@plt>
mov    %ebx,%edi
call   1040 <pawJoint@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @lowerLeg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @glPushMatrix()
%4 = call i32 (...) @drawLowerLeg()
%5 = load i32, i32* %2
%6 = call i32 @pawJoint(i32 %5)
%7 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @lowerLeg(i32 %0) {
%2 = tail call i32 (...) @glPushMatrix()
%3 = tail call i32 (...) @drawLowerLeg()
%4 = tail call i32 @pawJoint(i32 %0)
%5 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage() {
  fprintf(stderr, "Usage: rm [-rR] [-f] <target>\n");
  return -1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: rm [-rR] [-f] <target>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: rm [-rR] [-f] <target>\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}