xunge/DecIR huggingface dataset:
/* Variables and functions */
int partition(int *, int, int);
void qsort(int *array, int l, int u) {
  if (u - l <= 1) {
    return;
  } else {
    int m = partition(array, l, u);
    qsort(array, l, m);
    qsort(array, m + 1, u);
  }
}


x86 assembly (clang, -O0):
<qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x1,%eax
jg     1146 <qsort+0x26>
jmp    1179 <qsort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <qsort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%eax
sub    %esi,%eax
cmp    $0x2,%eax
jl     116a <qsort+0x4a>
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <qsort@plt>
add    $0x1,%ebp
mov    %r14d,%eax
sub    %ebp,%eax
mov    %ebp,%ebx
cmp    $0x1,%eax
jg     1140 <qsort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @qsort(i32* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = icmp slt i32 %4, 2
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %1, %3 ]
%8 = tail call i32 @partition(i32* %0, i32 %7, i32 %2)
tail call void @qsort(i32* %0, i32 %7, i32 %8)
%9 = add nsw i32 %8, 1
%10 = sub nsw i32 %2, %9
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %6
12: ; preds = %6, %3
ret void
}
/* Variables and functions */
double RAND_MAX;
unsigned int rand();
int int_rand_range(unsigned int a, unsigned int b) {
  unsigned int n = (b - a + 1);
  return a + ((int)((n * 1.0 * rand() / (RAND_MAX + 1.0))));
}


x86 assembly (clang, -O0):
<int_rand_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
movsd  -0x18(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
mov    %ecx,%ecx
cvtsi2sd %rcx,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9d(%rip),%xmm1
mov    0x2e7e(%rip),%rcx
addsd  (%rcx),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_rand_range>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
sub    %edi,%esi
add    $0x1,%esi
cvtsi2sd %rsi,%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0x8(%rsp),%xmm0
mov    0x2ea3(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xeaf(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @int_rand_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
%9 = add i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = uitofp i32 %11 to double
%13 = fmul double %12, 1.000000e+00
%14 = call i32 (...) @rand()
%15 = uitofp i32 %14 to double
%16 = fmul double %13, %15
%17 = load double, double* @RAND_MAX
%18 = fadd double %17, 1.000000e+00
%19 = fdiv double %16, %18
%20 = fptosi double %19 to i32
%21 = add i32 %10, %20
ret i32 %21
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @int_rand_range(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = uitofp i32 %4 to double
%6 = tail call i32 (...) @rand()
%7 = uitofp i32 %6 to double
%8 = fmul double %5, %7
%9 = load double, double* @RAND_MAX
%10 = fadd double %9, 1.000000e+00
%11 = fdiv double %8, %10
%12 = fptosi double %11 to i32
%13 = add i32 %12, %0
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char const *);
int strlen(char *);
int PrintError(char *buffer, const char *message) {
  sprintf(buffer + strlen(buffer), "\nError: ");
  sprintf(buffer + strlen(buffer), message);
  return 1;
}


x86 assembly (clang, -O0):
<PrintError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
cltq
add    %rax,%rdi
lea    0xeaf(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintError>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movabs $0x203a726f7272450a,%rcx
72 3a 20
mov    %rcx,(%rbx,%rax,1)
movb   $0x0,0x8(%rbx,%rax,1)
mov    %rbx,%rdi
call   1030 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1040 <sprintf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\0AError: \00"
define i32 @PrintError(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @strlen(i8* %12)
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8*, i8** %4
%17 = call i32 @sprintf(i8* %15, i8* %16)
ret i32 1
}

LLVM IR (-O2):
@.str = [9 x i8] c"\0AError: \00"
define i32 @PrintError(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(9) %5, i8* align 1 dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 9, i1 false)
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) %1)
ret i32 1
}
void foo819(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo819(i32 %0) {
ret void
}
unsigned addval_461(unsigned x) { return x + 3281043853U; }


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

x86 assembly (clang, -O2):
<addval_461>:
lea    -0x3c6f3e73(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_461(i32 %0) {
%2 = add i32 %0, -1013923443
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ suaF(unsigned int *);
void suaF2(unsigned int *x) { suaF(x); }


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

x86 assembly (clang, -O2):
<suaF2>:
jmp    1030 <suaF@plt>

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

LLVM IR (-O2):
define void @suaF2(i32* %0) {
%2 = tail call i32 @suaF(i32* %0)
ret void
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll5(struct __test_metadata *);
void wrapper_epoll5(struct __test_metadata *_metadata,
                    struct __fixture_variant_metadata *variant) {
  epoll5(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll5>:
jmp    1030 <epoll5@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll5(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll5(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll5(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll5(%struct.__test_metadata* %0)
ret void
}
int cmpul(const void *a, const void *b) {
  if (*(unsigned long *)a < *(unsigned long *)b)
    return -1;
  else if (*(unsigned long *)a > *(unsigned long *)b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmpul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jae    112c <cmpul+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <cmpul+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jbe    114c <cmpul+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <cmpul+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmpul(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 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
%12 = icmp ult i64 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i64*
%17 = load i64, i64* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i64*
%20 = load i64, i64* %19
%21 = icmp ugt i64 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %24
23: ; preds = %14
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmpul(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ugt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int strtol(char *, int /*<<< orphan*/ *, int);
int get_num(void) {
  char buf[10] = {0};
  fgets(buf, sizeof(buf), stdin);
  return strtol(buf, NULL, 10);
}


x86 assembly (clang, -O0):
<get_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    -0xa(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1040 <fgets@plt>
lea    -0xa(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1050 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num>:
push   %rbx
sub    $0x10,%rsp
movw   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <fgets@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @get_num() {
%1 = alloca [10 x i8]
%2 = bitcast [10 x i8]* %1 to i8*
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 10, i32 %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = call i32 @strtol(i8* %6, i32* null, i32 10)
ret i32 %7
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @get_num() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 10, i32 %3)
%5 = call i32 @strtol(i8* nocapture %2, i32* null, i32 10)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M355_f(char *s) {
  debug("M355_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M355_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M355_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M355_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M355_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M355_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M355_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int assert_false(int given, char *msg) {
  if (given) {
    printf("%s\n", msg);
    exit(1);
  }
  return 1;
}


x86 assembly (clang, -O0):
<assert_false>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1153 <assert_false+0x33>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_false>:
test   %edi,%edi
jne    112a <assert_false+0xa>
mov    $0x1,%eax
ret
push   %rax
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @assert_false(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @assert_false(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret i32 1
}
float PenumbraSize(float zReceiver, float zBlocker) {
  return (zReceiver - zBlocker) / zBlocker;
}


x86 assembly (clang, -O0):
<PenumbraSize>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<PenumbraSize>:
subss  %xmm1,%xmm0
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @PenumbraSize(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
%8 = load float, float* %4
%9 = fdiv float %7, %8
ret float %9
}

LLVM IR (-O2):
define float @PenumbraSize(float %0, float %1) {
%3 = fsub float %0, %1
%4 = fdiv float %3, %1
ret float %4
}
alphan(c) char c;
{
  if (alpha(c))
    return (1);
  if (c <= '9' && c >= '0')
    return (1);
  if (c == '$')
    return (1);
  if (c == '@')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<alphan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
mov    $0x0,%al
call   1030 <alpha@plt>
cmp    $0x0,%eax
je     113e <alphan+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    119d <alphan+0x8d>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1164 <alphan+0x54>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1164 <alphan+0x54>
movl   $0x1,-0x4(%rbp)
jmp    119d <alphan+0x8d>
movsbl -0x5(%rbp),%eax
cmp    $0x24,%eax
jne    117d <alphan+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    119d <alphan+0x8d>
movsbl -0x5(%rbp),%eax
cmp    $0x40,%eax
jne    1196 <alphan+0x86>
movl   $0x1,-0x4(%rbp)
jmp    119d <alphan+0x8d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphan>:
push   %rbx
movsbl %dil,%eax
mov    %edi,%ebx
shl    $0x18,%ebx
mov    %eax,%edi
xor    %eax,%eax
call   1030 <alpha@plt>
test   %eax,%eax
setne  %al
lea    -0x2f000001(%rbx),%ecx
cmp    $0xaffffff,%ecx
setb   %cl
or     %al,%cl
cmp    $0x24000000,%ebx
sete   %al
cmp    $0x40000000,%ebx
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @alphan(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @alpha to i32 (i32, ...)*)(i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %30
10: ; preds = %1
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp sge i32 %16, 48
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 1, i32* %2
br label %30
19: ; preds = %14, %10
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 36
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 1, i32* %2
br label %30
24: ; preds = %19
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 64
br i1 %27, label %28, label %29
28: ; preds = %24
store i32 1, i32* %2
br label %30
29: ; preds = %24
store i32 0, i32* %2
br label %30
30: ; preds = %29, %28, %23, %18, %9
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @alphan(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @alpha to i32 (i32, ...)*)(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = add i32 %2, -788529153
%7 = icmp ult i32 %6, 184549375
%8 = or i1 %7, %5
%9 = icmp eq i32 %2, 603979776
%10 = icmp eq i32 %2, 1073741824
%11 = or i1 %9, %10
%12 = or i1 %11, %8
%13 = zext i1 %12 to i32
ret i32 %13
}
int adjust_num_gangs(int num_gangs, int limit) {
  int n = num_gangs <= limit ? num_gangs : limit;
  return ((((((n)) % ((16))) == 0 ? (((n)) / ((16))) : (((n)) / ((16))) + 1)) *
          (16));
}


x86 assembly (clang, -O0):
<adjust_num_gangs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1121 <adjust_num_gangs+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <adjust_num_gangs+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1154 <adjust_num_gangs+0x54>
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
jmp    1165 <adjust_num_gangs+0x65>
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_num_gangs>:
cmp    %esi,%edi
cmovg  %esi,%edi
mov    %edi,%ecx
and    $0xf,%ecx
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
shr    $0x4,%eax
cmp    $0x1,%ecx
sbb    $0xffffffff,%eax
shl    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @adjust_num_gangs(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
%5 = and i32 %4, 15
%6 = icmp ne i32 %5, 0
%7 = sdiv i32 %4, 16
%8 = zext i1 %6 to i32
%9 = add nsw i32 %7, %8
%10 = shl nsw i32 %9, 4
ret i32 %10
}
/* Variables and functions */
bool gen_is_vlv(int devid) {
  return (devid == 0x0f30 || devid == 0x0f31 || devid == 0x0f32 ||
          devid == 0x0f33 || devid == 0x0157 || devid == 0x0155);
}


x86 assembly (clang, -O0):
<gen_is_vlv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0xf30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <gen_is_vlv+0x6e>
mov    $0x1,%al
cmpl   $0xf31,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <gen_is_vlv+0x6e>
mov    $0x1,%al
cmpl   $0xf32,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <gen_is_vlv+0x6e>
mov    $0x1,%al
cmpl   $0xf33,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <gen_is_vlv+0x6e>
mov    $0x1,%al
cmpl   $0x157,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     116e <gen_is_vlv+0x6e>
cmpl   $0x155,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_is_vlv>:
mov    $0x1,%eax
lea    -0xf30(%rdi),%ecx
cmp    $0x4,%ecx
jae    1111 <gen_is_vlv+0x11>
ret
cmp    $0x157,%edi
je     1110 <gen_is_vlv+0x10>
xor    %eax,%eax
cmp    $0x155,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @gen_is_vlv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 3888
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 3889
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 3890
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 3891
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 343
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 341
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @gen_is_vlv(i32 %0) {
switch i32 %0, label %2 [
i32 3891, label %5
i32 3890, label %5
i32 3889, label %5
i32 3888, label %5
i32 343, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 341
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
unsigned long hash_syscall(const pid_t pid, const int syscall) {
  unsigned long h;
  unsigned long lpid = (unsigned long)pid;
  h = (lpid ^ (lpid << 3) ^ syscall) % (1997);
  return h;
}


x86 assembly (clang, -O0):
<hash_syscall>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x3,%rcx
xor    %rcx,%rax
movslq -0xc(%rbp),%rcx
xor    %rcx,%rax
mov    $0x7cd,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_syscall>:
lea    0x0(,%rdi,8),%rax
xor    %rdi,%rax
movslq %esi,%rcx
xor    %rax,%rcx
movabs $0x689adb3574c87e3,%rdx
ad 89 06
mov    %rcx,%rax
mul    %rdx
mov    %rcx,%rax
sub    %rdx,%rax
shr    %rax
add    %rdx,%rax
shr    $0xa,%rax
imul   $0x7cd,%rax,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @hash_syscall(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%7 = load i64, i64* %3
store i64 %7, i64* %6
%8 = load i64, i64* %6
%9 = load i64, i64* %6
%10 = shl i64 %9, 3
%11 = xor i64 %8, %10
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = xor i64 %11, %13
%15 = urem i64 %14, 1997
store i64 %15, i64* %5
%16 = load i64, i64* %5
ret i64 %16
}

LLVM IR (-O2):
define i64 @hash_syscall(i64 %0, i32 %1) {
%3 = shl i64 %0, 3
%4 = xor i64 %3, %0
%5 = sext i32 %1 to i64
%6 = xor i64 %4, %5
%7 = urem i64 %6, 1997
ret i64 %7
}
/* Variables and functions */
int core10_safe(char const *);
int U_EMRPOLYPOLYGON16_safe(const char *record) {
  return (core10_safe(record));
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYPOLYGON16_safe>:
jmp    1030 <core10_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRPOLYPOLYGON16_safe(i8* %0) {
%2 = tail call i32 @core10_safe(i8* %0)
ret i32 %2
}
unsigned iabs(int a) {
  if (a < 0)
    return -a;
  return a;
}


x86 assembly (clang, -O0):
<iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <iabs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <iabs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iabs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @iabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
struct timespec {
  unsigned long tv_sec;
  unsigned long tv_nsec;
};
typedef unsigned long clock_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_BOOTTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
clock_t ddi_get_lbolt(void) {
  struct timespec ts;
  clock_gettime(CLOCK_BOOTTIME, &ts);
  return ((ts.tv_sec) * (1000000ul / 1ul)) +
         ((ts.tv_nsec) / (1000000000ul / 1000000ul));
}


x86 assembly (clang, -O0):
<ddi_get_lbolt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddi_get_lbolt>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,0x8(%rsp),%rcx
mov    0x10(%rsp),%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mul    %rdx
shr    $0x4,%rdx
add    %rdx,%rcx
mov    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_BOOTTIME = global i32 0
define i64 @ddi_get_lbolt() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_BOOTTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = udiv i64 %8, 1000
%10 = add i64 %6, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_BOOTTIME = global i32 0
define i64 @ddi_get_lbolt() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_BOOTTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = udiv i64 %9, 1000
%11 = add i64 %10, %7
ret i64 %11
}
void l_vm_add_module(struct l_vm_t *vm, struct l_object_t *module) {}


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

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

LLVM IR (-O0):
%struct.l_vm_t = type opaque
%struct.l_object_t = type opaque
define void @l_vm_add_module(%struct.l_vm_t* %0, %struct.l_object_t* %1) {
%3 = alloca %struct.l_vm_t*
%4 = alloca %struct.l_object_t*
store %struct.l_vm_t* %0, %struct.l_vm_t** %3
store %struct.l_object_t* %1, %struct.l_object_t** %4
ret void
}

LLVM IR (-O2):
%struct.l_vm_t = type opaque
%struct.l_object_t = type opaque
define void @l_vm_add_module(%struct.l_vm_t* nocapture %0, %struct.l_object_t* nocapture %1) {
ret void
}
swab(from, to, nbytes) register char *from, *to;
{
  nbytes /= 2;
  while (nbytes-- > 0) {
    *(to + 1) = *from++;
    *to = *from++;
    to += 2;
  }
}


x86 assembly (clang, -O0):
<swab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    $0x0,%eax
jle    1171 <swab+0x71>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    111d <swab+0x1d>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swab>:
cmp    $0x2,%edx
jl     112c <swab+0x2c>
shr    %edx
add    $0x1,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,0x1(%rsi,%rax,1)
movzbl 0x1(%rdi,%rax,1),%ecx
mov    %cl,(%rsi,%rax,1)
add    $0xffffffff,%edx
add    $0x2,%rax
cmp    $0x1,%edx
ja     1110 <swab+0x10>
ret

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

LLVM IR (-O2):
define i32 @swab(i8* nocapture %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 1
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = lshr i32 %2, 1
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %11, %7 ], [ %6, %5 ]
%9 = phi i8* [ %17, %7 ], [ %1, %5 ]
%10 = phi i8* [ %15, %7 ], [ %0, %5 ]
%11 = add nsw i32 %8, -1
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = load i8, i8* %10
%14 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %13, i8* %14
%15 = getelementptr inbounds i8, i8* %10, i64 2
%16 = load i8, i8* %12
store i8 %16, i8* %9
%17 = getelementptr inbounds i8, i8* %9, i64 2
%18 = icmp ugt i32 %8, 1
br i1 %18, label %7, label %19
19: ; preds = %7, %3
ret i32 undef
}
char ctoi(int b) {
  int a, c;
  a = b / 2;
  c = b % 2;
  if (c)
    return a + 'a';
  else
    return a + 'A';
}


x86 assembly (clang, -O0):
<ctoi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     113b <ctoi+0x3b>
mov    -0xc(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1144 <ctoi+0x44>
mov    -0xc(%rbp),%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctoi>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
shr    %eax
and    $0x1,%dil
shl    $0x5,%dil
add    %dil,%al
add    $0x41,%al
ret

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

LLVM IR (-O2):
define signext i8 @ctoi(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
%5 = trunc i32 %2 to i8
%6 = select i1 %4, i8 65, i8 97
%7 = add i8 %6, %5
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ f();
int main() {
  extern int i;
  i = 1;
  f();
  assert(i == 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
movl   $0x1,(%rax)
mov    $0x0,%al
call   1030 <f@plt>
mov    0x2ea9(%rip),%rax
cmpl   $0xa,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
movl   $0x1,(%rbx)
xor    %eax,%eax
call   1030 <f@plt>
xor    %edi,%edi
cmpl   $0xa,(%rbx)
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@i = external global i32
define i32 @main() {
store i32 1, i32* @i
%1 = call i32 (...) @f()
%2 = load i32, i32* @i
%3 = icmp eq i32 %2, 10
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@i = external global i32
define i32 @main() {
store i32 1, i32* @i
%1 = tail call i32 (...) @f()
%2 = load i32, i32* @i
%3 = icmp eq i32 %2, 10
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addFoncT(char *, void (*)(), int /*<<< orphan*/, int);
void addFonP(char *l, void (*f)(void)) { addFoncT(l, f, 0, 4); }


x86 assembly (clang, -O0):
<addFonP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <addFoncT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addFonP>:
xor    %edx,%edx
mov    $0x4,%ecx
jmp    1030 <addFoncT@plt>

LLVM IR (-O0):
define void @addFonP(i8* %0, void ()* %1) {
%3 = alloca i8*
%4 = alloca void ()*
store i8* %0, i8** %3
store void ()* %1, void ()** %4
%5 = load i8*, i8** %3
%6 = load void ()*, void ()** %4
%7 = bitcast void ()* %6 to void (...)*
%8 = call i32 @addFoncT(i8* %5, void (...)* %7, i32 0, i32 4)
ret void
}

LLVM IR (-O2):
define void @addFonP(i8* %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @addFoncT(i8* %0, void (...)* %3, i32 0, i32 4)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void *sagetv_malloc(int size) {
  char *p = (char *)malloc(size);
  if (p)
    memset(p, 0, size);
  return (void *)p;
}


x86 assembly (clang, -O0):
<sagetv_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <sagetv_malloc+0x30>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sagetv_malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113e <sagetv_malloc+0x1e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @sagetv_malloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @memset(i8* %3, i32 0, i32 %0)
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
size_t fread_unlocked(void *, size_t, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
size_t fread(void *restrict ptr, size_t size, size_t count,
             FILE *restrict file) {
  flockfile(file);
  size_t result = fread_unlocked(ptr, size, count, file);
  funlockfile(file);
  return result;
}


x86 assembly (clang, -O0):
<fread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <flockfile@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <fread_unlocked@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <funlockfile@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fread>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %rcx,%rdi
call   1050 <flockfile@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1040 <fread_unlocked@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <funlockfile@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @fread(i8* noalias %0, i64 %1, i64 %2, i32* noalias %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = load i32*, i32** %8
%11 = call i32 @flockfile(i32* %10)
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = load i64, i64* %7
%15 = load i32*, i32** %8
%16 = call i64 @fread_unlocked(i8* %12, i64 %13, i64 %14, i32* %15)
store i64 %16, i64* %9
%17 = load i32*, i32** %8
%18 = call i32 @funlockfile(i32* %17)
%19 = load i64, i64* %9
ret i64 %19
}

LLVM IR (-O2):
define i64 @fread(i8* noalias nocapture %0, i64 %1, i64 %2, i32* noalias nocapture %3) {
%5 = tail call i32 @flockfile(i32* %3)
%6 = tail call i64 @fread_unlocked(i8* %0, i64 %1, i64 %2, i32* %3)
%7 = tail call i32 @funlockfile(i32* %3)
ret i64 %6
}
nosound() {}


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

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

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

LLVM IR (-O2):
define i32 @nosound() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int pthread_join(int /*<<< orphan*/, void **);
void thread_join(pthread_t thread, void **retval) {
  int err = pthread_join(thread, retval);
  if (err != 0) {
    perror("pthread_join");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<thread_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <pthread_join@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1172 <thread_join+0x42>
lea    0xea1(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_join>:
push   %rax
call   1050 <pthread_join@plt>
test   %eax,%eax
jne    113c <thread_join+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"pthread_join\00"
@EXIT_FAILURE = global i32 0
define void @thread_join(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @pthread_join(i32 %6, i8** %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"pthread_join\00"
@EXIT_FAILURE = global i32 0
define void @thread_join(i32 %0, i8** %1) {
%3 = tail call i32 @pthread_join(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
void avformat_free_context() {}


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

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

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

LLVM IR (-O2):
define void @avformat_free_context() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asinh(double);
int sqrt(int);
double tanh(int /*<<< orphan*/);
double f(double t) {
  double val = tanh(asinh(t));
  return sqrt(1 + val * val) / (1 + t * t);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <asinh@plt>
mov    %eax,%edi
call   1030 <tanh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe97(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe70(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movsd  %xmm0,(%rsp)
call   1050 <asinh@plt>
mov    %eax,%edi
call   1030 <tanh@plt>
mulsd  %xmm0,%xmm0
addsd  0xeb2(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm1
addsd  0xe91(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @asinh(double %4)
%6 = call double @tanh(i32 %5)
store double %6, double* %3
%7 = load double, double* %3
%8 = load double, double* %3
%9 = call double @llvm.fmuladd.f64(double %7, double %8, double 1.000000e+00)
%10 = fptosi double %9 to i32
%11 = call i32 @sqrt(i32 %10)
%12 = sitofp i32 %11 to double
%13 = load double, double* %2
%14 = load double, double* %2
%15 = call double @llvm.fmuladd.f64(double %13, double %14, double 1.000000e+00)
%16 = fdiv double %12, %15
ret double %16
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call i32 @asinh(double %0)
%3 = tail call double @tanh(i32 %2)
%4 = tail call double @llvm.fmuladd.f64(double %3, double %3, double 1.000000e+00)
%5 = fptosi double %4 to i32
%6 = tail call i32 @sqrt(i32 %5)
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%9 = fdiv double %7, %8
ret double %9
}
void XXorRegion() {}


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

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

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

LLVM IR (-O2):
define void @XXorRegion() {
ret void
}
int do_068() { return 68; }


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

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

LLVM IR (-O0):
define i32 @do_068() {
ret i32 68
}

LLVM IR (-O2):
define i32 @do_068() {
ret i32 68
}