xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, void const *, size_t);
int /*<<< orphan*/ nla_reserve(void **, int, size_t);
void nla_put_blob(void **ctx, int type, const void *blob, size_t len) {
  memcpy(nla_reserve(ctx, type, len), blob, len);
}


x86 assembly (clang, -O0):
<nla_put_blob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <nla_reserve@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nla_put_blob(i8** %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8**, i8*** %5
%10 = load i32, i32* %6
%11 = load i64, i64* %8
%12 = call i32 @nla_reserve(i8** %9, i32 %10, i64 %11)
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = call i32 @memcpy(i32 %12, i8* %13, i64 %14)
ret void
}

LLVM IR (-O2):
define void @nla_put_blob(i8** %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i32 @nla_reserve(i8** %0, i32 %1, i64 %3)
%6 = tail call i32 @memcpy(i32 %5, i8* %2, i64 %3)
ret void
}
char *strcat(char *__restrict s1, register const char *__restrict s2) {
  register char *s = s1;
  while (*s++)
    ;
  --s;
  while ((*s++ = *s2++) != 0)
    ;
  return s1;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmpb   $0x0,(%rax)
je     1131 <strcat+0x31>
jmp    1114 <strcat+0x14>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1170 <strcat+0x70>
jmp    113d <strcat+0x3d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* noalias returned %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
int main() {
  struct T {
    int x;
  } s1;
  s1.x = 1;
  {
    struct T {
      int y;
    } s2;
    s2.y = 1;
    if (s1.x - s2.y != 0)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
cmp    $0x0,%eax
je     1134 <main+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <main+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.T = type { i32 }
%struct.T.0 = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.T
%3 = alloca %struct.T.0
store i32 0, i32* %1
%4 = getelementptr inbounds %struct.T, %struct.T* %2, i32 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.T.0, %struct.T.0* %3, i32 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.T, %struct.T* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.T.0, %struct.T.0* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = sub nsw i32 %7, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %0
store i32 1, i32* %1
br label %14
13: ; preds = %0
store i32 0, i32* %1
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void itoa(int n, char *s) {
  if (n < 0) {
    *s++ = '-';
    n = -n;
  }
  if (n / 10)
    itoa(n / 10, s);
  *s++ = n % 10 + '0';
  *s = '\0';
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1143 <itoa+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     116d <itoa+0x5d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <itoa@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
test   %edi,%edi
jns    1126 <itoa+0x16>
movb   $0x2d,(%rbx)
add    $0x1,%rbx
neg    %ebp
mov    %ebp,%r14d
cmp    $0xa,%ebp
jb     1143 <itoa+0x33>
mov    $0xcccccccd,%edi
imul   %r14,%rdi
shr    $0x23,%rdi
mov    %rbx,%rsi
call   1030 <itoa@plt>
mov    $0xcccccccd,%eax
imul   %r14,%rax
shr    $0x23,%rax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%ebp
or     $0x30,%bpl
mov    %bpl,(%rbx)
movb   $0x0,0x1(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @itoa(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 %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
store i8 45, i8* %8
%10 = load i32, i32* %3
%11 = sub nsw i32 0, %10
store i32 %11, i32* %3
br label %12
12: ; preds = %7, %2
%13 = load i32, i32* %3
%14 = sdiv i32 %13, 10
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i32, i32* %3
%18 = sdiv i32 %17, 10
%19 = load i8*, i8** %4
br label %20
20: ; preds = %16, %12
%21 = load i32, i32* %3
%22 = srem i32 %21, 10
%23 = add nsw i32 %22, 48
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %4
store i8 %24, i8* %25
%27 = load i8*, i8** %4
store i8 0, i8* %27
ret void
}

LLVM IR (-O2):
define void @itoa(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%6 = sub nsw i32 0, %0
br label %7
7: ; preds = %4, %2
%8 = phi i32 [ %6, %4 ], [ %0, %2 ]
%9 = phi i8* [ %5, %4 ], [ %1, %2 ]
%10 = icmp ult i32 %8, 10
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = udiv i32 %8, 10
tail call void @itoa(i32 %12, i8* %9)
br label %13
13: ; preds = %11, %7
%14 = urem i32 %8, 10
%15 = trunc i32 %14 to i8
%16 = or i8 %15, 48
%17 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %16, i8* %9
store i8 0, i8* %17
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char);
int my_isnumeric(char *s) {
  while (*s) {
    if (!isdigit(*s))
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<my_isnumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <my_isnumeric+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114a <my_isnumeric+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <my_isnumeric+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <my_isnumeric+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isnumeric>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <my_isnumeric+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <my_isnumeric+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <my_isnumeric+0x20>
jmp    114b <my_isnumeric+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @my_isnumeric(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int __attribute__((section("libgloss_epiphany")))
_execve(const char *filename, char *const argv[], char *const envp[]) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<_execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_execve(i8* %0, i8** %1, i8** %2) section "libgloss_epiphany" {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) section "libgloss_epiphany" {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void Debug_reset_MINUS_memory_MINUS_balance_BANG_() {
  printf("Error - calling 'reset-memory-balance!' without compiling with "
         "LOG_MEMORY enabled.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<Debug_reset_MINUS_memory_MINUS_balance_BANG_>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Debug_reset_MINUS_memory_MINUS_balance_BANG_>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [84 x i8] c"Error - calling 'reset-memory-balance!' without compiling with LOG_MEMORY enabled.\0A\00"
define void @Debug_reset_MINUS_memory_MINUS_balance_BANG_() {
%1 = call i32 @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [83 x i8] c"Error - calling 'reset-memory-balance!' without compiling with LOG_MEMORY enabled.\00"
define void @Debug_reset_MINUS_memory_MINUS_balance_BANG_() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float fabs(float n) {
  float f;
  if (n >= 0)
    f = n;
  else
    f = -n;
  return f;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1129 <fabs+0x29>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1140 <fabs+0x40>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm1,%xmm1
cmpnless %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fabs(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
get_nb_salon() { return 4; }


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

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

LLVM IR (-O0):
define i32 @get_nb_salon() {
ret i32 4
}

LLVM IR (-O2):
define i32 @get_nb_salon() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ei_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<ei_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ei_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int fun322() { return 322; }


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

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

LLVM IR (-O0):
define i32 @fun322() {
ret i32 322
}

LLVM IR (-O2):
define i32 @fun322() {
ret i32 322
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s1) {
  char *s2 = malloc(strlen(s1) + 1);
  if (s2 == NULL)
    return NULL;
  strcpy(s2, s1);
  return s2;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ my_printnbr(unsigned long, char *, int /*<<< orphan*/);
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_strlen(char *);
int my_putunbr_base(unsigned long nbr, char *base) {
  if (nbr == 0) {
    my_putchar('0');
    return (0);
  } else if (nbr < 0)
    my_putchar('-');
  my_printnbr(nbr, base, my_strlen(base));
  return (0);
}


x86 assembly (clang, -O0):
<my_putunbr_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <my_putunbr_base+0x31>
mov    $0x30,%edi
call   1040 <my_putchar@plt>
movl   $0x0,-0x4(%rbp)
jmp    11aa <my_putunbr_base+0x7a>
cmpq   $0x0,-0x10(%rbp)
jae    1176 <my_putunbr_base+0x46>
mov    $0x2d,%edi
call   1040 <my_putchar@plt>
jmp    117b <my_putunbr_base+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1050 <my_printnbr@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putunbr_base>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1156 <my_putunbr_base+0x26>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <my_strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <my_printnbr@plt>
jmp    1160 <my_putunbr_base+0x30>
mov    $0x30,%edi
call   1040 <my_putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @my_putunbr_base(i64 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @my_putchar(i8 signext 48)
store i32 0, i32* %3
br label %22
10: ; preds = %2
%11 = load i64, i64* %4
%12 = icmp ult i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @my_putchar(i8 signext 45)
br label %15
15: ; preds = %13, %10
br label %16
16: ; preds = %15
%17 = load i64, i64* %4
%18 = load i8*, i8** %5
%19 = load i8*, i8** %5
%20 = call i32 @my_strlen(i8* %19)
%21 = call i32 @my_printnbr(i64 %17, i8* %18, i32 %20)
store i32 0, i32* %3
br label %22
22: ; preds = %16, %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @my_putunbr_base(i64 %0, i8* %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @my_putchar(i8 signext 48)
br label %9
6: ; preds = %2
%7 = tail call i32 @my_strlen(i8* %1)
%8 = tail call i32 @my_printnbr(i64 %0, i8* %1, i32 %7)
br label %9
9: ; preds = %6, %4
ret i32 0
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_42(uint64_t x) {
  __asm__("rolq $42, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_42>:
mov    %rdi,%rax
rol    $0x2a,%rax
ret

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

LLVM IR (-O2):
define i8* @ROL64_42(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$42, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
void pci_disable_pasid(struct pci_dev *pdev) {}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @pci_disable_pasid(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_disable_pasid(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *a;
  printf("%p\n", a);
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* undef)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
scalar_t__ write(int, char *, size_t);
void http_send_data(int fd, char *data, size_t size) {
  ssize_t bytes_sent;
  while (size > 0) {
    bytes_sent = write(fd, data, size);
    if (bytes_sent < 0)
      return;
    size -= bytes_sent;
    data += bytes_sent;
  }
}


x86 assembly (clang, -O0):
<http_send_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    1172 <http_send_data+0x62>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1152 <http_send_data+0x42>
jmp    1172 <http_send_data+0x62>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1123 <http_send_data+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_send_data>:
push   %rbp
push   %r14
push   %rbx
test   %rdx,%rdx
je     114d <http_send_data+0x3d>
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <write@plt>
test   %rax,%rax
js     114d <http_send_data+0x3d>
sub    %rax,%rbx
add    %rax,%r14
test   %rbx,%rbx
jne    1130 <http_send_data+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @http_send_data(i32 %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i8* [ %11, %5 ], [ %1, %3 ]
%7 = phi i64 [ %10, %5 ], [ %2, %3 ]
%8 = tail call i64 @write(i32 %0, i8* %6, i64 %7)
%9 = icmp slt i64 %8, 0
%10 = sub i64 %7, %8
%11 = getelementptr inbounds i8, i8* %6, i64 %8
%12 = icmp eq i64 %10, 0
%13 = or i1 %9, %12
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ INS_0F();
int /*<<< orphan*/ _c_setbyte(int);
void POP_GS() {
  ;
  INS_0F();
  _c_setbyte(0xa9);
  ;
}


x86 assembly (clang, -O0):
<POP_GS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <INS_0F@plt>
mov    $0xa9,%edi
call   1040 <_c_setbyte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<POP_GS>:
push   %rax
xor    %eax,%eax
call   1030 <INS_0F@plt>
mov    $0xa9,%edi
pop    %rax
jmp    1040 <_c_setbyte@plt>

LLVM IR (-O0):
define void @POP_GS() {
%1 = call i32 (...) @INS_0F()
%2 = call i32 @_c_setbyte(i32 169)
ret void
}

LLVM IR (-O2):
define void @POP_GS() {
%1 = tail call i32 (...) @INS_0F()
%2 = tail call i32 @_c_setbyte(i32 169)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: puretrace [-hid] command [args]\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: puretrace [-hid] command [args]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"Usage: puretrace [-hid] command [args]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
int evenOddSwap(int x) {
  int evenMask = (0xAA << 24) | (0xAA << 16) | (0xAA << 8) | (0xAA);
  int oddMask = ~evenMask;
  int evens = x & evenMask;
  int odds = x & oddMask;
  return ((evens >> 1) & (~(1 << 31))) | (odds << 1);
}


x86 assembly (clang, -O0):
<evenOddSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xaaaaaaaa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x1,%eax
and    $0x7fffffff,%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evenOddSwap>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
and    $0xd5555555,%edi
lea    (%rax,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @evenOddSwap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 -1431655766, i32* %3
%7 = load i32, i32* %3
%8 = xor i32 %7, -1
store i32 %8, i32* %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = and i32 %9, %10
store i32 %11, i32* %5
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = and i32 %12, %13
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = ashr i32 %15, 1
%17 = and i32 %16, 2147483647
%18 = load i32, i32* %6
%19 = shl i32 %18, 1
%20 = or i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @evenOddSwap(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = shl i32 %0, 1
%5 = and i32 %4, -1431655766
%6 = or i32 %3, %5
ret i32 %6
}
void set_bit(char *bytes, int idx) {
  int byte = idx >> 3;
  int bit = (byte << 3) ^ idx;
  bytes[byte] |= 1 << bit;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x3,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
cltq
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @set_bit(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
%7 = load i32, i32* %4
%8 = ashr i32 %7, 3
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = shl i32 %9, 3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = shl i32 1, %13
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = or i32 %20, %14
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
ret void
}

LLVM IR (-O2):
define void @set_bit(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = and i32 %1, 7
%5 = shl nuw nsw i32 1, %4
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %5 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int z();
int main(void) {
  int val;
  val = z();
  if (val != 0x60)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <z@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x60,-0x8(%rbp)
je     115a <main+0x2a>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <z@plt>
cmp    $0x60,%eax
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @z()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 96
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @z()
%2 = icmp eq i32 %1, 96
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ intrflush(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ nonl();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
void init_curses() {
  noecho();
  nonl();
  intrflush(stdscr, FALSE);
  curs_set(FALSE);
  keypad(stdscr, TRUE);
  start_color();
}


x86 assembly (clang, -O0):
<init_curses>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <noecho@plt>
mov    $0x0,%al
call   1060 <nonl@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    0x2e4e(%rip),%rax
mov    (%rax),%esi
call   1040 <intrflush@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   1080 <curs_set@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%edi
mov    0x2e39(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
mov    $0x0,%al
call   1050 <start_color@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_curses>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1070 <noecho@plt>
xor    %eax,%eax
call   1060 <nonl@plt>
mov    0x2e6f(%rip),%r14
mov    (%r14),%edi
mov    0x2e4d(%rip),%rbx
mov    (%rbx),%esi
call   1040 <intrflush@plt>
mov    (%rbx),%edi
call   1080 <curs_set@plt>
mov    (%r14),%edi
mov    0x2e45(%rip),%rax
mov    (%rax),%esi
call   1030 <keypad@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <start_color@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@FALSE = global i32 0
@TRUE = global i32 0
define void @init_curses() {
%1 = call i32 (...) @noecho()
%2 = call i32 (...) @nonl()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @FALSE
%5 = call i32 @intrflush(i32 %3, i32 %4)
%6 = load i32, i32* @FALSE
%7 = call i32 @curs_set(i32 %6)
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = call i32 @keypad(i32 %8, i32 %9)
%11 = call i32 (...) @start_color()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@FALSE = global i32 0
@TRUE = global i32 0
define void @init_curses() {
%1 = tail call i32 (...) @noecho()
%2 = tail call i32 (...) @nonl()
%3 = load i32, i32* @stdscr
%4 = load i32, i32* @FALSE
%5 = tail call i32 @intrflush(i32 %3, i32 %4)
%6 = load i32, i32* @FALSE
%7 = tail call i32 @curs_set(i32 %6)
%8 = load i32, i32* @stdscr
%9 = load i32, i32* @TRUE
%10 = tail call i32 @keypad(i32 %8, i32 %9)
%11 = tail call i32 (...) @start_color()
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *realloc(void *, size_t);
void *rpl_realloc(void *ptr, size_t n) {
  if (n == 0)
    n = 1;
  if (ptr == 0)
    return malloc(n);
  return realloc(ptr, n);
}


x86 assembly (clang, -O0):
<rpl_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1143 <rpl_realloc+0x23>
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <rpl_realloc+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1171 <rpl_realloc+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_realloc>:
mov    %rsi,%rax
test   %rsi,%rsi
mov    $0x1,%esi
cmovne %rax,%rsi
test   %rdi,%rdi
je     1139 <rpl_realloc+0x19>
jmp    1040 <realloc@plt>
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @rpl_realloc(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = select i1 %3, i64 1, i64 %1
%5 = icmp eq i8* %0, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i8* @malloc(i64 %4)
br label %10
8: ; preds = %2
%9 = tail call i8* @realloc(i8* %0, i64 %4)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
void funcion(double *t, double *k, double *l) {
  (*t) += (*l) / (*k);
  (*k) += 2.0;
  (*l) *= -1.0;
}


x86 assembly (clang, -O0):
<funcion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xed0(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0xeb4(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcion>:
movsd  (%rdx),%xmm0
divsd  (%rsi),%xmm0
addsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
movsd  (%rsi),%xmm0
addsd  0xee4(%rip),%xmm0
movsd  %xmm0,(%rsi)
movsd  (%rdx),%xmm0
xorps  0xee5(%rip),%xmm0
movlps %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @funcion(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %6
%8 = load double, double* %7
%9 = load double*, double** %5
%10 = load double, double* %9
%11 = fdiv double %8, %10
%12 = load double*, double** %4
%13 = load double, double* %12
%14 = fadd double %13, %11
store double %14, double* %12
%15 = load double*, double** %5
%16 = load double, double* %15
%17 = fadd double %16, 2.000000e+00
store double %17, double* %15
%18 = load double*, double** %6
%19 = load double, double* %18
%20 = fmul double %19, -1.000000e+00
store double %20, double* %18
ret void
}

LLVM IR (-O2):
define void @funcion(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %2
%5 = load double, double* %1
%6 = fdiv double %4, %5
%7 = load double, double* %0
%8 = fadd double %7, %6
store double %8, double* %0
%9 = load double, double* %1
%10 = fadd double %9, 2.000000e+00
store double %10, double* %1
%11 = load double, double* %2
%12 = fneg double %11
store double %12, double* %2
ret void
}
void movCS(char *src, short *dst) { *dst = *src; }


x86 assembly (clang, -O0):
<movCS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<movCS>:
movsbl (%rdi),%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @movCS(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
store i8* %0, i8** %3
store i16* %1, i16** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i16
%8 = load i16*, i16** %4
store i16 %7, i16* %8
ret void
}

LLVM IR (-O2):
define void @movCS(i8* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i16
store i16 %4, i16* %1
ret void
}
void yy_1_ParagraphText(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_ParagraphText(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(int argc, char *argv[]) {
  printf("Usage: %s [-r|-w] <entry_name> [value]\n", argv[0]);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    (%rsi),%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: %s [-r|-w] <entry_name> [value]\0A\00"
define void @usage(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 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Usage: %s [-r|-w] <entry_name> [value]\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x, y;
  int r = rand();
  if (!(r <= 0)) {
    y = rand();
    x = 42;
  } else {
    rand();
    y = rand();
    x = 7;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1150 <main+0x40>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2a,-0x14(%rbp)
jmp    1168 <main+0x58>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x7,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x2a,%eax
test   %ebx,%ebx
jle    112c <main+0x1c>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x7,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @rand()
store i32 %9, i32* %8
%10 = load i32, i32* %8
%11 = icmp sle i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 (...) @rand()
store i32 %13, i32* %7
store i32 42, i32* %6
br label %17
14: ; preds = %2
%15 = call i32 (...) @rand()
%16 = call i32 (...) @rand()
store i32 %16, i32* %7
store i32 7, i32* %6
br label %17
17: ; preds = %14, %12
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp slt i32 %3, 1
%5 = tail call i32 (...) @rand()
br i1 %4, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @rand()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 7, %6 ], [ 42, %2 ]
ret i32 %9
}
/* Type definitions */
struct snd_kcontrol {
  int dummy;
};
struct snd_ctl_elem_info {
  int dummy;
};

/* Variables and functions */
int snd_ctl_enum_info(struct snd_ctl_elem_info *, int, int,
                      char const *const *);
int snd_ac97_ymf7x3_info_speaker(struct snd_kcontrol *kcontrol,
                                 struct snd_ctl_elem_info *uinfo) {
  static const char *const texts[3] = {"Standard", "Small", "Smaller"};
  return snd_ctl_enum_info(uinfo, 1, 3, texts);
}


x86 assembly (clang, -O0):
<snd_ac97_ymf7x3_info_speaker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
lea    0x2ccb(%rip),%rcx
call   1030 <snd_ctl_enum_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snd_ac97_ymf7x3_info_speaker>:
mov    %rsi,%rdi
lea    0x2ce6(%rip),%rcx
mov    $0x1,%esi
mov    $0x3,%edx
jmp    1030 <snd_ctl_enum_info@plt>

LLVM IR (-O0):
%struct.snd_kcontrol = type { i32 }
%struct.snd_ctl_elem_info = type { i32 }
@snd_ac97_ymf7x3_info_speaker.texts = internal constant [3 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0)]
@.str = [9 x i8] c"Standard\00"
@.str.1 = [6 x i8] c"Small\00"
@.str.2 = [8 x i8] c"Smaller\00"
define i32 @snd_ac97_ymf7x3_info_speaker(%struct.snd_kcontrol* %0, %struct.snd_ctl_elem_info* %1) {
%3 = alloca %struct.snd_kcontrol*
%4 = alloca %struct.snd_ctl_elem_info*
store %struct.snd_kcontrol* %0, %struct.snd_kcontrol** %3
store %struct.snd_ctl_elem_info* %1, %struct.snd_ctl_elem_info** %4
%5 = load %struct.snd_ctl_elem_info*, %struct.snd_ctl_elem_info** %4
%6 = call i32 @snd_ctl_enum_info(%struct.snd_ctl_elem_info* %5, i32 1, i32 3, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @snd_ac97_ymf7x3_info_speaker.texts, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
%struct.snd_kcontrol = type { i32 }
%struct.snd_ctl_elem_info = type { i32 }
@snd_ac97_ymf7x3_info_speaker.texts = internal constant [3 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i32 0, i32 0)]
@.str = [9 x i8] c"Standard\00"
@.str.1 = [6 x i8] c"Small\00"
@.str.2 = [8 x i8] c"Smaller\00"
define i32 @snd_ac97_ymf7x3_info_speaker(%struct.snd_kcontrol* nocapture readnone %0, %struct.snd_ctl_elem_info* %1) {
%3 = tail call i32 @snd_ctl_enum_info(%struct.snd_ctl_elem_info* %1, i32 1, i32 3, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @snd_ac97_ymf7x3_info_speaker.texts, i64 0, i64 0))
ret i32 %3
}
int test_imm_68uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x68 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_68uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 104
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double MACH_EPS(void) {
  double mach_eps = 1;
  do
    mach_eps /= 2;
  while ((mach_eps + 1) > 1);
  return mach_eps * 2;
}


x86 assembly (clang, -O0):
<MACH_EPS>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xed1(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xec4(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     1111 <MACH_EPS+0x11>
movsd  0xeba(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MACH_EPS>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MACH_EPS() {
%1 = alloca double
store double 1.000000e+00, double* %1
br label %2
2: ; preds = %5, %0
%3 = load double, double* %1
%4 = fdiv double %3, 2.000000e+00
store double %4, double* %1
br label %5
5: ; preds = %2
%6 = load double, double* %1
%7 = fadd double %6, 1.000000e+00
%8 = fcmp ogt double %7, 1.000000e+00
br i1 %8, label %2, label %9
9: ; preds = %5
%10 = load double, double* %1
%11 = fmul double %10, 2.000000e+00
ret double %11
}

LLVM IR (-O2):
define double @MACH_EPS() {
ret double 0x3CB0000000000000
}