xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t const);
size_t strlen(char const *);
char *strcat(char *restrict dst, const char *restrict src) {
  const size_t dstlen = strlen(dst);
  const size_t srclen = strlen(src);
  memcpy(dst + dstlen, src, srclen + 1);
  return dst;
}


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

x86 assembly (clang, -O2):
<strcat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
add    %r15,%rbx
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strcat(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8*, i8** %4
%15 = load i64, i64* %6
%16 = add i64 %15, 1
%17 = call i32 @memcpy(i8* %13, i8* %14, i64 %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @strcat(i8* noalias returned %0, i8* noalias %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = add i64 %4, 1
%7 = tail call i32 @memcpy(i8* %5, i8* %1, i64 %6)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ memmove(char *, char *, size_t);
wchar_t *__wmemmove(wchar_t *s1, const wchar_t *s2, size_t n) {
  return (wchar_t *)memmove((char *)s1, (char *)s2, n * sizeof(wchar_t));
}


x86 assembly (clang, -O0):
<__wmemmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
shl    $0x2,%rdx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wmemmove>:
shl    $0x2,%rdx
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define i32* @__wmemmove(i32* %0, i32* %1, i64 %2) {
%4 = bitcast i32* %0 to i8*
%5 = bitcast i32* %1 to i8*
%6 = shl i64 %2, 2
%7 = tail call i64 @memmove(i8* %4, i8* %5, i64 %6)
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}
void test52_FcnImpl_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test52_FcnImpl_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
void *getpwuid() {
  errno = ENOSYS;
  return 0;
}


x86 assembly (clang, -O0):
<getpwuid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpwuid>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @getpwuid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @getpwuid() {
%1 = load i32, i32* @ENOSYS
store i32 %1, i32* @errno
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ t;
struct v4l2_dv_timings {
  int dummy;
};

/* Variables and functions */
int main(void) {
  struct v4l2_dv_timings t;
  (void)t;
  return sizeof(t);
}


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

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

LLVM IR (-O0):
%struct.v4l2_dv_timings = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.v4l2_dv_timings
store i32 0, i32* %1
ret i32 4
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rr(uint8_t val) { return val >> 1 | ((val & 1) << 7); }


x86 assembly (clang, -O0):
<rr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
shl    $0x7,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rr>:
mov    %edi,%ecx
sar    %ecx
shl    $0x7,%edi
movzbl %dil,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @rr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = and i32 %5, 1
%7 = shl i32 %6, 7
%8 = or i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @rr(i32 %0) {
%2 = ashr i32 %0, 1
%3 = shl i32 %0, 7
%4 = and i32 %3, 128
%5 = or i32 %4, %2
ret i32 %5
}
void appendfield(morewords) char *morewords;
{ append_words(morewords); }


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

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

LLVM IR (-O0):
define void @appendfield(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @append_words to i32 (i8*, ...)*)(i8* %3)
ret void
}

LLVM IR (-O2):
define void @appendfield(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @append_words to i32 (i8*, ...)*)(i8* %0)
ret void
}
/* Variables and functions */
int partition(int *, int);
void quicksort(int *a, int n) {
  int pindex;
  if (n <= 1)
    return;
  else {
    pindex = partition(a, n);
    quicksort(a, pindex);
    quicksort(a + pindex + 1, n - pindex - 1);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     113e <quicksort+0x1e>
jmp    117a <quicksort+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <partition@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1040 <quicksort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1040 <quicksort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     115f <quicksort+0x3f>
mov    %esi,%r14d
mov    %rdi,%rbx
nop
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <quicksort@plt>
movslq %ebp,%rax
lea    (%rbx,%rax,4),%rbx
add    $0x4,%rbx
not    %eax
add    %r14d,%eax
mov    %eax,%r14d
cmp    $0x1,%eax
jg     1130 <quicksort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %12, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = tail call i32 @partition(i32* %6, i32 %5)
tail call void @quicksort(i32* %6, i32 %7)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = getelementptr inbounds i32, i32* %9, i64 %8
%11 = xor i32 %7, -1
%12 = add i32 %5, %11
%13 = icmp slt i32 %12, 2
br i1 %13, label %14, label %4
14: ; preds = %4, %2
ret void
}
int lcp_this_layer_finished(struct lcp_context *context) {
  context = context;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.lcp_context = type opaque
define i32 @lcp_this_layer_finished(%struct.lcp_context* %0) {
%2 = alloca %struct.lcp_context*
store %struct.lcp_context* %0, %struct.lcp_context** %2
%3 = load %struct.lcp_context*, %struct.lcp_context** %2
store %struct.lcp_context* %3, %struct.lcp_context** %2
ret i32 0
}

LLVM IR (-O2):
%struct.lcp_context = type opaque
define i32 @lcp_this_layer_finished(%struct.lcp_context* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, long);
void do_stdio_log_xlong(void *context, long val) {
  FILE *stdio = context;
  fprintf(stdio, "%lx", val);
}


x86 assembly (clang, -O0):
<do_stdio_log_xlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_stdio_log_xlong>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lx\00"
define void @do_stdio_log_xlong(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int sweep_get_dobldobl_start(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 1;
  ptos[1] = 0;
  fail = _ada_use_c2phc(619, ptos, &n, c);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_get_dobldobl_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26b,%edi
lea    -0x4(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_get_dobldobl_start>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movq   $0x1,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26b,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_get_dobldobl_start(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc(i32 619, i32* %9, i32* %3, double* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_get_dobldobl_start(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 1, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 0, i32* %7
%8 = call i32 @_ada_use_c2phc(i32 619, i32* %6, i32* %3, double* %1)
ret i32 %8
}
void __attribute__((constructor)) initialize3() {
  printf(__func__);
  printf("\n");
}


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

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

LLVM IR (-O0):
@__func__.initialize3 = [12 x i8] c"initialize3\00"
@.str = [2 x i8] c"\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initialize3, i8* null }]
define void @initialize3() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.initialize3, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.initialize3 = [12 x i8] c"initialize3\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @initialize3, i8* null }]
define void @initialize3() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.initialize3, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flop();
int /*<<< orphan*/ plot();
int main() {
label:
  plot();
babel:
  flop();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <main+0x9>
mov    $0x0,%al
call   1040 <plot@plt>
mov    $0x0,%al
call   1030 <flop@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <plot@plt>
xor    %eax,%eax
call   1030 <flop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
br label %1
1: ; preds = %0
%2 = call i32 (...) @plot()
br label %3
3: ; preds = %1
%4 = call i32 (...) @flop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @plot()
%2 = tail call i32 (...) @flop()
ret i32 0
}
short zero(int n) { return 0; }


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

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

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

LLVM IR (-O2):
define signext i16 @zero(i32 %0) {
ret i16 0
}
void g_param_spec_pool_insert() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_pool_insert() {
ret void
}
unsigned xrop3_163_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S ^ D;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_163_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_163_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    $0xff,%eax
or     %ecx,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_163_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_163_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = or i32 %6, %7
%9 = xor i32 %8, -256
ret i32 %9
}
/* Variables and functions */
char const *irc_message_get_nick_from_host(char const *);
const char *irc_info_info_irc_nick_from_host_cb(void *data,
                                                const char *info_name,
                                                const char *arguments) {
  (void)data;
  (void)info_name;
  return (arguments && arguments[0]) ? irc_message_get_nick_from_host(arguments)
                                     : NULL;
}


x86 assembly (clang, -O0):
<irc_info_info_irc_nick_from_host_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <irc_info_info_irc_nick_from_host_cb+0x41>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <irc_info_info_irc_nick_from_host_cb+0x41>
mov    -0x18(%rbp),%rdi
call   1030 <irc_message_get_nick_from_host@plt>
mov    %rax,-0x20(%rbp)
jmp    115c <irc_info_info_irc_nick_from_host_cb+0x4c>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    115c <irc_info_info_irc_nick_from_host_cb+0x4c>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_info_info_irc_nick_from_host_cb>:
test   %rdx,%rdx
je     1122 <irc_info_info_irc_nick_from_host_cb+0x12>
cmpb   $0x0,(%rdx)
je     1122 <irc_info_info_irc_nick_from_host_cb+0x12>
mov    %rdx,%rdi
jmp    1030 <irc_message_get_nick_from_host@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @irc_info_info_irc_nick_from_host_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i8* @irc_message_get_nick_from_host(i8* %2)
br label %10
10: ; preds = %3, %5, %8
%11 = phi i8* [ %9, %8 ], [ null, %5 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int stroscmp(char const *, char const *);
int sorter(const void *first, const void *second) {
  const char *stra = *(const char **)first;
  const char *strb = *(const char **)second;
  return stroscmp(stra, strb);
}


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

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

LLVM IR (-O0):
define i32 @sorter(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @stroscmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @sorter(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @stroscmp(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
void *malloc(int size) { return (void *)size; }


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

x86 assembly (clang, -O2):
<malloc>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i8* @malloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @malloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
int hv_min_i(int x, int y) { return (x <= y) ? x : y; }


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

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

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

LLVM IR (-O2):
define i32 @hv_min_i(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ irmpc_irhandler();
int /*<<< orphan*/ irmpc_mpd_free();
int /*<<< orphan*/ irmpc_parse_options(int *, char ***);
int /*<<< orphan*/ irmpc_playlist_free();
int main(int argc, char **argv) {
  if (!irmpc_parse_options(&argc, &argv)) {
    goto exit_error;
  }
  irmpc_irhandler();
  irmpc_playlist_free();
  irmpc_mpd_free();
  return 0;
exit_error:
  irmpc_playlist_free();
  irmpc_mpd_free();
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <irmpc_parse_options@plt>
cmp    $0x0,%eax
jne    1171 <main+0x31>
jmp    1192 <main+0x52>
mov    $0x0,%al
call   1040 <irmpc_irhandler@plt>
mov    $0x0,%al
call   1060 <irmpc_playlist_free@plt>
mov    $0x0,%al
call   1050 <irmpc_mpd_free@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <main+0x67>
mov    $0x0,%al
call   1060 <irmpc_playlist_free@plt>
mov    $0x0,%al
call   1050 <irmpc_mpd_free@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x4(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <irmpc_parse_options@plt>
test   %eax,%eax
je     116c <main+0x2c>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <irmpc_irhandler@plt>
jmp    1171 <main+0x31>
mov    $0x1,%ebx
xor    %eax,%eax
call   1060 <irmpc_playlist_free@plt>
xor    %eax,%eax
call   1050 <irmpc_mpd_free@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
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 @irmpc_parse_options(i32* %4, i8*** %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 (...) @irmpc_irhandler()
%11 = call i32 (...) @irmpc_playlist_free()
%12 = call i32 (...) @irmpc_mpd_free()
store i32 0, i32* %3
br label %16
13: ; preds = %8
%14 = call i32 (...) @irmpc_playlist_free()
%15 = call i32 (...) @irmpc_mpd_free()
store i32 1, i32* %3
br label %16
16: ; preds = %13, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @irmpc_parse_options(i32* %3, i8*** %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 (...) @irmpc_irhandler()
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ 1, %2 ]
%11 = call i32 (...) @irmpc_playlist_free()
%12 = call i32 (...) @irmpc_mpd_free()
ret i32 %10
}
/* Variables and functions */
double CLOCKS_PER_SEC;
double clock();
double getMilliseconds() { return 1000.0 * clock() / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<getMilliseconds>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
movaps %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2eb7(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMilliseconds>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
mulsd  0xee0(%rip),%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @getMilliseconds() {
%1 = call double (...) @clock()
%2 = fmul double 1.000000e+03, %1
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @getMilliseconds() {
%1 = tail call double (...) @clock()
%2 = fmul double %1, 1.000000e+03
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}
unsigned long get32bits(unsigned char *buf) {
  unsigned long ret = 0;
  ret = (((unsigned long)buf[0]) << 24) | (((unsigned long)buf[1]) << 16) |
        (((unsigned long)buf[2]) << 8) | ((unsigned long)buf[3]);
  return ret;
}


x86 assembly (clang, -O0):
<get32bits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32bits>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @get32bits(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl i64 %7, 24
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl i64 %12, 16
%14 = or i64 %8, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i64
%19 = shl i64 %18, 8
%20 = or i64 %14, %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i64
%25 = or i64 %20, %24
store i64 %25, i64* %3
%26 = load i64, i64* %3
ret i64 %26
}

LLVM IR (-O2):
define i64 @get32bits(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 8
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
/* Variables and functions */
int partition(int *, int, int);
void qsort(int list[], int low, int high) {
  if (low < high) {
    int p = partition(list, low, high);
    qsort(list, low, p);
    qsort(list, p + 1, high);
  }
}


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

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

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

LLVM IR (-O2):
define void @qsort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
tail call void @qsort(i32* %0, i32 %6, i32 %7)
%8 = add nsw i32 %7, 1
%9 = icmp slt i32 %8, %2
br i1 %9, label %5, label %10
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This is a win :)\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"This is a win :)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"This is a win :)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void initialized_read() {
  int a = 0;
  printf("%d\n", a);
  a = 1;
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<initialized_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialized_read>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @initialized_read() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int clear_multprec_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(524, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<clear_multprec_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x20c,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_multprec_homotopy>:
mov    $0x20c,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @clear_multprec_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 524, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_multprec_homotopy() {
%1 = tail call i32 @_ada_use_c2phc(i32 524, i32* undef, i32* undef, double* undef)
ret i32 %1
}
void f(int c) { int x = c; }


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
int test_imm_14int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x14 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_14int64_midword_mem>:
testb  $0x14,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_14int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1310720
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct pipeline_scheduler_simple {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pipeline_scheduler_simple *);
int /*<<< orphan*/
pipeline_scheduler_simple_free_internal(struct pipeline_scheduler_simple *);
void pipeline_scheduler_simple_free(struct pipeline_scheduler_simple *sched) {
  pipeline_scheduler_simple_free_internal(sched);
  free(sched);
}


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

x86 assembly (clang, -O2):
<pipeline_scheduler_simple_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pipeline_scheduler_simple_free_internal@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.pipeline_scheduler_simple = type { i32 }
define void @pipeline_scheduler_simple_free(%struct.pipeline_scheduler_simple* %0) {
%2 = tail call i32 @pipeline_scheduler_simple_free_internal(%struct.pipeline_scheduler_simple* %0)
%3 = tail call i32 @free(%struct.pipeline_scheduler_simple* %0)
ret void
}
int isdel(char *del, char chr) {
  int i = 0;
  while (del[i]) {
    if (del[i++] == chr)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isdel>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115a <isdel+0x5a>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x18(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1155 <isdel+0x55>
movl   $0x1,-0x4(%rbp)
jmp    1161 <isdel+0x61>
jmp    1115 <isdel+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdel>:
movzbl (%rdi),%eax
test   %al,%al
je     1116 <isdel+0x16>
add    $0x1,%rdi
cmp    %sil,%al
jne    1100 <isdel>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isdel(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i64 [ %9, %8 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = add nuw i64 %4, 1
%10 = icmp eq i8 %6, %1
br i1 %10, label %11, label %3
11: ; preds = %3, %8
%12 = phi i32 [ 1, %8 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ hybrid(int *, int *);
int /*<<< orphan*/ ins_sort(int *, int *);
void qsort_hybrid(int *start, int n) {
  int *end;
  end = start + n - 1;
  hybrid(start, end - 1);
  ins_sort(start, end);
}


x86 assembly (clang, -O0):
<qsort_hybrid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
add    $0xfffffffffffffffc,%rsi
call   1040 <hybrid@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <ins_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_hybrid>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%r14
add    $0xfffffffffffffffc,%r14
lea    (%rdi,%rax,4),%rsi
add    $0xfffffffffffffff8,%rsi
call   1040 <hybrid@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ins_sort@plt>

LLVM IR (-O0):
define void @qsort_hybrid(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 -1
store i32* %10, i32** %5
%11 = load i32*, i32** %3
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 -1
%14 = call i32 @hybrid(i32* %11, i32* %13)
%15 = load i32*, i32** %3
%16 = load i32*, i32** %5
%17 = call i32 @ins_sort(i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @qsort_hybrid(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = getelementptr inbounds i32, i32* %4, i64 -1
%6 = getelementptr inbounds i32, i32* %5, i64 -1
%7 = tail call i32 @hybrid(i32* %0, i32* %6)
%8 = tail call i32 @ins_sort(i32* %0, i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, size_t);
int munmap(void *, size_t);
int /*<<< orphan*/ stderr;
void huge_free(void *ptr, size_t bytes) {
  int rc = munmap(ptr, bytes);
  if (rc)
    fprintf(stderr, "munmap(%p,%zu) failed\n", ptr, bytes);
  return;
}


x86 assembly (clang, -O0):
<huge_free>:
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 <munmap@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1167 <huge_free+0x47>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<huge_free>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <munmap@plt>
test   %eax,%eax
je     1155 <huge_free+0x35>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"munmap(%p,%zu) failed\0A\00"
define void @huge_free(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @munmap(i8* %6, i64 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = load i64, i64* %4
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %13, i64 %14)
br label %16
16: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"munmap(%p,%zu) failed\0A\00"
define void @huge_free(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
br label %8
8: ; preds = %5, %2
ret void
}
int op_preced(const char c) {
  switch (c) {
  case '|':
    return 3;
  case '&':
    return 2;
  case '!':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<op_preced>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x21,%eax
je     1159 <op_preced+0x59>
jmp    111f <op_preced+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x26,%eax
je     114d <op_preced+0x4d>
jmp    1130 <op_preced+0x30>
mov    -0xc(%rbp),%eax
sub    $0x7c,%eax
jne    1165 <op_preced+0x65>
jmp    1141 <op_preced+0x41>
movl   $0x3,-0x4(%rbp)
jmp    116c <op_preced+0x6c>
movl   $0x2,-0x4(%rbp)
jmp    116c <op_preced+0x6c>
movl   $0x1,-0x4(%rbp)
jmp    116c <op_preced+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_preced>:
cmp    $0x21,%edi
je     1115 <op_preced+0x15>
cmp    $0x7c,%edi
je     111b <op_preced+0x1b>
cmp    $0x26,%edi
jne    1121 <op_preced+0x21>
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret
mov    $0x3,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @op_preced(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 124, label %6
i32 38, label %3
i32 33, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ 0, %5 ], [ 1, %4 ], [ 2, %3 ], [ 3, %1 ]
ret i32 %7
}