xunge/DecIR huggingface dataset:
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ silly_free(struct node *);
void freenode(struct node *n) {
  silly_free(n);
  return;
}


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

x86 assembly (clang, -O2):
<freenode>:
jmp    1030 <silly_free@plt>

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

LLVM IR (-O2):
%struct.node = type { i32 }
define void @freenode(%struct.node* %0) {
%2 = tail call i32 @silly_free(%struct.node* %0)
ret void
}
void deallocate_StatPersisted(struct StatPersisted *v) {}


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

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

LLVM IR (-O0):
%struct.StatPersisted = type opaque
define void @deallocate_StatPersisted(%struct.StatPersisted* %0) {
%2 = alloca %struct.StatPersisted*
store %struct.StatPersisted* %0, %struct.StatPersisted** %2
ret void
}

LLVM IR (-O2):
%struct.StatPersisted = type opaque
define void @deallocate_StatPersisted(%struct.StatPersisted* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: col [-bfhpx] [-l nline]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"usage: col [-bfhpx] [-l nline]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"usage: col [-bfhpx] [-l nline]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t random_uint64_t() {
  uint64_t u1, u2, u3, u4;
  u1 = (uint64_t)(random()) & 0xFFFF;
  u2 = (uint64_t)(random()) & 0xFFFF;
  u3 = (uint64_t)(random()) & 0xFFFF;
  u4 = (uint64_t)(random()) & 0xFFFF;
  return u1 | (u2 << 16) | (u3 << 32) | (u4 << 48);
}


x86 assembly (clang, -O0):
<random_uint64_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @random_uint64_t() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @random()
%6 = and i32 %5, 65535
store i32 %6, i32* %1
%7 = call i32 (...) @random()
%8 = and i32 %7, 65535
store i32 %8, i32* %2
%9 = call i32 (...) @random()
%10 = and i32 %9, 65535
store i32 %10, i32* %3
%11 = call i32 (...) @random()
%12 = and i32 %11, 65535
store i32 %12, i32* %4
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = shl i32 %14, 16
%16 = or i32 %13, %15
%17 = load i32, i32* %3
%18 = shl i32 %17, 32
%19 = or i32 %16, %18
%20 = load i32, i32* %4
%21 = shl i32 %20, 48
%22 = or i32 %19, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @random_uint64_t() {
%1 = tail call i32 (...) @random()
%2 = tail call i32 (...) @random()
%3 = tail call i32 (...) @random()
%4 = tail call i32 (...) @random()
ret i32 poison
}
void XkbAllocNames() {}


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

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

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

LLVM IR (-O2):
define void @XkbAllocNames() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xbb() {
  Assert_real((isodigit(187) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              940, ("isodigit should be 0 for 0xbb"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xbb>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbb,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3ac,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xbb>:
push   %rax
mov    $0xbb,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3ac,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xbb\00"
define void @t_isodigit_0xbb() {
%1 = call i64 @isodigit(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xbb\00"
define void @t_isodigit_0xbb() {
%1 = tail call i64 @isodigit(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float absf(float f) {
  if (f < 0.0)
    return -f;
  else
    return f;
}


x86 assembly (clang, -O0):
<absf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    113b <absf+0x3b>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1145 <absf+0x45>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absf>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @absf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float, float* %3
%9 = fneg float %8
store float %9, float* %2
br label %12
10: ; preds = %1
%11 = load float, float* %3
store float %11, float* %2
br label %12
12: ; preds = %10, %7
%13 = load float, float* %2
ret float %13
}

LLVM IR (-O2):
define float @absf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
int do_984() { return 984; }


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

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

LLVM IR (-O0):
define i32 @do_984() {
ret i32 984
}

LLVM IR (-O2):
define i32 @do_984() {
ret i32 984
}
/* Variables and functions */
int /*<<< orphan*/ exchange_member(int *, int, int);
void select_pivot_last(int *arr, int lo, int hi) {
  exchange_member(arr, lo, hi);
  return;
}


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

x86 assembly (clang, -O2):
<select_pivot_last>:
jmp    1030 <exchange_member@plt>

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

LLVM IR (-O2):
define void @select_pivot_last(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @exchange_member(i32* %0, i32 %1, i32 %2)
ret void
}
void g_value_array_sort_with_data() {}


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

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

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

LLVM IR (-O2):
define void @g_value_array_sort_with_data() {
ret void
}
void eglGetError(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct ff *);
void ff_free(struct ff *ff) { free(ff); }


x86 assembly (clang, -O0):
<ff_free>:
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):
<ff_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.ff = type { i32 }
define void @ff_free(%struct.ff* nocapture %0) {
%2 = tail call i32 @free(%struct.ff* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void self() { printf("self...\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"self...\00"
define void @self() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void version() { printf("powerdebug version %s\n", "0.6.1"); }


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

x86 assembly (clang, -O2):
<version>:
lea    0xee9(%rip),%rdi
lea    0xef9(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"powerdebug version %s\0A\00"
@.str.1 = [6 x i8] c"0.6.1\00"
define void @version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double deriv(double, double);
double fun(double, double, double);
double next(double tm, double n, double c) {
  double next_app = tm - fun(tm, n, c) / deriv(tm, n);
  return next_app;
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <fun@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <deriv@plt>
movsd  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1030 <fun@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <deriv@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  (%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @next(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %4
%10 = load double, double* %5
%11 = load double, double* %6
%12 = call double @fun(double %9, double %10, double %11)
%13 = load double, double* %4
%14 = load double, double* %5
%15 = call double @deriv(double %13, double %14)
%16 = fdiv double %12, %15
%17 = fsub double %8, %16
store double %17, double* %7
%18 = load double, double* %7
ret double %18
}

LLVM IR (-O2):
define double @next(double %0, double %1, double %2) {
%4 = tail call double @fun(double %0, double %1, double %2)
%5 = tail call double @deriv(double %0, double %1)
%6 = fdiv double %4, %5
%7 = fsub double %0, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void freep(void *p) {
  if (*(void ***)p)
    free(*(void ***)p);
}


x86 assembly (clang, -O0):
<freep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <freep+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @freep(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 @free(i8** %3)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ack(char *);
scalar_t__ chdir(char const *);
int /*<<< orphan*/ perror_reply(int, char const *);
void cwd(const char *path) {
  if (chdir(path) < 0)
    perror_reply(550, path);
  else
    ack("CWD");
}


x86 assembly (clang, -O0):
<cwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <chdir@plt>
cmp    $0x0,%rax
jge    1162 <cwd+0x32>
mov    -0x8(%rbp),%rsi
mov    $0x226,%edi
call   1050 <perror_reply@plt>
jmp    116e <cwd+0x3e>
lea    0xe97(%rip),%rdi
call   1030 <ack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwd>:
push   %rbx
mov    %rdi,%rbx
call   1040 <chdir@plt>
test   %rax,%rax
js     114b <cwd+0x1b>
lea    0xebb(%rip),%rdi
pop    %rbx
jmp    1030 <ack@plt>
mov    $0x226,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <perror_reply@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"CWD\00"
define void @cwd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @chdir(i8* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @perror_reply(i32 550, i8* %7)
br label %11
9: ; preds = %1
%10 = call i32 @ack(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"CWD\00"
define void @cwd(i8* %0) {
%2 = tail call i64 @chdir(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror_reply(i32 550, i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @ack(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret void
}
int ls_costN_nm9_n_in(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @ls_costN_nm9_n_in() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ls_costN_nm9_n_in() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;

/* Variables and functions */
int /*<<< orphan*/ NID_organizationalUnitName;
char const *req_GetNameNid(int /*<<< orphan*/ *, int /*<<< orphan*/);
const char *req_GetName_OU(X509_NAME *name) {
  return req_GetNameNid(name, NID_organizationalUnitName);
}


x86 assembly (clang, -O0):
<req_GetName_OU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <req_GetNameNid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<req_GetName_OU>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <req_GetNameNid@plt>

LLVM IR (-O0):
@NID_organizationalUnitName = global i32 0
define i8* @req_GetName_OU(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @NID_organizationalUnitName
%5 = call i8* @req_GetNameNid(i32* %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
@NID_organizationalUnitName = global i32 0
define i8* @req_GetName_OU(i32* %0) {
%2 = load i32, i32* @NID_organizationalUnitName
%3 = tail call i8* @req_GetNameNid(i32* %0, i32 %2)
ret i8* %3
}
int proc_true(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @proc_true() {
ret i32 1
}

LLVM IR (-O2):
define i32 @proc_true() {
ret i32 1
}
/* Variables and functions */
int read(int, char *, int);
int readChar(int fd, char *buf) {
  int n;
  do {
    n = read(fd, buf, 1);
  } while (n > 0 && *buf++ != '\0');
  return n > 0;
}


x86 assembly (clang, -O0):
<readChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jle    115d <readChar+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    111f <readChar+0xf>
cmpl   $0x0,-0x14(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readChar>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    113c <readChar+0x2c>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <readChar+0x10>
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @readChar(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = tail call i32 @read(i32 %0, i8* %4, i32 1)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = load i8, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = zext i1 %6 to i32
ret i32 %12
}
void use(int x) { __asm__ __volatile__("nop" : : "r"(x) : "cc", "memory"); }


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

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

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

LLVM IR (-O2):
define void @use(i32 %0) {
tail call void asm sideeffect "nop", "r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
__attribute__((always_)) void __enable_irq(void) {}


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

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

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

LLVM IR (-O2):
define void @__enable_irq() {
ret void
}
int oleo_set_options(set_opt, option)
int set_opt;
char *option;
{ return -1; }


x86 assembly (clang, -O0):
<oleo_set_options>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @oleo_set_options(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_open_graph() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_open_graph>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_open_graph>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_open_graph() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_open_graph() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
long long int reversePositive(long long int x) {
  long long int ans = 0;
  while (x != 0) {
    ans *= 10;
    ans += x % 10;
    x /= 10;
  }
  return ans;
}


x86 assembly (clang, -O0):
<reversePositive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <reversePositive+0x51>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
add    -0x10(%rbp),%rdx
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1110 <reversePositive+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reversePositive>:
test   %rdi,%rdi
je     1158 <reversePositive+0x58>
mov    %rdi,%rcx
xor    %eax,%eax
movabs $0x6666666666666667,%r8
66 66 66
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rax,%rax,4),%rsi
mov    %rcx,%rax
imul   %r8
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rcx,%rdi
sub    %rax,%rdi
lea    (%rdi,%rsi,2),%rax
add    $0x9,%rcx
cmp    $0x12,%rcx
mov    %rdx,%rcx
ja     1120 <reversePositive+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @reversePositive(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i64, i64* %3
%9 = mul nsw i64 %8, 10
store i64 %9, i64* %3
%10 = load i64, i64* %2
%11 = srem i64 %10, 10
%12 = load i64, i64* %3
%13 = add nsw i64 %12, %11
store i64 %13, i64* %3
%14 = load i64, i64* %2
%15 = sdiv i64 %14, 10
store i64 %15, i64* %2
br label %4
16: ; preds = %4
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @reversePositive(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i64 %4, 10
%7 = srem i64 %5, 10
%8 = add nsw i64 %6, %7
%9 = sdiv i64 %5, 10
%10 = add i64 %5, 9
%11 = icmp ult i64 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i64 [ 0, %1 ], [ %8, %3 ]
ret i64 %13
}
int Panel_AdjustValue(int value, int delta, int min, int max) {
  value += delta;
  if (value < min) {
    return min;
  } else if (value > max) {
    return max;
  }
  return value;
}


x86 assembly (clang, -O0):
<Panel_AdjustValue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1130 <Panel_AdjustValue+0x30>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <Panel_AdjustValue+0x52>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1147 <Panel_AdjustValue+0x47>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <Panel_AdjustValue+0x52>
jmp    114c <Panel_AdjustValue+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Panel_AdjustValue>:
mov    %ecx,%eax
add    %esi,%edi
cmp    %ecx,%edi
cmovle %edi,%eax
cmp    %edx,%edi
cmovl  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @Panel_AdjustValue(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = icmp slt i32 %5, %2
%7 = icmp sgt i32 %5, %3
%8 = select i1 %7, i32 %3, i32 %5
%9 = select i1 %6, i32 %2, i32 %8
ret i32 %9
}
int import() { return 42; }


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

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

LLVM IR (-O0):
define i32 @import() {
ret i32 42
}

LLVM IR (-O2):
define i32 @import() {
ret i32 42
}
void d2i_X509_REQ_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_X509_REQ_bio() {
ret void
}
/* Variables and functions */
int mt_rand_uint64();
double mt_rand_double_2(void) {
  return (mt_rand_uint64() >> 11) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<mt_rand_double_2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt_rand_uint64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_rand_double_2>:
push   %rax
xor    %eax,%eax
call   1030 <mt_rand_uint64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt_rand_double_2() {
%1 = call i32 (...) @mt_rand_uint64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000000
ret double %4
}

LLVM IR (-O2):
define double @mt_rand_double_2() {
%1 = tail call i32 (...) @mt_rand_uint64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000000
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
int icinga_assert_fail(const char *expr, const char *file, int line) {
  fprintf(stderr, "%s:%d: assertion failed: %s\n", file, line, expr);
  abort();
}


x86 assembly (clang, -O0):
<icinga_assert_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<icinga_assert_fail>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"%s:%d: assertion failed: %s\0A\00"
define i32 @icinga_assert_fail(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"%s:%d: assertion failed: %s\0A\00"
define i32 @icinga_assert_fail(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned int GetTimerMS(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec * 1000 + tv.tv_usec / 1000);
}


x86 assembly (clang, -O0):
<GetTimerMS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTimerMS>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @GetTimerMS() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @GetTimerMS() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
int main(void) {
  long long int a = 14;
  long int b = 9;
  asm volatile("" : "+r"(a), "+r"(b));
  if ((a - b) != 5)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xe,-0x10(%rbp)
movq   $0x9,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
cmp    $0x5,%rax
je     1156 <main+0x46>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xe,%eax
mov    $0x9,%ecx
sub    %rcx,%rax
cmp    $0x5,%rax
jne    1126 <main+0x16>
xor    %eax,%eax
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 14, i64* %2
store i64 9, i64* %3
%4 = load i64, i64* %2
%5 = load i64, i64* %3
%6 = call { i64, i64 } asm sideeffect "", "=r,=r,0,1,~{dirflag},~{fpsr},~{flags}"(i64 %4, i64 %5)
%7 = extractvalue { i64, i64 } %6, 0
%8 = extractvalue { i64, i64 } %6, 1
store i64 %7, i64* %2
store i64 %8, i64* %3
%9 = load i64, i64* %2
%10 = load i64, i64* %3
%11 = sub nsw i64 %9, %10
%12 = icmp ne i64 %11, 5
br i1 %12, label %13, label %14
13: ; preds = %0
unreachable
14: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i64, i64 } asm sideeffect "", "=r,=r,0,1,~{dirflag},~{fpsr},~{flags}"(i64 14, i64 9)
%2 = extractvalue { i64, i64 } %1, 0
%3 = extractvalue { i64, i64 } %1, 1
%4 = sub nsw i64 %2, %3
%5 = icmp eq i64 %4, 5
br i1 %5, label %7, label %6
6: ; preds = %0
tail call void @abort()
unreachable
7: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _MM_FLUSH_ZERO_ON;
int _MM_MASK_DENORM;
int _MM_MASK_INEXACT;
int _MM_MASK_UNDERFLOW;
int /*<<< orphan*/ _MM_SET_EXCEPTION_MASK(int);
int /*<<< orphan*/ _MM_SET_FLUSH_ZERO_MODE(int /*<<< orphan*/);
void set_ftz() {
  _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
  _MM_SET_EXCEPTION_MASK(_MM_MASK_INEXACT | _MM_MASK_UNDERFLOW |
                         _MM_MASK_DENORM);
}


x86 assembly (clang, -O0):
<set_ftz>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <_MM_SET_FLUSH_ZERO_MODE@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    0x2e9e(%rip),%rax
or     (%rax),%edi
mov    0x2e7d(%rip),%rax
or     (%rax),%edi
call   1040 <_MM_SET_EXCEPTION_MASK@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ftz>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <_MM_SET_FLUSH_ZERO_MODE@plt>
mov    0x2eb2(%rip),%rax
mov    0x2ea3(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
mov    0x2e80(%rip),%rax
or     (%rax),%edi
pop    %rax
jmp    1040 <_MM_SET_EXCEPTION_MASK@plt>

LLVM IR (-O0):
@_MM_FLUSH_ZERO_ON = global i32 0
@_MM_MASK_INEXACT = global i32 0
@_MM_MASK_UNDERFLOW = global i32 0
@_MM_MASK_DENORM = global i32 0
define void @set_ftz() {
%1 = load i32, i32* @_MM_FLUSH_ZERO_ON
%2 = call i32 @_MM_SET_FLUSH_ZERO_MODE(i32 %1)
%3 = load i32, i32* @_MM_MASK_INEXACT
%4 = load i32, i32* @_MM_MASK_UNDERFLOW
%5 = or i32 %3, %4
%6 = load i32, i32* @_MM_MASK_DENORM
%7 = or i32 %5, %6
%8 = call i32 @_MM_SET_EXCEPTION_MASK(i32 %7)
ret void
}

LLVM IR (-O2):
@_MM_FLUSH_ZERO_ON = global i32 0
@_MM_MASK_INEXACT = global i32 0
@_MM_MASK_UNDERFLOW = global i32 0
@_MM_MASK_DENORM = global i32 0
define void @set_ftz() {
%1 = load i32, i32* @_MM_FLUSH_ZERO_ON
%2 = tail call i32 @_MM_SET_FLUSH_ZERO_MODE(i32 %1)
%3 = load i32, i32* @_MM_MASK_INEXACT
%4 = load i32, i32* @_MM_MASK_UNDERFLOW
%5 = or i32 %4, %3
%6 = load i32, i32* @_MM_MASK_DENORM
%7 = or i32 %5, %6
%8 = tail call i32 @_MM_SET_EXCEPTION_MASK(i32 %7)
ret void
}
int is_enemy(int obj_type) {
  int res = -1;
  switch (obj_type) {
  case 1:
    res = 0;
    break;
  case 2:
    res = 0;
    break;
  case 3:
    res = 0;
    break;
  case 4:
    res = 0;
    break;
  case 5:
    res = 0;
    break;
  }
  return res;
}


x86 assembly (clang, -O0):
<is_enemy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     116e <is_enemy+0x6e>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    116e <is_enemy+0x6e>
movl   $0x0,-0x8(%rbp)
jmp    116e <is_enemy+0x6e>
movl   $0x0,-0x8(%rbp)
jmp    116e <is_enemy+0x6e>
movl   $0x0,-0x8(%rbp)
jmp    116e <is_enemy+0x6e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_enemy>:
add    $0xfffffffa,%edi
cmp    $0xfffffffb,%edi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_enemy(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %10 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
]
5: ; preds = %1
store i32 0, i32* %3
br label %10
6: ; preds = %1
store i32 0, i32* %3
br label %10
7: ; preds = %1
store i32 0, i32* %3
br label %10
8: ; preds = %1
store i32 0, i32* %3
br label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_enemy(i32 %0) {
%2 = add i32 %0, -6
%3 = icmp ult i32 %2, -5
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ inccount(int);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t size) {
  void *n = realloc(p, size);
  if (n && (p == NULL)) {
    inccount(7);
  }
  return (n);
}


x86 assembly (clang, -O0):
<xrealloc>:
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)
je     1161 <xrealloc+0x41>
cmpq   $0x0,-0x8(%rbp)
jne    1161 <xrealloc+0x41>
mov    $0x7,%edi
call   1030 <inccount@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
jne    1143 <xrealloc+0x23>
test   %r14,%r14
je     1143 <xrealloc+0x23>
mov    $0x7,%edi
call   1030 <inccount@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xrealloc(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 %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @inccount(i32 7)
br label %16
16: ; preds = %14, %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp ne i8* %3, null
%5 = icmp eq i8* %0, null
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @inccount(i32 7)
br label %9
9: ; preds = %7, %2
ret i8* %3
}
int isten(long double num) {
  int ret = 0;
  if (((long double)10) == num) {
    ret = 1;
  } else {
    ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<isten>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movl   $0x0,-0x14(%rbp)
fldt   -0x10(%rbp)
flds   0xee6(%rip)
fucomip %st(1),%st
fstp   %st(0)
jne    113b <isten+0x3b>
jp     113b <isten+0x3b>
jmp    112f <isten+0x2f>
movl   $0x1,-0x14(%rbp)
jmp    1142 <isten+0x42>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isten>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
fucomip %st(1),%st
fstp   %st(0)
setnp  %al
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isten(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i32
store x86_fp80 %0, x86_fp80* %2
store i32 0, i32* %3
%4 = load x86_fp80, x86_fp80* %2
%5 = fcmp oeq x86_fp80 0xK4002A000000000000000, %4
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %3
br label %8
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @isten(x86_fp80 %0) {
%2 = fcmp oeq x86_fp80 %0, 0xK4002A000000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 1UL) {
      if (!(state[0UL] > local1)) {
        state[local1] = state[0UL] * state[0UL];
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] * 45871808UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    $0x1,%rax
jae    1157 <RandomFunc+0x57>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
ja     1148 <RandomFunc+0x48>
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%eax
imul   $0x2bbf2c0,%rax,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
imul   $0x2bbf2c0,(%rdi),%eax
add    $0xc896adc0,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %30, %2
%13 = load i32, i32* %6
%14 = zext i32 %13 to i64
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %35
16: ; preds = %12
%17 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%18 = load i32, i32* %17
%19 = load i32, i32* %6
%20 = icmp ugt i32 %18, %19
br i1 %20, label %30, label %21
21: ; preds = %16
%22 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%23 = load i32, i32* %22
%24 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%25 = load i32, i32* %24
%26 = mul i32 %23, %25
%27 = load i32, i32* %6
%28 = zext i32 %27 to i64
%29 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %28
store i32 %26, i32* %29
br label %30
30: ; preds = %21, %16
%31 = load i32, i32* %6
%32 = zext i32 %31 to i64
%33 = add i64 %32, 2
%34 = trunc i64 %33 to i32
store i32 %34, i32* %6
br label %12
35: ; preds = %12
%36 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%37 = load i32, i32* %36
%38 = zext i32 %37 to i64
%39 = mul i64 %38, 45871808
%40 = trunc i64 %39 to i32
%41 = load i32*, i32** %4
%42 = getelementptr inbounds i32, i32* %41, i64 0
store i32 %40, i32* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = mul i32 %3, 45871808
%5 = add i32 %4, -929649216
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int write(int, void *, int);
void dowrite(int handle, void *buf, int len) {
  if (write(handle, buf, len) != len) {
    perror("?Error on write");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<dowrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
je     1170 <dowrite+0x40>
lea    0xe9f(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dowrite>:
push   %rbx
mov    %edx,%ebx
call   1030 <write@plt>
cmp    %ebx,%eax
jne    113e <dowrite+0xe>
pop    %rbx
ret
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"?Error on write\00"
define void @dowrite(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, %2
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
void send_arp() {}


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

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

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

LLVM IR (-O2):
define void @send_arp() {
ret void
}
void cube_by_reference(int *n_ptr) { *n_ptr = *n_ptr * *n_ptr * *n_ptr; }


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

x86 assembly (clang, -O2):
<cube_by_reference>:
mov    (%rdi),%eax
mov    %eax,%ecx
imul   %eax,%ecx
imul   %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @cube_by_reference(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = mul nsw i32 %4, %6
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = mul nsw i32 %7, %9
%11 = load i32*, i32** %2
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @cube_by_reference(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, %2
%4 = mul nsw i32 %3, %2
store i32 %4, i32* %0
ret void
}