xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char fs_bit_mask_set(long, int);
void fs_bit_array_set(unsigned char *p, long i, int value) {
  p[i / 8] &= fs_bit_mask_set(i % 8, value);
}


x86 assembly (clang, -O0):
<fs_bit_array_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    %rdx,%rdi
mov    -0x14(%rbp),%esi
call   1030 <fs_bit_mask_set@plt>
movzbl %al,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
movzbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_bit_array_set>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x7(%rsi),%rbx
test   %rsi,%rsi
cmovns %rsi,%rbx
mov    %rbx,%rax
and    $0xfffffffffffffff8,%rax
sub    %rax,%rsi
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <fs_bit_mask_set@plt>
sar    $0x3,%rbx
and    %al,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fs_bit_array_set(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i64, i64* %5
%8 = srem i64 %7, 8
%9 = load i32, i32* %6
%10 = call zeroext i8 @fs_bit_mask_set(i64 %8, i32 %9)
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = sdiv i64 %13, 8
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = and i32 %17, %11
%19 = trunc i32 %18 to i8
store i8 %19, i8* %15
ret void
}

LLVM IR (-O2):
define void @fs_bit_array_set(i8* nocapture %0, i64 %1, i32 %2) {
%4 = srem i64 %1, 8
%5 = tail call zeroext i8 @fs_bit_mask_set(i64 %4, i32 %2)
%6 = sdiv i64 %1, 8
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = and i8 %8, %5
store i8 %9, i8* %7
ret void
}
/* Variables and functions */
int call(char *, char *);
main() { return call("hello", "world"); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <call@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 @call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
int _is_digit(char c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<_is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <_is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @_is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void RTPollSetRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPollSetRemove() {
ret void
}
int lt(int x) { return x < 0; }


x86 assembly (clang, -O0):
<lt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @lt(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
__attribute__((no)) void force_stack_alignment(void) { asm(""); }


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

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

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

LLVM IR (-O2):
define void @force_stack_alignment() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void *dlsym(void *handle, const char *symbol) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(handle);
  (void)(symbol);
  return 0;
}


x86 assembly (clang, -O0):
<dlsym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlsym>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.dlsym = [6 x i8] c"dlsym\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i8* @dlsym(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.dlsym, i64 0, i64 0))
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
ret i8* null
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.dlsym = [6 x i8] c"dlsym\00"
@.str.1 = [4 x i8] c"()\0A\00"
define i8* @dlsym(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__FUNCTION__.dlsym, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret i8* null
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t fmix32(uint32_t h) {
  h ^= h >> 16;
  h *= 0x85ebca6b;
  h ^= h >> 13;
  h *= 0xc2b2ae35;
  h ^= h >> 16;
  return h;
}


x86 assembly (clang, -O0):
<fmix32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0x85ebca6b,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xd,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0xc2b2ae35,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmix32>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
imul   $0x85ebca6b,%eax,%eax
mov    %eax,%ecx
sar    $0xd,%ecx
xor    %eax,%ecx
imul   $0xc2b2ae35,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fmix32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = mul i32 %7, -2048144789
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 13
%11 = load i32, i32* %2
%12 = xor i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = mul i32 %13, -1028477387
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 16
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @fmix32(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = mul i32 %3, -2048144789
%5 = ashr i32 %4, 13
%6 = xor i32 %5, %4
%7 = mul i32 %6, -1028477387
%8 = ashr i32 %7, 16
%9 = xor i32 %8, %7
ret i32 %9
}
int ti_avgprice_start(double const *options) {
  (void)options;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @ti_avgprice_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @ti_avgprice_start(double* nocapture readnone %0) {
ret i32 0
}
unsigned long cypher(unsigned long input, unsigned long key,
                     unsigned long *divisor) {
  if (key == 1) {
    return input;
  }
  return (input * cypher(input, key - 1, divisor)) % *divisor;
}


x86 assembly (clang, -O0):
<cypher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x1,-0x18(%rbp)
jne    113c <cypher+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1171 <cypher+0x61>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
mov    -0x20(%rbp),%rdx
call   1030 <cypher@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
imul   %rcx,%rax
mov    -0x20(%rbp),%rcx
xor    %edx,%edx
divq   (%rcx)
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cypher>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmp    $0x1,%rsi
je     114f <cypher+0x3f>
mov    %rdx,%r14
add    $0xffffffffffffffff,%rsi
mov    %rbx,%rdi
call   1030 <cypher@plt>
imul   %rbx,%rax
mov    (%r14),%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1149 <cypher+0x39>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rbx
jmp    114f <cypher+0x3f>
xor    %edx,%edx
div    %ecx
mov    %edx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @cypher(i64 %0, i64 %1, i64* nocapture %2) {
%4 = icmp eq i64 %1, 1
br i1 %4, label %5, label %7
5: ; preds = %3, %7
%6 = phi i64 [ %12, %7 ], [ %0, %3 ]
ret i64 %6
7: ; preds = %3
%8 = add i64 %1, -1
%9 = tail call i64 @cypher(i64 %0, i64 %8, i64* %2)
%10 = mul i64 %9, %0
%11 = load i64, i64* %2
%12 = urem i64 %10, %11
br label %5
}
/* Variables and functions */
int _fitness(char *);
int fit_cmp(const void *el1, const void *el2) {
  int a = _fitness((char *)el1);
  int b = _fitness((char *)el2);
  if (a > b)
    return 1;
  if (a < b)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<fit_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <_fitness@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <_fitness@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1150 <fit_cmp+0x40>
movl   $0x1,-0x4(%rbp)
jmp    116f <fit_cmp+0x5f>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1168 <fit_cmp+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <fit_cmp+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fit_cmp>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <_fitness@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <_fitness@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
setl   %cl
neg    %ecx
cmp    %eax,%ebp
mov    $0x1,%eax
cmovle %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fit_cmp(i8* %0, i8* %1) {
%3 = tail call i32 @_fitness(i8* %0)
%4 = tail call i32 @_fitness(i8* %1)
%5 = icmp sgt i32 %3, %4
%6 = icmp slt i32 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
int dpll_cascading_blocker_hold(struct device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @dpll_cascading_blocker_hold(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @dpll_cascading_blocker_hold(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__4__GeneralIO__makeOutput();
void CC2420ControlP__RSTN__makeOutput(void) {
  Msp430GpioC__4__GeneralIO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @CC2420ControlP__RSTN__makeOutput() {
%1 = tail call i32 (...) @Msp430GpioC__4__GeneralIO__makeOutput()
ret void
}
/* Type definitions */
struct map_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ map_free(struct map_node *);
struct map_node *map_search(unsigned int);
int map_del(unsigned int id) {
  struct map_node *node;
  node = map_search(id);
  if (node) {
    map_free(node);
  }
  return (0);
}


x86 assembly (clang, -O0):
<map_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <map_search@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114b <map_del+0x2b>
mov    -0x10(%rbp),%rdi
call   1040 <map_free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_del>:
push   %rax
call   1030 <map_search@plt>
test   %rax,%rax
je     1133 <map_del+0x13>
mov    %rax,%rdi
call   1040 <map_free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.map_node = type { i32 }
define i32 @map_del(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.map_node*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.map_node* @map_search(i32 %4)
store %struct.map_node* %5, %struct.map_node** %3
%6 = load %struct.map_node*, %struct.map_node** %3
%7 = icmp ne %struct.map_node* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.map_node*, %struct.map_node** %3
%10 = call i32 @map_free(%struct.map_node* %9)
br label %11
11: ; preds = %8, %1
ret i32 0
}

LLVM IR (-O2):
%struct.map_node = type { i32 }
define i32 @map_del(i32 %0) {
%2 = tail call %struct.map_node* @map_search(i32 %0)
%3 = icmp eq %struct.map_node* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @map_free(%struct.map_node* %2)
br label %6
6: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int Calculator_add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  printf("The sum is %i\n", Calculator_add(2, 6));
  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)
mov    $0x2,%edi
mov    $0x6,%esi
call   1040 <Calculator_add@plt>
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"The sum is %i\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 @Calculator_add(i32 2, i32 6)
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"The sum is %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @Calculator_add(i32 2, i32 6)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void searches_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @searches_setup() {
ret void
}
unsigned long int F1(unsigned long int x, unsigned long int y,
                     unsigned long int z) {
  return (z ^ (x & (y ^ z)));
}


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

x86 assembly (clang, -O2):
<F1>:
mov    %rsi,%rax
xor    %rdx,%rax
and    %rdi,%rax
xor    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @F1(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = xor i64 %9, %10
%12 = and i64 %8, %11
%13 = xor i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @F1(i64 %0, i64 %1, i64 %2) {
%4 = xor i64 %2, %1
%5 = and i64 %4, %0
%6 = xor i64 %5, %2
ret i64 %6
}
/* Type definitions */
struct typ {
  int dummy;
};
struct module {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_typ_create_ungenarg_update_genargs(struct module *,
                                                         struct typ *);
void typ_create_ungenarg_update_genargs(struct module *trigger_mod,
                                        struct typ *r) {
  do_typ_create_ungenarg_update_genargs(trigger_mod, r);
}


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

x86 assembly (clang, -O2):
<typ_create_ungenarg_update_genargs>:
jmp    1030 <do_typ_create_ungenarg_update_genargs@plt>

LLVM IR (-O0):
%struct.module = type { i32 }
%struct.typ = type { i32 }
define void @typ_create_ungenarg_update_genargs(%struct.module* %0, %struct.typ* %1) {
%3 = alloca %struct.module*
%4 = alloca %struct.typ*
store %struct.module* %0, %struct.module** %3
store %struct.typ* %1, %struct.typ** %4
%5 = load %struct.module*, %struct.module** %3
%6 = load %struct.typ*, %struct.typ** %4
%7 = call i32 @do_typ_create_ungenarg_update_genargs(%struct.module* %5, %struct.typ* %6)
ret void
}

LLVM IR (-O2):
%struct.module = type { i32 }
%struct.typ = type { i32 }
define void @typ_create_ungenarg_update_genargs(%struct.module* %0, %struct.typ* %1) {
%3 = tail call i32 @do_typ_create_ungenarg_update_genargs(%struct.module* %0, %struct.typ* %1)
ret void
}
void line_cut_before(char *str, char c) {
  while (*str) {
    if (*str == c) {
      *str = 0;
      return;
    }
    ++str;
  }
}


x86 assembly (clang, -O0):
<line_cut_before>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <line_cut_before+0x4b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113a <line_cut_before+0x3a>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    114b <line_cut_before+0x4b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <line_cut_before+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_cut_before>:
mov    (%rdi),%al
test   %al,%al
je     1120 <line_cut_before+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    %sil,%al
je     1121 <line_cut_before+0x21>
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <line_cut_before+0x10>
ret
movb   $0x0,-0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @line_cut_before(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = icmp eq i8 %6, %1
br i1 %8, label %9, label %10
9: ; preds = %5
store i8 0, i8* %7
br label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %10, %2, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ askQuestions(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand((time(NULL)));
  askQuestions(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0xa,%edi
call   1030 <askQuestions@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0xa,%edi
call   1030 <askQuestions@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 @askQuestions(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 @askQuestions(i32 10)
ret i32 0
}
/* Type definitions */
struct userpos {
  int dummy;
};
struct user {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ simuserfull(struct userpos *, struct user *, char,
                               int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void simuser(struct userpos *state, struct user *usr, char addsegments) {
  simuserfull(state, usr, addsegments, 0, 0, 0);
}


x86 assembly (clang, -O0):
<simuser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %r9d,%r9d
movsbl -0x11(%rbp),%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <simuserfull@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simuser>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <simuserfull@plt>

LLVM IR (-O0):
%struct.userpos = type { i32 }
%struct.user = type { i32 }
define void @simuser(%struct.userpos* %0, %struct.user* %1, i8 signext %2) {
%4 = alloca %struct.userpos*
%5 = alloca %struct.user*
%6 = alloca i8
store %struct.userpos* %0, %struct.userpos** %4
store %struct.user* %1, %struct.user** %5
store i8 %2, i8* %6
%7 = load %struct.userpos*, %struct.userpos** %4
%8 = load %struct.user*, %struct.user** %5
%9 = load i8, i8* %6
%10 = call i32 @simuserfull(%struct.userpos* %7, %struct.user* %8, i8 signext %9, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.userpos = type { i32 }
%struct.user = type { i32 }
define void @simuser(%struct.userpos* %0, %struct.user* %1, i8 signext %2) {
%4 = tail call i32 @simuserfull(%struct.userpos* %0, %struct.user* %1, i8 signext %2, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ mysleep(int);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
int main(void) {
  alarm(4);
  mysleep(2);
  printf("1\n");
  while (1)
    pause();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <alarm@plt>
mov    $0x2,%edi
call   1030 <mysleep@plt>
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <pause@plt>
jmp    116f <main+0x2f>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1050 <alarm@plt>
mov    $0x2,%edi
call   1030 <mysleep@plt>
lea    0xea4(%rip),%rdi
call   1040 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <pause@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @alarm(i32 4)
%3 = call i32 @mysleep(i32 2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @pause()
br label %5
}

LLVM IR (-O2):
@str = [2 x i8] c"1\00"
define i32 @main() {
%1 = tail call i32 @alarm(i32 4)
%2 = tail call i32 @mysleep(i32 2)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @pause()
br label %4
}
/* Type definitions */
struct uwsgi_stats {
  int dummy;
};

/* Variables and functions */
int uwsgi_stats_comma(struct uwsgi_stats *);
int uwsgi_stats_keyval(struct uwsgi_stats *, char *, char *);
int uwsgi_stats_keyval_comma(struct uwsgi_stats *us, char *key, char *value) {
  int ret = uwsgi_stats_keyval(us, key, value);
  if (ret)
    return -1;
  return uwsgi_stats_comma(us);
}


x86 assembly (clang, -O0):
<uwsgi_stats_keyval_comma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <uwsgi_stats_keyval@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     115e <uwsgi_stats_keyval_comma+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <uwsgi_stats_keyval_comma+0x4a>
mov    -0x10(%rbp),%rdi
call   1030 <uwsgi_stats_comma@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_stats_keyval_comma>:
push   %rbx
mov    %rdi,%rbx
call   1040 <uwsgi_stats_keyval@plt>
test   %eax,%eax
je     1134 <uwsgi_stats_keyval_comma+0x14>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <uwsgi_stats_comma@plt>

LLVM IR (-O0):
%struct.uwsgi_stats = type { i32 }
define i32 @uwsgi_stats_keyval_comma(%struct.uwsgi_stats* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.uwsgi_stats*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store %struct.uwsgi_stats* %0, %struct.uwsgi_stats** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load %struct.uwsgi_stats*, %struct.uwsgi_stats** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i32 @uwsgi_stats_keyval(%struct.uwsgi_stats* %9, i8* %10, i8* %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 -1, i32* %4
br label %19
16: ; preds = %3
%17 = load %struct.uwsgi_stats*, %struct.uwsgi_stats** %5
%18 = call i32 @uwsgi_stats_comma(%struct.uwsgi_stats* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %16, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.uwsgi_stats = type { i32 }
define i32 @uwsgi_stats_keyval_comma(%struct.uwsgi_stats* %0, i8* %1, i8* %2) {
%4 = tail call i32 @uwsgi_stats_keyval(%struct.uwsgi_stats* %0, i8* %1, i8* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @uwsgi_stats_comma(%struct.uwsgi_stats* %0)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
double sqrt(double);
double pythag(double side_a, double side_b) {
  return (sqrt((side_a * side_a) + (side_b * side_b)));
}


x86 assembly (clang, -O0):
<pythag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pythag>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <pythag+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @pythag(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @pythag(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
/* Type definitions */
typedef enum beaglelogic_sampleunit {
  ____Placeholder_beaglelogic_sampleunit
} beaglelogic_sampleunit;

/* Variables and functions */
int /*<<< orphan*/ _IOR(char, int, int /*<<< orphan*/);
int ioctl(int, int /*<<< orphan*/, int *);
int /*<<< orphan*/ uint32_t;
int beaglelogic_get_sampleunit(int fd,
                               enum beaglelogic_sampleunit *sampleunit) {
  return ioctl(fd, _IOR('k', 0x22, uint32_t), sampleunit);
}


x86 assembly (clang, -O0):
<beaglelogic_get_sampleunit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
mov    $0x6b,%edi
mov    $0x22,%esi
call   1040 <_IOR@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beaglelogic_get_sampleunit>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    $0x6b,%edi
mov    $0x22,%esi
call   1040 <_IOR@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@uint32_t = global i32 0
define i32 @beaglelogic_get_sampleunit(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* @uint32_t
%7 = call i32 @_IOR(i8 signext 107, i32 34, i32 %6)
%8 = load i32*, i32** %4
%9 = call i32 @ioctl(i32 %5, i32 %7, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
@uint32_t = global i32 0
define i32 @beaglelogic_get_sampleunit(i32 %0, i32* %1) {
%3 = load i32, i32* @uint32_t
%4 = tail call i32 @_IOR(i8 signext 107, i32 34, i32 %3)
%5 = tail call i32 @ioctl(i32 %0, i32 %4, i32* %1)
ret i32 %5
}
/* Variables and functions */
float fabsf(float);
bool almostequal(float a, float b) { return fabsf(a - b) < 0.001f; }


x86 assembly (clang, -O0):
<almostequal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
movaps 0xef1(%rip),%xmm0
pand   %xmm0,%xmm1
movss  0xed5(%rip),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<almostequal>:
subss  %xmm1,%xmm0
andps  0xef5(%rip),%xmm0
movss  0xefd(%rip),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @almostequal(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = call float @llvm.fabs.f32(float %7)
%9 = fcmp olt float %8, 0x3F50624DE0000000
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @almostequal(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @llvm.fabs.f32(float %3)
%5 = fcmp olt float %4, 0x3F50624DE0000000
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int ceil(double);
int floor(double);
int round_near(double number) {
  return number < 0.0 ? ceil(number - 0.5) : floor(number + 0.5);
}


x86 assembly (clang, -O0):
<round_near>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1159 <round_near+0x39>
movsd  -0x8(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,-0xc(%rbp)
jmp    116e <round_near+0x4e>
movsd  0xe9f(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_near>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1137 <round_near+0x17>
addsd  0xed6(%rip),%xmm0
jmp    1030 <ceil@plt>
addsd  0xec1(%rip),%xmm0
jmp    1040 <floor@plt>

LLVM IR (-O0):
define i32 @round_near(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fsub double %6, 5.000000e-01
%8 = call i32 @ceil(double %7)
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fadd double %10, 5.000000e-01
%12 = call i32 @floor(double %11)
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %8, %5 ], [ %12, %9 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @round_near(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, -5.000000e-01
%5 = tail call i32 @ceil(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, 5.000000e-01
%8 = tail call i32 @floor(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ %5, %3 ], [ %8, %6 ]
ret i32 %10
}
long double mass_forceAcceleration(long double F, long double A) {
  return F / A;
}


x86 assembly (clang, -O0):
<mass_forceAcceleration>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fdivrp %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mass_forceAcceleration>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fdivp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @mass_forceAcceleration(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 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fdiv x86_fp80 %5, %6
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @mass_forceAcceleration(x86_fp80 %0, x86_fp80 %1) {
%3 = fdiv x86_fp80 %0, %1
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
unsigned int __VERIFIER_nondet_uint();
int main(void) {
  unsigned int a = __VERIFIER_nondet_uint();
  __VERIFIER_assert(a != 1);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_uint@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_uint@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0x1,%eax
setne  %dil
call   1030 <__VERIFIER_assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_uint()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @__VERIFIER_assert(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_uint()
%2 = icmp ne i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assert(i32 %3)
ret i32 %1
}
/* Variables and functions */
scalar_t__ motor_clicks(int);
int recharger_is_moving() {
  int i;
  for (i = 0; i < 3; i++)
    if (motor_clicks(i) != 0)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<recharger_is_moving>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    115a <recharger_is_moving+0x4a>
mov    -0x8(%rbp),%edi
call   1030 <motor_clicks@plt>
cmp    $0x0,%rax
je     1147 <recharger_is_moving+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1161 <recharger_is_moving+0x51>
jmp    114c <recharger_is_moving+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111f <recharger_is_moving+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recharger_is_moving>:
push   %rbx
xor    %edi,%edi
call   1030 <motor_clicks@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    1148 <recharger_is_moving+0x38>
mov    $0x1,%ebx
mov    $0x1,%edi
call   1030 <motor_clicks@plt>
test   %rax,%rax
jne    1148 <recharger_is_moving+0x38>
mov    $0x2,%edi
call   1030 <motor_clicks@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @recharger_is_moving() {
%1 = tail call i64 @motor_clicks(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i64 @motor_clicks(i32 1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @motor_clicks(i32 2)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %0 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
int msc_version_to_dll_version(int msc_version) {
  if (msc_version == 800) {
    return 10;
  } else {
    return (msc_version / 10) - 60;
  }
}


x86 assembly (clang, -O0):
<msc_version_to_dll_version>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x320,-0x8(%rbp)
jne    1120 <msc_version_to_dll_version+0x20>
movl   $0xa,-0x4(%rbp)
jmp    1131 <msc_version_to_dll_version+0x31>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
sub    $0x3c,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<msc_version_to_dll_version>:
mov    $0xa,%eax
cmp    $0x320,%edi
je     1127 <msc_version_to_dll_version+0x27>
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
sar    $0x22,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0xffffffc4,%eax
ret

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

LLVM IR (-O2):
define i32 @msc_version_to_dll_version(i32 %0) {
%2 = icmp eq i32 %0, 800
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = sdiv i32 %0, 10
%5 = add nsw i32 %4, -60
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 10, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x80() {
  Assert_real((iscntrl(128) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              645, ("iscntrl should be 0 for 0x80"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x80>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x285,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x80>:
push   %rax
mov    $0x80,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x285,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x80\00"
define void @t_iscntrl_0x80() {
%1 = call i64 @iscntrl(i32 128)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 645, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x80\00"
define void @t_iscntrl_0x80() {
%1 = tail call i64 @iscntrl(i32 128)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 645, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void sync_primitive(void) {}


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

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

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

LLVM IR (-O2):
define void @sync_primitive() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ret = malloc(size);
  if (ret == NULL)
    exit(EXIT_FAILURE);
  return ret;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <xmalloc+0x32>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     112d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("usage: csv [-VhsSqQ] [-d delimiter] [-r repl] [-n repl] "
         "[file ...]\n");
  exit(100);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"usage: csv [-VhsSqQ] [-d delimiter] [-r repl] [-n repl] [file ...]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 100)
unreachable
}

LLVM IR (-O2):
@str = [67 x i8] c"usage: csv [-VhsSqQ] [-d delimiter] [-r repl] [-n repl] [file ...]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 100)
unreachable
}