xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int allowedOp(int op) {
  assert(72 == 73 - 1 && 73 == 74 - 1 && 74 == 75 - 1 && 71 == 72 - 1);
  return op == 67 || (op >= 71 && op <= 75);
}


x86 assembly (clang, -O0):
<allowedOp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%al
cmpl   $0x43,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1153 <allowedOp+0x43>
xor    %eax,%eax
cmpl   $0x47,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     114d <allowedOp+0x3d>
cmpl   $0x4b,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allowedOp>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <assert@plt>
cmp    $0x43,%ebx
sete   %al
add    $0xffffffb9,%ebx
cmp    $0x5,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @allowedOp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @assert(i32 1)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 67
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 71
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 75
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br label %14
14: ; preds = %12, %1
%15 = phi i1 [ true, %1 ], [ %13, %12 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @allowedOp(i32 %0) {
%2 = tail call i32 @assert(i32 1)
%3 = icmp eq i32 %0, 67
%4 = add i32 %0, -71
%5 = icmp ult i32 %4, 5
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dminsorted(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dminsorted(N, x, stride);
  printf("min: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1040 <stdlib_strided_dminsorted@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dminsorted@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"min: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dminsorted(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"min: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dminsorted(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
char const *skip_string(char const *, char *);
const char *skip_line(const char *string) {
  return skip_string(string, "%*[^\n]\n%n");
}


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

x86 assembly (clang, -O2):
<skip_line>:
lea    0xee9(%rip),%rsi
jmp    1030 <skip_string@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%*[^\0A]\0A%n\00"
define i8* @skip_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @skip_string(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"%*[^\0A]\0A%n\00"
define i8* @skip_line(i8* %0) {
%2 = tail call i8* @skip_string(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
void dnk_dump() {}


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

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

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

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

/* Variables and functions */
int bgpdump_int2str(int, char *);
int /*<<< orphan*/ printf(char *, char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
void ti2s(uint32_t value) {
  char buf[100], ref[100];
  sprintf(ref, "%u", value);
  int len = bgpdump_int2str(value, buf);
  printf("%s =?= %s (%i)\n", ref, buf, len);
}


x86 assembly (clang, -O0):
<ti2s>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb1(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%edi
lea    -0x70(%rbp),%rsi
call   1040 <bgpdump_int2str@plt>
mov    %eax,-0xe4(%rbp)
lea    -0xe0(%rbp),%rsi
lea    -0x70(%rbp),%rdx
mov    -0xe4(%rbp),%ecx
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti2s>:
push   %r15
push   %r14
push   %rbx
sub    $0xe0,%rsp
mov    %edi,%ebx
lea    0xebb(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %ebx,%edx
call   1050 <sprintf@plt>
lea    0x70(%rsp),%r15
mov    %ebx,%edi
mov    %r15,%rsi
call   1040 <bgpdump_int2str@plt>
lea    0xe9b(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
add    $0xe0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [16 x i8] c"%s =?= %s (%i)\0A\00"
define void @ti2s(i32 %0) {
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @bgpdump_int2str(i32 %0, i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %4, i32 %7)
ret void
}
int xdddefault_delete_service_downtime(unsigned long downtime_id) {}


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

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

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

LLVM IR (-O2):
define i32 @xdddefault_delete_service_downtime(i64 %0) {
ret i32 undef
}
/* Variables and functions */
bool nrf52_errata_187(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_187() {
ret i32 0
}
int fMax4(int a, int b) {
  b = a - b;
  a -= b & (b >> 31);
  return a;
}


x86 assembly (clang, -O0):
<fMax4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
and    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fMax4>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @fMax4(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 = sub nsw i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 31
%11 = and i32 %8, %10
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @fMax4(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
double fmin(double a, double b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<fmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fmin+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <fmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmin>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @fmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void pal_smmu_device_start_monitor_iova(void *port) { return; }


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

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

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

LLVM IR (-O2):
define void @pal_smmu_device_start_monitor_iova(i8* nocapture %0) {
ret void
}
/* Variables and functions */
size_t string_list_length(const char **list) {
  if (list) {
    size_t i = 0;
    while (list[i])
      ++i;
    return i;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<string_list_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114c <string_list_length+0x4c>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     113f <string_list_length+0x3f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <string_list_length+0x1b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <string_list_length+0x54>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @string_list_length(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %4, %3 ]
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ *BN_lebin2bn(unsigned char const *, unsigned int,
                                int /*<<< orphan*/ *);
int read_lebn(const unsigned char **in, unsigned int nbyte, BIGNUM **r) {
  *r = BN_lebin2bn(*in, nbyte, NULL);
  if (*r == NULL)
    return 0;
  *in += nbyte;
  return 1;
}


x86 assembly (clang, -O0):
<read_lebn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <BN_lebin2bn@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
jne    115a <read_lebn+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1173 <read_lebn+0x63>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    %edx,%edx
add    %rdx,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_lebn>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%r14
mov    (%rdi),%rdi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <BN_lebin2bn@plt>
mov    %rax,(%r15)
test   %rax,%rax
je     113d <read_lebn+0x2d>
mov    %ebp,%eax
add    %rax,(%r14)
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @read_lebn(i8** nocapture %0, i32 %1, i32** nocapture writeonly %2) {
%4 = load i8*, i8** %0
%5 = tail call i32* @BN_lebin2bn(i8* %4, i32 %1, i32* null)
store i32* %5, i32** %2
%6 = icmp eq i32* %5, null
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = load i8*, i8** %0
%9 = zext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
store i8* %10, i8** %0
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
int comparer(const void *a, const void *b) {
  unsigned int uiA = *((unsigned int *)a);
  unsigned int uiB = *((unsigned int *)b);
  if (uiA < uiB) {
    return -1;
  } else if (uiA == uiB) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<comparer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    1136 <comparer+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <comparer+0x5a>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <comparer+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    115a <comparer+0x5a>
jmp    1153 <comparer+0x53>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comparer>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comparer(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ult i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int do_d(char **, int);
int cmd_dr(char **argv) { return do_d(argv, 1); }


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

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

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

LLVM IR (-O2):
define i32 @cmd_dr(i8** %0) {
%2 = tail call i32 @do_d(i8** %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void help(const char *progname) {
  printf("DNSPod recursive dns server\n");
  printf("version 0.01\n");
  printf("Usage: %s [-c config]\n", progname);
}


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

x86 assembly (clang, -O2):
<help>:
push   %rbx
mov    %rdi,%rbx
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"DNSPod recursive dns server\0A\00"
@.str.1 = [14 x i8] c"version 0.01\0A\00"
@.str.2 = [23 x i8] c"Usage: %s [-c config]\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str.2 = [23 x i8] c"Usage: %s [-c config]\0A\00"
@str = [28 x i8] c"DNSPod recursive dns server\00"
@str.3 = [13 x i8] c"version 0.01\00"
define void @help(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int latex_init();
int module_latex_init(void) { return latex_init(); }


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

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

LLVM IR (-O0):
define i32 @module_latex_init() {
%1 = call i32 (...) @latex_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @module_latex_init() {
%1 = tail call i32 (...) @latex_init()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ recursive(int, int /*<<< orphan*/ **);
int main() {
  FILE *inputFile = fopen("data.txt", "w");
  if (inputFile == NULL) {
    printf("Error opening file!\n");
    exit(1);
  }
  recursive(3, &inputFile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1187 <main+0x47>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    $0x3,%edi
lea    -0x10(%rbp),%rsi
call   1050 <recursive@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,(%rsp)
test   %rax,%rax
je     116e <main+0x2e>
mov    %rsp,%rsi
mov    $0x3,%edi
call   1050 <recursive@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"data.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [21 x i8] c"Error opening file!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = call i32 @recursive(i32 3, i32** %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"data.txt\00"
@.str.1 = [2 x i8] c"w\00"
@str = [20 x i8] c"Error opening file!\00"
define i32 @main() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = call i32 @recursive(i32 3, i32** %1)
ret i32 0
}
unsigned long long __make_mantissa_base8(const char *tagp) {
  unsigned long long r = 0;
  while (tagp) {
    char tmp = *tagp;
    if (tmp >= '0' && tmp <= '7')
      r = (r * 8u) + tmp - '0';
    else
      return 0;
    ++tagp;
  }
  return r;
}


x86 assembly (clang, -O0):
<__make_mantissa_base8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1179 <__make_mantissa_base8+0x79>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x30,%eax
jl     115b <__make_mantissa_base8+0x5b>
movsbl -0x19(%rbp),%eax
cmp    $0x37,%eax
jg     115b <__make_mantissa_base8+0x5b>
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
movsbq -0x19(%rbp),%rcx
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x18(%rbp)
jmp    1168 <__make_mantissa_base8+0x68>
movq   $0x0,-0x8(%rbp)
jmp    1181 <__make_mantissa_base8+0x81>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <__make_mantissa_base8+0x10>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__make_mantissa_base8>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %rdi,%rdi
je     112f <__make_mantissa_base8+0x2f>
movsbq (%rdi),%rcx
lea    (%rcx,%rax,8),%rax
add    $0xffffffffffffffd0,%rax
and    $0xf8,%cl
add    $0x1,%rdi
cmp    $0x30,%cl
je     1110 <__make_mantissa_base8+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @__make_mantissa_base8(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8
store i8* %0, i8** %3
store i64 0, i64* %4
br label %6
6: ; preds = %27, %1
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
store i8 %11, i8* %5
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 48
br i1 %14, label %15, label %26
15: ; preds = %9
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 55
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i64, i64* %4
%21 = mul i64 %20, 8
%22 = load i8, i8* %5
%23 = sext i8 %22 to i64
%24 = add i64 %21, %23
%25 = sub i64 %24, 48
store i64 %25, i64* %4
br label %27
26: ; preds = %15, %9
store i64 0, i64* %2
br label %32
27: ; preds = %19
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %3
br label %6
30: ; preds = %6
%31 = load i64, i64* %4
store i64 %31, i64* %2
br label %32
32: ; preds = %30, %26
%33 = load i64, i64* %2
ret i64 %33
}

LLVM IR (-O2):
define i64 @__make_mantissa_base8(i8* %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %14, %6 ]
%4 = phi i64 [ 0, %1 ], [ %13, %6 ]
%5 = icmp eq i8* %3, null
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = load i8, i8* %3
%8 = and i8 %7, -8
%9 = icmp eq i8 %8, 48
%10 = shl i64 %4, 3
%11 = sext i8 %7 to i64
%12 = add i64 %10, -48
%13 = add i64 %12, %11
%14 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %9, label %2, label %15
15: ; preds = %2, %6
%16 = phi i64 [ 0, %6 ], [ %4, %2 ]
ret i64 %16
}
void debug_no_newline(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @debug_no_newline(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ angle_rotate(unsigned int);
int /*<<< orphan*/ soft_left_2();
void soft_left_2_degrees(unsigned int Degrees) {
  soft_left_2();
  Degrees = Degrees * 2;
  angle_rotate(Degrees);
}


x86 assembly (clang, -O0):
<soft_left_2_degrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <soft_left_2@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <angle_rotate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soft_left_2_degrees>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <soft_left_2@plt>
add    %ebx,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <angle_rotate@plt>

LLVM IR (-O0):
define void @soft_left_2_degrees(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @soft_left_2()
%4 = load i32, i32* %2
%5 = mul i32 %4, 2
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @angle_rotate(i32 %6)
ret void
}

LLVM IR (-O2):
define void @soft_left_2_degrees(i32 %0) {
%2 = tail call i32 (...) @soft_left_2()
%3 = shl i32 %0, 1
%4 = tail call i32 @angle_rotate(i32 %3)
ret void
}
_Bool eq_float_cc(float _Complex a, float _Complex b) { return a == b; }


x86 assembly (clang, -O0):
<eq_float_cc>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movlpd %xmm1,-0x10(%rbp)
movss  -0x8(%rbp),%xmm2
movss  -0x4(%rbp),%xmm0
movss  -0x10(%rbp),%xmm3
movss  -0xc(%rbp),%xmm1
ucomiss %xmm3,%xmm2
sete   %al
setnp  %cl
and    %cl,%al
ucomiss %xmm1,%xmm0
sete   %cl
setnp  %dl
and    %dl,%cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_float_cc>:
ucomiss %xmm1,%xmm0
setnp  %al
sete   %cl
and    %al,%cl
cmpeqps %xmm1,%xmm0
pextrw $0x2,%xmm0,%eax
and    %cl,%al
ret

LLVM IR (-O0):
define zeroext i1 @eq_float_cc(<2 x float> %0, <2 x float> %1) {
%3 = alloca { float, float }
%4 = alloca { float, float }
%5 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %5
%6 = bitcast { float, float }* %4 to <2 x float>*
store <2 x float> %1, <2 x float>* %6
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%10 = load float, float* %9
%11 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 0
%12 = load float, float* %11
%13 = getelementptr inbounds { float, float }, { float, float }* %4, i32 0, i32 1
%14 = load float, float* %13
%15 = fcmp oeq float %8, %12
%16 = fcmp oeq float %10, %14
%17 = and i1 %15, %16
ret i1 %17
}

LLVM IR (-O2):
define zeroext i1 @eq_float_cc(<2 x float> %0, <2 x float> %1) {
%3 = extractelement <2 x float> %0, i64 0
%4 = extractelement <2 x float> %1, i64 0
%5 = fcmp oeq float %3, %4
%6 = fcmp oeq <2 x float> %0, %1
%7 = extractelement <2 x i1> %6, i64 1
%8 = and i1 %5, %7
ret i1 %8
}
int pow26(int n) {
  if (n == 0) {
    return 1;
  } else if (n % 2) {
    int product = pow26(n / 2);
    return 26 * product * product;
  } else {
    int product = pow26(n / 2);
    return product * product;
  }
}


x86 assembly (clang, -O0):
<pow26>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <pow26+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1189 <pow26+0x79>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116a <pow26+0x5a>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <pow26@plt>
mov    %eax,-0xc(%rbp)
imul   $0x1a,-0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <pow26+0x79>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <pow26@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow26>:
test   %edi,%edi
je     112d <pow26+0x1d>
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%edi
add    %ebx,%edi
sar    %edi
call   1030 <pow26@plt>
test   $0x1,%bl
pop    %rbx
jne    1133 <pow26+0x23>
imul   %eax,%eax
ret
mov    $0x1,%eax
ret
imul   %eax,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @pow26(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
%6 = sdiv i32 %0, 2
%7 = tail call i32 @pow26(i32 %6)
br i1 %5, label %13, label %10
8: ; preds = %1, %13, %10
%9 = phi i32 [ %12, %10 ], [ %14, %13 ], [ 1, %1 ]
ret i32 %9
10: ; preds = %3
%11 = mul nsw i32 %7, 26
%12 = mul nsw i32 %11, %7
br label %8
13: ; preds = %3
%14 = mul nsw i32 %7, %7
br label %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_patch(void) { printf("Hello from thread2 (PATCHED)\n"); }


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

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

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

LLVM IR (-O2):
@str = [29 x i8] c"Hello from thread2 (PATCHED)\00"
define void @print_patch() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void check(int a, int b) {
  if (a <= b)
    return;
  printf("Error in koord c! Exiting...");
  exit(1);
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1140 <check+0x20>
add    $0x10,%rsp
pop    %rbp
ret
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<check>:
cmp    %esi,%edi
jg     1125 <check+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Error in koord c! Exiting...\00"
define void @check(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 = icmp sle i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
ret void
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"Error in koord c! Exiting...\00"
define void @check(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %5, label %4
4: ; preds = %2
ret void
5: ; preds = %2
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ str_rindex_dfl(char const *, char, int);
ssize_t str_rindex(const char *s, char c) { return str_rindex_dfl(s, c, -1); }


x86 assembly (clang, -O0):
<str_rindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xffffffff,%edx
movsbl -0x9(%rbp),%esi
call   1030 <str_rindex_dfl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_rindex>:
mov    $0xffffffff,%edx
jmp    1030 <str_rindex_dfl@plt>

LLVM IR (-O0):
define i32 @str_rindex(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %4
%7 = call i32 @str_rindex_dfl(i8* %5, i8 signext %6, i32 -1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @str_rindex(i8* %0, i8 signext %1) {
%3 = tail call i32 @str_rindex_dfl(i8* %0, i8 signext %1, i32 -1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __dealloc(void *cc, void *m) { free(m); }


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

x86 assembly (clang, -O2):
<__dealloc>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @__dealloc(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addNode(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int k = 0;
  do {
    printf("\nDigite a chave do novo nodo: ");
    scanf("%d", &k);
    if (k != 0)
      addNode(k);
  } while (k != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1174 <main+0x44>
mov    -0x8(%rbp),%edi
call   1050 <addNode@plt>
jmp    1179 <main+0x49>
cmpl   $0x0,-0x8(%rbp)
jne    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeb8(%rip),%r14
lea    0xed0(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
je     1187 <main+0x57>
call   1050 <addNode@plt>
cmpl   $0x0,0xc(%rsp)
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0ADigite a chave do novo nodo: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %12, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* %2
%10 = call i32 @addNode(i32 %9)
br label %11
11: ; preds = %8, %3
br label %12
12: ; preds = %11
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %3, label %15
15: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0ADigite a chave do novo nodo: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = call i32 @addNode(i32 %6)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %8
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int pthread_rwlock_rdlock(pthread_rwlock_t *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 i32 @pthread_rwlock_rdlock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @pthread_rwlock_rdlock(i32* nocapture readnone %0) {
ret i32 0
}
void rop3_123_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_123_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_123_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %dl,%cl
or     %sil,%dl
not    %sil
or     %cl,%sil
not    %dl
and    %sil,%dl
or     %al,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_123_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = xor i32 %37, -1
%39 = and i32 %35, %38
%40 = load i8*, i8** %4
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = load i8, i8* %5
%44 = zext i8 %43 to i32
%45 = and i32 %42, %44
%46 = or i32 %39, %45
%47 = load i8*, i8** %4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = load i8, i8* %6
%51 = zext i8 %50 to i32
%52 = and i32 %49, %51
%53 = or i32 %46, %52
%54 = trunc i32 %53 to i8
%55 = load i8*, i8** %4
store i8 %54, i8* %55
ret void
}

LLVM IR (-O2):
define void @rop3_123_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = xor i8 %1, -1
%7 = or i8 %5, %6
%8 = or i8 %2, %1
%9 = xor i8 %8, -1
%10 = and i8 %7, %9
%11 = or i8 %4, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
double StandardGaussian();
double transformedGaussian(double mean, double stddev) {
  double stdGaussian, returnValue;
  stdGaussian = StandardGaussian();
  returnValue = stdGaussian * stddev + mean;
  return (returnValue);
}


x86 assembly (clang, -O0):
<transformedGaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <StandardGaussian@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transformedGaussian>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1030 <StandardGaussian@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @transformedGaussian(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = call double (...) @StandardGaussian()
store double %7, double* %5
%8 = load double, double* %5
%9 = load double, double* %4
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double %8, double %9, double %10)
store double %11, double* %6
%12 = load double, double* %6
ret double %12
}

LLVM IR (-O2):
define double @transformedGaussian(double %0, double %1) {
%3 = tail call double (...) @StandardGaussian()
%4 = tail call double @llvm.fmuladd.f64(double %3, double %1, double %0)
ret double %4
}
/* Variables and functions */
char *addColor(char *, char *);
char *bgCyan(char *str) { return addColor("46", str); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"46\00"
define i8* @bgCyan(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}