xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
scalar_t__ logarea_init(int);
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int log_init(char *program_name, int size) {
  do {
  } while (0);
  openlog(program_name, 0, LOG_DAEMON);
  if (logarea_init(size))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<log_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
jmp    1134 <log_init+0x14>
mov    -0x10(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <openlog@plt>
mov    -0x14(%rbp),%edi
call   1030 <logarea_init@plt>
cmp    $0x0,%rax
je     1166 <log_init+0x46>
movl   $0x1,-0x4(%rbp)
jmp    116d <log_init+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_init>:
push   %rbx
mov    %esi,%ebx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <openlog@plt>
mov    %ebx,%edi
call   1030 <logarea_init@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@LOG_DAEMON = global i32 0
define i32 @log_init(i8* %0, i32 %1) {
%3 = load i32, i32* @LOG_DAEMON
%4 = tail call i32 @openlog(i8* %0, i32 0, i32 %3)
%5 = tail call i64 @logarea_init(i32 %1)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int is_valid_card_value(char c) {
  switch (c) {
  case 'A':
  case 'K':
  case 'Q':
  case 'J':
  case 'T':
  case '9':
  case '8':
  case '7':
  case '6':
  case '5':
  case '4':
  case '3':
  case '2':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid_card_value>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffce,%eax
sub    $0x8,%eax
jb     1169 <is_valid_card_value+0x69>
jmp    1122 <is_valid_card_value+0x22>
mov    -0xc(%rbp),%eax
sub    $0x41,%eax
je     1169 <is_valid_card_value+0x69>
jmp    1133 <is_valid_card_value+0x33>
mov    -0xc(%rbp),%eax
add    $0xffffffb6,%eax
sub    $0x2,%eax
jb     1169 <is_valid_card_value+0x69>
jmp    1147 <is_valid_card_value+0x47>
mov    -0xc(%rbp),%eax
sub    $0x51,%eax
je     1169 <is_valid_card_value+0x69>
jmp    1158 <is_valid_card_value+0x58>
mov    -0xc(%rbp),%eax
sub    $0x54,%eax
jne    1175 <is_valid_card_value+0x75>
jmp    1169 <is_valid_card_value+0x69>
movl   $0x1,-0x4(%rbp)
jmp    117c <is_valid_card_value+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_card_value>:
add    $0xffffffce,%edi
cmp    $0x22,%edi
ja     111e <is_valid_card_value+0x1e>
mov    $0x1,%eax
movabs $0x4830080ff,%rcx
bt     %rdi,%rcx
jae    111e <is_valid_card_value+0x1e>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_card_value(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 65, label %6
i32 75, label %6
i32 81, label %6
i32 74, label %6
i32 84, label %6
i32 57, label %6
i32 56, label %6
i32 55, label %6
i32 54, label %6
i32 53, label %6
i32 52, label %6
i32 51, label %6
i32 50, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_valid_card_value(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 65, label %4
i32 75, label %4
i32 81, label %4
i32 74, label %4
i32 84, label %4
i32 57, label %4
i32 56, label %4
i32 55, label %4
i32 54, label %4
i32 53, label %4
i32 52, label %4
i32 51, label %4
i32 50, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
char *Scl_ConGetInCell_(int /*<<< orphan*/, int);
int /*<<< orphan*/ Scl_ConReadMan();
char *Scl_ConGetInCell(int i) { return Scl_ConGetInCell_(Scl_ConReadMan(), i); }


x86 assembly (clang, -O0):
<Scl_ConGetInCell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <Scl_ConGetInCell_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scl_ConGetInCell>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <Scl_ConReadMan@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <Scl_ConGetInCell_@plt>

LLVM IR (-O0):
define i8* @Scl_ConGetInCell(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Scl_ConReadMan()
%4 = load i32, i32* %2
%5 = call i8* @Scl_ConGetInCell_(i32 %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @Scl_ConGetInCell(i32 %0) {
%2 = tail call i32 (...) @Scl_ConReadMan()
%3 = tail call i8* @Scl_ConGetInCell_(i32 %2, i32 %0)
ret i8* %3
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMREA_get(void) { return U_WMRCORENONE_get("U_WMREA"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMREA\00"
define i32 @U_WMREA_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMREA\00"
define i32 @U_WMREA_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void Unary(char operator, double * R) {
  if (operator== '-')
    *R = -(*R);
}


x86 assembly (clang, -O0):
<Unary>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
jne    1142 <Unary+0x42>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Unary>:
cmp    $0x2d,%dil
jne    1114 <Unary+0x14>
movsd  (%rsi),%xmm0
xorps  0xeef(%rip),%xmm0
movlps %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @Unary(i8 signext %0, double* %1) {
%3 = alloca i8
%4 = alloca double*
store i8 %0, i8* %3
store double* %1, double** %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 45
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double*, double** %4
%10 = load double, double* %9
%11 = fneg double %10
%12 = load double*, double** %4
store double %11, double* %12
br label %13
13: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @Unary(i8 signext %0, double* nocapture %1) {
%3 = icmp eq i8 %0, 45
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load double, double* %1
%6 = fneg double %5
store double %6, double* %1
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void *memory_allocation(int size) {
  void *ptr;
  if ((ptr = calloc(size, sizeof(char))) == NULL) {
    perror("Error allocating memory. Out Of Memory ?\n");
    exit(-1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<memory_allocation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116c <memory_allocation+0x3c>
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_allocation>:
push   %rax
mov    $0x1,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1142 <memory_allocation+0x12>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Error allocating memory. Out Of Memory ?\0A\00"
define i8* @memory_allocation(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @calloc(i32 %4, i32 1)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [42 x i8] c"Error allocating memory. Out Of Memory ?\0A\00"
define noalias i8* @memory_allocation(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int __attribute__((weak)) pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) {
  (void)rwlock;
  return 0;
}


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

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

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

LLVM IR (-O2):
define weak i32 @pthread_rwlock_rdlock(i32* %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int matchnocase(char *st1, char *st2) {
  if (!strcasecmp(st1, st2))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<matchnocase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1142 <matchnocase+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <matchnocase+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @matchnocase(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ err_exit(char *);
scalar_t__ unlink(char *);
void _unlink(char *p) {
  if (unlink(p) < 0)
    err_exit("_unlink");
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
jge    114b <_unlink+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <err_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
push   %rax
call   1030 <unlink@plt>
test   %rax,%rax
js     112d <_unlink+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <err_exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"_unlink\00"
define void @_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @unlink(i8* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @err_exit(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"_unlink\00"
define void @_unlink(i8* nocapture %0) {
%2 = tail call i64 @unlink(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err_exit(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
double load_dfsf(float *p) {
  double d = (double)*p;
  __asm__("# reg %x0" : "+v"(d));
  return d;
}


x86 assembly (clang, -O0):
<load_dfsf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_dfsf>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @load_dfsf(float* %0) {
%2 = alloca float*
%3 = alloca double
store float* %0, float** %2
%4 = load float*, float** %2
%5 = load float, float* %4
%6 = fpext float %5 to double
store double %6, double* %3
%7 = load double, double* %3
%8 = call double asm "# reg ${0:x}", "=v,0,~{dirflag},~{fpsr},~{flags}"(double %7)
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @load_dfsf(float* nocapture %0) {
%2 = load float, float* %0
%3 = fpext float %2 to double
%4 = tail call double asm "# reg ${0:x}", "=v,0,~{dirflag},~{fpsr},~{flags}"(double %3)
ret double %4
}
int getLarger(int *num1, int *num2) {
  if (num1 > num2)
    return num1;
  return num2;
}


x86 assembly (clang, -O0):
<getLarger>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1126 <getLarger+0x26>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    112d <getLarger+0x2d>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLarger>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %edi,%eax
ret

LLVM IR (-O0):
define i32 @getLarger(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %4
%7 = load i32*, i32** %5
%8 = icmp ugt i32* %6, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
store i32 %11, i32* %3
br label %15
12: ; preds = %2
%13 = load i32*, i32** %5
%14 = ptrtoint i32* %13 to i32
store i32 %14, i32* %3
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @getLarger(i32* %0, i32* %1) {
%3 = icmp ugt i32* %0, %1
%4 = select i1 %3, i32* %0, i32* %1
%5 = ptrtoint i32* %4 to i64
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
struct link_map {
  int /*<<< orphan*/ l_addr;
};

/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
int /*<<< orphan*/ STDOUT_FILENO;
scalar_t__ dlopen(char *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
void do_leak_libc() {
  struct link_map *lm = (struct link_map *)dlopen("libc.so.6", RTLD_LAZY);
  write(STDOUT_FILENO, &lm->l_addr, sizeof(lm->l_addr));
}


x86 assembly (clang, -O0):
<do_leak_libc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1040 <dlopen@plt>
mov    %rax,-0x8(%rbp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_leak_libc>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <dlopen@plt>
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%edi
mov    %rax,%rsi
mov    $0x4,%edx
pop    %rax
jmp    1030 <write@plt>

LLVM IR (-O0):
%struct.link_map = type { i32 }
@.str = [10 x i8] c"libc.so.6\00"
@RTLD_LAZY = global i32 0
@STDOUT_FILENO = global i32 0
define void @do_leak_libc() {
%1 = alloca %struct.link_map*
%2 = load i32, i32* @RTLD_LAZY
%3 = call i64 @dlopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = inttoptr i64 %3 to %struct.link_map*
store %struct.link_map* %4, %struct.link_map** %1
%5 = load i32, i32* @STDOUT_FILENO
%6 = load %struct.link_map*, %struct.link_map** %1
%7 = getelementptr inbounds %struct.link_map, %struct.link_map* %6, i32 0, i32 0
%8 = call i32 @write(i32 %5, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
%struct.link_map = type { i32 }
@.str = [10 x i8] c"libc.so.6\00"
@RTLD_LAZY = global i32 0
@STDOUT_FILENO = global i32 0
define void @do_leak_libc() {
%1 = load i32, i32* @RTLD_LAZY
%2 = tail call i64 @dlopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = inttoptr i64 %2 to %struct.link_map*
%4 = load i32, i32* @STDOUT_FILENO
%5 = getelementptr inbounds %struct.link_map, %struct.link_map* %3, i64 0, i32 0
%6 = tail call i32 @write(i32 %4, i32* %5, i32 4)
ret void
}
char print_exception__9ExceptionFv(__0this)
struct Exception *__0this;
{
}


x86 assembly (clang, -O0):
<print_exception__9ExceptionFv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Exception = type opaque
define signext i8 @print_exception__9ExceptionFv(%struct.Exception* %0) {
%2 = alloca i8
%3 = alloca %struct.Exception*
store %struct.Exception* %0, %struct.Exception** %3
%4 = load i8, i8* %2
ret i8 %4
}

LLVM IR (-O2):
%struct.Exception = type opaque
define signext i8 @print_exception__9ExceptionFv(%struct.Exception* nocapture readnone %0) {
ret i8 undef
}
/* Variables and functions */
scalar_t__ display_fpga_init();
int display_gpio_init();
int display_init(void) {
  if (display_fpga_init() == 0) {
    return display_gpio_init();
  }
  return -1;
}


x86 assembly (clang, -O0):
<display_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <display_fpga_init@plt>
cmp    $0x0,%rax
jne    1148 <display_init+0x28>
mov    $0x0,%al
call   1040 <display_gpio_init@plt>
mov    %eax,-0x4(%rbp)
jmp    114f <display_init+0x2f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_init>:
push   %rax
xor    %eax,%eax
call   1030 <display_fpga_init@plt>
test   %rax,%rax
je     1134 <display_init+0x14>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <display_gpio_init@plt>

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

LLVM IR (-O2):
define i32 @display_init() {
%1 = tail call i64 (...) @display_fpga_init()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @display_gpio_init()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *strdup(const char *s) {
  if (s) {
    int len = strlen(s) + 1;
    char *a = malloc(len * sizeof(char));
    strcpy(a, s);
    return a;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1183 <strdup+0x53>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118b <strdup+0x5b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1159 <strdup+0x29>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115c <strdup+0x2c>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_fopen_cloexec() {
  printf("NOT IMPLEMENTED:"
         "pa_fopen_cloexec"
         "\n");
}


x86 assembly (clang, -O0):
<pa_fopen_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_fopen_cloexec\0A\00"
define i32 @pa_fopen_cloexec() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_fopen_cloexec\00"
define i32 @pa_fopen_cloexec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
void *read_cell_contents0(void *);
void *read_cell_contents(void *cell) {
  void *result = read_cell_contents0(cell);
  return result;
}


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

x86 assembly (clang, -O2):
<read_cell_contents>:
jmp    1030 <read_cell_contents0@plt>

LLVM IR (-O0):
define i8* @read_cell_contents(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @read_cell_contents0(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @read_cell_contents(i8* %0) {
%2 = tail call i8* @read_cell_contents0(i8* %0)
ret i8* %2
}
C() {}


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

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

LLVM IR (-O0):
define i32 @C() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @C() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ print_greetings();
int /*<<< orphan*/ sleep(int);
void do_work2() {
  while (1) {
    print_greetings();
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<do_work2>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <do_work2+0x9>
mov    $0x0,%al
call   1030 <print_greetings@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1129 <do_work2+0x9>

x86 assembly (clang, -O2):
<do_work2>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <print_greetings@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <do_work2+0x10>

LLVM IR (-O0):
define void @do_work2() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @print_greetings()
%3 = call i32 @sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define void @do_work2() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @print_greetings()
%3 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
scalar_t__ check_gpio(int);
int omap_request_gpio(int gpio) {
  if (check_gpio(gpio) < 0)
    return -22;
  return 0;
}


x86 assembly (clang, -O0):
<omap_request_gpio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <check_gpio@plt>
cmp    $0x0,%rax
jge    1139 <omap_request_gpio+0x29>
movl   $0xffffffea,-0x4(%rbp)
jmp    1140 <omap_request_gpio+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omap_request_gpio>:
push   %rax
call   1030 <check_gpio@plt>
sar    $0x3f,%rax
and    $0xffffffea,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @omap_request_gpio(i32 %0) {
%2 = tail call i64 @check_gpio(i32 %0)
%3 = icmp slt i64 %2, 0
%4 = select i1 %3, i32 -22, i32 0
ret i32 %4
}
/* Variables and functions */
scalar_t__ str_is_set(char const *);
const char *str_or(const char *s1, const char *s2) {
  return str_is_set(s1) ? s1 : s2;
}


x86 assembly (clang, -O0):
<str_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <str_is_set@plt>
cmp    $0x0,%rax
je     1140 <str_or+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <str_or+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_or>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <str_is_set@plt>
test   %rax,%rax
cmovne %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_or(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @str_is_set(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i8*, i8** %3
br label %12
10: ; preds = %2
%11 = load i8*, i8** %4
br label %12
12: ; preds = %10, %8
%13 = phi i8* [ %9, %8 ], [ %11, %10 ]
ret i8* %13
}

LLVM IR (-O2):
define i8* @str_or(i8* %0, i8* readnone %1) {
%3 = tail call i64 @str_is_set(i8* %0)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* %1, i8* %0
ret i8* %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t cd_rev(uint8_t byte) {
  int i;
  uint8_t output = 0;
  for (i = 0; i < 8; i++) {
    output <<= 1;
    if (byte & 0x01)
      output |= 1;
    byte >>= 1;
  }
  return (output);
}


x86 assembly (clang, -O0):
<cd_rev>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1157 <cd_rev+0x57>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1140 <cd_rev+0x40>
mov    -0xc(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <cd_rev+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_rev>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @cd_rev(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strcpytree(char *w) {
  char *s;
  s = (char *)malloc(strlen(w) + 1);
  if (s != NULL)
    strcpy(s, w);
  return s;
}


x86 assembly (clang, -O0):
<strcpytree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strcpytree+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpytree>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strcpytree+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcpytree(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%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 %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @strcpytree(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
scalar_t__ ERR;
scalar_t__ ungetch(int);
uint8_t ccbi_ungetch(int c) { return ((ungetch(c)) == ERR ? 0 : 1); }


x86 assembly (clang, -O0):
<ccbi_ungetch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ungetch@plt>
mov    %rax,%rdx
mov    0x2ebb(%rip),%rax
mov    (%rax),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccbi_ungetch>:
push   %rax
call   1030 <ungetch@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ERR = global i64 0
define i32 @ccbi_ungetch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ungetch(i32 %3)
%5 = load i64, i64* @ERR
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
ret i32 %8
}

LLVM IR (-O2):
@ERR = global i64 0
define i32 @ccbi_ungetch(i32 %0) {
%2 = tail call i64 @ungetch(i32 %0)
%3 = load i64, i64* @ERR
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void CtrBufStr(buf, buflen, bufstr) char *buf, *bufstr;
{
  tsprintf((char *)buf, "%*s%s\n",
           (int)((buflen - strlen((const char *)bufstr)) / 2), " ", bufstr);
}


x86 assembly (clang, -O0):
<CtrBufStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
shr    $0x1,%rax
mov    %eax,%edx
mov    -0x18(%rbp),%r8
lea    0xe95(%rip),%rsi
lea    0xe95(%rip),%rcx
mov    $0x0,%al
call   1030 <tsprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CtrBufStr>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rdi,%r14
movslq %esi,%rbx
mov    %rdx,%rdi
call   1040 <strlen@plt>
sub    %rax,%rbx
shr    %rbx
lea    0xebd(%rip),%rsi
lea    0xebd(%rip),%rcx
mov    %r14,%rdi
mov    %ebx,%edx
mov    %r15,%r8
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <tsprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%*s%s\0A\00"
@.str.1 = [2 x i8] c" \00"
define void @CtrBufStr(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = load i8*, i8** %6
%11 = call i64 @strlen(i8* %10)
%12 = sub i64 %9, %11
%13 = udiv i64 %12, 2
%14 = trunc i64 %13 to i32
%15 = load i8*, i8** %6
%16 = call i32 (i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tsprintf to i32 (i8*, i8*, i32, i8*, i8*, ...)*)(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%*s%s\0A\00"
@.str.1 = [2 x i8] c" \00"
define void @CtrBufStr(i8* %0, i32 %1, i8* %2) {
%4 = sext i32 %1 to i64
%5 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%6 = sub i64 %4, %5
%7 = lshr i64 %6, 1
%8 = trunc i64 %7 to i32
%9 = tail call i32 (i8*, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tsprintf to i32 (i8*, i8*, i32, i8*, i8*, ...)*)(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
void SubPersonTree(Schema, A, CompFunc) struct univStruct *Schema;
struct Person **A;
int (*CompFunc)();
{ PersonTreeTreeRemove(Schema, A, CompFunc); }


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

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

LLVM IR (-O0):
%struct.univStruct = type opaque
%struct.Person = type opaque
define void @SubPersonTree(%struct.univStruct* %0, %struct.Person** %1, i32 (...)* %2) {
%4 = alloca %struct.univStruct*
%5 = alloca %struct.Person**
%6 = alloca i32 (...)*
store %struct.univStruct* %0, %struct.univStruct** %4
store %struct.Person** %1, %struct.Person*** %5
store i32 (...)* %2, i32 (...)** %6
%7 = load %struct.univStruct*, %struct.univStruct** %4
%8 = load %struct.Person**, %struct.Person*** %5
%9 = load i32 (...)*, i32 (...)** %6
%10 = call i32 (%struct.univStruct*, %struct.Person**, i32 (...)*, ...) bitcast (i32 (...)* @PersonTreeTreeRemove to i32 (%struct.univStruct*, %struct.Person**, i32 (...)*, ...)*)(%struct.univStruct* %7, %struct.Person** %8, i32 (...)* %9)
ret void
}

LLVM IR (-O2):
%struct.univStruct = type opaque
%struct.Person = type opaque
define void @SubPersonTree(%struct.univStruct* %0, %struct.Person** %1, i32 (...)* %2) {
%4 = tail call i32 (%struct.univStruct*, %struct.Person**, i32 (...)*, ...) bitcast (i32 (...)* @PersonTreeTreeRemove to i32 (%struct.univStruct*, %struct.Person**, i32 (...)*, ...)*)(%struct.univStruct* %0, %struct.Person** %1, i32 (...)* %2)
ret void
}
void XGetWMHints() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SYS_ptrace;
int syscall(int /*<<< orphan*/, int, int /*<<< orphan*/, void *, void *);
int sys_ptrace(int request, pid_t pid, void *addr, void *data) {
  return syscall(SYS_ptrace, request, pid, addr, data);
}


x86 assembly (clang, -O0):
<sys_ptrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_ptrace>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_ptrace = global i32 0
define i32 @sys_ptrace(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* @SYS_ptrace
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @syscall(i32 %9, i32 %10, i32 %11, i8* %12, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@SYS_ptrace = global i32 0
define i32 @sys_ptrace(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = load i32, i32* @SYS_ptrace
%6 = tail call i32 @syscall(i32 %5, i32 %0, i32 %1, i8* %2, i8* %3)
ret i32 %6
}
int set_option(const char *name __attribute__((unused)),
               void *val __attribute__((unused))) {
  return -2;
}


x86 assembly (clang, -O0):
<set_option>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xfffffffe,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @set_option(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -2
}
int runcheck() {}


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

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

LLVM IR (-O0):
define i32 @runcheck() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @runcheck() {
ret i32 undef
}
unsigned int rd_unsigned2(fd) {
  char buf[2];
  rd_bytes(fd, buf, 2L);
  return (*((unsigned short *)(buf)));
}


x86 assembly (clang, -O0):
<rd_unsigned2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x6(%rbp),%rsi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <rd_bytes@plt>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_unsigned2>:
push   %rax
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <rd_bytes@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rd_unsigned2(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%6 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @rd_bytes to i32 (i32, i8*, i64, ...)*)(i32 %4, i8* %5, i64 2)
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = bitcast i8* %7 to i16*
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rd_unsigned2(i32 %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @rd_bytes to i32 (i32, i8*, i64, ...)*)(i32 %0, i8* %3, i64 2)
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xstrdup(const char *s) {
  char *t;
  if (!s)
    return NULL;
  t = (char *)malloc(strlen(s) + 1);
  if (t) {
    strcpy(t, s);
  }
  return t;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    118d <xstrdup+0x5d>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1185 <xstrdup+0x55>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115f <xstrdup+0x2f>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1162 <xstrdup+0x32>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    1162 <xstrdup+0x32>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
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 i8* null, i8** %2
br label %22
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %20
16: ; preds = %8
%17 = load i8*, i8** %4
%18 = load i8*, i8** %3
%19 = call i32 @strcpy(i8* %17, i8* %18)
br label %20
20: ; preds = %16, %8
%21 = load i8*, i8** %4
store i8* %21, i8** %2
br label %22
22: ; preds = %20, %7
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @strcpy(i8* %7, i8* %0)
br label %11
11: ; preds = %3, %9, %1
%12 = phi i8* [ null, %1 ], [ %7, %9 ], [ %7, %3 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void e(char *p, int i, void (*f)(char *)) {
  char test[10];
  memcpy(test, p, i);
  f(test);
  printf("%s", test);
}


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x22(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
lea    -0x22(%rbp),%rdi
call   *%rax
lea    -0x22(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xe(%rsp),%r14
mov    %r14,%rdi
call   1040 <memcpy@plt>
mov    %r14,%rdi
call   *%rbx
lea    0xeb8(%rip),%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @e(i8* %0, i32 %1, void (i8*)* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca void (i8*)*
%7 = alloca [10 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store void (i8*)* %2, void (i8*)** %6
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @memcpy(i8* %8, i8* %9, i32 %10)
%12 = load void (i8*)*, void (i8*)** %6
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @e(i8* %0, i32 %1, void (i8*)* nocapture %2) {
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = call i32 @memcpy(i8* %5, i8* %0, i32 %1)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
scalar_t__ isnan(float);
int __ocl_isgreaterequal_float(float src1, float src2) {
  return (isnan(src1) || isnan(src2)) ? 0 : src1 >= src2;
}


x86 assembly (clang, -O0):
<__ocl_isgreaterequal_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
jne    114a <__ocl_isgreaterequal_float+0x3a>
movss  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1154 <__ocl_isgreaterequal_float+0x44>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1168 <__ocl_isgreaterequal_float+0x58>
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_isgreaterequal_float>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0xc(%rsp)
call   1030 <isnan@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    114d <__ocl_isgreaterequal_float+0x3d>
movss  0x8(%rsp),%xmm0
call   1030 <isnan@plt>
test   %rax,%rax
jne    114d <__ocl_isgreaterequal_float+0x3d>
xor    %ebx,%ebx
movss  0xc(%rsp),%xmm0
ucomiss 0x8(%rsp),%xmm0
setae  %bl
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__ocl_isgreaterequal_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call i64 @isnan(float %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load float, float* %4
%10 = call i64 @isnan(float %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8, %2
br label %18
13: ; preds = %8
%14 = load float, float* %3
%15 = load float, float* %4
%16 = fcmp oge float %14, %15
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %13, %12
%19 = phi i32 [ 0, %12 ], [ %17, %13 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @__ocl_isgreaterequal_float(float %0, float %1) {
%3 = tail call i64 @isnan(float %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i64 @isnan(float %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = fcmp oge float %0, %1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %2, %5, %8
%12 = phi i32 [ %10, %8 ], [ 0, %5 ], [ 0, %2 ]
ret i32 %12
}