xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
int main(void) {
  int x = 10;
  printf("zmienna x = %d\n", x);
  printf("adres   x = %p\n", (void *)&x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"zmienna x = %d\0A\00"
@.str.1 = [16 x i8] c"adres x = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = bitcast i32* %2 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"zmienna x = %d\0A\00"
@.str.1 = [16 x i8] c"adres x = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* inttoptr (i64 10 to i8*))
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void udp_base_loop(int sock_fd) {}


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

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

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

LLVM IR (-O2):
define void @udp_base_loop(i32 %0) {
ret void
}
unsigned int len(const int number, const char base) {
  unsigned int length = 1;
  unsigned int div = (number > 0 ? number : -number);
  while (div) {
    div /= base;
    if (!div)
      break;
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1129 <len+0x29>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1131 <len+0x31>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     116c <len+0x6c>
movsbl -0x5(%rbp),%ecx
mov    -0x10(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    115e <len+0x5e>
jmp    116c <len+0x6c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <len+0x37>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
mov    %edi,%r8d
neg    %r8d
cmovs  %edi,%r8d
mov    $0x1,%ecx
jae    1136 <len+0x36>
cmp    %esi,%r8d
jb     1136 <len+0x36>
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
mov    %r8d,%eax
xor    %edx,%edx
div    %esi
add    $0x1,%ecx
cmp    %esi,%r8d
jb     1136 <len+0x36>
mov    %eax,%r8d
cmp    %esi,%eax
jae    1120 <len+0x20>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @len(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
store i32 1, i32* %5
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %3
br label %14
11: ; preds = %2
%12 = load i32, i32* %3
%13 = sub nsw i32 0, %12
br label %14
14: ; preds = %11, %9
%15 = phi i32 [ %10, %9 ], [ %13, %11 ]
store i32 %15, i32* %6
br label %16
16: ; preds = %27, %14
%17 = load i32, i32* %6
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %30
19: ; preds = %16
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = load i32, i32* %6
%23 = udiv i32 %22, %21
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %19
br label %30
27: ; preds = %19
%28 = load i32, i32* %5
%29 = add i32 %28, 1
store i32 %29, i32* %5
br label %16
30: ; preds = %26, %16
%31 = load i32, i32* %5
ret i32 %31
}

LLVM IR (-O2):
define i32 @len(i32 %0, i8 signext %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = sext i8 %1 to i32
%5 = icmp eq i32 %0, 0
%6 = icmp ult i32 %3, %4
%7 = or i1 %5, %6
br i1 %7, label %16, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ %3, %2 ]
%10 = phi i32 [ %12, %8 ], [ 1, %2 ]
%11 = udiv i32 %9, %4
%12 = add i32 %10, 1
%13 = icmp ult i32 %9, %4
%14 = icmp ult i32 %11, %4
%15 = or i1 %13, %14
br i1 %15, label %16, label %8
16: ; preds = %8, %2
%17 = phi i32 [ 1, %2 ], [ %12, %8 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void error(char *s) {
  printf("%s \n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ getppid();
int32_t OS_getppid() { return (getppid()); }


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

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

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

LLVM IR (-O2):
define i32 @OS_getppid() {
%1 = tail call i32 (...) @getppid()
ret i32 %1
}
int plus(int num) { return num + 2; }


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

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

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

LLVM IR (-O2):
define i32 @plus(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ btowc(int);
void uninitvar_btowc(void) {
  int c;
  (void)btowc(c);
}


x86 assembly (clang, -O0):
<uninitvar_btowc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <btowc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_btowc>:
jmp    1030 <btowc@plt>

LLVM IR (-O0):
define void @uninitvar_btowc() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @btowc(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_btowc() {
%1 = tail call i32 @btowc(i32 undef)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ux00ddr_disableaxireadinterleave(size_t ahbregaddr) {
  (*(volatile uint32_t *)((120 << 2) + (ahbregaddr))) |= (1 << 16);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1e0,%rax
mov    (%rax),%ecx
or     $0x10000,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
orl    $0x10000,0x1e0(%rdi)
ret

LLVM IR (-O0):
define void @ux00ddr_disableaxireadinterleave(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 480, %3
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 65536
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @ux00ddr_disableaxireadinterleave(i64 %0) {
%2 = add i64 %0, 480
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 65536
store volatile i32 %5, i32* %3
ret void
}
int div(int a, int b) {
  if (0 == b)
    return 0;
  return a / b;
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jne    1121 <div+0x21>
movl   $0x0,-0x4(%rbp)
jmp    112b <div+0x2b>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
test   %esi,%esi
je     110a <div+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @div(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *parbake_erealloc(void *ptr, size_t size) {
  void *p = realloc(ptr, size);
  if (!p) {
    fprintf(stderr,
            "parbake: "
            "could not reallocate (%u bytes)",
            (unsigned int)size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<parbake_erealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1181 <parbake_erealloc+0x51>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xe8e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parbake_erealloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1140 <parbake_erealloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"parbake: could not reallocate (%u bytes)\00"
define i8* @parbake_erealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %17, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"parbake: could not reallocate (%u bytes)\00"
define noalias i8* @parbake_erealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = trunc i64 %1 to i32
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
double linear_pearls_kernel(double, double, double, int, double, double);
double Iq(double q, double radius, double edge_sep, double fp_num_pearls,
          double pearl_sld, double solvent_sld) {
  int num_pearls = (int)(fp_num_pearls + 0.5);
  double result = linear_pearls_kernel(q, radius, edge_sep, num_pearls,
                                       pearl_sld, solvent_sld);
  return result;
}


x86 assembly (clang, -O0):
<Iq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  0xec2(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x34(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    -0x34(%rbp),%edi
movsd  -0x28(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm4
call   1030 <linear_pearls_kernel@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Iq>:
addsd  0xee8(%rip),%xmm3
cvttsd2si %xmm3,%edi
movaps %xmm4,%xmm3
movaps %xmm5,%xmm4
jmp    1030 <linear_pearls_kernel@plt>

LLVM IR (-O0):
define double @Iq(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%15 = load double, double* %10
%16 = fadd double %15, 5.000000e-01
%17 = fptosi double %16 to i32
store i32 %17, i32* %13
%18 = load double, double* %7
%19 = load double, double* %8
%20 = load double, double* %9
%21 = load i32, i32* %13
%22 = load double, double* %11
%23 = load double, double* %12
%24 = call double @linear_pearls_kernel(double %18, double %19, double %20, i32 %21, double %22, double %23)
store double %24, double* %14
%25 = load double, double* %14
ret double %25
}

LLVM IR (-O2):
define double @Iq(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fadd double %3, 5.000000e-01
%8 = fptosi double %7 to i32
%9 = tail call double @linear_pearls_kernel(double %0, double %1, double %2, i32 %8, double %4, double %5)
ret double %9
}
int test_imm_E1int64_highword_reg(long long val) {
  return ((val >> 32) & (0xE1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E1int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xe1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E1int64_highword_reg>:
movabs $0xe100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E1int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 225
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_E1int64_highword_reg(i64 %0) {
%2 = and i64 %0, 966367641600
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void mavlinkThread() {}


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

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

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

LLVM IR (-O2):
define void @mavlinkThread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addem(int, int, int, int *);
void passem(int a, int b, int c, int *res) { addem(a, b, c, res); }


x86 assembly (clang, -O0):
<passem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <addem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<passem>:
jmp    1030 <addem@plt>

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

LLVM IR (-O2):
define void @passem(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @addem(i32 %0, i32 %1, i32 %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MPIU_Free(char *);
void utarray_str_dtor(void *elt) {
  char **eltc = (char **)elt;
  if (*eltc)
    MPIU_Free(*eltc);
}


x86 assembly (clang, -O0):
<utarray_str_dtor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     113e <utarray_str_dtor+0x2e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <MPIU_Free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utarray_str_dtor>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <utarray_str_dtor+0xd>
jmp    1030 <MPIU_Free@plt>
ret

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

LLVM IR (-O2):
define void @utarray_str_dtor(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @MPIU_Free(i8* %3)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OsPrint(char *);
int /*<<< orphan*/ funcc();
int funcb() {
  funcc();
  OsPrint("funcb no-PIC OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<funcb>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <funcc@plt>
lea    0xece(%rip),%rdi
call   1030 <OsPrint@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcb>:
push   %rax
xor    %eax,%eax
call   1040 <funcc@plt>
lea    0xed1(%rip),%rdi
call   1030 <OsPrint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"funcb no-PIC OK\0A\00"
define i32 @funcb() {
%1 = call i32 (...) @funcc()
%2 = call i32 @OsPrint(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"funcb no-PIC OK\0A\00"
define i32 @funcb() {
%1 = tail call i32 (...) @funcc()
%2 = tail call i32 @OsPrint(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void XtFree() {}


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

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

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

LLVM IR (-O2):
define void @XtFree() {
ret void
}
signed int extra_bit_information(void) {
  signed int Byte_Count = 0;
  unsigned int return_value_Get_Bits1$1;
  do {
    return_value_Get_Bits1$1 = Get_Bits1();
    if (return_value_Get_Bits1$1 == 0u)
      goto __CPROVER_DUMP_L2;
    Flush_Buffer(8);
    Byte_Count = Byte_Count + 1;
  } while ((_Bool)1);
__CPROVER_DUMP_L2:;
  return Byte_Count;
}


x86 assembly (clang, -O0):
<extra_bit_information>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Get_Bits1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1148 <extra_bit_information+0x28>
jmp    1171 <extra_bit_information+0x51>
mov    $0x8,%edi
mov    $0x0,%al
call   1040 <Flush_Buffer@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    112f <extra_bit_information+0xf>
jmp    116c <extra_bit_information+0x4c>
jmp    1171 <extra_bit_information+0x51>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extra_bit_information>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <Get_Bits1@plt>
test   %eax,%eax
je     114a <extra_bit_information+0x2a>
xor    %ebx,%ebx
mov    $0x8,%edi
xor    %eax,%eax
call   1040 <Flush_Buffer@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <Get_Bits1@plt>
test   %eax,%eax
jne    1130 <extra_bit_information+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @extra_bit_information() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %12, %0
%4 = call i32 (...) @Get_Bits1()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %14
8: ; preds = %3
%9 = call i32 (i32, ...) bitcast (i32 (...)* @Flush_Buffer to i32 (i32, ...)*)(i32 8)
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %12
12: ; preds = %8
br i1 true, label %3, label %13
13: ; preds = %12
br label %14
14: ; preds = %13, %7
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @extra_bit_information() {
%1 = tail call i32 (...) @Get_Bits1()
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 0, %0 ]
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @Flush_Buffer to i32 (i32, ...)*)(i32 8)
%6 = add nuw nsw i32 %4, 1
%7 = tail call i32 (...) @Get_Bits1()
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3, %0
%10 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fflush(int /*<<< orphan*/ *);
int flush_des_file(FILE *fp) { return (fflush(fp)); }


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

x86 assembly (clang, -O2):
<flush_des_file>:
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
define i32 @flush_des_file(i32* nocapture %0) {
%2 = tail call i32 @fflush(i32* %0)
ret i32 %2
}
/* Type definitions */
struct rdp_lic {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ g_free(struct rdp_lic *);
void rdp_lic_delete(struct rdp_lic *self) {
  if (self == 0) {
    return;
  }
  g_free(self);
}


x86 assembly (clang, -O0):
<rdp_lic_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <rdp_lic_delete+0x1c>
jmp    1135 <rdp_lic_delete+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <g_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdp_lic_delete>:
test   %rdi,%rdi
je     111a <rdp_lic_delete+0xa>
jmp    1030 <g_free@plt>
ret

LLVM IR (-O0):
%struct.rdp_lic = type { i32 }
define void @rdp_lic_delete(%struct.rdp_lic* %0) {
%2 = alloca %struct.rdp_lic*
store %struct.rdp_lic* %0, %struct.rdp_lic** %2
%3 = load %struct.rdp_lic*, %struct.rdp_lic** %2
%4 = icmp eq %struct.rdp_lic* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.rdp_lic*, %struct.rdp_lic** %2
%8 = call i32 @g_free(%struct.rdp_lic* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.rdp_lic = type { i32 }
define void @rdp_lic_delete(%struct.rdp_lic* %0) {
%2 = icmp eq %struct.rdp_lic* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @g_free(%struct.rdp_lic* %0)
br label %5
5: ; preds = %1, %3
ret void
}
char num(int i) {
  switch (i) {
  case 10:
    return 'A';
    break;
  case 11:
    return 'B';
    break;
  case 12:
    return 'C';
    break;
  case 13:
    return 'D';
    break;
  case 14:
    return 'E';
    break;
  case 15:
    return 'F';
    break;
  default:
    i = i + '0';
    return i;
  }
}


x86 assembly (clang, -O0):
<num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1166 <num+0x66>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x1(%rbp)
jmp    1175 <num+0x75>
movb   $0x42,-0x1(%rbp)
jmp    1175 <num+0x75>
movb   $0x43,-0x1(%rbp)
jmp    1175 <num+0x75>
movb   $0x44,-0x1(%rbp)
jmp    1175 <num+0x75>
movb   $0x45,-0x1(%rbp)
jmp    1175 <num+0x75>
movb   $0x46,-0x1(%rbp)
jmp    1175 <num+0x75>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num>:
lea    -0xa(%rdi),%eax
cmp    $0x6,%eax
mov    $0x41,%ecx
mov    $0x30,%edx
cmovb  %ecx,%edx
cmovae %edi,%eax
add    %dl,%al
ret

LLVM IR (-O0):
define signext i8 @num(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 10, label %5
i32 11, label %6
i32 12, label %7
i32 13, label %8
i32 14, label %9
i32 15, label %10
]
5: ; preds = %1
store i8 65, i8* %2
br label %16
6: ; preds = %1
store i8 66, i8* %2
br label %16
7: ; preds = %1
store i8 67, i8* %2
br label %16
8: ; preds = %1
store i8 68, i8* %2
br label %16
9: ; preds = %1
store i8 69, i8* %2
br label %16
10: ; preds = %1
store i8 70, i8* %2
br label %16
11: ; preds = %1
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 48
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %16
16: ; preds = %11, %10, %9, %8, %7, %6, %5
%17 = load i8, i8* %2
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @num(i32 %0) {
%2 = add i32 %0, -10
%3 = icmp ult i32 %2, 6
%4 = select i1 %3, i32 %2, i32 %0
%5 = select i1 %3, i8 65, i8 48
%6 = trunc i32 %4 to i8
%7 = add i8 %5, %6
ret i8 %7
}
/* Variables and functions */
void *ft_memset(void *b, int c, size_t len) {
  unsigned char val;
  size_t i;
  char *dest;
  dest = (char *)b;
  val = (unsigned char)c;
  i = 0;
  while (i < len) {
    dest[i] = val;
    i++;
  }
  return (b);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0x19(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1152 <ft_memset+0x52>
mov    -0x19(%rbp),%dl
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1125 <ft_memset+0x25>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
void invlpg(void *addr) { asm volatile("invlpg (%0)" : : "r"(addr)); }


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

x86 assembly (clang, -O2):
<invlpg>:
invlpg (%rdi)
ret

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

LLVM IR (-O2):
define void @invlpg(i8* %0) {
tail call void asm sideeffect "invlpg ($0)", "r,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, char const *);
void sparse_error(const char err[]) { foo("%s\n", err); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @sparse_error(i8* %0) {
%2 = tail call i32 @foo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct fd_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write_to_buf(struct fd_state *, char const *,
                                int /*<<< orphan*/);
void write_response_error(struct fd_state *state) {
  const char *msg = "HTTP/1.1 404 Not Found\r\nContent-Length:0\r\n\r\n";
  write_to_buf(state, msg, strlen(msg));
}


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

x86 assembly (clang, -O2):
<write_response_error>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <write_to_buf@plt>

LLVM IR (-O0):
%struct.fd_state = type { i32 }
@.str = [45 x i8] c"HTTP/1.1 404 Not Found\0D\0AContent-Length:0\0D\0A\0D\0A\00"
define void @write_response_error(%struct.fd_state* %0) {
%2 = alloca %struct.fd_state*
%3 = alloca i8*
store %struct.fd_state* %0, %struct.fd_state** %2
store i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load %struct.fd_state*, %struct.fd_state** %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @write_to_buf(%struct.fd_state* %4, i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.fd_state = type { i32 }
@.str = [45 x i8] c"HTTP/1.1 404 Not Found\0D\0AContent-Length:0\0D\0A\0D\0A\00"
define void @write_response_error(%struct.fd_state* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write_to_buf(%struct.fd_state* %0, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t AUXTDCMeasurementGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x00000008))));
}


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

x86 assembly (clang, -O2):
<AUXTDCMeasurementGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x8(%rax),%rax
ret

LLVM IR (-O0):
define i64 @AUXTDCMeasurementGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @AUXTDCMeasurementGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ db_init();
int /*<<< orphan*/ destroy();
int /*<<< orphan*/ destroyview(char *);
int /*<<< orphan*/ file_init();
int /*<<< orphan*/ init();
int /*<<< orphan*/ initview(char *, int /*<<< orphan*/);
int /*<<< orphan*/ run();
int /*<<< orphan*/ setup();
int main(int argc, char **argv) {
  init();
  setup();
  file_init();
  db_init();
  initview("front", 0);
  run();
  destroyview("front");
  destroy();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1080 <init@plt>
mov    $0x0,%al
call   10a0 <setup@plt>
mov    $0x0,%al
call   1090 <file_init@plt>
mov    $0x0,%al
call   1030 <db_init@plt>
lea    0xe47(%rip),%rdi
xor    %esi,%esi
call   1050 <initview@plt>
mov    $0x0,%al
call   1040 <run@plt>
lea    0xe32(%rip),%rdi
call   1060 <destroyview@plt>
mov    $0x0,%al
call   1070 <destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1080 <init@plt>
xor    %eax,%eax
call   10a0 <setup@plt>
xor    %eax,%eax
call   1090 <file_init@plt>
xor    %eax,%eax
call   1030 <db_init@plt>
lea    0xe5c(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <initview@plt>
xor    %eax,%eax
call   1040 <run@plt>
mov    %rbx,%rdi
call   1060 <destroyview@plt>
xor    %eax,%eax
call   1070 <destroy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"front\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 (...) @init()
%7 = call i32 (...) @setup()
%8 = call i32 (...) @file_init()
%9 = call i32 (...) @db_init()
%10 = call i32 @initview(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
%11 = call i32 (...) @run()
%12 = call i32 @destroyview(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (...) @destroy()
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"front\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @setup()
%5 = tail call i32 (...) @file_init()
%6 = tail call i32 (...) @db_init()
%7 = tail call i32 @initview(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
%8 = tail call i32 (...) @run()
%9 = tail call i32 @destroyview(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (...) @destroy()
ret i32 0
}
/* Variables and functions */
scalar_t__ memmem(char const *, int /*<<< orphan*/, char const *, size_t);
int /*<<< orphan*/ strlen(char const *);
char *strnstr(const char *haystack, const char *needle, size_t len) {
  return (char *)memmem(haystack, strlen(haystack), needle, len);
}


x86 assembly (clang, -O0):
<strnstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1040 <memmem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnstr>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r15,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memmem@plt>

LLVM IR (-O0):
define i8* @strnstr(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i64 @memmem(i8* %7, i32 %9, i8* %10, i64 %11)
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @strnstr(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i64 @memmem(i8* %0, i32 %4, i8* %1, i64 %2)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
int *f7c(int *x) {
  int *p = 0;
  if (((void *)0) == x)
    p = qux();
  if (((void *)0) != x)
    return x;
  *p = 1;
  return x;
}


x86 assembly (clang, -O0):
<f7c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    113d <f7c+0x2d>
mov    $0x0,%al
call   1030 <qux@plt>
cltq
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
je     1156 <f7c+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <f7c+0x58>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7c>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1128 <f7c+0x18>
xor    %eax,%eax
call   1030 <qux@plt>
cltq
movl   $0x1,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @f7c(i32* readnone returned %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 (...) @qux()
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32 1, i32* %6
br label %7
7: ; preds = %1, %3
ret i32* %0
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 28, b = 32;
  printf("gcd of %d,%d = %d\n", a, b, gcd(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1c,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <gcd@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1c,%edi
mov    $0x20,%esi
call   1040 <gcd@plt>
lea    0xec9(%rip),%rdi
mov    $0x1c,%esi
mov    $0x20,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"gcd of %d,%d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 28, i32* %2
store i32 32, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @gcd(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"gcd of %d,%d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @gcd(i32 28, i32 32)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 28, i32 32, i32 %1)
ret i32 0
}
int BLAS_char_check_side(char side) {
  return side == 'L' || side == 'l' || side == 'R' || side == 'r';
}


x86 assembly (clang, -O0):
<BLAS_char_check_side>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x4c,%ecx
mov    %al,-0x2(%rbp)
je     114d <BLAS_char_check_side+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6c,%ecx
mov    %al,-0x2(%rbp)
je     114d <BLAS_char_check_side+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x52,%ecx
mov    %al,-0x2(%rbp)
je     114d <BLAS_char_check_side+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x72,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BLAS_char_check_side>:
lea    -0x4c(%rdi),%ecx
cmp    $0x20,%cl
ja     1121 <BLAS_char_check_side+0x21>
mov    $0x1,%eax
movzbl %cl,%ecx
movabs $0x100000041,%rdx
bt     %rcx,%rdx
jae    1121 <BLAS_char_check_side+0x21>
ret
xor    %eax,%eax
cmp    $0x72,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @BLAS_char_check_side(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 76
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 108
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 82
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 114
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @BLAS_char_check_side(i8 signext %0) {
switch i8 %0, label %2 [
i8 108, label %5
i8 82, label %5
i8 76, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 114
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void case_sens_void(void) {}


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

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

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

LLVM IR (-O2):
define void @case_sens_void() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test01_head() {
  do {
    printf("test01");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test01_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test01_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test01_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test01\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test01_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test01\00"
define void @test01_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ mergeSort(int *, int);
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int a[] = {3, 11, 2, 9, 5, 22, 15, 100};
  int arrayLen = sizeof(a) / sizeof(a[0]);
  printArray(a, arrayLen);
  mergeSort(a, arrayLen);
  printArray(a, arrayLen);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <printArray@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <mergeSort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <printArray@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <mergeSort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 3, i32 11, i32 2, i32 9, i32 5, i32 22, i32 15, i32 100]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @printArray(i32* %5, i32 %6)
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @mergeSort(i32* %8, i32 %9)
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %3
%13 = call i32 @printArray(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [8 x i32] [i32 3, i32 11, i32 2, i32 9, i32 5, i32 22, i32 15, i32 100]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 8)
%5 = call i32 @mergeSort(i32* %3, i32 8)
%6 = call i32 @printArray(i32* %3, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned int);
void add_reg32_m32(unsigned int reg32, unsigned int *m32) {
  put8(0x03);
  put8((reg32 << 3) | 5);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<add_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x3,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @add_reg32_m32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @put8(i32 3)
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = or i32 %7, 5
%9 = call i32 @put8(i32 %8)
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
%12 = call i32 @put32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @add_reg32_m32(i32 %0, i32* %1) {
%3 = tail call i32 @put8(i32 3)
%4 = shl i32 %0, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
void unlock() {}


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

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

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

LLVM IR (-O2):
define void @unlock() {
ret void
}