xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ printfail();
void expectd(double a, double b) {
  if (!(a == b)) {
    printfail();
    printf("\n  %lf expected, but got %lf\n", a, b);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<expectd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jne    115d <expectd+0x2d>
jp     115d <expectd+0x2d>
jmp    1184 <expectd+0x54>
mov    $0x0,%al
call   1040 <printfail@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expectd>:
ucomisd %xmm1,%xmm0
jne    1139 <expectd+0x9>
jp     1139 <expectd+0x9>
ret
sub    $0x18,%rsp
xor    %eax,%eax
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <printfail@plt>
lea    0xea9(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0A %lf expected, but got %lf\0A\00"
define void @expectd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = call i32 (...) @printfail()
%10 = load double, double* %3
%11 = load double, double* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %10, double %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0A %lf expected, but got %lf\0A\00"
define void @expectd(double %0, double %1) {
%3 = fcmp oeq double %0, %1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 (...) @printfail()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double %0, double %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
int foo(int x, int y) {
  int r;
  return __builtin_sadd_overflow(x, y, &r);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
seto   %al
mov    %ecx,-0xc(%rbp)
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
add    %esi,%edi
seto   %al
ret

LLVM IR (-O0):
define i32 @foo(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 = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %6, i32 %7)
%9 = extractvalue { i32, i1 } %8, 1
%10 = extractvalue { i32, i1 } %8, 0
store i32 %10, i32* %5
%11 = zext i1 %9 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, struct timespec *);
void sleep_ns(long nanoseconds) {
  struct timespec time0, time1;
  time0.tv_sec = 0;
  time0.tv_nsec = nanoseconds;
  nanosleep(&time0, &time1);
}


x86 assembly (clang, -O0):
<sleep_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep_ns>:
sub    $0x28,%rsp
movq   $0x0,0x10(%rsp)
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @sleep_ns(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i64 %0, i64* %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 0, i64* %5
%6 = load i64, i64* %2
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %6, i64* %7
%8 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @sleep_ns(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %0, i64* %7
%8 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret void
}
/* Type definitions */
typedef int fpu_control_t;

/* Variables and functions */
int /*<<< orphan*/ _FPU_GETCW(int);
int /*<<< orphan*/ _FPU_SETCW(int);
int fesetround(int round) {
  fpu_control_t cw;
  if ((round & ~0x3) != 0)
    return 1;
  _FPU_GETCW(cw);
  cw &= ~0x3;
  cw |= round;
  _FPU_SETCW(cw);
  return 0;
}


x86 assembly (clang, -O0):
<fesetround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffffffc,%eax
cmp    $0x0,%eax
je     1146 <fesetround+0x26>
movl   $0x1,-0x4(%rbp)
jmp    116f <fesetround+0x4f>
mov    -0xc(%rbp),%edi
call   1030 <_FPU_GETCW@plt>
mov    -0xc(%rbp),%eax
and    $0xfffffffc,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <_FPU_SETCW@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetround>:
mov    $0x1,%eax
cmp    $0x3,%edi
ja     113c <fesetround+0x1c>
push   %rbx
mov    %edi,%ebx
call   1030 <_FPU_GETCW@plt>
mov    %ebx,%edi
call   1040 <_FPU_SETCW@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fesetround(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @_FPU_GETCW(i32 undef)
%5 = tail call i32 @_FPU_SETCW(i32 %0)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ 0, %3 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ log_part(char *, char);
void log_struct(char *name) { log_part(name, '{'); }


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

x86 assembly (clang, -O2):
<log_struct>:
mov    $0x7b,%esi
jmp    1030 <log_part@plt>

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

LLVM IR (-O2):
define void @log_struct(i8* %0) {
%2 = tail call i32 @log_part(i8* %0, i8 signext 123)
ret void
}
void andc(p) struct h8_opcode *p;
{ printf("SET_CCR(GET_CCR() & srca);\n"); }


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

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

LLVM IR (-O0):
%struct.h8_opcode = type opaque
@.str = [28 x i8] c"SET_CCR(GET_CCR() & srca);\0A\00"
define void @andc(%struct.h8_opcode* %0) {
%2 = alloca %struct.h8_opcode*
store %struct.h8_opcode* %0, %struct.h8_opcode** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.h8_opcode = type opaque
@str = [27 x i8] c"SET_CCR(GET_CCR() & srca);\00"
define void @andc(%struct.h8_opcode* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, PROD;
  scanf("%d", &a);
  scanf("%d", &b);
  PROD = a * b;
  printf("PROD = %d\n", PROD);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
imul   0xc(%rsp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"PROD = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *xfopen(const char *filename, const char *mode) {
  FILE *ret = fopen(filename, mode);
  if (!ret)
    die("xfopen");
  return ret;
}


x86 assembly (clang, -O0):
<xfopen>:
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   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xfopen+0x38>
lea    0xead(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfopen>:
push   %rbx
call   1030 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xfopen+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"xfopen\00"
define i32* @xfopen(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* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @die(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32*, i32** %5
ret i32* %14
}

LLVM IR (-O2):
@.str = [7 x i8] c"xfopen\00"
define noalias i32* @xfopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32* %3
}
void f4() { return; }


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

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

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

LLVM IR (-O2):
define void @f4() {
ret void
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ read(int, void *, size_t);
ssize_t utils_read(int fd, void *buf, size_t count) {
  ssize_t result;
  do {
    result = read(fd, buf, count);
  } while (result < 0 && errno == EINTR);
  return result;
}


x86 assembly (clang, -O0):
<utils_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x20(%rbp)
mov    %al,-0x21(%rbp)
jge    1161 <utils_read+0x51>
mov    0x2e92(%rip),%rax
mov    (%rax),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1123 <utils_read+0x13>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_read>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read@plt>
test   %rax,%rax
jns    114b <utils_read+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <utils_read+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i64 @utils_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i64 @read(i32 %9, i8* %10, i64 %11)
store i64 %12, i64* %7
br label %13
13: ; preds = %8
%14 = load i64, i64* %7
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i64, i64* %7
ret i64 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i64 @utils_read(i32 %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
%6 = icmp slt i64 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i64 %5
}
float avrArr(int arr[]) {
  int i;
  float mean = 0.0;
  for (i = 0; i < 3; i++) {
    mean += arr[i];
  }
  mean = (mean / 3);
  return mean;
}


x86 assembly (clang, -O0):
<avrArr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1146 <avrArr+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cvtsi2ssl (%rax,%rcx,4),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <avrArr+0x17>
movss  -0x10(%rbp),%xmm0
movss  0xead(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<avrArr>:
movsd  (%rdi),%xmm0
cvtdq2ps %xmm0,%xmm1
movaps %xmm1,%xmm2
shufps $0x55,%xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtsi2ssl 0x8(%rdi),%xmm0
addss  %xmm1,%xmm2
addss  %xmm2,%xmm0
divss  0xeda(%rip),%xmm0
ret

LLVM IR (-O0):
define float @avrArr(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca float
store i32* %0, i32** %2
store float 0.000000e+00, float* %4
store i32 0, i32* %3
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to float
%15 = load float, float* %4
%16 = fadd float %15, %14
store float %16, float* %4
br label %17
17: ; preds = %8
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %5
20: ; preds = %5
%21 = load float, float* %4
%22 = fdiv float %21, 3.000000e+00
store float %22, float* %4
%23 = load float, float* %4
ret float %23
}

LLVM IR (-O2):
define float @avrArr(i32* nocapture %0) {
%2 = bitcast i32* %0 to <2 x i32>*
%3 = load <2 x i32>, <2 x i32>* %2
%4 = sitofp <2 x i32> %3 to <2 x float>
%5 = shufflevector <2 x float> %4, <2 x float> poison, <2 x i32> <i32 1, i32 undef>
%6 = fadd <2 x float> %5, %4
%7 = extractelement <2 x float> %6, i64 0
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to float
%11 = fadd float %7, %10
%12 = fdiv float %11, 3.000000e+00
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ listsubsets(char *, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void ListSubsets(char *set) {
  char buf[10];
  memset(buf, 0, 10);
  listsubsets(buf, set);
}


x86 assembly (clang, -O0):
<ListSubsets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <listsubsets@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ListSubsets>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xe(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <listsubsets@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ListSubsets(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 10)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @listsubsets(i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
define void @ListSubsets(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 10)
%5 = call i32 @listsubsets(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned short);
int main(void) {
  unsigned short int x, y, z;
  x = 128;
  y = 255;
  z = x & y;
  printf("after and operation: %d", z);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x80,-0x6(%rbp)
movw   $0xff,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
and    %ecx,%eax
mov    %ax,-0xa(%rbp)
lea    0xec0(%rip),%rdi
movzwl -0xa(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"after and operation: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i32 0, i32* %1
store i16 128, i16* %2
store i16 255, i16* %3
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = load i16, i16* %3
%8 = zext i16 %7 to i32
%9 = and i32 %6, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %4
%11 = load i16, i16* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i16 zeroext %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"after and operation: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i16 zeroext 128)
ret i32 0
}
unsigned long virt_to_phys(const void *virt) { return (unsigned long)virt; }


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

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

LLVM IR (-O0):
define i64 @virt_to_phys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @virt_to_phys(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
double steal(double interest) {
  double rounded = (int)(interest * 100) / 100.0;
  return interest - rounded;
}


x86 assembly (clang, -O0):
<steal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<steal>:
movsd  0xef8(%rip),%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm2
cvtdq2pd %xmm2,%xmm2
divsd  %xmm1,%xmm2
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @steal(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.000000e+02
%6 = fptosi double %5 to i32
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 1.000000e+02
store double %8, double* %3
%9 = load double, double* %2
%10 = load double, double* %3
%11 = fsub double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @steal(double %0) {
%2 = fmul double %0, 1.000000e+02
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+02
%6 = fsub double %0, %5
ret double %6
}
/* Variables and functions */
scalar_t__ EINTR;
int close(int);
scalar_t__ errno;
int /*<<< orphan*/ pthread_yield();
void safe_close(int fd) {
  int error;
  while ((error = close(fd)) == -1 && errno == EINTR) {
    pthread_yield();
  }
}


x86 assembly (clang, -O0):
<safe_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x9(%rbp)
jne    1160 <safe_close+0x40>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    0x2e81(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1170 <safe_close+0x50>
jmp    117c <safe_close+0x5c>
mov    $0x0,%al
call   1040 <pthread_yield@plt>
jmp    112b <safe_close+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_close>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    115b <safe_close+0x3b>
mov    0x2ea8(%rip),%r14
mov    0x2e99(%rip),%r15
nop
mov    (%r15),%rax
cmp    %rax,(%r14)
jne    115b <safe_close+0x3b>
xor    %eax,%eax
call   1040 <pthread_yield@plt>
mov    %ebx,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     1140 <safe_close+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define void @safe_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
store i32 %6, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i64, i64* @errno
%10 = load i64, i64* @EINTR
%11 = icmp eq i64 %9, %10
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ false, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %16
14: ; preds = %12
%15 = call i32 (...) @pthread_yield()
br label %4
16: ; preds = %12
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define void @safe_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
%4 = load i64, i64* @errno
%5 = load i64, i64* @EINTR
%6 = icmp eq i64 %4, %5
%7 = select i1 %3, i1 %6, i1 false
br i1 %7, label %8, label %16
8: ; preds = %1, %8
%9 = tail call i32 (...) @pthread_yield()
%10 = tail call i32 @close(i32 %0)
%11 = icmp eq i32 %10, -1
%12 = load i64, i64* @errno
%13 = load i64, i64* @EINTR
%14 = icmp eq i64 %12, %13
%15 = select i1 %11, i1 %14, i1 false
br i1 %15, label %8, label %16
16: ; preds = %8, %1
ret void
}
void instruc_32() {}


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

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

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

LLVM IR (-O2):
define void @instruc_32() {
ret void
}
const char *cairo_version_string(void) { return "CAIRO NOT AVAILABLE"; }


x86 assembly (clang, -O0):
<cairo_version_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cairo_version_string>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"CAIRO NOT AVAILABLE\00"
define i8* @cairo_version_string() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [20 x i8] c"CAIRO NOT AVAILABLE\00"
define i8* @cairo_version_string() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sortrnd(void **, int, int (*)(void const *, void const *),
                           double *);
void sat_solver_sort(void **array, int size,
                     int (*comp)(const void *, const void *)) {
  double seed = 91648253;
  sortrnd(array, size, comp, &seed);
}


x86 assembly (clang, -O0):
<sat_solver_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <sortrnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_solver_sort>:
push   %rax
movabs $0x4195d9c3f4000000,%rax
d9 95 41
mov    %rax,(%rsp)
mov    %rsp,%rcx
call   1030 <sortrnd@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @sat_solver_sort(i8** %0, i32 %1, i32 (i8*, i8*)* %2) {
%4 = alloca double
%5 = bitcast double* %4 to i8*
store double 0x4195D9C3F4000000, double* %4
%6 = call i32 @sortrnd(i8** %0, i32 %1, i32 (i8*, i8*)* %2, double* %4)
ret void
}
int id(int i) {
  asm("" : "+r"(i));
  return i;
}


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

x86 assembly (clang, -O2):
<id>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @id(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @id(i32 %0) {
%2 = tail call i32 asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
void generarIndex() {}


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

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

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

LLVM IR (-O2):
define void @generarIndex() {
ret void
}
int intcmp(int *x, int *y) { return (*x < *y ? -1 : (*x == *y ? 0 : +1)); }


x86 assembly (clang, -O0):
<intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    112b <intcmp+0x2b>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <intcmp+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @intcmp(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %19
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = icmp eq i32 %13, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 0, i32 1
br label %19
19: ; preds = %11, %10
%20 = phi i32 [ -1, %10 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @intcmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = icmp ne i32 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
double fog(int words, int bigwords, int sentences) {
  return ((((double)words) / sentences + (100.0 * bigwords) / words) * 0.4);
}


x86 assembly (clang, -O0):
<fog>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm2
movsd  0xee0(%rip),%xmm1
mulsd  %xmm2,%xmm1
cvtsi2sdl -0x4(%rbp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  0xebf(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fog>:
movd   %edi,%xmm0
movd   %edx,%xmm1
punpckldq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
mulsd  0xee1(%rip),%xmm1
movapd %xmm0,%xmm2
shufpd $0x1,%xmm1,%xmm2
divpd  %xmm0,%xmm2
movapd %xmm2,%xmm0
unpckhpd %xmm2,%xmm0
addsd  %xmm2,%xmm0
mulsd  0xec8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fog(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %6
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = fmul double 1.000000e+02, %13
%15 = load i32, i32* %4
%16 = sitofp i32 %15 to double
%17 = fdiv double %14, %16
%18 = fadd double %11, %17
%19 = fmul double %18, 4.000000e-01
ret double %19
}

LLVM IR (-O2):
define double @fog(i32 %0, i32 %1, i32 %2) {
%4 = insertelement <2 x i32> poison, i32 %2, i64 0
%5 = insertelement <2 x i32> %4, i32 %0, i64 1
%6 = sitofp <2 x i32> %5 to <2 x double>
%7 = sitofp i32 %1 to double
%8 = fmul double %7, 1.000000e+02
%9 = extractelement <2 x double> %6, i64 1
%10 = insertelement <2 x double> poison, double %9, i64 0
%11 = insertelement <2 x double> %10, double %8, i64 1
%12 = fdiv <2 x double> %11, %6
%13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%14 = fadd <2 x double> %12, %13
%15 = extractelement <2 x double> %14, i64 0
%16 = fmul double %15, 4.000000e-01
ret double %16
}
/* Type definitions */
struct writer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *writer_append(struct writer *, size_t);
void writer_append_data(struct writer *w, const char *buf, size_t len) {
  char *dest = writer_append(w, len);
  memcpy(dest, buf, len);
}


x86 assembly (clang, -O0):
<writer_append_data>:
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    -0x18(%rbp),%rsi
call   1040 <writer_append@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writer_append_data>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
call   1040 <writer_append@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.writer = type { i32 }
define void @writer_append_data(%struct.writer* %0, i8* %1, i64 %2) {
%4 = alloca %struct.writer*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store %struct.writer* %0, %struct.writer** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load %struct.writer*, %struct.writer** %4
%9 = load i64, i64* %6
%10 = call i8* @writer_append(%struct.writer* %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
%struct.writer = type { i32 }
define void @writer_append_data(%struct.writer* %0, i8* %1, i64 %2) {
%4 = tail call i8* @writer_append(%struct.writer* %0, i64 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int inb(int);
void waitdisk() {
  while ((inb(0x1F7) & 0xC0) != 0x40)
    ;
}


x86 assembly (clang, -O0):
<waitdisk>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <waitdisk+0x9>
mov    $0x1f7,%edi
call   1030 <inb@plt>
and    $0xc0,%eax
cmp    $0x40,%eax
je     1136 <waitdisk+0x26>
jmp    1119 <waitdisk+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitdisk>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1f7,%edi
call   1030 <inb@plt>
and    $0xc0,%eax
cmp    $0x40,%eax
jne    1120 <waitdisk+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @waitdisk() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @inb(i32 503)
%3 = and i32 %2, 192
%4 = icmp ne i32 %3, 64
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @waitdisk() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @inb(i32 503)
%3 = and i32 %2, 192
%4 = icmp eq i32 %3, 64
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int system_little_endian_check() {
  int16_t word = 0x0001;
  char *bytes = (char *)&word;
  if (bytes[0] == 0)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<system_little_endian_check>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112f <system_little_endian_check+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1136 <system_little_endian_check+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @system_little_endian_check() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 1, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 0, i32* %1
br label %12
11: ; preds = %0
store i32 1, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @system_little_endian_check() {
ret i32 1
}
void modif_front2pcre_delim() {}


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

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

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

LLVM IR (-O2):
define void @modif_front2pcre_delim() {
ret void
}
int g(char *x) {
  asm(".global g_end_lbl\ng_end_lbl:");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @g(i8* nocapture readnone %0) {
tail call void asm sideeffect ".global g_end_lbl\0Ag_end_lbl:", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
unsigned long __generic_copy_to_user(void *x, const void *y, unsigned long z) {
  assert(0);
}


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

x86 assembly (clang, -O2):
<__generic_copy_to_user>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i64 @__generic_copy_to_user(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @assert(i32 0)
ret i64 undef
}
int _rl_find_next_mbchar(string, seed, count, flags)
char *string __attribute__((unused));
int seed, count, flags __attribute__((unused));
{ return (seed + count); }


x86 assembly (clang, -O0):
<_rl_find_next_mbchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rl_find_next_mbchar>:
lea    (%rsi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @_rl_find_next_mbchar(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_rl_find_next_mbchar(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, %1
ret i32 %5
}
void RTLinuxSysFsReadStr(void) {}


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

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

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

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

/* Variables and functions */
int LITTLE_ENDIAN;
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t endian_to_host_16(int endian, uint16_t val) {
  if (endian != LITTLE_ENDIAN)
    return ntohs(val);
  return val;
}


x86 assembly (clang, -O0):
<endian_to_host_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ec0(%rip),%rcx
cmp    (%rcx),%eax
je     1140 <endian_to_host_16+0x30>
mov    -0xc(%rbp),%edi
call   1030 <ntohs@plt>
mov    %eax,-0x4(%rbp)
jmp    1146 <endian_to_host_16+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian_to_host_16>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    111e <endian_to_host_16+0xe>
mov    %esi,%eax
ret
mov    %esi,%edi
jmp    1030 <ntohs@plt>

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

LLVM IR (-O2):
@LITTLE_ENDIAN = global i32 0
define i32 @endian_to_host_16(i32 %0, i32 %1) {
%3 = load i32, i32* @LITTLE_ENDIAN
%4 = icmp eq i32 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @ntohs(i32 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %1, %2 ]
ret i32 %8
}
int config_MODULE_CCCAM(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @config_MODULE_CCCAM() {
ret i32 1
}
void PIRAmplifierStage2_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @PIRAmplifierStage2_RestoreConfig() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_dobldobl_random_coefficient_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(460, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<celcon_dobldobl_random_coefficient_system>:
mov    $0x1cc,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @celcon_dobldobl_random_coefficient_system() {
%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_c2phc4c(i32 460, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_dobldobl_random_coefficient_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 460, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int __max_impl_int(int a, int b) { return (a > b) ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @__max_impl_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
char *strcat(char *restrict s1, const char *restrict s2) {
  char *s = s1;
  while (*s != '\0')
    s++;
  strcpy(s, s2);
  return s1;
}


x86 assembly (clang, -O0):
<strcat>:
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),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <strcat+0x39>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <strcat+0x18>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi)
lea    0x1(%rdi),%rdi
jne    1120 <strcat+0x10>
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* noalias returned %0, i8* noalias %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %4, i8* %1)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ optval;

/* Variables and functions */
int setsockopt(int, int, int, void const *, int);
int c_setsockopt_int(int sockfd, int level, int optname, int optval) {
  return setsockopt(sockfd, level, optname, (const void *)&optval,
                    sizeof(optval));
}


x86 assembly (clang, -O0):
<c_setsockopt_int>:
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    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_setsockopt_int>:
push   %rax
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @c_setsockopt_int(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
store i32 %3, i32* %5
%6 = bitcast i32* %5 to i8*
%7 = call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %6, i32 4)
ret i32 %7
}