xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t rotr32(uint32_t a, uint8_t n) { return ((a >> n) | (a << (32 - n))); }


x86 assembly (clang, -O0):
<rotr32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr32>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotr32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotr32(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sep(void) {
  printf("\n------------------------------------------------------------"
         "------------------\n");
}


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

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

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

LLVM IR (-O2):
@str = [80 x i8] c"\0A------------------------------------------------------------------------------\00"
define void @print_sep() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ asm_read(int, void *, size_t);
ssize_t __attribute__((section("libgloss_epiphany")))
_read(int fildes, void *ptr, size_t len) {
  return asm_read(fildes, ptr, len);
}


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

x86 assembly (clang, -O2):
<_read>:
jmp    1030 <asm_read@plt>

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

LLVM IR (-O2):
define i32 @_read(i32 %0, i8* %1, i64 %2) section "libgloss_epiphany" {
%4 = tail call i32 @asm_read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int O_RDWR;
int O_SYNC;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dni_erase_for_mmc(int);
int open(char *, int);
void erase_pot_mtd(char *mtd) {
  int devfd;
  devfd = open(mtd, O_RDWR | O_SYNC);
  if (devfd < 0)
    return;
  dni_erase_for_mmc(devfd);
  close(devfd);
}


x86 assembly (clang, -O0):
<erase_pot_mtd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2e90(%rip),%rax
or     (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1169 <erase_pot_mtd+0x39>
jmp    1179 <erase_pot_mtd+0x49>
mov    -0xc(%rbp),%edi
call   1030 <dni_erase_for_mmc@plt>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_pot_mtd>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1050 <open@plt>
test   %eax,%eax
js     115d <erase_pot_mtd+0x2d>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <dni_erase_for_mmc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_SYNC = global i32 0
define void @erase_pot_mtd(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_SYNC
%7 = or i32 %5, %6
%8 = call i32 @open(i8* %4, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
br label %17
12: ; preds = %1
%13 = load i32, i32* %3
%14 = call i32 @dni_erase_for_mmc(i32 %13)
%15 = load i32, i32* %3
%16 = call i32 @close(i32 %15)
br label %17
17: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_SYNC = global i32 0
define void @erase_pot_mtd(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_SYNC
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = tail call i32 @dni_erase_for_mmc(i32 %5)
%9 = tail call i32 @close(i32 %5)
br label %10
10: ; preds = %1, %7
ret void
}
/* Variables and functions */
double __llvm_amdgcn_rcp_f64(double);
double __drcp_rz(double x) { return __llvm_amdgcn_rcp_f64(x); }


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

x86 assembly (clang, -O2):
<__drcp_rz>:
jmp    1030 <__llvm_amdgcn_rcp_f64@plt>

LLVM IR (-O0):
define double @__drcp_rz(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__llvm_amdgcn_rcp_f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @__drcp_rz(double %0) {
%2 = tail call double @__llvm_amdgcn_rcp_f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ opl_timer_over(int, int /*<<< orphan*/);
void opl_timer_callback10(void *p) { opl_timer_over(1, 0); }


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

x86 assembly (clang, -O2):
<opl_timer_callback10>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <opl_timer_over@plt>

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

LLVM IR (-O2):
define void @opl_timer_callback10(i8* nocapture readnone %0) {
%2 = tail call i32 @opl_timer_over(i32 1, i32 0)
ret void
}
/* Variables and functions */
int right_child_index(int);
bool has_right_child(int size, int index) {
  return right_child_index(index) < size;
}


x86 assembly (clang, -O0):
<has_right_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <right_child_index@plt>
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_right_child>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <right_child_index@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @has_right_child(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @right_child_index(i32 %5)
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @has_right_child(i32 %0, i32 %1) {
%3 = tail call i32 @right_child_index(i32 %1)
%4 = icmp slt i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
void csv_log_terminate(struct _nlTestSuite *inSuite, int inResult,
                       int inWidth) {
  printf("'#5:','%-*s','%s'\n", inWidth, "Terminate",
         inResult == -1 ? "FAILED" : "PASSED");
}


x86 assembly (clang, -O0):
<csv_log_terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xef5(%rip),%rcx
lea    0xee7(%rip),%rax
cmp    $0xffffffff,%edx
cmove  %rax,%rcx
lea    0xebc(%rip),%rdi
lea    0xec8(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csv_log_terminate>:
cmp    $0xffffffff,%esi
lea    0xf03(%rip),%rax
lea    0xf03(%rip),%rcx
cmove  %rax,%rcx
lea    0xed4(%rip),%rdi
lea    0xee0(%rip),%rax
mov    %edx,%esi
mov    %rax,%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct._nlTestSuite = type opaque
@.str = [19 x i8] c"':','%-*s','%s'\0A\00"
@.str.1 = [10 x i8] c"Terminate\00"
@.str.2 = [7 x i8] c"FAILED\00"
@.str.3 = [7 x i8] c"PASSED\00"
define void @csv_log_terminate(%struct._nlTestSuite* %0, i32 %1, i32 %2) {
%4 = alloca %struct._nlTestSuite*
%5 = alloca i32
%6 = alloca i32
store %struct._nlTestSuite* %0, %struct._nlTestSuite** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
%struct._nlTestSuite = type opaque
@.str = [19 x i8] c"':','%-*s','%s'\0A\00"
@.str.1 = [10 x i8] c"Terminate\00"
@.str.2 = [7 x i8] c"FAILED\00"
@.str.3 = [7 x i8] c"PASSED\00"
define void @csv_log_terminate(%struct._nlTestSuite* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, -1
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
double EvalAngDist_alpha1_3minus_2plus_15097_L1(double);
double funcAngDist_alpha1_3minus_2plus_15097_L1(double *x, double *par) {
  double result;
  result = par[0] * EvalAngDist_alpha1_3minus_2plus_15097_L1(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngDist_alpha1_3minus_2plus_15097_L1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngDist_alpha1_3minus_2plus_15097_L1@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngDist_alpha1_3minus_2plus_15097_L1>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngDist_alpha1_3minus_2plus_15097_L1@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngDist_alpha1_3minus_2plus_15097_L1(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngDist_alpha1_3minus_2plus_15097_L1(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngDist_alpha1_3minus_2plus_15097_L1(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngDist_alpha1_3minus_2plus_15097_L1(double %4)
%6 = fmul double %3, %5
ret double %6
}
void gtk_widget_activate() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_activate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void msg_print(void *msg) { printf("%s\n", (char *)msg); }


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

x86 assembly (clang, -O2):
<msg_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @msg_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @msg_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ access(char *, int);
void c_access_(char *path, int *mode, int lpath) { access(path, *mode); }


x86 assembly (clang, -O0):
<c_access_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <access@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_access_>:
mov    (%rsi),%esi
jmp    1030 <access@plt>

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

LLVM IR (-O2):
define void @c_access_(i8* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @access(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prune_sub1(int);
void call_prune_sub1_2_Good() { prune_sub1(10); }


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

x86 assembly (clang, -O2):
<call_prune_sub1_2_Good>:
mov    $0xa,%edi
jmp    1030 <prune_sub1@plt>

LLVM IR (-O0):
define void @call_prune_sub1_2_Good() {
%1 = call i32 @prune_sub1(i32 10)
ret void
}

LLVM IR (-O2):
define void @call_prune_sub1_2_Good() {
%1 = tail call i32 @prune_sub1(i32 10)
ret void
}
/* Variables and functions */
int strcmp(void const *, void const *);
int grabber_cmp_fct(const void *tocmp, const void *data) {
  if (!tocmp || !data)
    return -1;
  return strcmp(tocmp, data);
}


x86 assembly (clang, -O0):
<grabber_cmp_fct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <grabber_cmp_fct+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <grabber_cmp_fct+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <grabber_cmp_fct+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grabber_cmp_fct>:
test   %rdi,%rdi
je     111f <grabber_cmp_fct+0xf>
test   %rsi,%rsi
je     111f <grabber_cmp_fct+0xf>
jmp    1030 <strcmp@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @grabber_cmp_fct(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 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %16
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @strcmp(i8* %13, i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @grabber_cmp_fct(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
int vde_chain_nm3_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 4;
  if (sz_res)
    *sz_res = 3;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 33;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm3_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vde_chain_nm3_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vde_chain_nm3_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vde_chain_nm3_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vde_chain_nm3_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x21,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm3_work>:
test   %rdi,%rdi
je     110b <vde_chain_nm3_work+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vde_chain_nm3_work+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vde_chain_nm3_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vde_chain_nm3_work+0x2c>
movl   $0x21,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @vde_chain_nm3_work(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 4, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 3, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 33, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @vde_chain_nm3_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 33, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
void *base32_decode(const char *buf, unsigned int *outlen) {
  unsigned int len = strlen(buf);
  char *tmp = malloc(base32_decode_length(len));
  unsigned int x = base32_decode_into(buf, len, tmp);
  if (outlen)
    *outlen = x;
  return tmp;
}


x86 assembly (clang, -O0):
<base32_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1060 <base32_decode_length@plt>
movslq %eax,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1040 <base32_decode_into@plt>
mov    %eax,-0x24(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     119b <base32_decode+0x5b>
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base32_decode>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%r12
mov    %r12d,%edi
xor    %eax,%eax
call   1060 <base32_decode_length@plt>
movslq %eax,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r12d,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <base32_decode_into@plt>
test   %r14,%r14
je     1183 <base32_decode+0x43>
mov    %eax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @base32_decode(i8* %0, i32* writeonly %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @base32_decode_length to i32 (i32, ...)*)(i32 %4)
%6 = sext i32 %5 to i64
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @base32_decode_into to i32 (i8*, i32, i8*, ...)*)(i8* %0, i32 %4, i8* %7)
%9 = icmp eq i32* %1, null
br i1 %9, label %11, label %10
10: ; preds = %2
store i32 %8, i32* %1
br label %11
11: ; preds = %10, %2
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int main(int argc, char *argv[]) {
  execv("/usr/share/backuppc/bin/BackupPC_Admin_real", argv);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <execv@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"/usr/share/backuppc/bin/BackupPC_Admin_real\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 = load i8**, i8*** %5
%7 = call i32 @execv(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8** %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"/usr/share/backuppc/bin/BackupPC_Admin_real\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @execv(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8** %1)
ret i32 0
}
/* Type definitions */
struct program {
  int dummy;
};

/* Variables and functions */
int program_eval_logic(struct program *);
int program_eval_expression(struct program *prog) {
  return program_eval_logic(prog);
}


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

x86 assembly (clang, -O2):
<program_eval_expression>:
jmp    1030 <program_eval_logic@plt>

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

LLVM IR (-O2):
%struct.program = type { i32 }
define i32 @program_eval_expression(%struct.program* %0) {
%2 = tail call i32 @program_eval_logic(%struct.program* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ isdigit(char);
char *find_dot(char *str) {
  while (isdigit(*str))
    str++;
  if (*str == '.') {
    *str = '\0';
    return str + 1;
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<find_dot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1143 <find_dot+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <find_dot+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    116b <find_dot+0x5b>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <find_dot+0x63>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_dot>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <find_dot+0x10>
cmpb   $0x2e,-0x1(%rbx)
jne    113d <find_dot+0x2d>
movb   $0x0,-0x1(%rbx)
jmp    113f <find_dot+0x2f>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @find_dot(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isdigit(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 46
br i1 %10, label %11, label %12
11: ; preds = %8
store i8 0, i8* %3
br label %12
12: ; preds = %8, %11
%13 = phi i8* [ %7, %11 ], [ null, %8 ]
ret i8* %13
}
/* Variables and functions */
scalar_t__ is_hex(char const);
int __hex_len(const char *s) {
  int l;
  for (l = 0; is_hex(*s); l++)
    s++;
  return l;
}


x86 assembly (clang, -O0):
<__hex_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_hex@plt>
cmp    $0x0,%rax
je     1153 <__hex_len+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <__hex_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hex_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <is_hex@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1144 <__hex_len+0x34>
cs nopw 0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <is_hex@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <__hex_len+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @__hex_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @is_hex(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8, i8* %8
%11 = tail call i64 @is_hex(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *malloc(int);
int main() {
  unsigned char a = 200;
  unsigned char *y = malloc(1);
  *y = a;
  signed char *z = y;
  assert(*z == -56);
  signed char *s = malloc(10 * sizeof(signed char));
  s[0] = -5;
  unsigned char *us = s;
  *us = 12;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movb   $0xc8,-0x1(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xffffffc8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0xfb,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0xc,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8 -56, i8* %1
%6 = call i8* @malloc(i32 1)
store i8* %6, i8** %2
%7 = load i8, i8* %1
%8 = load i8*, i8** %2
store i8 %7, i8* %8
%9 = load i8*, i8** %2
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, -56
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i8* @malloc(i32 10)
store i8* %16, i8** %4
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 0
store i8 -5, i8* %18
%19 = load i8*, i8** %4
store i8* %19, i8** %5
%20 = load i8*, i8** %5
store i8 12, i8* %20
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int ulz77_encode_data(unsigned char **, size_t *, unsigned char *, size_t, int);
int ulz77_decompress_data(unsigned char **dst_out, size_t *dst_out_len,
                          unsigned char *src, size_t src_len) {
  return ulz77_encode_data(dst_out, dst_out_len, src, src_len, 1);
}


x86 assembly (clang, -O0):
<ulz77_decompress_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <ulz77_encode_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulz77_decompress_data>:
mov    $0x1,%r8d
jmp    1030 <ulz77_encode_data@plt>

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

LLVM IR (-O2):
define i32 @ulz77_decompress_data(i8** %0, i64* %1, i8* %2, i64 %3) {
%5 = tail call i32 @ulz77_encode_data(i8** %0, i64* %1, i8* %2, i64 %3, i32 1)
ret i32 %5
}
int rdr_debug_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rdr_debug_init() {
ret i32 0
}
int BKDRHash(char *str, int size) {
  int seed = 131;
  unsigned int hash = 0;
  while (*str != '\0') {
    hash = hash * seed + (*str++);
  }
  return hash % size;
}


x86 assembly (clang, -O0):
<BKDRHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x83,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114c <BKDRHash+0x4c>
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <BKDRHash+0x19>
mov    -0x14(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BKDRHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <BKDRHash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x83,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <BKDRHash+0x10>
jmp    112a <BKDRHash+0x2a>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @BKDRHash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %11, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = mul i32 %7, 131
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add i32 %10, %9
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}
/* Variables and functions */
void *insert(void *, void const *, int (*)(void const *, void const *), int *);
void *tsearch(const void *key, void **rootp,
              int (*compar)(const void *, const void *)) {
  int new = 0;
  return insert((void *)rootp, key, compar, &new);
}


x86 assembly (clang, -O0):
<tsearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <insert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsearch>:
push   %rax
mov    %rdi,%rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <insert@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @tsearch(i8* %0, i8** %1, i32 (i8*, i8*)* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = bitcast i8** %1 to i8*
%7 = call i8* @insert(i8* %6, i8* %0, i32 (i8*, i8*)* %2, i32* %4)
ret i8* %7
}
void acmpConfigure(unsigned int channel, unsigned int flags) {
  (*((volatile unsigned int *const)(0x4001105c + (channel * 4)))) = flags;
}


x86 assembly (clang, -O0):
<acmpConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    $0x4001105c,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<acmpConfigure>:
lea    0x4001105c(,%rdi,4),%eax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @acmpConfigure(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul i32 %6, 4
%8 = add i32 1073811548, %7
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %5, i32* %10
ret void
}

LLVM IR (-O2):
define void @acmpConfigure(i32 %0, i32 %1) {
%3 = shl i32 %0, 2
%4 = add i32 %3, 1073811548
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %1, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void prettyprint(double value) {
  if (value >= 0) {
    printf(" %1.3e ", value);
  } else {
    printf("%1.3e ", value);
  }
}


x86 assembly (clang, -O0):
<prettyprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1145 <prettyprint+0x35>
movsd  -0x8(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1156 <prettyprint+0x46>
movsd  -0x8(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prettyprint>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
lea    0xee2(%rip),%rax
lea    0xeda(%rip),%rdi
cmovb  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c" %1.3e \00"
@.str.1 = [7 x i8] c"%1.3e \00"
define void @prettyprint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double %6)
br label %11
8: ; preds = %1
%9 = load double, double* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %9)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c" %1.3e \00"
@.str.1 = [7 x i8] c"%1.3e \00"
define void @prettyprint(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* %3, double %0)
ret void
}
/* Type definitions */
struct dyString {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errAbort(char *, char *);
struct dyString *netSlurpFile(int);
int netUrlOpen(char *);
struct dyString *netSlurpUrl(char *url) {
  int sd = netUrlOpen(url);
  if (sd < 0)
    errAbort("netSlurpUrl: failed to open socket for [%s]", url);
  struct dyString *dy = netSlurpFile(sd);
  close(sd);
  return dy;
}


x86 assembly (clang, -O0):
<netSlurpUrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <netUrlOpen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1172 <netSlurpUrl+0x32>
mov    -0x8(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1040 <errAbort@plt>
mov    -0xc(%rbp),%edi
call   1030 <netSlurpFile@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netSlurpUrl>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1060 <netUrlOpen@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1161 <netSlurpUrl+0x21>
lea    0xea7(%rip),%rdi
mov    %r14,%rsi
call   1040 <errAbort@plt>
mov    %ebx,%edi
call   1030 <netSlurpFile@plt>
mov    %rax,%r14
mov    %ebx,%edi
call   1050 <close@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.dyString = type { i32 }
@.str = [44 x i8] c"netSlurpUrl: failed to open socket for [%s]\00"
define %struct.dyString* @netSlurpUrl(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.dyString*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @netUrlOpen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @errAbort(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = call %struct.dyString* @netSlurpFile(i32 %13)
store %struct.dyString* %14, %struct.dyString** %4
%15 = load i32, i32* %3
%16 = call i32 @close(i32 %15)
%17 = load %struct.dyString*, %struct.dyString** %4
ret %struct.dyString* %17
}

LLVM IR (-O2):
%struct.dyString = type { i32 }
@.str = [44 x i8] c"netSlurpUrl: failed to open socket for [%s]\00"
define %struct.dyString* @netSlurpUrl(i8* %0) {
%2 = tail call i32 @netUrlOpen(i8* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @errAbort(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
%7 = tail call %struct.dyString* @netSlurpFile(i32 %2)
%8 = tail call i32 @close(i32 %2)
ret %struct.dyString* %7
}
int setlogmask(int mask) { return 0xff; }


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

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

LLVM IR (-O0):
define i32 @setlogmask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 255
}

LLVM IR (-O2):
define i32 @setlogmask(i32 %0) {
ret i32 255
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void bar() {
  for (int i = 0; i < 10; i++) {
    foo();
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    113e <bar+0x2e>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <bar+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @bar() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @foo()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
%6 = tail call i32 (...) @foo()
%7 = tail call i32 (...) @foo()
%8 = tail call i32 (...) @foo()
%9 = tail call i32 (...) @foo()
%10 = tail call i32 (...) @foo()
ret void
}
char const *_Locale_extract_collate_name(const char *__DUMMY_PAR1,
                                         char *__DUMMY_PAR,
                                         struct _Locale_name_hint *hint) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct._Locale_name_hint = type opaque
define i8* @_Locale_extract_collate_name(i8* %0, i8* %1, %struct._Locale_name_hint* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct._Locale_name_hint*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct._Locale_name_hint* %2, %struct._Locale_name_hint** %6
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type opaque
define noalias i8* @_Locale_extract_collate_name(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct._Locale_name_hint* nocapture readnone %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void memcpy() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @memcpy() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Variables and functions */
int realmain(int, char **, char **);
int main(int argc, char *argv[], char *environ[]) {
  return realmain(argc, argv, environ);
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <realmain@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @realmain(i32 %0, i8** %1, i8** %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigwaitinfo(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int test(void) {
  sigset_t set;
  siginfo_t info;
  int result;
  (void)sigemptyset(&set);
  result = sigwaitinfo(&set, &info);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <sigemptyset@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <sigwaitinfo@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigemptyset@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <sigwaitinfo@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @sigemptyset(i32* %1)
%5 = call i32 @sigwaitinfo(i32* %1, i32* %2)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sigemptyset(i32* %1)
%6 = call i32 @sigwaitinfo(i32* %1, i32* %2)
ret i32 %6
}