xunge/DecIR huggingface dataset:
void VMR3ReqWait(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3ReqWait() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ E_P24(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ E_md4hash(unsigned char *, unsigned char *);
int /*<<< orphan*/ memset(unsigned char *, char, int);
void SMBNTencrypt(unsigned char *passwd, unsigned char *c8,
                  unsigned char *p24) {
  unsigned char p21[21];
  memset(p21, '\0', 21);
  E_md4hash(passwd, p21);
  E_P24(p21, c8, p24);
}


x86 assembly (clang, -O0):
<SMBNTencrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1050 <E_md4hash@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <E_P24@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SMBNTencrypt>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rsp,%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x15,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <E_md4hash@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <E_P24@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @SMBNTencrypt(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [21 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 0
%9 = call i32 @memset(i8* %8, i8 signext 0, i32 21)
%10 = load i8*, i8** %4
%11 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 0
%12 = call i32 @E_md4hash(i8* %10, i8* %11)
%13 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 0
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = call i32 @E_P24(i8* %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @SMBNTencrypt(i8* %0, i8* %1, i8* %2) {
%4 = alloca [21 x i8]
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i8 signext 0, i32 21)
%7 = call i32 @E_md4hash(i8* %0, i8* %5)
%8 = call i32 @E_P24(i8* %5, i8* %1, i8* %2)
ret void
}
/* Variables and functions */
int _ZN7android16MediaBufferGroupC1Ej();
int _ZN7android16MediaBufferGroupC1Ev() {
  return _ZN7android16MediaBufferGroupC1Ej();
}


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

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

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

LLVM IR (-O2):
define i32 @_ZN7android16MediaBufferGroupC1Ev() {
%1 = tail call i32 (...) @_ZN7android16MediaBufferGroupC1Ej()
ret i32 %1
}
int ls_costN_nm9_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 1;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 1;
  return 0;
}


x86 assembly (clang, -O0):
<ls_costN_nm9_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <ls_costN_nm9_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <ls_costN_nm9_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <ls_costN_nm9_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <ls_costN_nm9_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm9_work>:
test   %rdi,%rdi
je     110b <ls_costN_nm9_work+0xb>
movl   $0x1,(%rdi)
test   %rsi,%rsi
je     1116 <ls_costN_nm9_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <ls_costN_nm9_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <ls_costN_nm9_work+0x2c>
movl   $0x1,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ls_costN_nm9_work(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 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 1, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 1, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @ls_costN_nm9_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 1, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
int odd_ones(unsigned x) {
  x ^= x >> 16;
  x ^= x >> 8;
  x ^= x >> 4;
  x ^= x >> 2;
  x ^= x >> 1;
  x &= 0x1;
  return x;
}


x86 assembly (clang, -O0):
<odd_ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<odd_ones>:
mov    %edi,%eax
shr    $0x10,%eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @odd_ones(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 8
%9 = load i32, i32* %2
%10 = xor i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = load i32, i32* %2
%14 = xor i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 2
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 1
%21 = load i32, i32* %2
%22 = xor i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = and i32 %23, 1
store i32 %24, i32* %2
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @odd_ones(i32 %0) {
%2 = lshr i32 %0, 16
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 8
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = lshr i32 %7, 2
%9 = xor i32 %8, %7
%10 = lshr i32 %9, 1
%11 = xor i32 %10, %9
%12 = and i32 %11, 1
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write(int, int /*<<< orphan*/, int);
void I_summa_reset_summa(int fd) {
  write(fd, 0, 1);
  usleep(400000);
}


x86 assembly (clang, -O0):
<I_summa_reset_summa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x61a80,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I_summa_reset_summa>:
push   %rax
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x61a80,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @I_summa_reset_summa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write(i32 %3, i32 0, i32 1)
%5 = call i32 @usleep(i32 400000)
ret void
}

LLVM IR (-O2):
define void @I_summa_reset_summa(i32 %0) {
%2 = tail call i32 @write(i32 %0, i32 0, i32 1)
%3 = tail call i32 @usleep(i32 400000)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ talloc_report_depth_file(void const *, int /*<<< orphan*/,
                                            int, int /*<<< orphan*/ *);
void talloc_report_full(const void *ptr, FILE *f) {
  talloc_report_depth_file(ptr, 0, -1, f);
}


x86 assembly (clang, -O0):
<talloc_report_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <talloc_report_depth_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<talloc_report_full>:
mov    %rsi,%rcx
xor    %esi,%esi
mov    $0xffffffff,%edx
jmp    1030 <talloc_report_depth_file@plt>

LLVM IR (-O0):
define void @talloc_report_full(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = call i32 @talloc_report_depth_file(i8* %5, i32 0, i32 -1, i32* %6)
ret void
}

LLVM IR (-O2):
define void @talloc_report_full(i8* %0, i32* %1) {
%3 = tail call i32 @talloc_report_depth_file(i8* %0, i32 0, i32 -1, i32* %1)
ret void
}
int ft_toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return ('A' + c - 'a');
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <ft_toupper+0x2c>
cmpl   $0x7a,-0x8(%rbp)
jg     112c <ft_toupper+0x2c>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <ft_toupper+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 65, %10
%12 = sub nsw i32 %11, 97
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int getNumericCoordinateFromIndex(int i, int boardSize) {
  return i - boardSize / 2;
}


x86 assembly (clang, -O0):
<getNumericCoordinateFromIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumericCoordinateFromIndex>:
mov    %edi,%eax
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
sar    %ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getNumericCoordinateFromIndex(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 = sdiv i32 %6, 2
%8 = sub nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @getNumericCoordinateFromIndex(i32 %0, i32 %1) {
%3 = sdiv i32 %1, -2
%4 = add i32 %3, %0
ret i32 %4
}
/* Variables and functions */
uintptr_t syscall(int, uintptr_t);
uintptr_t __brk(uintptr_t newbrk) { return syscall(45, newbrk); }


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

x86 assembly (clang, -O2):
<__brk>:
mov    %rdi,%rsi
mov    $0x2d,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i64 @__brk(i64 %0) {
%2 = tail call i64 @syscall(i32 45, i64 %0)
ret i64 %2
}
void swap(double lyst[], int i, int j) {
  double temp = lyst[i];
  lyst[i] = lyst[j];
  lyst[j] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
movsd  (%rdi,%rax,8),%xmm0
movslq %edx,%rcx
movsd  (%rdi,%rcx,8),%xmm1
movsd  %xmm1,(%rdi,%rax,8)
movsd  %xmm0,(%rdi,%rcx,8)
ret

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

LLVM IR (-O2):
define void @swap(double* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = load double, double* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
store double %9, double* %5
store double %6, double* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void bcopy(void const *src, void *dest, size_t count) {
  memcpy(dest, src, count);
}


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

x86 assembly (clang, -O2):
<bcopy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @bcopy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i64 %2)
ret void
}
int main(int argc, char **argv) {
#pragma omp parallel
  {}
#pragma omp parallel
  {
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int tosReal_asInt(double d) { return (int)d; }


x86 assembly (clang, -O0):
<tosReal_asInt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosReal_asInt>:
cvttsd2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @tosReal_asInt(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double ASRT_Seconds(clock_t start, clock_t end) {
  return (double)(end - start) / (1.0 * CLOCKS_PER_SEC);
}


x86 assembly (clang, -O0):
<ASRT_Seconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  0xedf(%rip),%xmm1
mov    0x2ec0(%rip),%rax
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASRT_Seconds>:
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @ASRT_Seconds(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to double
%9 = load double, double* @CLOCKS_PER_SEC
%10 = fmul double 1.000000e+00, %9
%11 = fdiv double %8, %10
ret double %11
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @ASRT_Seconds(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to double
%5 = load double, double* @CLOCKS_PER_SEC
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int lower(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int carac;
  printf("Ingrese un caracter: ");
  scanf("%c", &carac);
  carac = lower(carac);
  printf("%c", carac);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <lower@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea4(%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    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <lower@plt>
mov    %eax,0x4(%rsp)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Ingrese un caracter: \00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 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* %2)
%5 = load i32, i32* %2
%6 = call i32 @lower(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Ingrese un caracter: \00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 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 @lower(i32 %5)
store i32 %6, i32* %1
%7 = call i32 @putchar(i32 %6)
ret i32 0
}
/* Variables and functions */
void *mb_correct_addr_and_bit(int *, void *);
int /*<<< orphan*/ set_bit(int, void *);
void mb_set_bit(int bit, void *addr) {
  addr = mb_correct_addr_and_bit(&bit, addr);
  set_bit(bit, addr);
}


x86 assembly (clang, -O0):
<mb_set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
call   1030 <mb_correct_addr_and_bit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <set_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_set_bit>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <mb_correct_addr_and_bit@plt>
mov    0x4(%rsp),%edi
mov    %rax,%rsi
call   1040 <set_bit@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @mb_set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i8* @mb_correct_addr_and_bit(i32* %3, i8* %5)
store i8* %6, i8** %4
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @set_bit(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @mb_set_bit(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i8* @mb_correct_addr_and_bit(i32* %3, i8* %1)
%5 = load i32, i32* %3
%6 = call i32 @set_bit(i32 %5, i8* %4)
ret void
}
unsigned char t0u(unsigned char a, unsigned char b) {
  printf("%s: a: %u\n", __func__, a);
  printf("%s: b: %u\n", __func__, b);
  return a + b;
}


x86 assembly (clang, -O0):
<t0u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%edx
lea    0xed1(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x2(%rbp),%edx
lea    0xec7(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t0u>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
lea    0xedf(%rip),%rdi
lea    0xee3(%rip),%r15
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    %r15,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    (%r14,%rbx,1),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s: a: %u\0A\00"
@__func__.t0u = [4 x i8] c"t0u\00"
@.str.1 = [11 x i8] c"%s: b: %u\0A\00"
define zeroext i8 @t0u(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.t0u, i64 0, i64 0), i32 %6)
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.t0u, i64 0, i64 0), i32 %9)
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = add nsw i32 %12, %14
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s: a: %u\0A\00"
@__func__.t0u = [4 x i8] c"t0u\00"
@.str.1 = [11 x i8] c"%s: b: %u\0A\00"
define zeroext i8 @t0u(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.t0u, i64 0, i64 0), i32 %3)
%5 = zext i8 %1 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__func__.t0u, i64 0, i64 0), i32 %5)
%7 = add i8 %1, %0
ret i8 %7
}
/* Variables and functions */
int core4_safe(char const *);
int U_EMRSCALEVIEWPORTEXTEX_safe(const char *record) {
  return (core4_safe(record));
}


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

x86 assembly (clang, -O2):
<U_EMRSCALEVIEWPORTEXTEX_safe>:
jmp    1030 <core4_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSCALEVIEWPORTEXTEX_safe(i8* %0) {
%2 = tail call i32 @core4_safe(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ bar(int, int /*<<< orphan*/);
void foo(int i, va_list args) { bar(i, args); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo(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 = call i32 @bar(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = tail call i32 @bar(i32 %0, i32 %1)
ret void
}
void three_cycle(array, ind0, ind1, ind2) int array[], ind0, ind1, ind2;
{
  int temp;
  temp = array[ind0];
  array[ind0] = array[ind1];
  array[ind1] = array[ind2];
  array[ind2] = temp;
  return;
}


x86 assembly (clang, -O0):
<three_cycle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<three_cycle>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%r8d
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
movslq %ecx,%rax
mov    (%rdi,%rax,4),%ecx
mov    %ecx,(%rdi,%rdx,4)
mov    %r8d,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @three_cycle(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %9
%15 = load i32*, i32** %5
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = load i32*, i32** %5
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 %19, i32* %23
%24 = load i32*, i32** %5
%25 = load i32, i32* %8
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = load i32*, i32** %5
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %29, i64 %31
store i32 %28, i32* %32
%33 = load i32, i32* %9
%34 = load i32*, i32** %5
%35 = load i32, i32* %8
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %34, i64 %36
store i32 %33, i32* %37
ret void
}

LLVM IR (-O2):
define void @three_cycle(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
store i32 %13, i32* %9
store i32 %7, i32* %12
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int connect(int, struct sockaddr const *, int /*<<< orphan*/);
int errno;
int __sulong_posix_connect(int socket, const struct sockaddr *address,
                           socklen_t address_len) {
  {
    int native_errno = errno;
    int result = connect(socket, address, address_len);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <connect@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    115a <__sulong_posix_connect+0x4a>
xor    %eax,%eax
mov    0x2e8d(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%ecx
mov    0x2e7c(%rip),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_connect>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <connect@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @__sulong_posix_connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%9 = load i32, i32* @errno
store i32 %9, i32* %7
%10 = load i32, i32* %4
%11 = load %struct.sockaddr*, %struct.sockaddr** %5
%12 = load i32, i32* %6
%13 = call i32 @connect(i32 %10, %struct.sockaddr* %11, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %21
16: ; preds = %3
%17 = load i32, i32* @errno
%18 = sub nsw i32 0, %17
%19 = sext i32 %18 to i64
%20 = trunc i64 %19 to i32
store i32 %20, i32* %8
br label %21
21: ; preds = %16, %3
%22 = load i32, i32* %7
store i32 %22, i32* @errno
%23 = load i32, i32* %8
ret i32 %23
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @__sulong_posix_connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = load i32, i32* @errno
%5 = tail call i32 @connect(i32 %0, %struct.sockaddr* %1, i32 %2)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = select i1 %6, i32 %8, i32 %5
store i32 %4, i32* @errno
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ FIONREAD;
size_t ioctl(int, int /*<<< orphan*/, int *);
size_t bytes_available(int fd) {
  int bytes_avail = 0;
  return ioctl(fd, FIONREAD, &bytes_avail);
  return bytes_avail;
}


x86 assembly (clang, -O0):
<bytes_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_available>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@FIONREAD = global i32 0
define i64 @bytes_available(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONREAD
%6 = call i64 @ioctl(i32 %4, i32 %5, i32* %3)
ret i64 %6
}

LLVM IR (-O2):
@FIONREAD = global i32 0
define i64 @bytes_available(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @FIONREAD
%5 = call i64 @ioctl(i32 %0, i32 %4, i32* %2)
ret i64 %5
}
int strlength(const char *str) {
  int i;
  for (i = 0; str[i] != '\0'; ++i)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <strlength+0x37>
jmp    1129 <strlength+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlength+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int sock_op_enable_creds(int sock_fd) { abort(); }


x86 assembly (clang, -O0):
<sock_op_enable_creds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sock_op_enable_creds>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @sock_op_enable_creds(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @sock_op_enable_creds(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
char *datalog(uint8_t *src, int len) { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @datalog(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @datalog(i32* nocapture readnone %0, i32 %1) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ color(int);
int /*<<< orphan*/ io_hlt();
int /*<<< orphan*/ printk(char *);
void int_Un_define(void) {
  color(0xff0000);
  printk("Undefine!!!");
  io_hlt();
}


x86 assembly (clang, -O0):
<int_Un_define>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff0000,%edi
call   1050 <color@plt>
lea    0xebb(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <io_hlt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_Un_define>:
push   %rax
mov    $0xff0000,%edi
call   1050 <color@plt>
lea    0xebe(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <io_hlt@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Undefine!!!\00"
define void @int_Un_define() {
%1 = call i32 @color(i32 16711680)
%2 = call i32 @printk(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @io_hlt()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Undefine!!!\00"
define void @int_Un_define() {
%1 = tail call i32 @color(i32 16711680)
%2 = tail call i32 @printk(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @io_hlt()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t get_dbits(double d) {
  union {
    double dbl;
    uint64_t i;
  } dbl_bits = {d};
  return dbl_bits.i;
}


x86 assembly (clang, -O0):
<get_dbits>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dbits>:
movq   %xmm0,%rax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @get_dbits(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = bitcast %union.anon* %3 to double*
%5 = load double, double* %2
store double %5, double* %4
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_dbits(double %0) {
%2 = bitcast double %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int timer_isset(const struct timeval *tv) {
  return tv->tv_sec != 0 || tv->tv_usec != 0;
}


x86 assembly (clang, -O0):
<timer_isset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
cmpq   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
jne    112a <timer_isset+0x2a>
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_isset>:
mov    $0x1,%eax
cmpq   $0x0,(%rdi)
je     110c <timer_isset+0xc>
ret
xor    %eax,%eax
cmpq   $0x0,0x8(%rdi)
setne  %al
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @timer_isset(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ true, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @timer_isset(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr(int, int);
int /*<<< orphan*/ GenPrintNewLine();
int /*<<< orphan*/ GenPrintOperand(int, int);
void GenPrintInstr1Operand(int instr, int instrval, int operand,
                           int operandval) {
  GenPrintInstr(instr, instrval);
  GenPrintOperand(operand, operandval);
  GenPrintNewLine();
}


x86 assembly (clang, -O0):
<GenPrintInstr1Operand>:
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
call   1030 <GenPrintInstr@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <GenPrintOperand@plt>
mov    $0x0,%al
call   1050 <GenPrintNewLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenPrintInstr1Operand>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
call   1030 <GenPrintInstr@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <GenPrintOperand@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <GenPrintNewLine@plt>

LLVM IR (-O0):
define void @GenPrintInstr1Operand(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 = call i32 @GenPrintInstr(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @GenPrintOperand(i32 %12, i32 %13)
%15 = call i32 (...) @GenPrintNewLine()
ret void
}

LLVM IR (-O2):
define void @GenPrintInstr1Operand(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @GenPrintInstr(i32 %0, i32 %1)
%6 = tail call i32 @GenPrintOperand(i32 %2, i32 %3)
%7 = tail call i32 (...) @GenPrintNewLine()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ runAllTests_project();
int main(void) {
  runAllTests_project();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runAllTests_project()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void displayTitle() {
  puts("\n---------------\n| THE MESSAGE |\n---------------");
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"\0A---------------\0A| THE MESSAGE |\0A---------------\00"
define void @displayTitle() {
%1 = call i32 @puts(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"\0A---------------\0A| THE MESSAGE |\0A---------------\00"
define void @displayTitle() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void app_error(char *msg) {
  fprintf(stdout, "***%s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<app_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<app_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ resume(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stop(int /*<<< orphan*/);
void test(pid_t pid, int interval) {
  for (;;) {
    fprintf(stderr, "sleeping\n");
    sleep(interval);
    stop(pid);
    resume(pid);
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%edi
call   1060 <sleep@plt>
mov    -0x4(%rbp),%edi
call   1030 <stop@plt>
mov    -0x4(%rbp),%edi
call   1050 <resume@plt>
jmp    114e <test+0xe>

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    0x2e8e(%rip),%r15
lea    0xea7(%rip),%r14
nopl   0x0(%rax)
mov    (%r15),%edi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    %ebx,%edi
call   1060 <sleep@plt>
mov    %ebp,%edi
call   1030 <stop@plt>
mov    %ebp,%edi
call   1050 <resume@plt>
jmp    1160 <test+0x20>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"sleeping\0A\00"
define void @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %5, %2
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = call i32 @sleep(i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @stop(i32 %10)
%12 = load i32, i32* %3
%13 = call i32 @resume(i32 %12)
br label %5
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"sleeping\0A\00"
define void @test(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 %1)
%7 = tail call i32 @stop(i32 %0)
%8 = tail call i32 @resume(i32 %0)
br label %3
}
/* Variables and functions */
int fat(int);
int /*<<< orphan*/ printf(char *, int, int);
void main(void) {
  int numero = 5;
  printf("O fatorial de %d é %d\n", numero, fat(numero));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <fat@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <fat@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
mov    %eax,%edx
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [24 x i8] c"O fatorial de %d \C3\A9 %d\0A\00"
define void @main() {
%1 = tail call i32 @fat(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 5, i32 %1)
ret void
}
int INHERENT_fork() { return 0; }


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

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

LLVM IR (-O0):
define i32 @INHERENT_fork() {
ret i32 0
}

LLVM IR (-O2):
define i32 @INHERENT_fork() {
ret i32 0
}