xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ Available();
scalar_t__ IsEolnChar(int /*<<< orphan*/);
int /*<<< orphan*/ NextCh();
int Eoln() { return Available() == 0 || IsEolnChar(NextCh()); }


x86 assembly (clang, -O0):
<Eoln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Available@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1169 <Eoln+0x39>
mov    $0x0,%al
call   1050 <NextCh@plt>
mov    %eax,%edi
call   1040 <IsEolnChar@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Eoln>:
push   %rax
xor    %eax,%eax
call   1030 <Available@plt>
test   %rax,%rax
je     1158 <Eoln+0x28>
xor    %eax,%eax
call   1050 <NextCh@plt>
mov    %eax,%edi
call   1040 <IsEolnChar@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Eoln() {
%1 = call i64 (...) @Available()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = call i32 (...) @NextCh()
%5 = call i64 @IsEolnChar(i32 %4)
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %3, %0
%8 = phi i1 [ true, %0 ], [ %6, %3 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @Eoln() {
%1 = tail call i64 (...) @Available()
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 (...) @NextCh()
%5 = tail call i64 @IsEolnChar(i32 %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ 1, %0 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  int i, j;
  unsigned long u, r1, r2;
  i = -16;
  j = 1;
  u = i + j;
  r1 = u >> 1;
  r2 = ((unsigned long)(i + j)) >> 1;
  if (r1 != r2)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffff0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cltq
shr    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     116a <main+0x5a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_main() {
  char *nullptr = (char *)0;
  *nullptr = 'a';
  return 0;
}


x86 assembly (clang, -O0):
<test_main>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @test_main() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
store i8 97, i8* %2
ret i32 0
}

LLVM IR (-O2):
void free_puzzle(const int k, int **puzzle) {
  const int n = k * k;
  int i;
  for (i = 0; i < n; i++)
    free(puzzle[i]);
  free(puzzle);
}


x86 assembly (clang, -O0):
<free_puzzle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <free_puzzle+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1130 <free_puzzle+0x20>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_puzzle>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
imul   %edi,%edi
test   %edi,%edi
je     1142 <free_puzzle+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_puzzle+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_puzzle(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 = mul nsw i32 %7, %8
store i32 %9, i32* %5
store i32 0, i32* %6
br label %10
10: ; preds = %21, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i32**, i32*** %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32*, i32** %15, i64 %17
%19 = load i32*, i32** %18
%20 = bitcast i32* %19 to i8*
br label %21
21: ; preds = %14
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %10
24: ; preds = %10
%25 = load i32**, i32*** %4
%26 = bitcast i32** %25 to i8*
ret void
}

LLVM IR (-O2):
define void @free_puzzle(i32 %0, i32** nocapture %1) {
%3 = mul i32 %0, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2
%6 = zext i32 %3 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32*, i32** %1, i64 %8
%10 = bitcast i32** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
%15 = bitcast i32** %1 to i8*
tail call void @free(i8* %15)
ret void
}
/* Variables and functions */
volatile bool buttonDown(volatile unsigned int *p) {
  static bool b = false;
  if (((*p) & 0x00000002) == 0x00000002) {
    if (b == false) {
      b = true;
      return true;
    } else
      return false;
  }
  b = false;
  return false;
}


x86 assembly (clang, -O0):
<buttonDown>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x2,%eax
jne    1149 <buttonDown+0x49>
cmpl   $0x0,0x2f03(%rip)
jne    113d <buttonDown+0x3d>
movl   $0x1,0x2ef3(%rip)
movl   $0x1,-0x4(%rbp)
jmp    115a <buttonDown+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    115a <buttonDown+0x5a>
movl   $0x0,0x2ed1(%rip)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<buttonDown>:
mov    (%rdi),%ecx
xor    %edx,%edx
test   $0x2,%cl
je     1119 <buttonDown+0x19>
mov    $0x1,%edx
xor    %eax,%eax
cmpb   $0x0,0x2f0d(%rip)
jne    1126 <buttonDown+0x26>
shr    %cl
and    $0x1,%cl
mov    %cl,0x2f00(%rip)
mov    %edx,%eax
ret

LLVM IR (-O0):
@buttonDown.b = internal global i32 0
define i32 @buttonDown(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 2
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @buttonDown.b
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* @buttonDown.b
store i32 1, i32* %2
br label %14
12: ; preds = %8
store i32 0, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* @buttonDown.b
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@buttonDown.b = internal unnamed_addr global i1 false
define i32 @buttonDown(i32* %0) {
%2 = load volatile i32, i32* %0
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = load i1, i1* @buttonDown.b
br i1 %6, label %10, label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %5 ], [ 0, %1 ]
%9 = xor i1 %4, true
store i1 %9, i1* @buttonDown.b
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ 0, %5 ], [ %8, %7 ]
ret i32 %11
}
int baz(int n) {
  n *= 3;
  n /= 4;
  return n;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
lea    (%rdi,%rdi,2),%ecx
lea    (%rdi,%rdi,2),%eax
add    $0x3,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @baz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 4
store i32 %6, i32* %2
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @baz(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = sdiv i32 %2, 4
ret i32 %3
}
int hiddenFunction() { return 42; }


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

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

LLVM IR (-O0):
define i32 @hiddenFunction() {
ret i32 42
}

LLVM IR (-O2):
define i32 @hiddenFunction() {
ret i32 42
}
/* Variables and functions */
int rand();
int roll_dice() { return rand() % 3; }


x86 assembly (clang, -O0):
<roll_dice>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roll_dice>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @roll_dice() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 3
ret i32 %2
}

LLVM IR (-O2):
define i32 @roll_dice() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void amaret_local_Mcu_cycle__E() { usleep(1); }


x86 assembly (clang, -O0):
<amaret_local_Mcu_cycle__E>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<amaret_local_Mcu_cycle__E>:
mov    $0x1,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @amaret_local_Mcu_cycle__E() {
%1 = call i32 @usleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @amaret_local_Mcu_cycle__E() {
%1 = tail call i32 @usleep(i32 1)
ret void
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ free(char *);
scalar_t__ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *);
void clear_msg(int len) {
  char *clear = calloc(len, 1);
  printf("%s", (char *)memset(clear, '\b', len - 1));
  free(clear);
}


x86 assembly (clang, -O0):
<clear_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
mov    $0x8,%esi
call   1050 <memset@plt>
mov    %rax,%rsi
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_msg>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,%r14
add    $0xffffffff,%ebx
mov    %rax,%rdi
mov    $0x8,%esi
mov    %ebx,%edx
call   1050 <memset@plt>
lea    0xe94(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @clear_msg(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @calloc(i32 %4, i32 1)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = call i64 @memset(i8* %6, i8 signext 8, i32 %8)
%10 = inttoptr i64 %9 to i8*
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @clear_msg(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
%3 = add nsw i32 %0, -1
%4 = tail call i64 @memset(i8* %2, i8 signext 8, i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
double mean(double *, int);
double stdev(double *, int);
double coefficient_of_variance(double *vals, int len) {
  return stdev(vals, len) / mean(vals, len);
}


x86 assembly (clang, -O0):
<coefficient_of_variance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <stdev@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <mean@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coefficient_of_variance>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <stdev@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <mean@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @coefficient_of_variance(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call double @stdev(double* %5, i32 %6)
%8 = load double*, double** %3
%9 = load i32, i32* %4
%10 = call double @mean(double* %8, i32 %9)
%11 = fdiv double %7, %10
ret double %11
}

LLVM IR (-O2):
define double @coefficient_of_variance(double* %0, i32 %1) {
%3 = tail call double @stdev(double* %0, i32 %1)
%4 = tail call double @mean(double* %0, i32 %1)
%5 = fdiv double %3, %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int ESRCH;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ thd_join(int /*<<< orphan*/, void **);
int pthread_join(pthread_t thread, void **value_ptr) {
  assert(thread);
  if (thd_join(thread, value_ptr) < 0)
    return ESRCH;
  else
    return 0;
}


x86 assembly (clang, -O0):
<pthread_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <thd_join@plt>
cmp    $0x0,%rax
jge    115e <pthread_join+0x3e>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <pthread_join+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_join>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <assert@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <thd_join@plt>
mov    0x2e9a(%rip),%rcx
sar    $0x3f,%rax
and    (%rcx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@ESRCH = global i32 0
define i32 @pthread_join(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i64 @thd_join(i32 %8, i8** %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* @ESRCH
store i32 %13, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@ESRCH = global i32 0
define i32 @pthread_join(i32 %0, i8** %1) {
%3 = tail call i32 @assert(i32 %0)
%4 = tail call i64 @thd_join(i32 %0, i8** %1)
%5 = icmp slt i64 %4, 0
%6 = load i32, i32* @ESRCH
%7 = select i1 %5, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ say_usage();
int main(void) {
  say_usage();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <say_usage@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @say_usage()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @say_usage()
ret i32 0
}
double dbl_add(double a, double b) { return a + b; }


x86 assembly (clang, -O0):
<dbl_add>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_add>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dbl_add(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @dbl_add(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
int test_imm_78int64_highword_reg(long long val) {
  return ((val >> 32) & (0x78 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_78int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x78,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_78int64_highword_reg>:
movabs $0x7800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_78int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 120
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_78int64_highword_reg(i64 %0) {
%2 = and i64 %0, 515396075520
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char const *, char const);
int strHasChar(const char *s1, const char c) { return (NULL != strchr(s1, c)); }


x86 assembly (clang, -O0):
<strHasChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strHasChar>:
push   %rax
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @strHasChar(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i32* @strchr(i8* %5, i8 signext %6)
%8 = icmp ne i32* null, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @strHasChar(i8* %0, i8 signext %1) {
%3 = tail call i32* @strchr(i8* %0, i8 signext %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char);
void ligarLampada(void *lampadas, void *idxLampada) {
  unsigned char *pLampadas = (unsigned char *)lampadas;
  unsigned int *pIdxLampada = (unsigned int *)idxLampada;
  pLampadas[*pIdxLampada] = 1;
  printf("%d\n", pLampadas[*pIdxLampada]);
}


x86 assembly (clang, -O0):
<ligarLampada>:
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    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
movb   $0x1,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
lea    0xeb1(%rip),%rdi
movzbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ligarLampada>:
mov    (%rsi),%eax
movb   $0x1,(%rdi,%rax,1)
mov    (%rsi),%eax
movzbl (%rdi,%rax,1),%esi
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @ligarLampada(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %6
%10 = load i8*, i8** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
store i8 1, i8* %14
%15 = load i8*, i8** %5
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
%20 = load i8, i8* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %20)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @ligarLampada(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 1, i8* %6
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
ret void
}
double radtodeg(double rad) { return rad * 180. / 3.14159265358979323846; }


x86 assembly (clang, -O0):
<radtodeg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radtodeg>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @radtodeg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = fdiv double %4, 0x400921FB54442D18
ret double %5
}

LLVM IR (-O2):
define double @radtodeg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = fdiv double %2, 0x400921FB54442D18
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M563_f(char *s) {
  debug("M563_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [47 x i8] c"M563_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M563_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int bits(int x) {
  int c = 0;
  while (x > 0) {
    x >>= 1;
    c++;
  }
  return c;
}


x86 assembly (clang, -O0):
<bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    112f <bits+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits>:
xor    %eax,%eax
test   %edi,%edi
jle    111c <bits+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bits+0x10>
ret

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

LLVM IR (-O2):
define i32 @bits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int rand();
void rand_doubles(int size, double *rands) {
  int i;
  for (i = 0; i < size; i++) {
    rands[i] = rand() % 10;
  }
}


x86 assembly (clang, -O0):
<rand_doubles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1160 <rand_doubles+0x50>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <rand_doubles+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_doubles>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    116a <rand_doubles+0x5a>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <rand_doubles+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @rand_doubles(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 10
%13 = sitofp i32 %12 to double
%14 = load double*, double** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
store double %13, double* %17
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @rand_doubles(i32 %0, double* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 10
%10 = sitofp i32 %9 to double
%11 = getelementptr inbounds double, double* %1, i64 %7
store double %10, double* %11
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
void g_type_plugin_use() {}


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

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

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

LLVM IR (-O2):
define void @g_type_plugin_use() {
ret void
}
int destroy_timers() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @destroy_timers() {
ret i32 0
}
int pthread_setcanceltype(int type, int *oldtype) {
  *oldtype = 0;
  return 0;
}


x86 assembly (clang, -O0):
<pthread_setcanceltype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_setcanceltype>:
movl   $0x0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pthread_setcanceltype(i32 %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
ret i32 0
}
double atan(double x) {
  puts("# ");
  puts(__FUNCTION__);
  puts("()\n");
  delay(100000000);
  (void)(x);
  return 0;
}


x86 assembly (clang, -O0):
<atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
mov    $0x0,%al
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan>:
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    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x5f5e100,%edi
xor    %eax,%eax
call   1040 <delay@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.atan = [5 x i8] c"atan\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @atan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.atan, i64 0, i64 0))
%5 = 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 = call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
%7 = load double, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [3 x i8] c"# \00"
@__FUNCTION__.atan = [5 x i8] c"atan\00"
@.str.1 = [4 x i8] c"()\0A\00"
define double @atan(double %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.atan, i64 0, i64 0))
%4 = 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))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @delay to i32 (i32, ...)*)(i32 100000000)
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ assert(void const *);
int hash_ulongptr_equal(const void *ulong_one, const void *ulong_two) {
  assert(ulong_one);
  assert(ulong_two);
  return *((unsigned long *)ulong_one) == *((unsigned long *)ulong_two);
}


x86 assembly (clang, -O0):
<hash_ulongptr_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_ulongptr_equal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    (%rbx),%rcx
xor    %eax,%eax
cmp    (%r14),%rcx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @hash_ulongptr_equal(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 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to i64*
%14 = load i64, i64* %13
%15 = icmp eq i64 %11, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @hash_ulongptr_equal(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = bitcast i8* %0 to i64*
%6 = load i64, i64* %5
%7 = bitcast i8* %1 to i64*
%8 = load i64, i64* %7
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
double sum6(double a, double b, double c, double d, double e, double f) {
  return a + b + c + d + e + f;
}


x86 assembly (clang, -O0):
<sum6>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum6>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
addsd  %xmm5,%xmm0
ret

LLVM IR (-O0):
define double @sum6(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = fadd double %13, %14
%16 = load double, double* %9
%17 = fadd double %15, %16
%18 = load double, double* %10
%19 = fadd double %17, %18
%20 = load double, double* %11
%21 = fadd double %19, %20
%22 = load double, double* %12
%23 = fadd double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @sum6(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fadd double %0, %1
%8 = fadd double %7, %2
%9 = fadd double %8, %3
%10 = fadd double %9, %4
%11 = fadd double %10, %5
ret double %11
}
void delete_listeners(struct sockaddr **addr, int *fd, int cnt) {
  ;
  for (; cnt; cnt--)
    free(addr[cnt - 1]);
  ;
  free(addr);
  free(fd);
}


x86 assembly (clang, -O0):
<delete_listeners>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1151 <delete_listeners+0x41>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <delete_listeners+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_listeners>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
test   %edx,%edx
je     1153 <delete_listeners+0x43>
mov    %edx,%r12d
movslq %edx,%rax
neg    %r12d
lea    (%r15,%rax,8),%r13
add    $0xfffffffffffffff8,%r13
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r12d
jne    1140 <delete_listeners+0x30>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.sockaddr = type opaque
define void @delete_listeners(%struct.sockaddr** %0, i32* %1, i32 %2) {
%4 = alloca %struct.sockaddr**
%5 = alloca i32*
%6 = alloca i32
store %struct.sockaddr** %0, %struct.sockaddr*** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %18, %3
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load %struct.sockaddr**, %struct.sockaddr*** %4
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds %struct.sockaddr*, %struct.sockaddr** %11, i64 %14
%16 = load %struct.sockaddr*, %struct.sockaddr** %15
%17 = bitcast %struct.sockaddr* %16 to i8*
br label %18
18: ; preds = %10
%19 = load i32, i32* %6
%20 = add nsw i32 %19, -1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
%22 = load %struct.sockaddr**, %struct.sockaddr*** %4
%23 = bitcast %struct.sockaddr** %22 to i8*
%24 = load i32*, i32** %5
%25 = bitcast i32* %24 to i8*
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type opaque
define void @delete_listeners(%struct.sockaddr** nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = sext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ %6, %5 ], [ %9, %7 ]
%9 = add nsw i64 %8, -1
%10 = getelementptr inbounds %struct.sockaddr*, %struct.sockaddr** %0, i64 %9
%11 = bitcast %struct.sockaddr** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = trunc i64 %9 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %3
%16 = bitcast %struct.sockaddr** %0 to i8*
tail call void @free(i8* %16)
%17 = bitcast i32* %1 to i8*
tail call void @free(i8* %17)
ret void
}
void s_delay() {}


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

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

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

LLVM IR (-O2):
define void @s_delay() {
ret void
}
int ath10k_thermal_register(struct ath10k *ar) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ath10k = type opaque
define i32 @ath10k_thermal_register(%struct.ath10k* nocapture readnone %0) {
ret i32 0
}
void fn_pt_1(void) {}


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

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

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

LLVM IR (-O2):
define void @fn_pt_1() {
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ wait(int *);
int main(void) {
  int status;
  pid_t pid;
  for (;;) {
    pid = fork();
    if (pid == 0) {
      return 0;
    }
    wait(&status);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
lea    -0x8(%rbp),%rdi
call   1030 <wait@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
je     1154 <main+0x34>
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <wait@plt>
xor    %eax,%eax
call   1040 <fork@plt>
test   %rax,%rax
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
store i32 0, i32* %1
br label %4
4: ; preds = %9, %0
%5 = call i64 (...) @fork()
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
ret i32 0
9: ; preds = %4
%10 = call i32 @wait(i32* %2)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 (...) @fork()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %0
ret i32 0
6: ; preds = %0, %6
%7 = call i32 @wait(i32* %1)
%8 = call i64 (...) @fork()
%9 = icmp eq i64 %8, 0
br i1 %9, label %5, label %6
}
/* Variables and functions */
int /*<<< orphan*/ dlerror();
void *dlsym(void *, char *);
char *strdup(int /*<<< orphan*/);
void *os_libfunc(char **pe, void *handle, char *function) {
  void *retval;
  if ((!(retval = dlsym(handle, function))) && (pe))
    *pe = strdup(dlerror());
  return retval;
}


x86 assembly (clang, -O0):
<os_libfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <dlsym@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1182 <os_libfunc+0x52>
cmpq   $0x0,-0x8(%rbp)
je     1182 <os_libfunc+0x52>
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_libfunc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <dlsym@plt>
mov    %rax,%rbx
test   %r14,%r14
je     1160 <os_libfunc+0x30>
test   %rbx,%rbx
jne    1160 <os_libfunc+0x30>
xor    %eax,%eax
call   1030 <dlerror@plt>
mov    %eax,%edi
call   1050 <strdup@plt>
mov    %rax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @os_libfunc(i8** writeonly %0, i8* %1, i8* %2) {
%4 = tail call i8* @dlsym(i8* %1, i8* %2)
%5 = icmp eq i8* %4, null
%6 = icmp ne i8** %0, null
%7 = and i1 %6, %5
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = tail call i32 (...) @dlerror()
%10 = tail call i8* @strdup(i32 %9)
store i8* %10, i8** %0
br label %11
11: ; preds = %8, %3
ret i8* %4
}
/* Variables and functions */
scalar_t__ ___sl_get_nondet_int();
int /*<<< orphan*/ gl_insert(scalar_t__);
void gl_read() {
  do {
    gl_insert(___sl_get_nondet_int());
  } while (___sl_get_nondet_int());
}


x86 assembly (clang, -O0):
<gl_read>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <gl_read+0x9>
mov    $0x0,%al
call   1030 <___sl_get_nondet_int@plt>
mov    %rax,%rdi
call   1040 <gl_insert@plt>
mov    $0x0,%al
call   1030 <___sl_get_nondet_int@plt>
cmp    $0x0,%rax
jne    1129 <gl_read+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gl_read>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <___sl_get_nondet_int@plt>
mov    %rax,%rdi
call   1040 <gl_insert@plt>
xor    %eax,%eax
call   1030 <___sl_get_nondet_int@plt>
test   %rax,%rax
jne    1130 <gl_read+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @gl_read() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @___sl_get_nondet_int()
%3 = call i32 @gl_insert(i64 %2)
br label %4
4: ; preds = %1
%5 = call i64 (...) @___sl_get_nondet_int()
%6 = icmp ne i64 %5, 0
br i1 %6, label %1, label %7
7: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @gl_read() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @___sl_get_nondet_int()
%3 = tail call i32 @gl_insert(i64 %2)
%4 = tail call i64 (...) @___sl_get_nondet_int()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *file_name(char *path) {
  char *slashpos = strrchr(path, '/');
  if (slashpos != NULL)
    return slashpos + 1;
  else
    return path;
}


x86 assembly (clang, -O0):
<file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <file_name+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <file_name+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_name>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @file_name(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}