xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
int raise(int sig) {
  (void)(sig);
  panic("raise()\n");
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
call   1030 <panic@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"raise()\0A\00"
define i32 @raise(i32 %0) {
%2 = tail call i32 @panic(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *);
char *strdup(char const *);
char *estrdup(const char *s) {
  char *p;
  p = strdup(s);
  if (!p)
    eprintf("strdup: out of memory\n");
  return p;
}


x86 assembly (clang, -O0):
<estrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <estrdup+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <eprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"strdup: out of memory\0A\00"
define i8* @estrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @eprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [23 x i8] c"strdup: out of memory\0A\00"
define noalias i8* @estrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @eprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
long sysconf(int /*<<< orphan*/);
unsigned heap_get_ncpus(void) {
  long cpus = sysconf(_SC_NPROCESSORS_ONLN);
  if (cpus < 1)
    cpus = 1;
  return (unsigned)cpus;
}


x86 assembly (clang, -O0):
<heap_get_ncpus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jge    113d <heap_get_ncpus+0x2d>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heap_get_ncpus>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
cmp    $0x2,%rax
mov    $0x1,%ecx
cmovl  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @heap_get_ncpus() {
%1 = alloca i64
%2 = load i32, i32* @_SC_NPROCESSORS_ONLN
%3 = call i64 @sysconf(i32 %2)
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = icmp slt i64 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i64 1, i64* %1
br label %7
7: ; preds = %6, %0
%8 = load i64, i64* %1
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @heap_get_ncpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i64 @sysconf(i32 %1)
%3 = icmp sgt i64 %2, 1
%4 = select i1 %3, i64 %2, i64 1
%5 = trunc i64 %4 to i32
ret i32 %5
}
int fib(int n) {
  if (n < 2) {
    return (n);
  }
  int x, y;
  x = fib(n - 1);
  y = fib(n - 2);
  return (x + y);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <fib+0x45>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
char *UTIL_mallocStr(size_t);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlen(char *);
char *UTIL_appendStr(char *str1, char *str2) {
  size_t length = strlen(str1) + strlen(str2);
  char *ptr = UTIL_mallocStr(length + 1);
  strcpy(ptr, str1);
  strcat(ptr, str2);
  return ptr;
}


x86 assembly (clang, -O0):
<UTIL_appendStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <UTIL_mallocStr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTIL_appendStr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <UTIL_mallocStr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @UTIL_appendStr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
%11 = add i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = add i64 %12, 1
%14 = call i8* @UTIL_mallocStr(i64 %13)
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %6
%19 = load i8*, i8** %4
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = load i8*, i8** %6
ret i8* %21
}

LLVM IR (-O2):
define i8* @UTIL_appendStr(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i8* @UTIL_mallocStr(i64 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
/* Type definitions */
typedef char wint_t;

/* Variables and functions */
int __iswprint_ascii(wint_t c) { return (unsigned int)(c - ' ') < 127u - ' '; }


x86 assembly (clang, -O0):
<__iswprint_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
cmp    $0x5f,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iswprint_ascii>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @__iswprint_ascii(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 32
%6 = icmp ult i32 %5, 95
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @__iswprint_ascii(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -32
%4 = icmp ult i32 %3, 95
%5 = zext i1 %4 to i32
ret i32 %5
}
void testtosingled_(double *z, double *x) { *z = (float)*x; }


x86 assembly (clang, -O0):
<testtosingled_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testtosingled_>:
movsd  (%rsi),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @testtosingled_(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = fptrunc double %6 to float
%8 = fpext float %7 to double
%9 = load double*, double** %3
store double %8, double* %9
ret void
}

LLVM IR (-O2):
define void @testtosingled_(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fptrunc double %3 to float
%5 = fpext float %4 to double
store double %5, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void segfault_hdlr(int dummy) {
  printf("Segmentation fault detected\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<segfault_hdlr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [29 x i8] c"Segmentation fault detected\0A\00"
define void @segfault_hdlr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [28 x i8] c"Segmentation fault detected\00"
define void @segfault_hdlr(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
unsigned ec_laplace_get_freq1(unsigned fs0, int decay) {
  unsigned ft;
  ft = 32768 - (1 << (0)) * (2 * (16)) - fs0;
  return ft * (16384 - decay) >> 15;
}


x86 assembly (clang, -O0):
<ec_laplace_get_freq1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x7fe0,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4000,%ecx
sub    -0x8(%rbp),%ecx
imul   %ecx,%eax
shr    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_laplace_get_freq1>:
mov    $0x7fe0,%ecx
sub    %edi,%ecx
mov    $0x4000,%eax
sub    %esi,%eax
imul   %ecx,%eax
shr    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @ec_laplace_get_freq1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sub i32 32736, %6
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = sub nsw i32 16384, %9
%11 = mul i32 %8, %10
%12 = lshr i32 %11, 15
ret i32 %12
}

LLVM IR (-O2):
define i32 @ec_laplace_get_freq1(i32 %0, i32 %1) {
%3 = sub i32 32736, %0
%4 = sub nsw i32 16384, %1
%5 = mul i32 %4, %3
%6 = lshr i32 %5, 15
ret i32 %6
}
double power(double r, int i) {
  int j;
  double value;
  value = 1.0;
  for (j = 0; j < i; j++) {
    value = value * r;
  }
  return value;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1149 <power+0x49>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <power+0x20>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %edi,%edi
jle    111b <power+0x1b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1124 <power+0x24>
movsd  0xee7(%rip),%xmm1
jmp    1155 <power+0x55>
movsd  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%edi
movsd  0xed1(%rip),%xmm1
nop
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
add    $0xfffffff8,%edi
jne    1130 <power+0x30>
test   %eax,%eax
je     1169 <power+0x69>
nopl   0x0(%rax)
mulsd  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1160 <power+0x60>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @power(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
store double 1.000000e+00, double* %6
store i32 0, i32* %5
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load double, double* %6
%13 = load double, double* %3
%14 = fmul double %12, %13
store double %14, double* %6
br label %15
15: ; preds = %11
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %7
18: ; preds = %7
%19 = load double, double* %6
ret double %19
}

LLVM IR (-O2):
define double @power(double %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi double [ 1.000000e+00, %8 ], [ %20, %10 ]
%12 = phi i32 [ 0, %8 ], [ %21, %10 ]
%13 = fmul double %11, %0
%14 = fmul double %13, %0
%15 = fmul double %14, %0
%16 = fmul double %15, %0
%17 = fmul double %16, %0
%18 = fmul double %17, %0
%19 = fmul double %18, %0
%20 = fmul double %19, %0
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi double [ undef, %4 ], [ %20, %10 ]
%25 = phi double [ 1.000000e+00, %4 ], [ %20, %10 ]
%26 = icmp eq i32 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi double [ %30, %27 ], [ %25, %23 ]
%29 = phi i32 [ %31, %27 ], [ 0, %23 ]
%30 = fmul double %28, %0
%31 = add i32 %29, 1
%32 = icmp eq i32 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi double [ 1.000000e+00, %2 ], [ %24, %23 ], [ %30, %27 ]
ret double %34
}
/* Variables and functions */
size_t xsum(size_t, size_t);
size_t __attribute__((__pure__))
xsum4(size_t size1, size_t size2, size_t size3, size_t size4) {
  return xsum(xsum(xsum(size1, size2), size3), size4);
}


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

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

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

LLVM IR (-O2):
define i64 @xsum4(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 @xsum(i64 %0, i64 %1)
%6 = tail call i64 @xsum(i64 %5, i64 %2)
%7 = tail call i64 @xsum(i64 %6, i64 %3)
ret i64 %7
}
/* Variables and functions */
int strncmp(char *, char *, int);
int verify_user_pass(char *a_user_pass) {
  return strncmp(a_user_pass, "admin", 5);
}


x86 assembly (clang, -O0):
<verify_user_pass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_user_pass>:
lea    0xee9(%rip),%rsi
mov    $0x5,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"admin\00"
define i32 @verify_user_pass(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strncmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 %4
}

LLVM IR (-O2):
@.str = [6 x i8] c"admin\00"
define i32 @verify_user_pass(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 %2
}
/* Variables and functions */
char *CONF_get_string(void *, char const *, char const *);
char *conf_lhash_get_string(void *db, const char *section, const char *value) {
  return CONF_get_string(db, section, value);
}


x86 assembly (clang, -O0):
<conf_lhash_get_string>:
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 <CONF_get_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_lhash_get_string>:
jmp    1030 <CONF_get_string@plt>

LLVM IR (-O0):
define i8* @conf_lhash_get_string(i8* %0, i8* %1, i8* %2) {
%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 i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i8* @CONF_get_string(i8* %7, i8* %8, i8* %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @conf_lhash_get_string(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @CONF_get_string(i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ loff_t;

/* Variables and functions */
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int);
loff_t llseek(int fd, loff_t offset, int whence) {
  return lseek(fd, offset, whence);
}


x86 assembly (clang, -O0):
<llseek>:
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
call   1030 <lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llseek>:
jmp    1030 <lseek@plt>

LLVM IR (-O0):
define i32 @llseek(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 @lseek(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @llseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
int atoi(const char *nptr __attribute__((unused))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ sleep(int);
void maybe_stall(int myid) {
  assert(myid >= 0 && myid < 2);
  if (myid > 0)
    sleep(1);
}


x86 assembly (clang, -O0):
<maybe_stall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1144 <maybe_stall+0x24>
cmpl   $0x2,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1165 <maybe_stall+0x45>
mov    $0x1,%edi
call   1040 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maybe_stall>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x2,%ebx
setb   %dil
call   1030 <assert@plt>
test   %ebx,%ebx
jle    1140 <maybe_stall+0x20>
mov    $0x1,%edi
pop    %rbx
jmp    1040 <sleep@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @maybe_stall(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 2
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 @sleep(i32 1)
br label %16
16: ; preds = %14, %8
ret void
}

LLVM IR (-O2):
define void @maybe_stall(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @sleep(i32 1)
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *malloc0(size_t size) {
  void *rc = NULL;
  if (size > 0) {
    rc = malloc(size);
    if (rc != NULL)
      memset(rc, 0, size);
  }
  return (rc);
}


x86 assembly (clang, -O0):
<malloc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    116b <malloc0+0x4b>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <malloc0+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
jmp    116b <malloc0+0x4b>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc0>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1148 <malloc0+0x28>
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1148 <malloc0+0x28>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
jmp    114b <malloc0+0x2b>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @malloc0(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %0)
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ %4, %6 ], [ null, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *dupalloc(void *old, size_t size) {
  void *new = malloc(size);
  if (new)
    memcpy(new, old, size);
  return new;
}


x86 assembly (clang, -O0):
<dupalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <dupalloc+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <dupalloc+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @dupalloc(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void memory_init_openmp(void) { return; }


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

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

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

LLVM IR (-O2):
define void @memory_init_openmp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wrapper_free(void *);
void var_dtor_wrapper(void *wrapper) { wrapper_free(wrapper); }


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

x86 assembly (clang, -O2):
<var_dtor_wrapper>:
jmp    1030 <wrapper_free@plt>

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

LLVM IR (-O2):
define void @var_dtor_wrapper(i8* %0) {
%2 = tail call i32 @wrapper_free(i8* %0)
ret void
}
void fill_32(unsigned char *dest, unsigned long src) {
  int i;
  for (i = 0; i < 4; i++) {
    *dest++ = src;
    src >>= 8;
  }
}


x86 assembly (clang, -O0):
<fill_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    114e <fill_32+0x4e>
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <fill_32+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @fill_32(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %0
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %4
%8 = lshr i64 %1, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %9, i8* %7
%11 = lshr i64 %1, 24
%12 = trunc i64 %11 to i8
store i8 %12, i8* %10
ret void
}
void XcmsCIEuvYToCIELuv() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIEuvYToCIELuv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CRT_done();
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void CRT_handleSIGSEGV(int sgn) {
  (void)sgn;
  CRT_done();
  fprintf(stderr, "\n\nhtop "
                  "0.9"
                  " aborting. Please report bug at http://htop.sf.net\n");
  abort();
}


x86 assembly (clang, -O0):
<CRT_handleSIGSEGV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <CRT_done@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<CRT_handleSIGSEGV>:
push   %rax
xor    %eax,%eax
call   1050 <CRT_done@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [62 x i8] c"\0A\0Ahtop 0.9 aborting. Please report bug at http://htop.sf.net\0A\00"
define void @CRT_handleSIGSEGV(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @CRT_done()
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [62 x i8] c"\0A\0Ahtop 0.9 aborting. Please report bug at http://htop.sf.net\0A\00"
define void @CRT_handleSIGSEGV(i32 %0) {
%2 = tail call i32 (...) @CRT_done()
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
struct struct_automata {
  int dummy;
};

/* Variables and functions */
int _func_is_accept_current(struct struct_automata *, int /*<<< orphan*/);
int func_is_accept_current(struct struct_automata *p) {
  return _func_is_accept_current(p, 0);
}


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

x86 assembly (clang, -O2):
<func_is_accept_current>:
xor    %esi,%esi
jmp    1030 <_func_is_accept_current@plt>

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

LLVM IR (-O2):
%struct.struct_automata = type { i32 }
define i32 @func_is_accept_current(%struct.struct_automata* %0) {
%2 = tail call i32 @_func_is_accept_current(%struct.struct_automata* %0, i32 0)
ret i32 %2
}
void genbgezal_idle() {}


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

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

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

LLVM IR (-O2):
define void @genbgezal_idle() {
ret void
}
/* Variables and functions */
int close(int);
int s_pipe_posix_close(int fd) { return close(fd); }


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

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

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

LLVM IR (-O2):
define i32 @s_pipe_posix_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int hex1(char const);
uint8_t hex2(const char *str) { return (hex1(str[0]) << 4) | hex1(str[1]); }


x86 assembly (clang, -O0):
<hex2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <hex1@plt>
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <hex1@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <hex1@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <hex1@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hex2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @hex1(i8 signext %5)
%7 = shl i32 %6, 4
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = call i32 @hex1(i8 signext %10)
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @hex2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @hex1(i8 signext %2)
%4 = shl i32 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @hex1(i8 signext %6)
%8 = or i32 %7, %4
ret i32 %8
}
/* Variables and functions */
scalar_t__ strlen(char *);
void rotate_one(char *board) {
  int len = (int)strlen(board), i = 0, first = board[0];
  while (i < len)
    board[i++] = board[i];
  board[len - 1] = (char)first;
}


x86 assembly (clang, -O0):
<rotate_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116a <rotate_one+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1139 <rotate_one+0x29>
mov    -0x14(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_one>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    (%rbx),%cl
add    $0xffffffff,%eax
cltq
mov    %cl,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @rotate_one(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %3
store i32 0, i32* %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
store i32 %12, i32* %5
br label %13
13: ; preds = %17, %1
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %28
17: ; preds = %13
%18 = load i8*, i8** %2
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = load i8*, i8** %2
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
%26 = sext i32 %24 to i64
%27 = getelementptr inbounds i8, i8* %23, i64 %26
store i8 %22, i8* %27
br label %13
28: ; preds = %13
%29 = load i32, i32* %5
%30 = trunc i32 %29 to i8
%31 = load i8*, i8** %2
%32 = load i32, i32* %3
%33 = sub nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %31, i64 %34
store i8 %30, i8* %35
ret void
}

LLVM IR (-O2):
define void @rotate_one(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = load i8, i8* %0
%4 = shl i64 %2, 32
%5 = add i64 %4, -4294967296
%6 = ashr exact i64 %5, 32
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %3, i8* %7
ret void
}
/* Variables and functions */
int __memcmp(void const *, void const *, size_t);
__attribute__((optimize("0"))) int memcmp(const void *m1, const void *m2,
                                          size_t n) {
  return __memcmp(m1, m2, n);
}


x86 assembly (clang, -O0):
<memcmp>:
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 <__memcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp>:
jmp    1030 <__memcmp@plt>

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

LLVM IR (-O2):
define i32 @memcmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @__memcmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_print_numbers(void) {
  char c;
  c = '0';
  while (c <= '9')
    ft_putchar(c++);
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_print_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x30,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1141 <ft_print_numbers+0x31>
mov    -0x1(%rbp),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,-0x1(%rbp)
movsbl %al,%edi
call   1030 <ft_putchar@plt>
jmp    111c <ft_print_numbers+0xc>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_numbers>:
push   %rax
mov    $0x30,%edi
call   1030 <ft_putchar@plt>
mov    $0x31,%edi
call   1030 <ft_putchar@plt>
mov    $0x32,%edi
call   1030 <ft_putchar@plt>
mov    $0x33,%edi
call   1030 <ft_putchar@plt>
mov    $0x34,%edi
call   1030 <ft_putchar@plt>
mov    $0x35,%edi
call   1030 <ft_putchar@plt>
mov    $0x36,%edi
call   1030 <ft_putchar@plt>
mov    $0x37,%edi
call   1030 <ft_putchar@plt>
mov    $0x38,%edi
call   1030 <ft_putchar@plt>
mov    $0x39,%edi
call   1030 <ft_putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_print_numbers() {
%1 = alloca i8
store i8 48, i8* %1
br label %2
2: ; preds = %6, %0
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 57
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i8, i8* %1
%8 = add i8 %7, 1
store i8 %8, i8* %1
%9 = call i32 @ft_putchar(i8 signext %7)
br label %2
10: ; preds = %2
%11 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ft_print_numbers() {
%1 = tail call i32 @ft_putchar(i8 signext 48)
%2 = tail call i32 @ft_putchar(i8 signext 49)
%3 = tail call i32 @ft_putchar(i8 signext 50)
%4 = tail call i32 @ft_putchar(i8 signext 51)
%5 = tail call i32 @ft_putchar(i8 signext 52)
%6 = tail call i32 @ft_putchar(i8 signext 53)
%7 = tail call i32 @ft_putchar(i8 signext 54)
%8 = tail call i32 @ft_putchar(i8 signext 55)
%9 = tail call i32 @ft_putchar(i8 signext 56)
%10 = tail call i32 @ft_putchar(i8 signext 57)
%11 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ v;
struct cdrom_volctrl {
  int dummy;
};

/* Variables and functions */
int main(void) {
  struct cdrom_volctrl v;
  (void)v;
  return sizeof(v);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
void putc(char c) {
  while (((*((volatile unsigned long *)0x7F005018)) & (1 << 14)) == 1)
    ;
  (*((volatile unsigned char *)0x7F005020)) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x4000,%rax
cmp    $0x1,%rax
jne    1127 <putc+0x27>
jmp    110a <putc+0xa>
mov    -0x1(%rbp),%cl
mov    $0x7f005020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
mov    0x7f005018,%rax
7f
mov    %dil,0x7f005020
7f
ret

LLVM IR (-O0):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%5 = and i64 %4, 16384
%6 = icmp eq i64 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
store volatile i8 %9, i8* inttoptr (i64 2130726944 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i8 signext %0) {
%2 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
store volatile i8 %0, i8* inttoptr (i64 2130726944 to i8*)
ret void
}
float razao(float a, float b) { return a / b; }


x86 assembly (clang, -O0):
<razao>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<razao>:
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @razao(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @razao(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char *, struct stat *);
int sknobs_file_exists(char *filename) {
  struct stat lbuffer;
  int rc;
  rc = stat(filename, &lbuffer);
  return rc != -1;
}


x86 assembly (clang, -O0):
<sknobs_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sknobs_file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @sknobs_file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @sknobs_file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
const char *gu_str_table_get_name(const char *str) { return str; }


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

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

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

LLVM IR (-O2):
define i8* @gu_str_table_get_name(i8* readnone returned %0) {
ret i8* %0
}
void reboot(void) {
  (*(volatile unsigned int *)(0x7E004000)) = 0x4121;
  (*(volatile unsigned int *)(0x7E004004)) = 16;
  return;
}


x86 assembly (clang, -O0):
<reboot>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e004000,%eax
movl   $0x4121,(%rax)
mov    $0x7e004004,%eax
movl   $0x10,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reboot>:
movl   $0x4121,0x7e004000
movl   $0x10,0x7e004004
ret

LLVM IR (-O0):
define void @reboot() {
store volatile i32 16673, i32* inttoptr (i64 2113945600 to i32*)
store volatile i32 16, i32* inttoptr (i64 2113945604 to i32*)
ret void
}

LLVM IR (-O2):
define void @reboot() {
store volatile i32 16673, i32* inttoptr (i64 2113945600 to i32*)
store volatile i32 16, i32* inttoptr (i64 2113945604 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atualizarInteiroTest();
int /*<<< orphan*/ construirInteiroTest();
int /*<<< orphan*/ limpezaInteiroTest();
int main(int argc, char *argv[]) {
  construirInteiroTest();
  atualizarInteiroTest();
  limpezaInteiroTest();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <construirInteiroTest@plt>
mov    $0x0,%al
call   1040 <atualizarInteiroTest@plt>
mov    $0x0,%al
call   1030 <limpezaInteiroTest@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @construirInteiroTest()
%7 = call i32 (...) @atualizarInteiroTest()
%8 = call i32 (...) @limpezaInteiroTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @construirInteiroTest()
%4 = tail call i32 (...) @atualizarInteiroTest()
%5 = tail call i32 (...) @limpezaInteiroTest()
ret i32 0
}
char *strdup(str) const char *str;
{
  char *ret;
  ret = (char *)ck_malloc(strlen(str) + 2);
  strcpy(ret, str);
  return ret;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x2,%rdi
mov    $0x0,%al
call   1050 <ck_malloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x2(%rax),%rdi
xor    %eax,%eax
call   1050 <ck_malloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 2
%7 = call i32 (i64, ...) bitcast (i32 (...)* @ck_malloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 2
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @ck_malloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}