xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int _d_parse_cstring(char *v, int l, void *s) {
  char *c = malloc(l + 1);
  memcpy(c, v, l);
  c[l] = 0;
  *(char **)s = c;
  return 1;
}


x86 assembly (clang, -O0):
<_d_parse_cstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_d_parse_cstring>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r12d
mov    %rdi,%r15
lea    0x1(%r12),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
call   1030 <memcpy@plt>
movslq %r12d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @_d_parse_cstring(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 1
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i32 @memcpy(i8* %11, i8* %12, i32 %13)
%15 = load i8*, i8** %7
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 0, i8* %18
%19 = load i8*, i8** %7
%20 = load i8*, i8** %6
%21 = bitcast i8* %20 to i8**
store i8* %19, i8** %21
ret i32 1
}

LLVM IR (-O2):
define i32 @_d_parse_cstring(i8* %0, i32 %1, i8* nocapture writeonly %2) {
%4 = add nsw i32 %1, 1
%5 = tail call i8* @malloc(i32 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %1)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
%9 = bitcast i8* %2 to i8**
store i8* %5, i8** %9
ret i32 1
}
unsigned int signedToUnsignedInt(int signedInt) {
  union _Integer {
    int s;
    unsigned int u;
  } Integer;
  Integer.s = signedInt;
  return Integer.u;
}


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

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

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

LLVM IR (-O2):
define i32 @signedToUnsignedInt(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ econais_ec19d_binary_file_store(char *, char const *,
                                                   size_t);
void ext_configuration_store(const char *buffer, size_t buffer_size) {
  econais_ec19d_binary_file_store("kaa_configuration.bin", buffer, buffer_size);
}


x86 assembly (clang, -O0):
<ext_configuration_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <econais_ec19d_binary_file_store@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext_configuration_store>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <econais_ec19d_binary_file_store@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_store(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @econais_ec19d_binary_file_store(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_store(i8* %0, i64 %1) {
%3 = tail call i32 @econais_ec19d_binary_file_store(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
ret void
}
/* Type definitions */
typedef unsigned int wint_t;

/* Variables and functions */
scalar_t__ iswcntrl(unsigned int);
int iswprint(wint_t wc) {
  unsigned c = wc;
  if (c > 0x10ffff || c - 0xd800 < 0x800 || (c & 0xfffe) == 0xfffe ||
      iswcntrl(c))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<iswprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x10ffff,-0xc(%rbp)
ja     1166 <iswprint+0x56>
mov    -0xc(%rbp),%eax
sub    $0xd800,%eax
cmp    $0x800,%eax
jb     1166 <iswprint+0x56>
mov    -0xc(%rbp),%eax
and    $0xfffe,%eax
cmp    $0xfffe,%eax
je     1166 <iswprint+0x56>
mov    -0xc(%rbp),%edi
call   1030 <iswcntrl@plt>
cmp    $0x0,%rax
je     1172 <iswprint+0x62>
movl   $0x0,-0x4(%rbp)
jmp    1179 <iswprint+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswprint>:
mov    %edi,%ecx
not    %ecx
xor    %eax,%eax
test   $0xfffe,%ecx
je     114b <iswprint+0x3b>
cmp    $0x10ffff,%edi
ja     114b <iswprint+0x3b>
mov    %edi,%ecx
and    $0xfffff800,%ecx
cmp    $0xd800,%ecx
je     114b <iswprint+0x3b>
push   %rax
call   1030 <iswcntrl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @iswprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp ugt i32 %6, 1114111
br i1 %7, label %20, label %8
8: ; preds = %1
%9 = load i32, i32* %4
%10 = sub i32 %9, 55296
%11 = icmp ult i32 %10, 2048
br i1 %11, label %20, label %12
12: ; preds = %8
%13 = load i32, i32* %4
%14 = and i32 %13, 65534
%15 = icmp eq i32 %14, 65534
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = load i32, i32* %4
%18 = call i64 @iswcntrl(i32 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16, %12, %8, %1
store i32 0, i32* %2
br label %22
21: ; preds = %16
store i32 1, i32* %2
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @iswprint(i32 %0) {
%2 = icmp ugt i32 %0, 1114111
%3 = and i32 %0, -2048
%4 = icmp eq i32 %3, 55296
%5 = or i1 %2, %4
%6 = and i32 %0, 65534
%7 = icmp eq i32 %6, 65534
%8 = or i1 %7, %5
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = tail call i64 @iswcntrl(i32 %0)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %1
%14 = phi i32 [ 0, %1 ], [ %12, %9 ]
ret i32 %14
}
/* Variables and functions */
int chdir(char *);
int chcwd(char *path) { return chdir(path); }


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

x86 assembly (clang, -O2):
<chcwd>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @chcwd(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
void bzero(void *__dest, unsigned long int __len) {
  __builtin___memset_chk(__dest, 0, (unsigned int)__len,
                         18446744073709551615ul);
}


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

x86 assembly (clang, -O2):
<bzero>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bzero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = zext i32 %7 to i64
%9 = call i8* @__memset_chk(i8* %5, i32 0, i64 %8, i64 -1)
ret void
}

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = and i64 %1, 4294967295
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %3, i1 false)
ret void
}
long int fib(long int n) {
  if (n == 1) {
    return 1;
  } else if (n == 2) {
    return 1;
  } else
    return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1134 <fib+0x24>
movq   $0x1,-0x8(%rbp)
jmp    1178 <fib+0x68>
cmpq   $0x2,-0x10(%rbp)
jne    114c <fib+0x3c>
movq   $0x1,-0x8(%rbp)
jmp    1178 <fib+0x68>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
mov    $0x1,%r14d
cmp    $0x2,%rbx
jb     1149 <fib+0x39>
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <fib@plt>
add    %rax,%r14
add    $0xfffffffffffffffe,%rbx
cmp    $0x1,%rbx
ja     1130 <fib+0x20>
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib(i64 %0) {
%2 = add i64 %0, -1
%3 = icmp ult i64 %2, 2
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ %2, %1 ]
%6 = phi i64 [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %10, %4 ], [ 0, %1 ]
%8 = tail call i64 @fib(i64 %5)
%9 = add nsw i64 %6, -2
%10 = add nsw i64 %8, %7
%11 = add i64 %6, -3
%12 = icmp ult i64 %11, 2
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = add i64 %10, 1
br label %15
15: ; preds = %13, %1
%16 = phi i64 [ 1, %1 ], [ %14, %13 ]
ret i64 %16
}
/* Variables and functions */
size_t ez_align_to(size_t d, size_t a) { return (size_t)(d + a) & ~a; }


x86 assembly (clang, -O0):
<ez_align_to>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_align_to>:
lea    (%rdi,%rsi,1),%rax
not    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @ez_align_to(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add i64 %5, %6
%8 = load i64, i64* %4
%9 = xor i64 %8, -1
%10 = and i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @ez_align_to(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = xor i64 %1, -1
%5 = and i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ mystrncpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char s[] = "abcdefg";
  char *t = "abcd";
  mystrncpy(s, t, 3);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x3,%edx
call   1040 <mystrncpy@plt>
lea    -0xc(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x67666564636261,%rax
mov    %rax,0x8(%rsp)
lea    0xec5(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%edx
call   1040 <mystrncpy@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [8 x i8] c"abcdefg\00"
@.str = [5 x i8] c"abcd\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [8 x i8]* %2 to i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @mystrncpy(i8* %5, i8* %6, i32 3)
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 29104508263162465, i64* %1
%3 = call i32 @mystrncpy(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
char *fcvt(value, ndigit, decpt, sign)
double value;
int ndigit, *decpt, *sign;
{ return cvt(value, ndigit, decpt, sign, 0); }


x86 assembly (clang, -O0):
<fcvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcvt>:
push   %rax
xor    %ecx,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @fcvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %9, i32 %10, i32* %11, i32* %12, i32 0)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @fcvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %0, i32 %1, i32* %2, i32* %3, i32 0)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
double RAND_MAX;
double log(double);
double rand();
double rand_exp(double a) {
  double s;
  s = (1.0 + rand()) / (RAND_MAX + 2.0);
  return -a * log(s);
}


x86 assembly (clang, -O0):
<rand_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movaps %xmm0,%xmm1
movsd  0xec9(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb5(%rip),%xmm1
mov    0x2e96(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_exp>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
addsd  0xec8(%rip),%xmm0
mov    0x2ea9(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movaps (%rsp),%xmm1
xorps  0xeb6(%rip),%xmm1
movaps %xmm1,(%rsp)
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand_exp(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double (...) @rand()
%5 = fadd double 1.000000e+00, %4
%6 = load double, double* @RAND_MAX
%7 = fadd double %6, 2.000000e+00
%8 = fdiv double %5, %7
store double %8, double* %3
%9 = load double, double* %2
%10 = fneg double %9
%11 = load double, double* %3
%12 = call double @log(double %11)
%13 = fmul double %10, %12
ret double %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand_exp(double %0) {
%2 = tail call double (...) @rand()
%3 = fadd double %2, 1.000000e+00
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 2.000000e+00
%6 = fdiv double %3, %5
%7 = fneg double %0
%8 = tail call double @log(double %6)
%9 = fmul double %8, %7
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_is_socket_inet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
xor    %eax,%eax
mov    0x2ec3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_is_socket_inet>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_is_socket_inet(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* @EINVAL
%12 = sub nsw i32 0, %11
ret i32 %12
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_is_socket_inet(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = load i32, i32* @EINVAL
%7 = sub nsw i32 0, %6
ret i32 %7
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_page(void *);
__attribute__((always_)) void clear_user_page(void *page, unsigned long vaddr,
                                              struct page *pg) {
  clear_page(page);
}


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

x86 assembly (clang, -O2):
<clear_user_page>:
jmp    1030 <clear_page@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define void @clear_user_page(i8* %0, i64 %1, %struct.page* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca %struct.page*
store i8* %0, i8** %4
store i64 %1, i64* %5
store %struct.page* %2, %struct.page** %6
%7 = load i8*, i8** %4
%8 = call i32 @clear_page(i8* %7)
ret void
}

LLVM IR (-O2):
%struct.page = type { i32 }
define void @clear_user_page(i8* %0, i64 %1, %struct.page* nocapture readnone %2) {
%4 = tail call i32 @clear_page(i8* %0)
ret void
}
void Breakpoint(void) { __builtin_trap(); }


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

x86 assembly (clang, -O2):
<Breakpoint>:
ud2

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

LLVM IR (-O2):
define void @Breakpoint() {
tail call void @llvm.trap()
unreachable
}
int MAIN_(int ac, char **av) { return 0; }


x86 assembly (clang, -O0):
<MAIN_>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%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 i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @MAIN_(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void genc_nge_s() {}


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

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

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

LLVM IR (-O2):
define void @genc_nge_s() {
ret void
}
unsigned int ixp2000_is_pcimaster(void) {
  return ((*(volatile unsigned long *)((0xfef04000 + 0x0a00) | (0x18))) &
          ((1 << 2)));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0xfef04a18,%eax
mov    (%rax),%rax
and    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0xfef04a18,%eax
mov    (%rax),%rax
and    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @ixp2000_is_pcimaster() {
%1 = load volatile i64, i64* inttoptr (i64 4277160472 to i64*)
%2 = and i64 %1, 4
%3 = trunc i64 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @ixp2000_is_pcimaster() {
%1 = load volatile i64, i64* inttoptr (i64 4277160472 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 4
ret i32 %3
}
void check_zero_sized_VLA_multi2(int x, int y) {
  if (x)
    return;
  int vla[y][x];
}


x86 assembly (clang, -O0):
<check_zero_sized_VLA_multi2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111d <check_zero_sized_VLA_multi2+0x1d>
jmp    113b <check_zero_sized_VLA_multi2+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
mov    %rsp,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @check_zero_sized_VLA_multi2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
br label %20
11: ; preds = %2
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = load i32, i32* %3
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %5
%17 = mul nuw i64 %13, %15
%18 = alloca i32, i64 %17
store i64 %13, i64* %6
store i64 %15, i64* %7
%19 = load i8*, i8** %5
br label %20
20: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @check_zero_sized_VLA_multi2(i32 %0, i32 %1) {
ret void
}
unsigned int mem_get_be32_as_int(const void *vmem) {
  unsigned int val;
  const unsigned char *mem = (const unsigned char *)vmem;
  val = ((unsigned int)mem[0]) << 24;
  val |= mem[1] << 16;
  val |= mem[2] << 8;
  val |= mem[3];
  return val;
}


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

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

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

LLVM IR (-O2):
define i32 @mem_get_be32_as_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int rj_writebyte(int, int /*<<< orphan*/);
int rj232_send(unsigned char *buf, int len) {
  int i, rval;
  for (i = 0; i < len; i++)
    rval = rj_writebyte(0x10, *buf++);
  return rval;
}


x86 assembly (clang, -O0):
<rj232_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <rj232_send+0x4f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
mov    $0x10,%edi
call   1030 <rj_writebyte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <rj232_send+0x16>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rj232_send>:
test   %esi,%esi
jle    114e <rj232_send+0x3e>
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%esi
mov    $0x10,%edi
call   1030 <rj_writebyte@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <rj232_send+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret
ret

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

LLVM IR (-O2):
define i32 @rj232_send(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i8* [ %7, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = tail call i32 @rj_writebyte(i32 16, i32 %9)
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ undef, %2 ], [ %10, %4 ]
ret i32 %14
}
/* Type definitions */
union bpf_attr {
  scalar_t__ kern_version;
  scalar_t__ log_level;
  scalar_t__ log_size;
  scalar_t__ log_buf;
  scalar_t__ license;
  scalar_t__ insns;
  scalar_t__ insn_cnt;
  int /*<<< orphan*/ prog_type;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_LOAD;
int /*<<< orphan*/ BPF_PROG_TYPE_KPROBE;
int syscall(int, int /*<<< orphan*/, union bpf_attr, int);
int main(void) {
  union bpf_attr attr;
  attr.prog_type = BPF_PROG_TYPE_KPROBE;
  attr.insn_cnt = 0;
  attr.insns = 0;
  attr.license = 0;
  attr.log_buf = 0;
  attr.log_size = 0;
  attr.log_level = 0;
  attr.kern_version = 0;
  attr = attr;
  return syscall(321, BPF_PROG_LOAD, attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e76(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    $0x141,%edi
mov    $0x8,%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
xor    %edx,%edx
mov    $0x8,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%union.bpf_attr = type { i64 }
@BPF_PROG_TYPE_KPROBE = global i32 0
@BPF_PROG_LOAD = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.bpf_attr
store i32 0, i32* %1
%3 = load i32, i32* @BPF_PROG_TYPE_KPROBE
%4 = bitcast %union.bpf_attr* %2 to i32*
store i32 %3, i32* %4
%5 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %5
%6 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %6
%7 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %7
%8 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %8
%9 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %9
%10 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %10
%11 = bitcast %union.bpf_attr* %2 to i64*
store i64 0, i64* %11
%12 = bitcast %union.bpf_attr* %2 to i8*
%13 = bitcast %union.bpf_attr* %2 to i8*
%14 = load i32, i32* @BPF_PROG_LOAD
%15 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %2, i32 0, i32 0
%16 = load i64, i64* %15
%17 = call i32 @syscall(i32 321, i32 %14, i64 %16, i32 8)
ret i32 %17
}

LLVM IR (-O2):
@BPF_PROG_TYPE_KPROBE = global i32 0
@BPF_PROG_LOAD = global i32 0
define i32 @main() {
%1 = load i32, i32* @BPF_PROG_LOAD
%2 = tail call i32 @syscall(i32 321, i32 %1, i64 0, i32 8)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int main(void) {
  const char *close = "this should not shadow";
  printf("%s\n", close);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"this should not shadow\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"this should not shadow\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
scalar_t__ time(int /*<<< orphan*/);
void khSeedRand(void) { srand((int)time(0)); }


x86 assembly (clang, -O0):
<khSeedRand>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<khSeedRand>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @khSeedRand() {
%1 = call i64 @time(i32 0)
%2 = trunc i64 %1 to i32
%3 = call i32 @srand(i32 %2)
ret void
}

LLVM IR (-O2):
define void @khSeedRand() {
%1 = tail call i64 @time(i32 0)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
ret void
}
/* Variables and functions */
int exp(double);
double sigmoid(double x) { return 1. / (1. + exp(-x)); }


x86 assembly (clang, -O0):
<sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeaa(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm1
movsd  0xee7(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sigmoid(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @exp(double %4)
%6 = sitofp i32 %5 to double
%7 = fadd double 1.000000e+00, %6
%8 = fdiv double 1.000000e+00, %7
ret double %8
}

LLVM IR (-O2):
define double @sigmoid(double %0) {
%2 = fneg double %0
%3 = tail call i32 @exp(double %2)
%4 = sitofp i32 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
/* Type definitions */
struct tms {
  int dummy;
};
struct _reent {
  int dummy;
};
typedef int clock_t;

/* Variables and functions */
clock_t _times_r(struct _reent *r, struct tms *buf) { return -1; }


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

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

LLVM IR (-O0):
%struct._reent = type { i32 }
%struct.tms = type { i32 }
define i32 @_times_r(%struct._reent* %0, %struct.tms* %1) {
%3 = alloca %struct._reent*
%4 = alloca %struct.tms*
store %struct._reent* %0, %struct._reent** %3
store %struct.tms* %1, %struct.tms** %4
ret i32 -1
}

LLVM IR (-O2):
%struct._reent = type { i32 }
%struct.tms = type { i32 }
define i32 @_times_r(%struct._reent* nocapture readnone %0, %struct.tms* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ close(int const);
__attribute__((__visibility__("default"))) void
CloseConnection(const int sock) {
  (close(sock));
}


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

x86 assembly (clang, -O2):
<CloseConnection>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @CloseConnection(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ traiteErr(int, char *);
void messErr2(int n, char *M) {
  if ((n < 0) || (n > 61))
    n = 1;
  traiteErr(n, M);
}


x86 assembly (clang, -O0):
<messErr2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1133 <messErr2+0x23>
cmpl   $0x3d,-0x4(%rbp)
jle    113a <messErr2+0x2a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <traiteErr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<messErr2>:
cmp    $0x3e,%edi
mov    $0x1,%eax
cmovae %eax,%edi
jmp    1030 <traiteErr@plt>

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

LLVM IR (-O2):
define void @messErr2(i32 %0, i8* %1) {
%3 = icmp ugt i32 %0, 61
%4 = select i1 %3, i32 1, i32 %0
%5 = tail call i32 @traiteErr(i32 %4, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int phRingingCall(int cid) {
  char reqbuf[64];
  snprintf(reqbuf, sizeof(reqbuf), "RINGING CID=%d", cid);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phRingingCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x40,%esi
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phRingingCall>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"RINGING CID=%d\00"
define i32 @phRingingCall(i32 %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @ph_rpc(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [15 x i8] c"RINGING CID=%d\00"
define i32 @phRingingCall(i32 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @ph_rpc(i8* %3)
ret i32 %5
}
/* Variables and functions */
char *commas_in_money(double);
char *timlib_commas_in_dollars(double d) { return commas_in_money(d); }


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

x86 assembly (clang, -O2):
<timlib_commas_in_dollars>:
jmp    1030 <commas_in_money@plt>

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

LLVM IR (-O2):
define i8* @timlib_commas_in_dollars(double %0) {
%2 = tail call i8* @commas_in_money(double %0)
ret i8* %2
}
void foo123(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo123(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ criaVetor(int *, int *, int *);
int /*<<< orphan*/ mostraVetor(int *);
int main(void) {
  int v[10];
  int v1[] = {1, 2, 3, 4, 5};
  int v2[] = {6, 7, 8, 9, 10};
  criaVetor(v, v1, v2);
  mostraVetor(v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x40(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x60(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1030 <criaVetor@plt>
lea    -0x30(%rbp),%rdi
call   1040 <mostraVetor@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xeef(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x40(%rsp),%rbx
lea    0x20(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1030 <criaVetor@plt>
mov    %rbx,%rdi
call   1040 <mostraVetor@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.v1 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.main.v2 = [5 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = bitcast [5 x i32]* %2 to i8*
%5 = bitcast [5 x i32]* %3 to i8*
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%9 = call i32 @criaVetor(i32* %6, i32* %7, i32* %8)
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%11 = call i32 @mostraVetor(i32* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.v1 = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@__const.main.v2 = [5 x i32] [i32 6, i32 7, i32 8, i32 9, i32 10]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = bitcast [10 x i32]* %1 to i8*
%5 = bitcast [5 x i32]* %2 to i8*
%6 = bitcast [5 x i32]* %3 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%10 = call i32 @criaVetor(i32* %7, i32* %8, i32* %9)
%11 = call i32 @mostraVetor(i32* %7)
ret i32 0
}
unsigned int f17(unsigned int x, unsigned int y) {
  return (x >> ((-y) & (8 * 4 - 1))) ^ (x << y);
}


x86 assembly (clang, -O0):
<f17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
and    $0x1f,%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f17>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f17(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 = sub i32 0, %6
%8 = and i32 %7, 31
%9 = lshr i32 %5, %8
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = shl i32 %10, %11
%13 = xor i32 %9, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f17(i32 %0, i32 %1) {
%3 = sub i32 0, %1
%4 = and i32 %3, 31
%5 = lshr i32 %0, %4
%6 = shl i32 %0, %1
%7 = xor i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int fact(int);
int fact12(void) { return fact(12); }


x86 assembly (clang, -O0):
<fact12>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1030 <fact@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact12>:
mov    $0xc,%edi
jmp    1030 <fact@plt>

LLVM IR (-O0):
define i32 @fact12() {
%1 = call i32 @fact(i32 12)
ret i32 %1
}

LLVM IR (-O2):
define i32 @fact12() {
%1 = tail call i32 @fact(i32 12)
ret i32 %1
}
double util_fabs(double n) { return (n < 0 ? -n : n); }


x86 assembly (clang, -O0):
<util_fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <util_fabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <util_fabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @util_fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
scalar_t__ read_quoted(char const **const, char **const);
scalar_t__ read_token(char const **const, char **const);
bool read_value(char const **const src, char **const dst) {
  return read_token(src, dst) || read_quoted(src, dst);
}


x86 assembly (clang, -O0):
<read_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <read_token@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    1166 <read_value+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <read_quoted@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_value>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <read_token@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1152 <read_value+0x32>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <read_quoted@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @read_value(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %3
%6 = load i8**, i8*** %4
%7 = call i64 @read_token(i8** %5, i8** %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i8**, i8*** %3
%11 = load i8**, i8*** %4
%12 = call i64 @read_quoted(i8** %10, i8** %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ true, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @read_value(i8** %0, i8** %1) {
%3 = tail call i64 @read_token(i8** %0, i8** %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @read_quoted(i8** %0, i8** %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
int test_imm_76uint16_reg(unsigned short val) {
  return ((val) & (-0x76 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_76uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff8a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_76uint16_reg>:
test   $0xff8a,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_76uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -118
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}