xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int pid_t;
typedef int /*<<< orphan*/ path;

/* Variables and functions */
int procfs_enum_id(char *, int **, int *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int procfs_lwp_enum(pid_t pid, int **lwps, int *num) {
  char path[4096];
  (void)snprintf(path, sizeof(path), "/proc/%d/task", pid);
  return (procfs_enum_id(path, lwps, num));
}


x86 assembly (clang, -O0):
<procfs_lwp_enum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1020(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x1000,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x1020(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <procfs_enum_id@plt>
add    $0x1020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<procfs_lwp_enum>:
push   %r15
push   %r14
push   %rbx
sub    $0x1000,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ecx
lea    0xec5(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x1000,%esi
call   1030 <snprintf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <procfs_enum_id@plt>
add    $0x1000,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/proc/%d/task\00"
define i32 @procfs_lwp_enum(i32 %0, i32** %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32**
%6 = alloca i32*
%7 = alloca [4096 x i8]
store i32 %0, i32* %4
store i32** %1, i32*** %5
store i32* %2, i32** %6
%8 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @snprintf(i8* %8, i32 4096, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %7, i64 0, i64 0
%12 = load i32**, i32*** %5
%13 = load i32*, i32** %6
%14 = call i32 @procfs_enum_id(i8* %11, i32** %12, i32* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"/proc/%d/task\00"
define i32 @procfs_lwp_enum(i32 %0, i32** %1, i32* %2) {
%4 = alloca [4096 x i8]
%5 = getelementptr inbounds [4096 x i8], [4096 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 4096, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @procfs_enum_id(i8* %5, i32** %1, i32* %2)
ret i32 %7
}
void setPointer(void **address, void *value) { *address = value; }


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

x86 assembly (clang, -O2):
<setPointer>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @setPointer(i8** nocapture writeonly %0, i8* %1) {
store i8* %1, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int check_circ(double *cparam) {
  if (cparam == NULL)
    error("check_circ: invalid circle.");
  if (cparam[2] <= 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_circ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <check_circ+0x23>
lea    0xeda(%rip),%rdi
call   1030 <error@plt>
mov    -0x10(%rbp),%rax
movsd  0xec1(%rip),%xmm0
ucomisd 0x10(%rax),%xmm0
jb     1156 <check_circ+0x46>
movl   $0x0,-0x4(%rbp)
jmp    115d <check_circ+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_circ>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1125 <check_circ+0x15>
lea    0xee8(%rip),%rdi
call   1030 <error@plt>
movsd  0xed3(%rip),%xmm0
xor    %eax,%eax
ucomisd 0x10(%rbx),%xmm0
setb   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"check_circ: invalid circle.\00"
define i32 @check_circ(double* %0) {
%2 = alloca i32
%3 = alloca double*
store double* %0, double** %3
%4 = load double*, double** %3
%5 = icmp eq double* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 2
%11 = load double, double* %10
%12 = fcmp ole double %11, 1.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 0, i32* %2
br label %15
14: ; preds = %8
store i32 1, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [28 x i8] c"check_circ: invalid circle.\00"
define i32 @check_circ(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = getelementptr inbounds double, double* %0, i64 2
%7 = load double, double* %6
%8 = fcmp ugt double %7, 1.000000e+00
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
scalar_t__ popNumber();
char *popString();
int /*<<< orphan*/ pushStringCopy(char *);
char *right(char *, int);
void basRight() {
  int pos;
  char *string;
  char *dest;
  pos = (int)popNumber();
  string = popString();
  dest = right(string, pos);
  pushStringCopy(dest);
  eFree(string);
  eFree(dest);
}


x86 assembly (clang, -O0):
<basRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1070 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <popString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <right@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <pushStringCopy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <eFree@plt>
mov    -0x18(%rbp),%rdi
call   1030 <eFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basRight>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1070 <popNumber@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1050 <popString@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14d,%esi
call   1040 <right@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <pushStringCopy@plt>
mov    %r15,%rdi
call   1030 <eFree@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <eFree@plt>

LLVM IR (-O0):
define void @basRight() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = call i64 (...) @popNumber()
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = call i8* (...) @popString()
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = load i32, i32* %1
%9 = call i8* @right(i8* %7, i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @pushStringCopy(i8* %10)
%12 = load i8*, i8** %2
%13 = call i32 @eFree(i8* %12)
%14 = load i8*, i8** %3
%15 = call i32 @eFree(i8* %14)
ret void
}

LLVM IR (-O2):
define void @basRight() {
%1 = tail call i64 (...) @popNumber()
%2 = trunc i64 %1 to i32
%3 = tail call i8* (...) @popString()
%4 = tail call i8* @right(i8* %3, i32 %2)
%5 = tail call i32 @pushStringCopy(i8* %4)
%6 = tail call i32 @eFree(i8* %3)
%7 = tail call i32 @eFree(i8* %4)
ret void
}
void swapString2(char **x, char **y) {
  char *t = *y;
  *y = *x;
  *x = t;
}


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

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

LLVM IR (-O0):
define void @swapString2(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %4
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %3
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swapString2(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8*, i8** %0
store i8* %4, i8** %1
store i8* %3, i8** %0
ret void
}
/* Variables and functions */
scalar_t__ __builtin_significand(double);
int /*<<< orphan*/ link_failure_builtin_significand();
void test_builtin_significand(double d) {
  if (__builtin_significand(d) != __builtin_significand(d))
    link_failure_builtin_significand();
}


x86 assembly (clang, -O0):
<test_builtin_significand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <__builtin_significand@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <__builtin_significand@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_significand+0x3c>
mov    $0x0,%al
call   1030 <link_failure_builtin_significand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_significand>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <__builtin_significand@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <__builtin_significand@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_significand+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_builtin_significand@plt>

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

LLVM IR (-O2):
define void @test_builtin_significand(double %0) {
%2 = tail call i64 @__builtin_significand(double %0)
%3 = tail call i64 @__builtin_significand(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_significand()
br label %7
7: ; preds = %5, %1
ret void
}
int test_imm_C3uint32_mem(unsigned int *val) {
  return ((*val) & (0xC3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C3uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xc3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C3uint32_mem>:
testb  $0xc3,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C3uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 195
%6 = icmp ne i32 %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_C3uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 195
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _terminate(int);
void cgc_exit(int ret) { _terminate(ret); }


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

x86 assembly (clang, -O2):
<cgc_exit>:
jmp    1030 <_terminate@plt>

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

LLVM IR (-O2):
define void @cgc_exit(i32 %0) {
%2 = tail call i32 @_terminate(i32 %0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int dobldobl_witness_set_to_Laurent_system_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(808, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_witness_set_to_Laurent_system_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x328,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_witness_set_to_Laurent_system_container>:
mov    $0x328,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @dobldobl_witness_set_to_Laurent_system_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 808, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @dobldobl_witness_set_to_Laurent_system_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 808, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  printf("entering\n");
  while (1) {
    printf("sleeping...\n");
    sleep(2);
    printf("Finished sleeping. Repeating.\n");
  }
  printf("exiting\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%r14
lea    0xed7(%rip),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [10 x i8] c"entering\0A\00"
@.str.1 = [13 x i8] c"sleeping...\0A\00"
@.str.2 = [31 x i8] c"Finished sleeping. Repeating.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %7
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @sleep(i32 2)
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %7
}

LLVM IR (-O2):
@str = [9 x i8] c"entering\00"
@str.3 = [12 x i8] c"sleeping...\00"
@str.4 = [30 x i8] c"Finished sleeping. Repeating.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 2)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
br label %4
}
int copy(unsigned char *to, char *from) {
  int distance = 0;
  while ((*to++ = *from++))
    distance++;
  return (distance + 2) / 3;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     114b <copy+0x4b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copy+0x13>
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    (%rsi),%al
mov    %al,(%rdi)
test   %al,%al
je     1130 <copy+0x30>
mov    $0x1,%ecx
nopl   (%rax)
movzbl (%rsi,%rcx,1),%eax
mov    %al,(%rdi,%rcx,1)
add    $0x1,%rcx
test   %al,%al
jne    1110 <copy+0x10>
add    $0x1,%ecx
mov    $0xaaaaaaab,%eax
imul   %rcx,%rax
shr    $0x21,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ 0, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = add nuw nsw i32 %6, 1
%12 = load i8, i8* %10
store i8 %12, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5
%15 = add nuw i32 %6, 3
%16 = udiv i32 %15, 3
br label %17
17: ; preds = %14, %2
%18 = phi i32 [ 0, %2 ], [ %16, %14 ]
ret i32 %18
}
int test_imm_92int64_lowword_mem(long long *val) {
  return ((*val) & (0x92 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_92int64_lowword_mem>:
testb  $0x92,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_92int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 146
%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_92int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 146
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() {
  fprintf(stderr, "VRLDBG (C) 2016 Jonathan Campbell\n");
  fprintf(stderr, "\n");
  fprintf(stderr, "vrldbg file\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xef5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeff(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee6(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"VRLDBG (C) 2016 Jonathan Campbell\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [13 x i8] c"vrldbg file\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"VRLDBG (C) 2016 Jonathan Campbell\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [13 x i8] c"vrldbg file\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(const char *s) {
  int n = 0;
  char *c = (char *)s;
  while (*c++ != '\0')
    n++;
  return n + 1;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <strlen+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <strlen+0x17>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111b <strlen+0x1b>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 1, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
void beep() {}


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

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

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

LLVM IR (-O2):
define void @beep() {
ret void
}
void list_insert(char a) { a = 1; }


x86 assembly (clang, -O0):
<list_insert>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @list_insert(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
store i8 1, i8* %2
ret void
}

LLVM IR (-O2):
define void @list_insert(i8 signext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void fisFreeMatrix(void **matrix, int row_n) {
  int i;
  if (matrix != NULL) {
    for (i = 0; i < row_n; i++) {
      free(matrix[i]);
    }
    free(matrix);
  }
}


x86 assembly (clang, -O0):
<fisFreeMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <fisFreeMatrix+0x55>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <fisFreeMatrix+0x4c>
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    1131 <fisFreeMatrix+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fisFreeMatrix(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %18, label %4
4: ; preds = %2
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %16
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %14, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = bitcast i8** %10 to i8***
%12 = load i8**, i8*** %11
%13 = tail call i32 @free(i8** %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %4
%17 = tail call i32 @free(i8** %0)
br label %18
18: ; preds = %16, %2
ret void
}
void RTPathCountComponents(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathCountComponents() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef scalar_t__ uint32_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ num_leading_zeros(int /*<<< orphan*/);
uint32_t num_significant_bits_var3(int64_t x) {
  uint64_t y;
  y = (x < 0) ? ~((uint64_t)x) : ((uint64_t)x);
  return 65 - num_leading_zeros(y);
}


x86 assembly (clang, -O0):
<num_significant_bits_var3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1136 <num_significant_bits_var3+0x26>
mov    -0x8(%rbp),%rax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <num_significant_bits_var3+0x2d>
mov    -0x8(%rbp),%rax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <num_leading_zeros@plt>
mov    %rax,%rcx
mov    $0x41,%eax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_significant_bits_var3>:
push   %rax
mov    %rdi,%rax
sar    $0x3f,%rax
xor    %eax,%edi
call   1030 <num_leading_zeros@plt>
mov    $0x41,%ecx
sub    %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @num_significant_bits_var3(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
%9 = xor i32 %8, -1
br label %13
10: ; preds = %1
%11 = load i64, i64* %2
%12 = trunc i64 %11 to i32
br label %13
13: ; preds = %10, %6
%14 = phi i32 [ %9, %6 ], [ %12, %10 ]
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i64 @num_leading_zeros(i32 %15)
%17 = sub nsw i64 65, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @num_significant_bits_var3(i64 %0) {
%2 = ashr i64 %0, 63
%3 = xor i64 %2, %0
%4 = trunc i64 %3 to i32
%5 = tail call i64 @num_leading_zeros(i32 %4)
%6 = sub nsw i64 65, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void strcat() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @strcat() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
long int sum(long int n) {
  long int sum = 0;
  for (int i = 1; i < n + 1; i += 1) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jge    1146 <sum+0x46>
movslq -0x14(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <sum+0x17>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %rdi,%rdi
jle    111e <sum+0x1e>
lea    -0x1(%rdi),%rax
lea    -0x2(%rdi),%rcx
mul    %rcx
shld   $0x3f,%rax,%rdx
lea    (%rdx,%rdi,2),%rax
add    $0xffffffffffffffff,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @sum(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = shl nuw i64 %0, 1
%5 = add i64 %4, 2
%6 = add nsw i64 %0, -1
%7 = zext i64 %6 to i65
%8 = add nsw i64 %0, -2
%9 = zext i64 %8 to i65
%10 = mul i65 %7, %9
%11 = lshr i65 %10, 1
%12 = trunc i65 %11 to i64
%13 = add i64 %5, %12
%14 = add i64 %13, -3
br label %15
15: ; preds = %3, %1
%16 = phi i64 [ 0, %1 ], [ %14, %3 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int);
void fatal() {
  error("\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @fatal() {
%1 = call i32 @error(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @fatal() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int count_monitors();
int three_monitors(void) { return count_monitors() == 3; }


x86 assembly (clang, -O0):
<three_monitors>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <count_monitors@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<three_monitors>:
push   %rax
xor    %eax,%eax
call   1030 <count_monitors@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @three_monitors() {
%1 = call i32 (...) @count_monitors()
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @three_monitors() {
%1 = tail call i32 (...) @count_monitors()
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void handler(int sig) { exit(sig); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x10_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x10_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x10_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x10_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x10_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
uint32_t schema_rt_search32(const uint32_t *tab, uint32_t k, size_t n) {
  uint32_t i = 0;
  while (i != n - 1 && tab[i] != k)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<schema_rt_search32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x21(%rbp)
je     1148 <schema_rt_search32+0x48>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x10(%rbp),%rax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1158 <schema_rt_search32+0x58>
jmp    1169 <schema_rt_search32+0x69>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <schema_rt_search32+0x18>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<schema_rt_search32>:
xor    %eax,%eax
add    $0xffffffffffffffff,%rdx
je     1122 <schema_rt_search32+0x22>
nopl   0x0(%rax,%rax,1)
cmp    %rsi,(%rdi,%rax,8)
je     1122 <schema_rt_search32+0x22>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <schema_rt_search32+0x10>
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @schema_rt_search32(i64* nocapture %0, i64 %1, i64 %2) {
%4 = add i64 %2, -1
%5 = icmp eq i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %11
%7 = phi i64 [ %12, %11 ], [ 0, %3 ]
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, %1
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw i64 %7, 1
%13 = icmp eq i64 %12, %4
br i1 %13, label %14, label %6
14: ; preds = %6, %11, %3
%15 = phi i64 [ 0, %3 ], [ %4, %11 ], [ %7, %6 ]
ret i64 %15
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
double *dvector_alloc(long n) {
  double *v;
  v = (double *)calloc((size_t)(n + 1), sizeof(double));
  return v;
}


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

x86 assembly (clang, -O2):
<dvector_alloc>:
add    $0x1,%rdi
mov    $0x8,%esi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define double* @dvector_alloc(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = tail call i64 @calloc(i64 %2, i32 8)
%4 = inttoptr i64 %3 to double*
ret double* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *str1 = "Hello, World!\n";
  char buf[14] = {72, 101, 108, 108, 111, 44, 32,
                  87, 111, 114, 108, 100, 33, 10};
  char *str2 = buf;
  printf("%s", str1);
  printf("%s", str2);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x26(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x1e(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x1a(%rbp)
lea    -0x26(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0xa21646c726f5720,%rax
64 21 0a
mov    %rax,0x6(%rsp)
movabs $0x57202c6f6c6c6548,%rax
2c 20 57
mov    %rax,(%rsp)
lea    0xec6(%rip),%rbx
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, World!\0A\00"
@__const.main.buf = [14 x i8] c"Hello, World!\0A"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [14 x i8]
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %6
%9 = bitcast [14 x i8]* %7 to i8*
%10 = getelementptr inbounds [14 x i8], [14 x i8]* %7, i64 0, i64 0
store i8* %10, i8** %8
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %8
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
@__const.main.buf = [14 x i8] c"Hello, World!\0A"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [14 x i8]
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct rt_mutex_waiter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *);
void rt_mutex_print_deadlock(struct rt_mutex_waiter *w) {
  debug_rt_mutex_print_deadlock(w);
}


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

x86 assembly (clang, -O2):
<rt_mutex_print_deadlock>:
jmp    1030 <debug_rt_mutex_print_deadlock@plt>

LLVM IR (-O0):
%struct.rt_mutex_waiter = type { i32 }
define void @rt_mutex_print_deadlock(%struct.rt_mutex_waiter* %0) {
%2 = alloca %struct.rt_mutex_waiter*
store %struct.rt_mutex_waiter* %0, %struct.rt_mutex_waiter** %2
%3 = load %struct.rt_mutex_waiter*, %struct.rt_mutex_waiter** %2
%4 = call i32 @debug_rt_mutex_print_deadlock(%struct.rt_mutex_waiter* %3)
ret void
}

LLVM IR (-O2):
%struct.rt_mutex_waiter = type { i32 }
define void @rt_mutex_print_deadlock(%struct.rt_mutex_waiter* %0) {
%2 = tail call i32 @debug_rt_mutex_print_deadlock(%struct.rt_mutex_waiter* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ niceprint(char *);
void whirlpool(void) {
  niceprint("An underwater crevasse or drain creates a small vortex in this "
            "area, much like the "
            "whirlpool effect of the control water spell. Character must make "
            "a DC 14 Strength "
            "(Athletics) check to avoid being drawn in.  The vortex is 50 feet "
            "wide at the top, "
            "25 feet deep, and 5 feet wide at the bottom.  See Players "
            "Handbook page 228.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [327 x i8] c"An underwater crevasse or drain creates a small vortex in this area, much like the whirlpool effect of the control water spell. Character must make a DC 14 Strength (Athletics) check to avoid being drawn in. The vortex is 50 feet wide at the top, 25 feet deep, and 5 feet wide at the bottom. See Players Handbook page 228.\0A\0A\00"
define void @whirlpool() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([327 x i8], [327 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [327 x i8] c"An underwater crevasse or drain creates a small vortex in this area, much like the whirlpool effect of the control water spell. Character must make a DC 14 Strength (Athletics) check to avoid being drawn in. The vortex is 50 feet wide at the top, 25 feet deep, and 5 feet wide at the bottom. See Players Handbook page 228.\0A\0A\00"
define void @whirlpool() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([327 x i8], [327 x i8]* @.str, i64 0, i64 0))
ret void
}
int main(void) {
  char *p;
  p = "hello"
      " is better than bye";
  return (*p == 'h') ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x68,%edx
cmove  %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"hello is better than bye\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 104
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int f_print(int mode, unsigned char **sec, float *data, unsigned int ndata,
            char *inv_out, void **local, const char *arg1) {
  if (mode >= 0) {
    strcpy(inv_out, arg1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1149 <f_print+0x39>
mov    -0x28(%rbp),%rdi
mov    0x10(%rbp),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_print>:
test   %edi,%edi
js     1126 <f_print+0x16>
push   %rax
mov    0x10(%rsp),%rsi
mov    %r8,%rdi
call   1030 <strcpy@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f_print(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* %4, i8** nocapture readnone %5, i8* %6) {
%8 = icmp sgt i32 %0, -1
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @strcpy(i8* %4, i8* %6)
br label %11
11: ; preds = %9, %7
ret i32 0
}