xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int);
const char *startswith(const char *s, const char *prefix) {
  if (strncmp(s, prefix, strlen(prefix)) == 0)
    return s + strlen(prefix);
  return NULL;
}


x86 assembly (clang, -O0):
<startswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1188 <startswith+0x68>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <startswith+0x70>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startswith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1149 <startswith+0x29>
xor    %r14d,%r14d
jmp    1156 <startswith+0x36>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
add    %rax,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @startswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %1)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
br label %10
10: ; preds = %2, %6
%11 = phi i8* [ %9, %6 ], [ null, %2 ]
ret i8* %11
}
/* Variables and functions */
float sqrtf(float);
float circular_ease_in(float p) { return 1.0f - sqrtf(1.0f - (p * p)); }


x86 assembly (clang, -O0):
<circular_ease_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xec0(%rip),%xmm1
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  0xeac(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circular_ease_in>:
push   %rax
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
movss  0xee0(%rip),%xmm2
movaps %xmm2,%xmm0
subss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1135 <circular_ease_in+0x25>
sqrtss %xmm0,%xmm0
jmp    1142 <circular_ease_in+0x32>
call   1030 <sqrtf@plt>
movss  0xebe(%rip),%xmm2
subss  %xmm0,%xmm2
movaps %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @circular_ease_in(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fneg float %3
%6 = call float @llvm.fmuladd.f32(float %5, float %4, float 1.000000e+00)
%7 = call float @sqrtf(float %6)
%8 = fsub float 1.000000e+00, %7
ret float %8
}

LLVM IR (-O2):
define float @circular_ease_in(float %0) {
%2 = fneg float %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float %0, float 1.000000e+00)
%4 = tail call float @sqrtf(float %3)
%5 = fsub float 1.000000e+00, %4
ret float %5
}
void cat(char *s, char *t) {
  while (*s)
    s++;
  while (*s = *t)
    s++, t++;
}


x86 assembly (clang, -O0):
<cat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <cat+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <cat+0xc>
jmp    112f <cat+0x2f>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1160 <cat+0x60>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <cat+0x2f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <cat>
mov    (%rsi),%al
mov    %al,-0x1(%rdi)
test   %al,%al
je     1130 <cat+0x30>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1120 <cat+0x20>
ret

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

LLVM IR (-O2):
define void @cat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
store i8 %9, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %15, %11 ], [ %1, %8 ]
%13 = phi i8* [ %14, %11 ], [ %4, %8 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %8
ret void
}
/* Variables and functions */
double celcius2fahrenheit(float);
float fahrenheit2celcius(float);
int /*<<< orphan*/ printf(char *, float, double);
int main() {
  float f = 80;
  float c = fahrenheit2celcius(f);
  printf("%.2fF = %.2fC\n", f, c);
  printf("%.2fC = %.2fF\n", c, celcius2fahrenheit(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <fahrenheit2celcius@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <celcius2fahrenheit@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xec7(%rip),%xmm0
call   1050 <fahrenheit2celcius@plt>
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm1
lea    0xeb5(%rip),%rdi
movss  0xea9(%rip),%xmm0
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <celcius2fahrenheit@plt>
movaps %xmm0,%xmm1
lea    0xea2(%rip),%rdi
movss  0x4(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%.2fF = %.2fC\0A\00"
@.str.1 = [15 x i8] c"%.2fC = %.2fF\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 8.000000e+01, float* %2
%4 = load float, float* %2
%5 = call float @fahrenheit2celcius(float %4)
store float %5, float* %3
%6 = load float, float* %2
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float %6, double %8)
%10 = load float, float* %3
%11 = load float, float* %3
%12 = call double @celcius2fahrenheit(float %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), float %10, double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%.2fF = %.2fC\0A\00"
@.str.1 = [15 x i8] c"%.2fC = %.2fF\0A\00"
define i32 @main() {
%1 = tail call float @fahrenheit2celcius(float 8.000000e+01)
%2 = fpext float %1 to double
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), float 8.000000e+01, double %2)
%4 = tail call double @celcius2fahrenheit(float %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), float %1, double %4)
ret i32 0
}
__attribute__((always_)) void outw_p(unsigned short value,
                                     unsigned short port) {
  asm volatile("out"
               "w"
               " %"
               "w"
               "0,%"
               "w"
               "1"
               :
               : "a"(value), "Nd"(port));
  slow_down_io();
}


x86 assembly (clang, -O0):
<outw_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
mov    $0x0,%al
call   1030 <slow_down_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
xor    %eax,%eax
jmp    1030 <slow_down_io@plt>

LLVM IR (-O0):
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = call i32 (...) @slow_down_io()
ret void
}

LLVM IR (-O2):
define void @outw_p(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
%3 = tail call i32 (...) @slow_down_io()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int errno;
int open(char const *, int, int /*<<< orphan*/);
int __sulong_posix_open(const char *pathname, int flags, mode_t mode) {
  {
    int native_errno = errno;
    int result = open(pathname, flags, mode);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  }
}


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

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

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* @errno
%5 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%6 = icmp eq i32 %5, -1
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = select i1 %6, i32 %8, i32 %5
store i32 %4, i32* @errno
ret i32 %9
}
/* Variables and functions */
int part(int *, int, int);
void quicksort(int a[], int l, int h) {
  int p;
  if (l < h) {
    p = part(a, l, h);
    quicksort(a, l, p - 1);
    quicksort(a, p + 1, h);
  }
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <part@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <part@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @part(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void outw(unsigned short _port, unsigned short _data) {
  asm volatile("push %%ax \n"
               "push %%dx \n"
               "mov %1, %%ax \n"
               "mov %0, %%dx \n"
               "out %%ax, %%dx \n"
               "pop %%dx \n"
               "pop %%ax \n"
               :
               : "r"(_port), "r"(_data)
               :);
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%cx
push   %ax
push   %dx
mov    %cx,%ax
mov    %ax,%dx
out    %ax,(%dx)
pop    %dx
pop    %ax
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
push   %ax
push   %dx
mov    %si,%ax
mov    %di,%dx
out    %ax,(%dx)
pop    %dx
pop    %ax
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "push %ax \0Apush %dx \0Amov $1, %ax \0Amov $0, %dx \0Aout %ax, %dx \0Apop %dx \0Apop %ax \0A", "r,r,~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
long long zuuz() { return 0x00007fff7fff0000LL; }


x86 assembly (clang, -O0):
<zuuz>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff7fff0000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zuuz>:
movabs $0x7fff7fff0000,%rax
ret

LLVM IR (-O0):
define i64 @zuuz() {
ret i64 140735340806144
}

LLVM IR (-O2):
define i64 @zuuz() {
ret i64 140735340806144
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("%d minutos\n", a * 2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%d minutos\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = shl nsw i32 %4, 1
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void show_help(void) {
  printf("Usage: eee-she <OPTION>\n"
         "Controls Asus eee Super Hybrid Engine\n\n"
         "-h,  --help            This help message\n"
         "-p,  --performance     Set SHE to Performance mode\n"
         "-n,  --normal          Set SHE to Normal mode\n"
         "-ps, --powersave       Set SHE to Power Save mode\n"
         "-t,  --toggle          Toggles through all modes\n");
  exit(EXIT_SUCCESS);
}


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

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

LLVM IR (-O0):
@.str = [301 x i8] c"Usage: eee-she <OPTION>\0AControls Asus eee Super Hybrid Engine\0A\0A-h, --help This help message\0A-p, --performance Set SHE to Performance mode\0A-n, --normal Set SHE to Normal mode\0A-ps, --powersave Set SHE to Power Save mode\0A-t, --toggle Toggles through all modes\0A\00"
@EXIT_SUCCESS = global i32 0
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([301 x i8], [301 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [300 x i8] c"Usage: eee-she <OPTION>\0AControls Asus eee Super Hybrid Engine\0A\0A-h, --help This help message\0A-p, --performance Set SHE to Performance mode\0A-n, --normal Set SHE to Normal mode\0A-ps, --powersave Set SHE to Power Save mode\0A-t, --toggle Toggles through all modes\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([300 x i8], [300 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  printf("Hello, world!\n");
  return 0;
}


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    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void unload_remote_stream() {}


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

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

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

LLVM IR (-O2):
define void @unload_remote_stream() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int digital_sum(int);
int isHarshad(uint64_t s) { return (s % digital_sum(s) == 0); }


x86 assembly (clang, -O0):
<isHarshad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <digital_sum@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isHarshad>:
push   %rbx
mov    %edi,%ebx
call   1030 <digital_sum@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xor    %eax,%eax
test   %edx,%edx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isHarshad(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @digital_sum(i32 %4)
%6 = srem i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isHarshad(i32 %0) {
%2 = tail call i32 @digital_sum(i32 %0)
%3 = srem i32 %0, %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t threefish_rrotate(uint64_t x, int n) {
  return (x >> n) | (x << (64 - n));
}


x86 assembly (clang, -O0):
<threefish_rrotate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<threefish_rrotate>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
neg    %cl
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @threefish_rrotate(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @threefish_rrotate(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
cclose(i) { close(i); }


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

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

LLVM IR (-O0):
define i32 @cclose(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @cclose(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
int dlclose(void *ptr) {}


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

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

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

LLVM IR (-O2):
define i32 @dlclose(i8* nocapture readnone %0) {
ret i32 undef
}
void TOSH_MAKE_PW7_OUTPUT() { ; }


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

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

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

LLVM IR (-O2):
define void @TOSH_MAKE_PW7_OUTPUT() {
ret void
}
/* Type definitions */
struct timespec {
  int /*<<< orphan*/ tv_sec;
  int /*<<< orphan*/ tv_nsec;
};

/* Variables and functions */
void timespec_copy(struct timespec *dst, struct timespec *src) {
  dst->tv_nsec = src->tv_nsec;
  dst->tv_sec = src->tv_sec;
}


x86 assembly (clang, -O0):
<timespec_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_copy>:
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
mov    (%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @timespec_copy(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
store i32 %7, i32* %9
%10 = load %struct.timespec*, %struct.timespec** %4
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load %struct.timespec*, %struct.timespec** %3
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 0
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @timespec_copy(%struct.timespec* nocapture writeonly %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
store i32 %7, i32* %8
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
ssize_t msgrcv(int msqid, void *msgp, size_t msgsz, long msgtyp, int msgflg) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<msgrcv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgrcv>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @msgrcv(i32 %0, i8* %1, i64 %2, i64 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
%12 = call i32 @__set_errno(i32 %11)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @msgrcv(i32 %0, i8* nocapture readnone %1, i64 %2, i64 %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
/* Type definitions */
struct oscap_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct oscap_iterator *);
void oscap_iterator_free(struct oscap_iterator *it) { free(it); }


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

LLVM IR (-O0):
%struct.oscap_iterator = type { i32 }
define void @oscap_iterator_free(%struct.oscap_iterator* %0) {
%2 = alloca %struct.oscap_iterator*
store %struct.oscap_iterator* %0, %struct.oscap_iterator** %2
%3 = load %struct.oscap_iterator*, %struct.oscap_iterator** %2
%4 = call i32 @free(%struct.oscap_iterator* %3)
ret void
}

LLVM IR (-O2):
%struct.oscap_iterator = type { i32 }
define void @oscap_iterator_free(%struct.oscap_iterator* nocapture %0) {
%2 = tail call i32 @free(%struct.oscap_iterator* %0)
ret void
}
int main() {
  asm("nop");
  asm("nop");
  foo();
  asm("nop");
  asm("nop");
  bar();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (...) @foo()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 (...) @bar()
ret i32 0
}
/* Type definitions */
struct dns_reply {
  int dummy;
};

/* Variables and functions */
struct dns_reply *_nss_ldap_dns_lookup(const char *domain,
                                       const char *type_name) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.dns_reply = type { i32 }
define %struct.dns_reply* @_nss_ldap_dns_lookup(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret %struct.dns_reply* null
}

LLVM IR (-O2):
%struct.dns_reply = type { i32 }
define noalias %struct.dns_reply* @_nss_ldap_dns_lookup(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret %struct.dns_reply* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char const *argv[]) {
  int a = 1, b = 1;
  int aplus, plusb;
  aplus = a++;
  plusb = ++b;
  printf("a aplus b plusb \n");
  printf("%1d %5d %5d %5d \n", a, aplus, b, plusb);
  return 0;
}


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)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    %eax,-0x20(%rbp)
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8d
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"a aplus b plusb \0A\00"
@.str.1 = [18 x i8] c"%1d %5d %5d %5d \0A\00"
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
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 1, i32* %7
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
store i32 %11, i32* %6
store i32 %10, i32* %8
%12 = load i32, i32* %7
%13 = add nsw i32 %12, 1
store i32 %13, i32* %7
store i32 %13, i32* %9
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %6
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = load i32, i32* %9
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"%1d %5d %5d %5d \0A\00"
@str = [17 x i8] c"a aplus b plusb \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 2, i32 1, i32 2, i32 2)
ret i32 0
}
void read_error(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<read_error>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <read_error+0x9>
jmp    110e <read_error+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @read_error() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ remove(char *);
int main(void) {
  FILE *fp = NULL;
  fp = fopen("Test.txt", "w");
  fclose(fp);
  remove("Test1.txt");
  remove("Test2.txt");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xeb2(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xe9d(%rip),%rdi
call   1030 <remove@plt>
lea    0xe9b(%rip),%rdi
call   1030 <remove@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rdi
call   1040 <fclose@plt>
lea    0xeb8(%rip),%rdi
call   1030 <remove@plt>
lea    0xeb6(%rip),%rdi
call   1030 <remove@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Test.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [10 x i8] c"Test1.txt\00"
@.str.3 = [10 x i8] c"Test2.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fclose(i32* %4)
%6 = call i32 @remove(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @remove(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Test.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [10 x i8] c"Test1.txt\00"
@.str.3 = [10 x i8] c"Test2.txt\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
%3 = tail call i32 @remove(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @remove(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct params {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ write_gcc_func_trailer(char *, char *, struct params *);
void write_func_trailer(char *package, char *name, struct params *rets) {
  write_gcc_func_trailer(package, name, rets);
}


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

x86 assembly (clang, -O2):
<write_func_trailer>:
jmp    1030 <write_gcc_func_trailer@plt>

LLVM IR (-O0):
%struct.params = type { i32 }
define void @write_func_trailer(i8* %0, i8* %1, %struct.params* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.params*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.params* %2, %struct.params** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.params*, %struct.params** %6
%10 = call i32 @write_gcc_func_trailer(i8* %7, i8* %8, %struct.params* %9)
ret void
}

LLVM IR (-O2):
%struct.params = type { i32 }
define void @write_func_trailer(i8* %0, i8* %1, %struct.params* %2) {
%4 = tail call i32 @write_gcc_func_trailer(i8* %0, i8* %1, %struct.params* %2)
ret void
}
__attribute__((always_)) void outw(unsigned short value, unsigned short port) {
  asm volatile("out"
               "w"
               " %"
               "w"
               "0,%"
               "w"
               "1"
               :
               : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

LLVM IR (-O0):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
void rl_vi_start_inserting(key, repeat, sign) int key, repeat, sign;
{
  _rl_vi_set_last(key, repeat, sign);
  rl_vi_insertion_mode(1, key);
}


x86 assembly (clang, -O0):
<rl_vi_start_inserting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1030 <_rl_vi_set_last@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <rl_vi_insertion_mode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_vi_start_inserting>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <_rl_vi_set_last@plt>
mov    $0x1,%edi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <rl_vi_insertion_mode@plt>

LLVM IR (-O0):
define void @rl_vi_start_inserting(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @_rl_vi_set_last to i32 (i32, i32, i32, ...)*)(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_vi_insertion_mode to i32 (i32, i32, ...)*)(i32 1, i32 %11)
ret void
}

LLVM IR (-O2):
define void @rl_vi_start_inserting(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @_rl_vi_set_last to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2)
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_vi_insertion_mode to i32 (i32, i32, ...)*)(i32 1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void __swap(void *a, void *b, size_t dataSize) {
  void *t = malloc(dataSize);
  memcpy(t, a, dataSize);
  memcpy(a, b, dataSize);
  memcpy(b, t, dataSize);
  free(t);
}


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

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

LLVM IR (-O0):
define void @__swap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i64, i64* %6
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %7
%20 = load i64, i64* %6
%21 = call i32 @memcpy(i8* %18, i8* %19, i64 %20)
%22 = load i8*, i8** %7
%23 = call i32 @free(i8* %22)
ret void
}

LLVM IR (-O2):
define void @__swap(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @malloc(i64 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %4, i64 %2)
%8 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
void *opendir(char const *);
void *system_opendir(const char *path) { return opendir(path); }


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

x86 assembly (clang, -O2):
<system_opendir>:
jmp    1030 <opendir@plt>

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

LLVM IR (-O2):
define noalias i8* @system_opendir(i8* nocapture %0) {
%2 = tail call i8* @opendir(i8* %0)
ret i8* %2
}
/* Variables and functions */
unsigned char gfx_inb(int);
int /*<<< orphan*/ toggle_Centaurus_9211_clock();
unsigned char read_Centaurus_CX9211_GPIO(void) {
  unsigned char data_port_val;
  toggle_Centaurus_9211_clock();
  data_port_val = gfx_inb(0xE4);
  data_port_val >>= 1;
  return (data_port_val & 0x1);
}


x86 assembly (clang, -O0):
<read_Centaurus_CX9211_GPIO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <toggle_Centaurus_9211_clock@plt>
mov    $0xe4,%edi
call   1030 <gfx_inb@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_Centaurus_CX9211_GPIO>:
push   %rax
xor    %eax,%eax
call   1040 <toggle_Centaurus_9211_clock@plt>
mov    $0xe4,%edi
call   1030 <gfx_inb@plt>
shr    %al
and    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @read_Centaurus_CX9211_GPIO() {
%1 = alloca i8
%2 = call i32 (...) @toggle_Centaurus_9211_clock()
%3 = call zeroext i8 @gfx_inb(i32 228)
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = ashr i32 %5, 1
%7 = trunc i32 %6 to i8
store i8 %7, i8* %1
%8 = load i8, i8* %1
%9 = zext i8 %8 to i32
%10 = and i32 %9, 1
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @read_Centaurus_CX9211_GPIO() {
%1 = tail call i32 (...) @toggle_Centaurus_9211_clock()
%2 = tail call zeroext i8 @gfx_inb(i32 228)
%3 = lshr i8 %2, 1
%4 = and i8 %3, 1
ret i8 %4
}
/* Variables and functions */
int fc8300_scan_status(void *, unsigned short);
int bbm_com_scan_status(void *handle, unsigned short devid) {
  int res;
  res = fc8300_scan_status(handle, devid);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_scan_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%esi
call   1030 <fc8300_scan_status@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_scan_status>:
jmp    1030 <fc8300_scan_status@plt>

LLVM IR (-O0):
define i32 @bbm_com_scan_status(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i32
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i8*, i8** %3
%7 = load i16, i16* %4
%8 = call i32 @fc8300_scan_status(i8* %6, i16 zeroext %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @bbm_com_scan_status(i8* %0, i16 zeroext %1) {
%3 = tail call i32 @fc8300_scan_status(i8* %0, i16 zeroext %1)
ret i32 %3
}