xunge/DecIR huggingface dataset:
int main() {
  int vet[6] = {20, 80, 70, 21, 31, 33};
  printf("\n1-endereco %g", &vet);
  mergeSort(6, vet);
  imprimeVet(6, vet);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeb1(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
mov    $0x6,%edi
mov    $0x0,%al
call   1050 <mergeSort@plt>
lea    -0x20(%rbp),%rsi
mov    $0x6,%edi
mov    $0x0,%al
call   1030 <imprimeVet@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec5(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x6,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <mergeSort@plt>
mov    $0x6,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <imprimeVet@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.vet = [6 x i32] [i32 20, i32 80, i32 70, i32 21, i32 31, i32 33]
@.str = [15 x i8] c"\0A1-endereco %g\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
store i32 0, i32* %1
%3 = bitcast [6 x i32]* %2 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), [6 x i32]* %2)
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @mergeSort to i32 (i32, i32*, ...)*)(i32 6, i32* %5)
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%8 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @imprimeVet to i32 (i32, i32*, ...)*)(i32 6, i32* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vet = [6 x i32] [i32 20, i32 80, i32 70, i32 21, i32 31, i32 33]
@.str = [15 x i8] c"\0A1-endereco %g\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), [6 x i32]* %1)
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @mergeSort to i32 (i32, i32*, ...)*)(i32 6, i32* %4)
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @imprimeVet to i32 (i32, i32*, ...)*)(i32 6, i32* %4)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_retrieve_dobldobl_term(int i, int j, int n, int *exp, double *c) {
  int a[3], fail;
  a[0] = n;
  a[1] = i;
  a[2] = j;
  fail = _ada_use_c2phc(335, a, exp, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_retrieve_dobldobl_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0x2c(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x14f,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_retrieve_dobldobl_term>:
sub    $0x18,%rsp
mov    %edx,0xc(%rsp)
mov    %edi,0x10(%rsp)
mov    %esi,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x14f,%edi
mov    %rcx,%rdx
mov    %r8,%rcx
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @syscon_retrieve_dobldobl_term(i32 %0, i32 %1, i32 %2, i32* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca double*
%11 = alloca [3 x i32]
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store double* %4, double** %10
%13 = load i32, i32* %8
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
store i32 %13, i32* %14
%15 = load i32, i32* %6
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 1
store i32 %15, i32* %16
%17 = load i32, i32* %7
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 2
store i32 %17, i32* %18
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
%20 = load i32*, i32** %9
%21 = load double*, double** %10
%22 = call i32 @_ada_use_c2phc(i32 335, i32* %19, i32* %20, double* %21)
store i32 %22, i32* %12
%23 = load i32, i32* %12
ret i32 %23
}

LLVM IR (-O2):
define i32 @syscon_retrieve_dobldobl_term(i32 %0, i32 %1, i32 %2, i32* %3, double* %4) {
%6 = alloca [3 x i32]
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 %2, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 %0, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 %1, i32* %10
%11 = call i32 @_ada_use_c2phc(i32 335, i32* %8, i32* %3, double* %4)
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ ptrdiff_t;

/* Variables and functions */
size_t objpc_to_size(const void *ptr) {
  size_t ptr_rep;
  ptrdiff_t distance;
  distance =
      (ptrdiff_t)(((const unsigned char *)ptr) - ((const unsigned char *)NULL));
  ptr_rep = (size_t)distance;
  return ((size_t)ptr_rep);
}


x86 assembly (clang, -O0):
<objpc_to_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @objpc_to_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i64
%7 = sub i64 %6, 0
store i64 %7, i64* %4
%8 = load i64, i64* %4
store i64 %8, i64* %3
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
define i64 @objpc_to_size(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ datum;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, char *, int);
int get_int(char *where) {
  int datum;
  memcpy(&datum, where, sizeof(datum));
  return datum;
}


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

x86 assembly (clang, -O2):
<get_int>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @get_int(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
int(max)(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @max(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 sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void repeat_ch(char ch, int count) {
  while (count > 0) {
    printf("%c", ch);
    count--;
  }
}


x86 assembly (clang, -O0):
<repeat_ch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1149 <repeat_ch+0x39>
lea    0xece(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1121 <repeat_ch+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repeat_ch>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <repeat_ch+0x32>
mov    %esi,%ebx
add    $0x1,%ebx
movsbl %dil,%ebp
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <repeat_ch+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @repeat_ch(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8, i8* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @repeat_ch(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 1
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
int adreno_iommu_set_pt_ctx(struct adreno_ringbuffer *rb,
                            struct kgsl_pagetable *new_pt,
                            struct adreno_context *drawctxt) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.adreno_ringbuffer = type opaque
%struct.kgsl_pagetable = type opaque
%struct.adreno_context = type opaque
define i32 @adreno_iommu_set_pt_ctx(%struct.adreno_ringbuffer* %0, %struct.kgsl_pagetable* %1, %struct.adreno_context* %2) {
%4 = alloca %struct.adreno_ringbuffer*
%5 = alloca %struct.kgsl_pagetable*
%6 = alloca %struct.adreno_context*
store %struct.adreno_ringbuffer* %0, %struct.adreno_ringbuffer** %4
store %struct.kgsl_pagetable* %1, %struct.kgsl_pagetable** %5
store %struct.adreno_context* %2, %struct.adreno_context** %6
ret i32 0
}

LLVM IR (-O2):
%struct.adreno_ringbuffer = type opaque
%struct.kgsl_pagetable = type opaque
%struct.adreno_context = type opaque
define i32 @adreno_iommu_set_pt_ctx(%struct.adreno_ringbuffer* nocapture readnone %0, %struct.kgsl_pagetable* nocapture readnone %1, %struct.adreno_context* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
size_t strlen(char *);
void chop(char *string, char to_remove) {
  size_t length = strlen(string);
  if (to_remove == string[length]) {
    string[length] = '\0';
  }
}


x86 assembly (clang, -O0):
<chop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1153 <chop+0x43>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    %bpl,(%rbx,%rax,1)
jne    1127 <chop+0x17>
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @chop(i8* nocapture %0, i8 signext %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
br i1 %6, label %7, label %8
7: ; preds = %2
store i8 0, i8* %4
br label %8
8: ; preds = %7, %2
ret void
}
void g_shell_quote() {}


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

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

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

LLVM IR (-O2):
define void @g_shell_quote() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PositionSetup(float *);
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ servoFix(int /*<<< orphan*/, int /*<<< orphan*/, float *);
int main(int argc, char *argv[]) {
  float array[180];
  int i;
  PositionSetup(array);
  servoFix(atoi(argv[1]), atoi(argv[2]), array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x2e0(%rbp),%rdi
call   1030 <PositionSetup@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x2e8(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    -0x2e8(%rbp),%edi
mov    %eax,%esi
lea    -0x2e0(%rbp),%rdx
call   1040 <servoFix@plt>
xor    %eax,%eax
add    $0x2f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x2d0,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <PositionSetup@plt>
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %r14,%rdx
call   1040 <servoFix@plt>
xor    %eax,%eax
add    $0x2d0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [180 x float]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [180 x float], [180 x float]* %6, i64 0, i64 0
%9 = call i32 @PositionSetup(float* %8)
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
%18 = getelementptr inbounds [180 x float], [180 x float]* %6, i64 0, i64 0
%19 = call i32 @servoFix(i32 %13, i32 %17, float* %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [180 x float]
%4 = bitcast [180 x float]* %3 to i8*
%5 = getelementptr inbounds [180 x float], [180 x float]* %3, i64 0, i64 0
%6 = call i32 @PositionSetup(float* %5)
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @atoi(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = call i32 @servoFix(i32 %9, i32 %12, float* %5)
ret i32 0
}
/* Variables and functions */
int tracepoint_probe_register(char *, void *);
__attribute__((always_)) int register_trace_mm_page_alloc_extfrag(
    void (*probe)(struct page *page, int alloc_order, int fallback_order,
                  int alloc_migratetype, int fallback_migratetype)) {
  return tracepoint_probe_register("mm_page_alloc_extfrag", (void *)probe);
}


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

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

LLVM IR (-O0):
%struct.page = type opaque
@.str = [22 x i8] c"mm_page_alloc_extfrag\00"
define i32 @register_trace_mm_page_alloc_extfrag(void (%struct.page*, i32, i32, i32, i32)* %0) {
%2 = alloca void (%struct.page*, i32, i32, i32, i32)*
store void (%struct.page*, i32, i32, i32, i32)* %0, void (%struct.page*, i32, i32, i32, i32)** %2
%3 = load void (%struct.page*, i32, i32, i32, i32)*, void (%struct.page*, i32, i32, i32, i32)** %2
%4 = bitcast void (%struct.page*, i32, i32, i32, i32)* %3 to i8*
%5 = call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.page = type opaque
@.str = [22 x i8] c"mm_page_alloc_extfrag\00"
define i32 @register_trace_mm_page_alloc_extfrag(void (%struct.page*, i32, i32, i32, i32)* %0) {
%2 = bitcast void (%struct.page*, i32, i32, i32, i32)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dump_heap(void *);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *);
void free_wrapper(void *ptr) {
  if (!ptr) {
    printf("[-] free pointer == NULL\n");
    return;
  }
  free(ptr);
  dump_heap(ptr);
}


x86 assembly (clang, -O0):
<free_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1158 <free_wrapper+0x28>
lea    0xeb2(%rip),%rdi
call   1050 <printf@plt>
jmp    116a <free_wrapper+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <dump_heap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_wrapper>:
test   %rdi,%rdi
je     1147 <free_wrapper+0x17>
push   %rbx
mov    %rdi,%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <dump_heap@plt>
lea    0xeb2(%rip),%rdi
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@str = [25 x i8] c"[-] free pointer == NULL\00"
define void @free_wrapper(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %8
5: ; preds = %1
%6 = tail call i32 @free(i8* %0)
%7 = tail call i32 @dump_heap(i8* %0)
br label %8
8: ; preds = %5, %3
ret void
}
int dlacpy(char UPLO, int M, int N, double *A, int LDA, double *B, int LDB) {
  extern int dlacpy_(char *UPLO, int *M, int *N, double *A, int *LDA, double *B,
                     int *LDB);
  return dlacpy_(&UPLO, &M, &N, A, &LDA, B, &LDB);
}


x86 assembly (clang, -O0):
<dlacpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    0x10(%rbp),%edi
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%r9
lea    -0x1(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x1c(%rbp),%r8
lea    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <dlacpy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlacpy>:
sub    $0x18,%rsp
mov    %dil,0xb(%rsp)
mov    %esi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x20(%rsp),%rax
mov    %rax,(%rsp)
lea    0xb(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <dlacpy_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @dlacpy(i8 signext %0, i32 %1, i32 %2, double* %3, i32 %4, double* %5, i32 %6) {
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
store i8 %0, i8* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double* %3, double** %11
store i32 %4, i32* %12
store double* %5, double** %13
store i32 %6, i32* %14
%15 = load double*, double** %11
%16 = load double*, double** %13
%17 = call i32 @dlacpy_(i8* %8, i32* %9, i32* %10, double* %15, i32* %12, double* %16, i32* %14)
ret i32 %17
}

LLVM IR (-O2):
define i32 @dlacpy(i8 signext %0, i32 %1, i32 %2, double* %3, i32 %4, double* %5, i32 %6) {
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8 %0, i8* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %4, i32* %11
store i32 %6, i32* %12
%13 = call i32 @dlacpy_(i8* %8, i32* %9, i32* %10, double* %3, i32* %11, double* %5, i32* %12)
ret i32 %13
}
void nseel_asm_abs(void) { __asm__("fabs\n"); }


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

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

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

LLVM IR (-O2):
define void @nseel_asm_abs() {
tail call void asm sideeffect "fabs\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
unsigned int getpagesize();
size_t ptob(unsigned pages) { return pages * getpagesize(); }


x86 assembly (clang, -O0):
<ptob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpagesize@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
mov    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptob>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpagesize@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ptob(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @getpagesize()
%5 = mul i32 %3, %4
%6 = zext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @ptob(i32 %0) {
%2 = tail call i32 (...) @getpagesize()
%3 = mul i32 %2, %0
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ main(int);
void start() { main(1900); }


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

x86 assembly (clang, -O2):
<start>:
mov    $0x76c,%edi
jmp    1030 <main@plt>

LLVM IR (-O0):
define void @start() {
%1 = call i32 @main(i32 1900)
ret void
}

LLVM IR (-O2):
define void @start() {
%1 = tail call i32 @main(i32 1900)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  system("whoami");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"whoami\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"whoami\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
unsigned int fb_get_start_address() {
  unsigned int addr = 0;
  outb(0x3D4, 0x0D);
  addr = inb(0x3D5);
  outb(0x3D4, 0x0C);
  addr = (inb(0x3D5) << 8) | addr;
  return addr;
}


x86 assembly (clang, -O0):
<fb_get_start_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xd,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
mov    %eax,-0x4(%rbp)
mov    $0x3d4,%edi
mov    $0xc,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_get_start_address>:
push   %rbx
mov    $0x3d4,%edi
mov    $0xd,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
mov    %eax,%ebx
mov    $0x3d4,%edi
mov    $0xc,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
shl    $0x8,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fb_get_start_address() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @outb(i32 980, i32 13)
%3 = call i32 @inb(i32 981)
store i32 %3, i32* %1
%4 = call i32 @outb(i32 980, i32 12)
%5 = call i32 @inb(i32 981)
%6 = shl i32 %5, 8
%7 = load i32, i32* %1
%8 = or i32 %6, %7
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @fb_get_start_address() {
%1 = tail call i32 @outb(i32 980, i32 13)
%2 = tail call i32 @inb(i32 981)
%3 = tail call i32 @outb(i32 980, i32 12)
%4 = tail call i32 @inb(i32 981)
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
/* Variables and functions */
double __daylen__(int, int, int, double, double, double, int);
double day_length(int year, int month, int day, double lon, double lat) {
  return __daylen__(year, month, day, lon, lat, -35.0 / 60.0, 1);
}


x86 assembly (clang, -O0):
<day_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xeba(%rip),%xmm2
mov    $0x1,%ecx
call   1030 <__daylen__@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<day_length>:
movsd  0xee8(%rip),%xmm2
mov    $0x1,%ecx
jmp    1030 <__daylen__@plt>

LLVM IR (-O0):
define double @day_length(i32 %0, i32 %1, i32 %2, double %3, double %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double %3, double* %9
store double %4, double* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load double, double* %9
%15 = load double, double* %10
%16 = call double @__daylen__(i32 %11, i32 %12, i32 %13, double %14, double %15, double 0xBFE2AAAAAAAAAAAB, i32 1)
ret double %16
}

LLVM IR (-O2):
define double @day_length(i32 %0, i32 %1, i32 %2, double %3, double %4) {
%6 = tail call double @__daylen__(i32 %0, i32 %1, i32 %2, double %3, double %4, double 0xBFE2AAAAAAAAAAAB, i32 1)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
main() {
  int x = 3 - (2 + 1);
  f(0 == x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
ret i32 0
}
void coolant_stop() {}


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

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

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

LLVM IR (-O2):
define void @coolant_stop() {
ret void
}
/* Type definitions */
struct tl880_dev {
  int dummy;
};

/* Variables and functions */
scalar_t__ CHECK_NULL(struct tl880_dev *);
int /*<<< orphan*/ tl880_set_sampling_clock(struct tl880_dev *, int);
int /*<<< orphan*/ tl880_write_register(struct tl880_dev *, int, int);
void tl880_set_ntsc_audio_clock(struct tl880_dev *tl880dev) {
  if (CHECK_NULL(tl880dev)) {
    return;
  }
  tl880_set_sampling_clock(tl880dev, 3);
  tl880_write_register(tl880dev, 0x27810, 0xa000);
}


x86 assembly (clang, -O0):
<tl880_set_ntsc_audio_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <CHECK_NULL@plt>
cmp    $0x0,%rax
je     1154 <tl880_set_ntsc_audio_clock+0x24>
jmp    1175 <tl880_set_ntsc_audio_clock+0x45>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
call   1050 <tl880_set_sampling_clock@plt>
mov    -0x8(%rbp),%rdi
mov    $0x27810,%esi
mov    $0xa000,%edx
call   1030 <tl880_write_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl880_set_ntsc_audio_clock>:
push   %rbx
mov    %rdi,%rbx
call   1040 <CHECK_NULL@plt>
test   %rax,%rax
je     1140 <tl880_set_ntsc_audio_clock+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x3,%esi
call   1050 <tl880_set_sampling_clock@plt>
mov    %rbx,%rdi
mov    $0x27810,%esi
mov    $0xa000,%edx
pop    %rbx
jmp    1030 <tl880_write_register@plt>

LLVM IR (-O0):
%struct.tl880_dev = type { i32 }
define void @tl880_set_ntsc_audio_clock(%struct.tl880_dev* %0) {
%2 = alloca %struct.tl880_dev*
store %struct.tl880_dev* %0, %struct.tl880_dev** %2
%3 = load %struct.tl880_dev*, %struct.tl880_dev** %2
%4 = call i64 @CHECK_NULL(%struct.tl880_dev* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load %struct.tl880_dev*, %struct.tl880_dev** %2
%9 = call i32 @tl880_set_sampling_clock(%struct.tl880_dev* %8, i32 3)
%10 = load %struct.tl880_dev*, %struct.tl880_dev** %2
%11 = call i32 @tl880_write_register(%struct.tl880_dev* %10, i32 161808, i32 40960)
br label %12
12: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.tl880_dev = type { i32 }
define void @tl880_set_ntsc_audio_clock(%struct.tl880_dev* %0) {
%2 = tail call i64 @CHECK_NULL(%struct.tl880_dev* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @tl880_set_sampling_clock(%struct.tl880_dev* %0, i32 3)
%6 = tail call i32 @tl880_write_register(%struct.tl880_dev* %0, i32 161808, i32 40960)
br label %7
7: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void mtmemzero(void *mem, int count) { memset(mem, 0, count); }


x86 assembly (clang, -O0):
<mtmemzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtmemzero>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @mtmemzero(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
unsigned long get_ds(void) {
  unsigned long _v;
  __asm__("mov %%ds,%w0" : "=r"(_v) : "0"(0));
  return _v;
}


x86 assembly (clang, -O0):
<get_ds>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %ds,%ax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ds>:
xor    %eax,%eax
mov    %ds,%ax
ret

LLVM IR (-O0):
define i64 @get_ds() {
%1 = alloca i64
%2 = call i64 asm "mov %ds,${0:w}", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 0)
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_ds() {
%1 = tail call i64 asm "mov %ds,${0:w}", "=r,0,~{dirflag},~{fpsr},~{flags}"(i64 0)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ cvmx_uart_write_byte(int, char const);
void cvmx_uart_write_string(int uart_index, const char *str) {
  while (*str) {
    cvmx_uart_write_byte(uart_index, *str);
    str++;
  }
}


x86 assembly (clang, -O0):
<cvmx_uart_write_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <cvmx_uart_write_string+0x3c>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <cvmx_uart_write_byte@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111f <cvmx_uart_write_string+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvmx_uart_write_string>:
push   %rbp
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1145 <cvmx_uart_write_string+0x35>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%esi
mov    %ebp,%edi
call   1030 <cvmx_uart_write_byte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <cvmx_uart_write_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @cvmx_uart_write_string(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = tail call i32 @cvmx_uart_write_byte(i32 %0, i8 signext %6)
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret void
}
/* Variables and functions */
char getbyte();
char getreg() { return ('A' + getbyte() - 1); }


x86 assembly (clang, -O0):
<getreg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getbyte@plt>
movsbl %al,%eax
add    $0x41,%eax
sub    $0x1,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getreg>:
push   %rax
xor    %eax,%eax
call   1030 <getbyte@plt>
add    $0x40,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @getreg() {
%1 = call signext i8 (...) @getbyte()
%2 = sext i8 %1 to i32
%3 = add nsw i32 65, %2
%4 = sub nsw i32 %3, 1
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @getreg() {
%1 = tail call signext i8 (...) @getbyte()
%2 = add i8 %1, 64
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void seed() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<seed>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @seed() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @seed() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
void OBJ_NAME_init(void) {}


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

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

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

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

/* Variables and functions */
void flockfile(FILE *stream) { (void)stream; }


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

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

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

LLVM IR (-O2):
define void @flockfile(i32* nocapture %0) {
ret void
}
int foo(int a, int b, int c) {
  int *p;
  if (c)
    p = &a;
  else
    p = &b;
  *p = 3;
  *p = 4;
  return *p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1124 <foo+0x24>
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112c <foo+0x2c>
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edx,%edx
lea    -0x8(%rsp),%rax
lea    -0x4(%rsp),%rcx
cmove  %rax,%rcx
movl   $0x4,(%rcx)
mov    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = icmp eq i32 %2, 0
%7 = select i1 %6, i32* %5, i32* %4
store i32 4, i32* %7
ret i32 4
}
char *bdevname(struct block_device *bdev, char *buffer) {
  char *a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.block_device = type opaque
define i8* @bdevname(%struct.block_device* %0, i8* %1) {
%3 = alloca %struct.block_device*
%4 = alloca i8*
%5 = alloca i8*
store %struct.block_device* %0, %struct.block_device** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %5
ret i8* %6
}

LLVM IR (-O2):
%struct.block_device = type opaque
define noalias i8* @bdevname(%struct.block_device* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
void tone(int frequency, int duration) {}


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

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

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

LLVM IR (-O2):
define void @tone(i32 %0, i32 %1) {
ret void
}
void plugin_register_init() {}


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

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

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

LLVM IR (-O2):
define void @plugin_register_init() {
ret void
}
/* Variables and functions */
float HUGE_VAL;
void wcoord(float *dest, float w) {
  float winv = (w <= 0.f) ? HUGE_VAL : 1.f / w;
  dest[0] = 0.5f * winv;
  dest[1] = 0.0f;
  dest[2] = winv;
}


x86 assembly (clang, -O0):
<wcoord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     112f <wcoord+0x2f>
mov    0x2ec7(%rip),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1141 <wcoord+0x41>
movss  0xec9(%rip),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xeb1(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcoord>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jae    1116 <wcoord+0x16>
movss  0xef0(%rip),%xmm1
divss  %xmm0,%xmm1
jmp    1121 <wcoord+0x21>
mov    0x2ecb(%rip),%rax
movss  (%rax),%xmm1
movss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,(%rdi)
movl   $0x0,0x4(%rdi)
movss  %xmm1,0x8(%rdi)
ret

LLVM IR (-O0):
@HUGE_VAL = global float 0.000000e+00
define void @wcoord(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
%5 = alloca float
store float* %0, float** %3
store float %1, float* %4
%6 = load float, float* %4
%7 = fcmp ole float %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* @HUGE_VAL
br label %13
10: ; preds = %2
%11 = load float, float* %4
%12 = fdiv float 1.000000e+00, %11
br label %13
13: ; preds = %10, %8
%14 = phi float [ %9, %8 ], [ %12, %10 ]
store float %14, float* %5
%15 = load float, float* %5
%16 = fmul float 5.000000e-01, %15
%17 = load float*, float** %3
%18 = getelementptr inbounds float, float* %17, i64 0
store float %16, float* %18
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 1
store float 0.000000e+00, float* %20
%21 = load float, float* %5
%22 = load float*, float** %3
%23 = getelementptr inbounds float, float* %22, i64 2
store float %21, float* %23
ret void
}

LLVM IR (-O2):
@HUGE_VAL = global float 0.000000e+00
define void @wcoord(float* nocapture writeonly %0, float %1) {
%3 = fcmp ugt float %1, 0.000000e+00
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = load float, float* @HUGE_VAL
br label %8
6: ; preds = %2
%7 = fdiv float 1.000000e+00, %1
br label %8
8: ; preds = %6, %4
%9 = phi float [ %5, %4 ], [ %7, %6 ]
%10 = fmul float %9, 5.000000e-01
store float %10, float* %0
%11 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %11
%12 = getelementptr inbounds float, float* %0, i64 2
store float %9, float* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mc_path_isdir(char const *);
int mc_path_isfile(const char *filename) { return !mc_path_isdir(filename); }


x86 assembly (clang, -O0):
<mc_path_isfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mc_path_isdir@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mc_path_isfile(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @mc_path_isdir(i8* %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @mc_path_isfile(i8* %0) {
%2 = tail call i32 @mc_path_isdir(i8* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc(size_t);
void *xzalloc(size_t size) {
  void *ptr = xmalloc(size);
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<xzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xzalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xzalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @xmalloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @xzalloc(i64 %0) {
%2 = tail call i8* @xmalloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ glutStrokeString(void *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void glutStrokeInt(void *fontface, int i) {
  char buf[64];
  snprintf(buf, 64, "%d", i);
  glutStrokeString(fontface, buf);
}


x86 assembly (clang, -O0):
<glutStrokeInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x40,%esi
lea    0xebe(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <glutStrokeString@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glutStrokeInt>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xecd(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <glutStrokeString@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @glutStrokeInt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [64 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @snprintf(i8* %6, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = call i32 @glutStrokeString(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @glutStrokeInt(i8* %0, i32 %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @glutStrokeString(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free_solution_vector_copy(double *X) { free(X); }


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

x86 assembly (clang, -O2):
<free_solution_vector_copy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_solution_vector_copy(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}