xunge/DecIR huggingface dataset:
int comp_assoc(const void *i1, const void *i2) {
  float *f1, *f2;
  f1 = (float *)i1 + 1;
  f2 = (float *)i2 + 1;
  if (*f1 < *f2)
    return -1;
  else
    return (*f1 == *f2) ? 0 : 1;
}


x86 assembly (clang, -O0):
<comp_assoc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1149 <comp_assoc+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <comp_assoc+0x73>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm1
mov    $0x1,%eax
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_assoc>:
movss  0x4(%rdi),%xmm0
movss  0x4(%rsi),%xmm1
movaps %xmm0,%xmm2
cmpneqss %xmm1,%xmm2
movd   %xmm2,%ecx
and    $0x1,%ecx
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comp_assoc(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float*
%7 = alloca float*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = getelementptr inbounds float, float* %9, i64 1
store float* %10, float** %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to float*
%13 = getelementptr inbounds float, float* %12, i64 1
store float* %13, float** %7
%14 = load float*, float** %6
%15 = load float, float* %14
%16 = load float*, float** %7
%17 = load float, float* %16
%18 = fcmp olt float %15, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %28
20: ; preds = %2
%21 = load float*, float** %6
%22 = load float, float* %21
%23 = load float*, float** %7
%24 = load float, float* %23
%25 = fcmp oeq float %22, %24
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 0, i32 1
store i32 %27, i32* %3
br label %28
28: ; preds = %20, %19
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @comp_assoc(i8* nocapture %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to float*
%5 = getelementptr inbounds i8, i8* %1, i64 4
%6 = bitcast i8* %5 to float*
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fcmp olt float %7, %8
%10 = fcmp une float %7, %8
%11 = zext i1 %10 to i32
%12 = select i1 %9, i32 -1, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *p) {
  free(p);
  return;
}


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

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

LLVM IR (-O2):
define void @xfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XConfigureEvent;

/* Variables and functions */
void set_XConfigureEvent_type(void *_p, int _v) {
  ((XConfigureEvent *)_p)->type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XConfigureEvent_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XConfigureEvent_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XConfigureEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strmaxcpy(char *to, char *from, int n) {
  int len = strlen(from);
  strncpy(to, from, n);
  to[(len <= n) ? len : n] = '\0';
  return to;
}


x86 assembly (clang, -O0):
<strmaxcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     116e <strmaxcpy+0x4e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1174 <strmaxcpy+0x54>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmaxcpy>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <strncpy@plt>
cmp    %ebx,%ebp
cmovg  %ebx,%ebp
movslq %ebp,%rax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strmaxcpy(i8* returned %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %2)
%6 = icmp sgt i32 %4, %2
%7 = select i1 %6, i32 %2, i32 %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
ret i8* %0
}
/* Variables and functions */
int bitcount(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned int x;
  printf("Please input a number: ");
  scanf("%d", &x);
  printf("Result: %d\n", bitcount(x));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <bitcount@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <bitcount@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Please input a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"Result: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @bitcount(i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Please input a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"Result: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @bitcount(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void bar(void) {
  int j = 0;
  do {
    if (j < 0 || j > 256)
      link_error();
    j++;
  } while (j <= 256);
  if (j != 257)
    link_error();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1136 <bar+0x26>
cmpl   $0x100,-0x4(%rbp)
jle    113d <bar+0x2d>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jle    111f <bar+0xf>
cmpl   $0x101,-0x4(%rbp)
je     1167 <bar+0x57>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bar() {
ret void
}
int isonum_733(char *p) {
  return ((p[0] & 0xff) | ((p[1] & 0xff) << 8) | ((p[2] & 0xff) << 16) |
          ((p[3] & 0xff) << 24));
}


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

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

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

LLVM IR (-O2):
define i32 @isonum_733(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
struct object *car(struct object *);
struct object *prim_car(void *workspace, struct object *args) {
  return (car(car((args))));
}


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

x86 assembly (clang, -O2):
<prim_car>:
push   %rax
mov    %rsi,%rdi
call   1030 <car@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <car@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
define %struct.object* @prim_car(i8* %0, %struct.object* %1) {
%3 = alloca i8*
%4 = alloca %struct.object*
store i8* %0, i8** %3
store %struct.object* %1, %struct.object** %4
%5 = load %struct.object*, %struct.object** %4
%6 = call %struct.object* @car(%struct.object* %5)
%7 = call %struct.object* @car(%struct.object* %6)
ret %struct.object* %7
}

LLVM IR (-O2):
%struct.object = type { i32 }
define %struct.object* @prim_car(i8* nocapture readnone %0, %struct.object* %1) {
%3 = tail call %struct.object* @car(%struct.object* %1)
%4 = tail call %struct.object* @car(%struct.object* %3)
ret %struct.object* %4
}
/* Variables and functions */
char *osdialog_strndup(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char *osdialog_strdup(const char *s) { return osdialog_strndup(s, strlen(s)); }


x86 assembly (clang, -O0):
<osdialog_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <osdialog_strndup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osdialog_strdup>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <osdialog_strndup@plt>

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

LLVM IR (-O2):
define i8* @osdialog_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @osdialog_strndup(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
float min(float, float);
float min3(float n1, float n2, float n3) { return min(min(n1, n2), n3); }


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <min@plt>
movss  -0xc(%rbp),%xmm1
call   1030 <min@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3>:
push   %rax
movss  %xmm2,0x4(%rsp)
call   1030 <min@plt>
movss  0x4(%rsp),%xmm1
pop    %rax
jmp    1030 <min@plt>

LLVM IR (-O0):
define float @min3(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = call float @min(float %7, float %8)
%10 = load float, float* %6
%11 = call float @min(float %9, float %10)
ret float %11
}

LLVM IR (-O2):
define float @min3(float %0, float %1, float %2) {
%4 = tail call float @min(float %0, float %1)
%5 = tail call float @min(float %4, float %2)
ret float %5
}
/* Variables and functions */
int getc(void *);
int get_next_byte(void *stream) { return getc(stream); }


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

x86 assembly (clang, -O2):
<get_next_byte>:
jmp    1030 <getc@plt>

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

LLVM IR (-O2):
define i32 @get_next_byte(i8* nocapture %0) {
%2 = tail call i32 @getc(i8* %0)
ret i32 %2
}
int ehnlc_isascii(int c) { return (c >= 0 && c <= 127) ? 1 : 0; }


x86 assembly (clang, -O0):
<ehnlc_isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ehnlc_isascii+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ehnlc_isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @ehnlc_isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
void *routine(void *data) {
  int i;
  for (i = 0; i < 6; ++i) {
    puts("bleble");
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1161 <routine+0x41>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <routine+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<routine>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1040 <sleep@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"bleble\00"
define noalias i8* @routine(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @sleep(i32 1)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @sleep(i32 1)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @sleep(i32 1)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ ft_strdel(char **);
void cleanup(char **split, size_t cur) {
  while (cur > 0) {
    cur--;
    ft_strdel(&split[cur]);
  }
  ft_strdel(split);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1150 <cleanup+0x40>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <ft_strdel@plt>
jmp    1120 <cleanup+0x10>
mov    -0x8(%rbp),%rdi
call   1030 <ft_strdel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     1142 <cleanup+0x32>
mov    %rsi,%r15
lea    (%r14,%rsi,8),%rbx
add    $0xfffffffffffffff8,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <ft_strdel@plt>
add    $0xfffffffffffffff8,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <cleanup+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <ft_strdel@plt>

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

LLVM IR (-O2):
define void @cleanup(i8** %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %1, %2 ]
%6 = add i64 %5, -1
%7 = getelementptr inbounds i8*, i8** %0, i64 %6
%8 = tail call i32 @ft_strdel(i8** %7)
%9 = icmp eq i64 %6, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = tail call i32 @ft_strdel(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
int symlink(char const *, char const *);
void create_symlink(const char *path1, const char *path2) {
  int ret = symlink(path1, path2);
  if (ret != 0) {
    printf("link failed: %s\n", strerror(errno));
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<create_symlink>:
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 <symlink@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1195 <create_symlink+0x55>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %rax,%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_symlink>:
push   %rax
call   1040 <symlink@plt>
test   %eax,%eax
jne    114c <create_symlink+0xc>
pop    %rax
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9f(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"link failed: %s\0A\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
define void @create_symlink(i8* %0, i8* %1) {
%3 = tail call i32 @symlink(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
ret void
}
int no_warning(unsigned x) { return x >= 0 || x == 1; }


x86 assembly (clang, -O0):
<no_warning>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jae    1120 <no_warning+0x20>
cmpl   $0x1,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @no_warning(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @no_warning(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cursoroff() { printf("\x1b[?25l"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25l\00"
define void @cursoroff() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25l\00"
define void @cursoroff() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_14int16_mem(short *val) {
  return ((*val) & (0x14 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_14int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 20
%7 = icmp ne i32 %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_14int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 20
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void g_markup_parse_context_free() {}


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

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

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

LLVM IR (-O2):
define void @g_markup_parse_context_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showHelp() {
  printf("Argumenty programu:\n"
         "\t--help vypise napovedu\n"
         "\t--test skontroluje ci zadany subor obsahuje validnu bitovu mapu\n"
         "\t--hline v danem obrazku nalezne a vytiskne pocatecni "
         "a\n\t\tkoncovou souradnici prvni nejdelsi horizontalni usecky.\n"
         "\t--vline v danem obrazku nalezne a vytiskne pocatecni "
         "a\n\t\tkoncovou souradnici prvni nejdelsi vertikalni usecky.\n"
         "\t--square v danem obrazku nalezne a vytiskne pocatecni "
         "a\n\t\tkoncovou souradnici prvniho nejvetsiho ctverce.\n");
}


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

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

LLVM IR (-O0):
@.str = [443 x i8] c"Argumenty programu:\0A\09--help vypise napovedu\0A\09--test skontroluje ci zadany subor obsahuje validnu bitovu mapu\0A\09--hline v danem obrazku nalezne a vytiskne pocatecni a\0A\09\09koncovou souradnici prvni nejdelsi horizontalni usecky.\0A\09--vline v danem obrazku nalezne a vytiskne pocatecni a\0A\09\09koncovou souradnici prvni nejdelsi vertikalni usecky.\0A\09--square v danem obrazku nalezne a vytiskne pocatecni a\0A\09\09koncovou souradnici prvniho nejvetsiho ctverce.\0A\00"
define void @showHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([443 x i8], [443 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [442 x i8] c"Argumenty programu:\0A\09--help vypise napovedu\0A\09--test skontroluje ci zadany subor obsahuje validnu bitovu mapu\0A\09--hline v danem obrazku nalezne a vytiskne pocatecni a\0A\09\09koncovou souradnici prvni nejdelsi horizontalni usecky.\0A\09--vline v danem obrazku nalezne a vytiskne pocatecni a\0A\09\09koncovou souradnici prvni nejdelsi vertikalni usecky.\0A\09--square v danem obrazku nalezne a vytiskne pocatecni a\0A\09\09koncovou souradnici prvniho nejvetsiho ctverce.\00"
define void @showHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([442 x i8], [442 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int printf(char *);
int print_header(void) { return printf("---\n"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"---\0A\00"
define i32 @print_header() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ stacktrace_pop();
void *stacktrace_rpop(void *val) {
  stacktrace_pop();
  return val;
}


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

x86 assembly (clang, -O2):
<stacktrace_rpop>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <stacktrace_pop@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @stacktrace_rpop(i8* readnone returned %0) {
%2 = tail call i32 (...) @stacktrace_pop()
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ install_syscall_filter();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  install_syscall_filter();
  printf("hello world\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @install_syscall_filter()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _unmarshal_uchar_array(unsigned char **, unsigned int *, unsigned char *,
                           int);
int _unmarshal_uuid(unsigned char **pData, unsigned int *pDataLen,
                    unsigned char *dest) {
  return _unmarshal_uchar_array(pData, pDataLen, dest, 16);
}


x86 assembly (clang, -O0):
<_unmarshal_uuid>:
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
mov    $0x10,%ecx
call   1030 <_unmarshal_uchar_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unmarshal_uuid>:
mov    $0x10,%ecx
jmp    1030 <_unmarshal_uchar_array@plt>

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

LLVM IR (-O2):
define i32 @_unmarshal_uuid(i8** %0, i32* %1, i8* %2) {
%4 = tail call i32 @_unmarshal_uchar_array(i8** %0, i32* %1, i8* %2, i32 16)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t max_uint64(uint64_t i1, uint64_t i2) {
  if (i1 > i2)
    return i1;
  return i2;
}


x86 assembly (clang, -O0):
<max_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <max_uint64+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <max_uint64+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_uint64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max_uint64(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ drawPoint(int, int /*<<< orphan*/, int /*<<< orphan*/);
void DrawVerticalLine(int x, int y, int length, uint8_t color) {
  while (length--)
    drawPoint(x, y++, color);
}


x86 assembly (clang, -O0):
<DrawVerticalLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1153 <DrawVerticalLine+0x43>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%edx
call   1030 <drawPoint@plt>
jmp    1124 <DrawVerticalLine+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawVerticalLine>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
je     1145 <DrawVerticalLine+0x35>
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %edi,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rsi),%ebx
mov    %r15d,%edi
mov    %r14d,%edx
call   1030 <drawPoint@plt>
mov    %ebx,%esi
add    $0xffffffff,%ebp
jne    1130 <DrawVerticalLine+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @DrawVerticalLine(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, 0
br i1 %5, label %13, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %10, %6 ], [ %1, %4 ]
%8 = phi i32 [ %9, %6 ], [ %2, %4 ]
%9 = add nsw i32 %8, -1
%10 = add nsw i32 %7, 1
%11 = tail call i32 @drawPoint(i32 %0, i32 %7, i32 %3)
%12 = icmp eq i32 %9, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x25_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x25_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x25_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x25_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x25_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void getchar_t() {
  char c;
  printf("Enter character: ");
  c = getchar();
  printf("Character entered: ");
  putchar(c);
}


x86 assembly (clang, -O0):
<getchar_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x1(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar_t>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Enter character: \00"
@.str.1 = [20 x i8] c"Character entered: \00"
define void @getchar_t() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8, i8* %1
%6 = call i32 @putchar(i8 signext %5)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter character: \00"
@.str.1 = [20 x i8] c"Character entered: \00"
define void @getchar_t() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @putchar(i8 signext %2)
ret void
}
__attribute__((no, noclone)) int f2(int x) { return x < 0 ? x : ~x; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111c <f2+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <f2+0x25>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %edi,%eax
sar    $0x1f,%eax
xor    %edi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, %0
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
char *getenv(char *);
char *cgiServerName() { return getenv("SERVER_NAME"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"SERVER_NAME\00"
define i8* @cgiServerName() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"SERVER_NAME\00"
define i8* @cgiServerName() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
unsigned char bcd_to_decimal(unsigned char d) {
  return ((d & 0x0F) + (((d & 0xF0) >> 4) * 10));
}


x86 assembly (clang, -O0):
<bcd_to_decimal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl -0x1(%rbp),%ecx
and    $0xf0,%ecx
sar    $0x4,%ecx
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd_to_decimal>:
mov    %edi,%ecx
and    $0xf,%cl
shr    $0x4,%dil
movzbl %dil,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @bcd_to_decimal(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 15
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = and i32 %7, 240
%9 = ashr i32 %8, 4
%10 = mul nsw i32 %9, 10
%11 = add nsw i32 %5, %10
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @bcd_to_decimal(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = lshr i8 %0, 4
%4 = mul nuw i8 %3, 10
%5 = add nuw i8 %4, %2
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ qd_add_d(double *, double, double *);
int /*<<< orphan*/ qd_copy(double const *, double *);
int /*<<< orphan*/ qd_minus(double *);
void qd_sub_d_qd(double a, const double *b, double *c) {
  double mb[4];
  qd_copy(b, mb);
  qd_minus(mb);
  qd_add_d(mb, a, c);
}


x86 assembly (clang, -O0):
<qd_sub_d_qd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <qd_copy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <qd_minus@plt>
lea    -0x40(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
call   1040 <qd_add_d@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_sub_d_qd>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <qd_copy@plt>
mov    %rbx,%rdi
call   1030 <qd_minus@plt>
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    %r14,%rsi
call   1040 <qd_add_d@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @qd_sub_d_qd(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca [4 x double]
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %5
%9 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%10 = call i32 @qd_copy(double* %8, double* %9)
%11 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%12 = call i32 @qd_minus(double* %11)
%13 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%14 = load double, double* %4
%15 = load double*, double** %6
%16 = call i32 @qd_add_d(double* %13, double %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @qd_sub_d_qd(double %0, double* %1, double* %2) {
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %4 to i8*
%6 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%7 = call i32 @qd_copy(double* %1, double* %6)
%8 = call i32 @qd_minus(double* %6)
%9 = call i32 @qd_add_d(double* %6, double %0, double* %2)
ret void
}
int test_imm_56uint16_mem(unsigned short *val) {
  return ((*val) & (-0x56 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_56uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffaa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_56uint16_mem>:
movzwl (%rdi),%eax
test   $0xffaa,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_56uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -86
%7 = icmp ne i32 %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_56uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -86
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_C6uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xC6 << 0)) ? -20 : -40;
}


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

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

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

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