xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t lstSize(char **lst) {
  if (!lst) {
    return 0;
  }
  size_t i = 0;
  while (lst[i]) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<lstSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <lstSize+0x20>
movq   $0x0,-0x8(%rbp)
jmp    1154 <lstSize+0x54>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     114c <lstSize+0x4c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <lstSize+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstSize>:
test   %rdi,%rdi
je     1120 <lstSize+0x20>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <lstSize+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @lstSize(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %4, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int free_db(char **ptr, int numlines) {
  int i;
  for (i = 0; i < numlines; ++i)
    free(*(ptr + i));
  return 0;
}


x86 assembly (clang, -O0):
<free_db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_db+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_db+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_db>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <free_db+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_db+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @free_db(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @free(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dposv_(char *, int *, int *, double *, int *, double *,
                          int *, int *);
int dposv(char UPLO, int N, int NRHS, double *A, int LDA, double *B, int LDB) {
  int INFO;
  dposv_(&UPLO, &N, &NRHS, A, &LDA, B, &LDB, &INFO);
  return INFO;
}


x86 assembly (clang, -O0):
<dposv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    0x10(%rbp),%edi
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%r9
lea    -0x1(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x1c(%rbp),%r8
lea    0x10(%rbp),%r10
lea    -0x2c(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dposv_@plt>
mov    -0x2c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dposv>:
sub    $0x18,%rsp
mov    %dil,0x7(%rsp)
mov    %esi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x8(%rsp),%rax
lea    0x20(%rsp),%r10
lea    0x7(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
push   %rax
push   %r10
call   1030 <dposv_@plt>
add    $0x10,%rsp
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @dposv(i8 signext %0, i32 %1, i32 %2, double* %3, i32 %4, double* %5, i32 %6) {
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32
store i8 %0, i8* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double* %3, double** %11
store i32 %4, i32* %12
store double* %5, double** %13
store i32 %6, i32* %14
%16 = load double*, double** %11
%17 = load double*, double** %13
%18 = call i32 @dposv_(i8* %8, i32* %9, i32* %10, double* %16, i32* %12, double* %17, i32* %14, i32* %15)
%19 = load i32, i32* %15
ret i32 %19
}

LLVM IR (-O2):
define i32 @dposv(i8 signext %0, i32 %1, i32 %2, double* %3, i32 %4, double* %5, i32 %6) {
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8 %0, i8* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %4, i32* %11
store i32 %6, i32* %12
%14 = bitcast i32* %13 to i8*
%15 = call i32 @dposv_(i8* %8, i32* %9, i32* %10, double* %3, i32* %11, double* %5, i32* %12, i32* %13)
%16 = load i32, i32* %13
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ write_log_file(char *, char *, int);
void log_data_two(char *log_path, char *message, char *message1, int watch_id) {
  char str_message[300];
  strcat(str_message, message);
  strcat(str_message, message1);
  write_log_file(log_path, str_message, watch_id);
}


x86 assembly (clang, -O0):
<log_data_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0x150(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcat@plt>
lea    -0x150(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    -0x150(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <write_log_file@plt>
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_data_two>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x138,%rsp
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%r15
mov    %rsp,%rbp
mov    %rbp,%rdi
call   1030 <strcat@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcat@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
call   1040 <write_log_file@plt>
add    $0x138,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @log_data_two(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [300 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [300 x i8], [300 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = getelementptr inbounds [300 x i8], [300 x i8]* %9, i64 0, i64 0
%14 = load i8*, i8** %7
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = load i8*, i8** %5
%17 = getelementptr inbounds [300 x i8], [300 x i8]* %9, i64 0, i64 0
%18 = load i32, i32* %8
%19 = call i32 @write_log_file(i8* %16, i8* %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @log_data_two(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca [300 x i8]
%6 = getelementptr inbounds [300 x i8], [300 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcat(i8* %6, i8* %1)
%8 = call i32 @strcat(i8* %6, i8* %2)
%9 = call i32 @write_log_file(i8* %0, i8* %6, i32 %3)
ret void
}
int do_895() { return 895; }


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

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

LLVM IR (-O0):
define i32 @do_895() {
ret i32 895
}

LLVM IR (-O2):
define i32 @do_895() {
ret i32 895
}
/* Variables and functions */
int /*<<< orphan*/ fixdown_max_heap(int *, int, int);
int parent(int);
void build_max_heap(int *array, int end) {
  if (end <= 1) {
    return;
  }
  int i = parent(end - 1);
  for (; i >= 0; --i) {
    fixdown_max_heap(array, i, end);
  }
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     113e <build_max_heap+0x1e>
jmp    1173 <build_max_heap+0x53>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <parent@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1173 <build_max_heap+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <fixdown_max_heap@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    114c <build_max_heap+0x2c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1151 <build_max_heap+0x31>
mov    %esi,%ebx
mov    %rdi,%r14
lea    -0x1(%rbx),%edi
call   1030 <parent@plt>
test   %eax,%eax
js     1151 <build_max_heap+0x31>
mov    %eax,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <fixdown_max_heap@plt>
add    $0xffffffff,%ebp
jb     1140 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = tail call i32 @parent(i32 %5)
%7 = icmp sgt i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %4, %8
%9 = phi i32 [ %11, %8 ], [ %6, %4 ]
%10 = tail call i32 @fixdown_max_heap(i32* %0, i32 %9, i32 %1)
%11 = add nsw i32 %9, -1
%12 = icmp eq i32 %9, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %4, %2
ret void
}
int _XMP_modi_i_i(int value, int cycle) {
  int mod = value % cycle;
  if (mod < 0) {
    return (mod += cycle) % cycle;
  } else {
    return mod;
  }
}


x86 assembly (clang, -O0):
<_XMP_modi_i_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1133 <_XMP_modi_i_i+0x33>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
jmp    1139 <_XMP_modi_i_i+0x39>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_XMP_modi_i_i>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
test   %edx,%edx
js     110c <_XMP_modi_i_i+0xc>
ret
add    %esi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @_XMP_modi_i_i(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = add nsw i32 %3, %1
%7 = srem i32 %6, %1
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %7, %5 ], [ %3, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hal() {
  printf("Dave, my mind is going. I can feel it... I can feel it\n");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"Dave, my mind is going. I can feel it... I can feel it\0A\00"
define void @hal() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [55 x i8] c"Dave, my mind is going. I can feel it... I can feel it\00"
define void @hal() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_FOG;
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void ffunc(void) {
  static int state = 1;
  if (state ^= 1)
    glEnable(GL_FOG);
  else
    glDisable(GL_FOG);
}


x86 assembly (clang, -O0):
<ffunc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f06(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2efd(%rip)
cmp    $0x0,%eax
je     114f <ffunc+0x2f>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
jmp    115d <ffunc+0x3d>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <glDisable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffunc>:
xorl   $0x1,0x2f09(%rip)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
je     1137 <ffunc+0x17>
jmp    1030 <glEnable@plt>
jmp    1040 <glDisable@plt>

LLVM IR (-O0):
@ffunc.state = internal global i32 1
@GL_FOG = global i32 0
define void @ffunc() {
%1 = load i32, i32* @ffunc.state
%2 = xor i32 %1, 1
store i32 %2, i32* @ffunc.state
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @GL_FOG
%6 = call i32 @glEnable(i32 %5)
br label %10
7: ; preds = %0
%8 = load i32, i32* @GL_FOG
%9 = call i32 @glDisable(i32 %8)
br label %10
10: ; preds = %7, %4
ret void
}

LLVM IR (-O2):
@ffunc.state = internal unnamed_addr global i32 1
@GL_FOG = global i32 0
define void @ffunc() {
%1 = load i32, i32* @ffunc.state
%2 = xor i32 %1, 1
store i32 %2, i32* @ffunc.state
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @GL_FOG
br i1 %3, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @glEnable(i32 %4)
br label %9
7: ; preds = %0
%8 = tail call i32 @glDisable(i32 %4)
br label %9
9: ; preds = %7, %5
ret void
}
void eglWaitClient(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglWaitClient() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t cc3_gpio_get_count() { return 4; }


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

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

LLVM IR (-O0):
define i32 @cc3_gpio_get_count() {
ret i32 4
}

LLVM IR (-O2):
define i32 @cc3_gpio_get_count() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *nstr;
  if ((nstr = strdup(str)) == NULL)
    errx(1, "out of memory");
  return (nstr);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1154 <xstrdup+0x34>
mov    $0x1,%edi
lea    0xeb1(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xstrdup+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
scalar_t__ malloc(size_t);
size_t my_malloc_test(void) {
  size_t add = 1024 * 1024;
  for (size_t s = add;; s += add) {
    void *ptr = (void *)malloc(s);
    if (!ptr)
      return s;
    free(ptr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<my_malloc_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x100000,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115a <my_malloc_test+0x3a>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <my_malloc_test+0x18>

x86 assembly (clang, -O2):
<my_malloc_test>:
push   %rbx
mov    $0x100000,%ebx
mov    $0x100000,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     115c <my_malloc_test+0x3c>
mov    $0x100000,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <free@plt>
add    $0x100000,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
jne    1140 <my_malloc_test+0x20>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @my_malloc_test() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i8*
store i64 1048576, i64* %1
%4 = load i64, i64* %1
store i64 %4, i64* %2
br label %5
5: ; preds = %16, %0
%6 = load i64, i64* %2
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %5
%12 = load i64, i64* %2
ret i64 %12
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = call i32 @free(i8* %14)
br label %16
16: ; preds = %13
%17 = load i64, i64* %1
%18 = load i64, i64* %2
%19 = add i64 %18, %17
store i64 %19, i64* %2
br label %5
}

LLVM IR (-O2):
define i64 @my_malloc_test() {
%1 = tail call i64 @malloc(i64 1048576)
%2 = icmp eq i64 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0, %3
%4 = phi i64 [ %9, %3 ], [ %1, %0 ]
%5 = phi i64 [ %8, %3 ], [ 1048576, %0 ]
%6 = inttoptr i64 %4 to i8*
%7 = tail call i32 @free(i8* %6)
%8 = add i64 %5, 1048576
%9 = tail call i64 @malloc(i64 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %0
%12 = phi i64 [ 1048576, %0 ], [ %8, %3 ]
ret i64 %12
}
double Mul(double x, double y) { return x * y; }


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

x86 assembly (clang, -O2):
<Mul>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Mul(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 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Mul(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
void p18_int_ports_rst(void) {}


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

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

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

LLVM IR (-O2):
define void @p18_int_ports_rst() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t align(uint32_t datalen, uint32_t page) {
  uint32_t seekamt;
  seekamt = datalen / page;
  seekamt += datalen % page ? 1 : 0;
  seekamt *= page;
  return seekamt;
}


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
mov    %edi,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @align(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = srem i32 %9, %10
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = load i32, i32* %5
%16 = add nsw i32 %15, %14
store i32 %16, i32* %5
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = mul nsw i32 %18, %17
store i32 %19, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @align(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add nsw i32 %3, %6
%8 = mul nsw i32 %7, %1
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ferror(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ report_errno(char const *);
bool read_line(FILE *f, const char *file_name, char *line) {
  bool ok = false;
  if (fgets(line, 255 + 1, f)) {
    ok = true;
  } else if (ferror(f)) {
    report_errno(file_name);
  }
  return ok;
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     1173 <read_line+0x43>
movl   $0x1,-0x1c(%rbp)
jmp    1194 <read_line+0x64>
mov    -0x8(%rbp),%rdi
call   1030 <ferror@plt>
cmp    $0x0,%rax
je     118f <read_line+0x5f>
mov    -0x10(%rbp),%rdi
call   1050 <report_errno@plt>
jmp    1194 <read_line+0x64>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1040 <fgets@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    116b <read_line+0x3b>
mov    %rbx,%rdi
call   1030 <ferror@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     116b <read_line+0x3b>
mov    %r14,%rdi
call   1050 <report_errno@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @read_line(i32* nocapture %0, i8* %1, i8* %2) {
%4 = tail call i64 @fgets(i8* %2, i32 256, i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = tail call i64 @ferror(i32* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @report_errno(i8* %1)
br label %11
11: ; preds = %3, %6, %9
%12 = phi i32 [ 0, %9 ], [ 0, %6 ], [ 1, %3 ]
ret i32 %12
}
int process_arguments(int const argc, char const **argv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @process_arguments(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
unsigned getArraySize(int *x) {
  if (!x)
    return *x;
  return 1;
}


x86 assembly (clang, -O0):
<getArraySize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1121 <getArraySize+0x21>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <getArraySize+0x28>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getArraySize(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ MAIN__();
int dblat1_() {
  MAIN__();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @dblat1_() {
%1 = call i32 (...) @MAIN__()
ret i32 0
}

LLVM IR (-O2):
define i32 @dblat1_() {
%1 = tail call i32 (...) @MAIN__()
ret i32 0
}
__attribute__((no, noclone)) signed __int128 t106_2mul(unsigned __int128 y) {
  unsigned __int128 x = (0);
  signed __int128 r;
  if (__builtin_mul_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t106_2mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    %rdx,-0x68(%rbp)
test   %rdx,%rdx
setne  %dl
test   %rax,%rax
setne  %dil
and    %dl,%dil
mul    %rcx
mov    -0x60(%rbp),%rdx
mov    %rax,%rsi
mov    -0x68(%rbp),%rax
seto   %r8b
or     %r8b,%dil
mul    %rdx
mov    %rax,%rdx
mov    -0x60(%rbp),%rax
seto   %r8b
or     %r8b,%dil
mov    %dil,-0x51(%rbp)
add    %rdx,%rsi
mul    %rcx
mov    %rax,%rcx
mov    -0x51(%rbp),%al
add    %rsi,%rdx
setb   %sil
or     %sil,%al
test   %rdx,%rdx
sets   %sil
or     %sil,%al
mov    %rcx,-0x50(%rbp)
mov    %rdx,-0x48(%rbp)
test   $0x1,%al
jne    11c7 <t106_2mul+0xb7>
jmp    11ce <t106_2mul+0xbe>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x50(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x70,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t106_2mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = alloca i128
%8 = bitcast i128* %4 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = load i128, i128* %4
store i128 %11, i128* %5
store i128 0, i128* %6
%12 = load i128, i128* %6
%13 = load i128, i128* %5
%14 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 %12, i128 %13)
%15 = extractvalue { i128, i1 } %14, 1
%16 = extractvalue { i128, i1 } %14, 0
%17 = icmp ugt i128 %16, 170141183460469231731687303715884105727
%18 = or i1 %15, %17
store i128 %16, i128* %7
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @bar()
br label %21
21: ; preds = %19, %2
%22 = load i128, i128* %7
store i128 %22, i128* %3
%23 = bitcast i128* %3 to { i64, i64 }*
%24 = load { i64, i64 }, { i64, i64 }* %23
ret { i64, i64 } %24
}

LLVM IR (-O2):
define { i64, i64 } @t106_2mul(i64 %0, i64 %1) {
ret { i64, i64 } zeroinitializer
}
/* Variables and functions */
int /*<<< orphan*/ fftss_init_threads();
void fftss_init_threads__(void) { fftss_init_threads(); }


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

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

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

LLVM IR (-O2):
define void @fftss_init_threads__() {
%1 = tail call i32 (...) @fftss_init_threads()
ret void
}
/* Variables and functions */
int inet_pton(int, char const *, void *);
int _GeoIP_inet_pton(int af, const char *src, void *dst) {
  return inet_pton(af, src, dst);
}


x86 assembly (clang, -O0):
<_GeoIP_inet_pton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <inet_pton@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_GeoIP_inet_pton>:
jmp    1030 <inet_pton@plt>

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

LLVM IR (-O2):
define i32 @_GeoIP_inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @inet_pton(i32 %0, i8* %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
const char *get_at_spec(int symbol_index) {
  static char at_buf[20];
  if (symbol_index == 0)
    strcpy(at_buf, "$$");
  else
    snprintf(at_buf, sizeof at_buf, "$%u", symbol_index);
  return at_buf;
}


x86 assembly (clang, -O0):
<get_at_spec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114d <get_at_spec+0x2d>
lea    0x2f04(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1168 <get_at_spec+0x48>
mov    -0x4(%rbp),%ecx
lea    0x2ee9(%rip),%rdi
mov    $0x14,%esi
lea    0xea0(%rip),%rdx
call   1040 <snprintf@plt>
lea    0x2ed1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_at_spec>:
push   %rax
test   %edi,%edi
je     1141 <get_at_spec+0x21>
mov    %edi,%ecx
lea    0x2f12(%rip),%rdi
lea    0xece(%rip),%rdx
mov    $0x14,%esi
call   1040 <snprintf@plt>
jmp    1154 <get_at_spec+0x34>
lea    0x2ef8(%rip),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2ee5(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@get_at_spec.at_buf = internal global [20 x i8] zeroinitializer
@.str = [3 x i8] c"$$\00"
@.str.1 = [4 x i8] c"$%u\00"
define i8* @get_at_spec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @strcpy(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @get_at_spec.at_buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @snprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @get_at_spec.at_buf, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %5
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @get_at_spec.at_buf, i64 0, i64 0)
}

LLVM IR (-O2):
@get_at_spec.at_buf = internal global [20 x i8] zeroinitializer
@.str = [3 x i8] c"$$\00"
@.str.1 = [4 x i8] c"$%u\00"
define i8* @get_at_spec(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @strcpy(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @get_at_spec.at_buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @snprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @get_at_spec.at_buf, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %3
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @get_at_spec.at_buf, i64 0, i64 0)
}
__attribute__((no)) void foo(void) {}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _BufferWrite(unsigned char, int);
void LCD_X_Write01(unsigned char Data) { _BufferWrite(Data, 1); }


x86 assembly (clang, -O0):
<LCD_X_Write01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%esi
movzbl -0x1(%rbp),%edi
call   1030 <_BufferWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_X_Write01>:
mov    $0x1,%esi
jmp    1030 <_BufferWrite@plt>

LLVM IR (-O0):
define void @LCD_X_Write01(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @_BufferWrite(i8 zeroext %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @LCD_X_Write01(i8 zeroext %0) {
%2 = tail call i32 @_BufferWrite(i8 zeroext %0, i32 1)
ret void
}
/* Variables and functions */
int *alloca(int);
void do_child(void *stop_address) {
  volatile int *x;
  do {
    x = alloca((256 * 1024 * 1024));
    *x = 1;
  } while ((void *)x >= stop_address);
}


x86 assembly (clang, -O0):
<do_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x10000000,%edi
call   1030 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    111c <do_child+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_child>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x10000000,%edi
call   1030 <alloca@plt>
movl   $0x1,(%rax)
cmp    %rbx,%rax
jae    1120 <do_child+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @do_child(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
br label %4
4: ; preds = %7, %1
%5 = call i32* @alloca(i32 268435456)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
store volatile i32 1, i32* %6
br label %7
7: ; preds = %4
%8 = load i32*, i32** %3
%9 = bitcast i32* %8 to i8*
%10 = load i8*, i8** %2
%11 = icmp uge i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @do_child(i8* readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32* @alloca(i32 268435456)
store volatile i32 1, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = icmp ult i8* %4, %0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
unsigned int BKDRHash(char *str) {
  unsigned int seed = 131;
  unsigned int hash = 0;
  while (*str) {
    hash = hash * seed + (*str++);
  }
  return (hash & 0xFFFFFFF) % 10000;
}


x86 assembly (clang, -O0):
<BKDRHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x83,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <BKDRHash+0x46>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <BKDRHash+0x16>
mov    -0x10(%rbp),%eax
and    $0xfffffff,%eax
mov    $0x2710,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BKDRHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1141 <BKDRHash+0x41>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x83,%eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <BKDRHash+0x10>
and    $0xfffffff,%eax
mov    $0xd1b71759,%ecx
imul   %rax,%rcx
shr    $0x2d,%rcx
imul   $0x2710,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @BKDRHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 131
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 268435455
%16 = urem i32 %15, 10000
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 0, %1 ], [ %16, %14 ]
ret i32 %18
}
void radix_tree_preload_end(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<radix_tree_preload_end>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <radix_tree_preload_end+0x9>
jmp    110e <radix_tree_preload_end+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @radix_tree_preload_end() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @radix_tree_preload_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "usage: setup_teardown [-h KINETIC_HOST] [-i IDLE_SECONDS]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [59 x i8] c"usage: setup_teardown [-h KINETIC_HOST] [-i IDLE_SECONDS]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [59 x i8] c"usage: setup_teardown [-h KINETIC_HOST] [-i IDLE_SECONDS]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t I2CFIFODataGet(uint32_t ui32Base) {
  ;
  while ((*((volatile unsigned long *)(ui32Base + 0x00000F08))) & 0x00010000) {
  }
  return ((*((volatile unsigned long *)(ui32Base + 0x00000F00))));
}


x86 assembly (clang, -O0):
<I2CFIFODataGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xf08(%rax),%rax
and    $0x10000,%rax
cmp    $0x0,%rax
je     1128 <I2CFIFODataGet+0x28>
jmp    1108 <I2CFIFODataGet+0x8>
mov    -0x8(%rbp),%rax
mov    0xf00(%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CFIFODataGet>:
mov    %rdi,-0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
mov    -0x8(%rsp),%rax
testq  $0x10000,0xf08(%rax)
jne    1110 <I2CFIFODataGet+0x10>
mov    -0x8(%rsp),%rax
mov    0xf00(%rax),%rax
ret

LLVM IR (-O0):
define i64 @I2CFIFODataGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
br label %3
3: ; preds = %10, %1
%4 = load volatile i64, i64* %2
%5 = add i64 %4, 3848
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, 65536
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
br label %3
11: ; preds = %3
%12 = load volatile i64, i64* %2
%13 = add i64 %12, 3840
%14 = inttoptr i64 %13 to i64*
%15 = load volatile i64, i64* %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @I2CFIFODataGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
br label %3
3: ; preds = %3, %1
%4 = load volatile i64, i64* %2
%5 = add i64 %4, 3848
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, 65536
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = load volatile i64, i64* %2
%12 = add i64 %11, 3840
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
ret i64 %14
}
void RTTarCurrentFile(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarCurrentFile() {
ret void
}
/* Variables and functions */
int wGetArrayIndexes();
int /*<<< orphan*/ wPopNumber();
int /*<<< orphan*/ wPushNumber(int);
void wBasIndexes() {
  int indexes;
  indexes = wGetArrayIndexes();
  wPopNumber();
  wPushNumber(indexes);
}


x86 assembly (clang, -O0):
<wBasIndexes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <wGetArrayIndexes@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <wPopNumber@plt>
mov    -0x4(%rbp),%edi
call   1030 <wPushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasIndexes>:
push   %rbx
xor    %eax,%eax
call   1050 <wGetArrayIndexes@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <wPopNumber@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <wPushNumber@plt>

LLVM IR (-O0):
define void @wBasIndexes() {
%1 = alloca i32
%2 = call i32 (...) @wGetArrayIndexes()
store i32 %2, i32* %1
%3 = call i32 (...) @wPopNumber()
%4 = load i32, i32* %1
%5 = call i32 @wPushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @wBasIndexes() {
%1 = tail call i32 (...) @wGetArrayIndexes()
%2 = tail call i32 (...) @wPopNumber()
%3 = tail call i32 @wPushNumber(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) { printf("Hello, CRake World!\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Hello, CRake World!\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Hello, CRake World!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void kirkwood_pm_init(void) {}


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

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

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

LLVM IR (-O2):
define void @kirkwood_pm_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ eventfd_t;

/* Variables and functions */
int __read(int, int /*<<< orphan*/ *, int);
int eventfd_read(int fd, eventfd_t *value) {
  return __read(fd, value, sizeof(eventfd_t)) != sizeof(eventfd_t) ? -1 : 0;
}


x86 assembly (clang, -O0):
<eventfd_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <__read@plt>
movslq %eax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x4,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eventfd_read>:
push   %rax
mov    $0x4,%edx
call   1030 <__read@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eventfd_read(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = load i32*, i32** %4
%7 = call i32 @__read(i32 %5, i32* %6, i32 4)
%8 = sext i32 %7 to i64
%9 = icmp ne i64 %8, 4
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 -1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @eventfd_read(i32 %0, i32* %1) {
%3 = tail call i32 @__read(i32 %0, i32* %1, i32 4)
%4 = icmp ne i32 %3, 4
%5 = sext i1 %4 to i32
ret i32 %5
}