xunge/DecIR huggingface dataset:
int dummy_compare(void *a, void *b) { return a == b; }


x86 assembly (clang, -O0):
<dummy_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_compare>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @dummy_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int sl_abs(int a) { return a < 0 ? -a : a; }


x86 assembly (clang, -O0):
<sl_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <sl_abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <sl_abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sl_abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @sl_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int conv420(unsigned char *, unsigned char *, int, int);
int conv_frame(unsigned char *input, unsigned char *output, int height,
               int width) {
  return conv420(input, output, height, width);
}


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

x86 assembly (clang, -O2):
<conv_frame>:
jmp    1030 <conv420@plt>

LLVM IR (-O0):
define i32 @conv_frame(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @conv420(i8* %9, i8* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @conv_frame(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @conv420(i8* %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int print(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vfprintf(FILE *stream, const char *format, va_list args) {
  return print(0, format, args);
}


x86 assembly (clang, -O0):
<vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %edi,%edi
call   1030 <print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf>:
xor    %edi,%edi
jmp    1030 <print@plt>

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

LLVM IR (-O2):
define i32 @vfprintf(i32* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i32 @print(i32 0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
unsigned long long fib(int, int);
int /*<<< orphan*/ init_fib();
int pisano(int);
int solve(unsigned long long n, int m) {
  int a = 0, pisano_length = 0;
  unsigned long long fin = 0;
  pisano_length = pisano(m);
  a = n % pisano_length;
  init_fib();
  fin = fib(a, m);
  return fin;
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <pisano@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <init_fib@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <fib@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <pisano@plt>
mov    %eax,%ecx
movslq %eax,%rsi
mov    %rbx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     115d <solve+0x2d>
mov    %rbx,%rax
xor    %edx,%edx
div    %rsi
mov    %rdx,%rbx
jmp    1165 <solve+0x35>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%ebx
xor    %eax,%eax
call   1050 <init_fib@plt>
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fib@plt>

LLVM IR (-O0):
define i32 @solve(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i64 0, i64* %7
%8 = load i32, i32* %4
%9 = call i32 @pisano(i32 %8)
store i32 %9, i32* %6
%10 = load i64, i64* %3
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = urem i64 %10, %12
%14 = trunc i64 %13 to i32
store i32 %14, i32* %5
%15 = call i32 (...) @init_fib()
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = call i64 @fib(i32 %16, i32 %17)
store i64 %18, i64* %7
%19 = load i64, i64* %7
%20 = trunc i64 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @solve(i64 %0, i32 %1) {
%3 = tail call i32 @pisano(i32 %1)
%4 = sext i32 %3 to i64
%5 = urem i64 %0, %4
%6 = trunc i64 %5 to i32
%7 = tail call i32 (...) @init_fib()
%8 = tail call i64 @fib(i32 %6, i32 %1)
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void smb___free(void *ptr) { free(ptr); }


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

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

LLVM IR (-O2):
define void @smb___free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
void strcat(char *source, char *target) {
  while (*source++ != '\0')
    ;
  for (--source; (*source++ = *target++) != '\0';)
    ;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112c <strcat+0x2c>
jmp    110c <strcat+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116b <strcat+0x6b>
jmp    1138 <strcat+0x38>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcat+0x10>
ret

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

LLVM IR (-O2):
define void @strcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
/* Variables and functions */
char *U_EMR_CORE5(int);
char *U_EMRREALIZEPALETTE_set(void) { return (U_EMR_CORE5(52)); }


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

x86 assembly (clang, -O2):
<U_EMRREALIZEPALETTE_set>:
mov    $0x34,%edi
jmp    1030 <U_EMR_CORE5@plt>

LLVM IR (-O0):
define i8* @U_EMRREALIZEPALETTE_set() {
%1 = call i8* @U_EMR_CORE5(i32 52)
ret i8* %1
}

LLVM IR (-O2):
define i8* @U_EMRREALIZEPALETTE_set() {
%1 = tail call i8* @U_EMR_CORE5(i32 52)
ret i8* %1
}
int my_isneg(int n) {
  if (n >= 0) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<my_isneg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111d <my_isneg+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <my_isneg+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isneg>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @my_isneg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @my_isneg(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Variables and functions */
void *malloc(size_t);
void *xmalloc_fatal(size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL)
    return xmalloc_fatal(size);
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <xmalloc+0x36>
mov    -0x10(%rbp),%rdi
call   1040 <xmalloc_fatal@plt>
mov    %rax,-0x8(%rbp)
jmp    115e <xmalloc+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     1130 <xmalloc+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <xmalloc_fatal@plt>

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

LLVM IR (-O2):
define i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @xmalloc_fatal(i64 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
ret i8* %7
}
char *strcpy(char *restrict __dest, const char *restrict __src) {
  char *return_value___builtin___strcpy_chk$1;
  return_value___builtin___strcpy_chk$1 =
      __builtin___strcpy_chk(__dest, __src, 18446744073709551615ul);
  return return_value___builtin___strcpy_chk$1;
}


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

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

LLVM IR (-O0):
define i8* @strcpy(i8* noalias %0, i8* noalias %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @__strcpy_chk(i8* %6, i8* %7, i64 -1)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @strcpy(i8* noalias readnone returned %0, i8* noalias nocapture %1) {
ret i8* %0
}
AR0A1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[10000000]) <= (*((double *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0A1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x4c4b400(%rax),%xmm1
04
mov    $0xa98ac7,%eax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1147 <AR0A1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <AR0A1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0A1>:
movsd  0xa98ac7,%xmm0
xor    %eax,%eax
ucomisd 0x4c4b400(%rdx),%xmm0
04
setae  %al
ret

LLVM IR (-O0):
define i32 @AR0A1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = getelementptr inbounds double, double* %14, i64 10000000
%16 = load double, double* %15
%17 = load double, double* inttoptr (i64 11111111 to double*)
%18 = fcmp ole double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @AR0A1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = getelementptr inbounds double, double* %4, i64 10000000
%8 = load double, double* %7
%9 = load double, double* inttoptr (i64 11111111 to double*)
%10 = fcmp ole double %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  while (x <= 100) {
    if (__VERIFIER_nondet_int()) {
      x = -2 * x + 2;
    } else {
      x = -3 * x - 2;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1167 <main+0x57>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x0,%eax
je     1155 <main+0x45>
imul   $0xfffffffe,-0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1162 <main+0x52>
imul   $0xfffffffd,-0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
cmp    $0x64,%eax
jg     1144 <main+0x34>
mov    %eax,%ebx
nop
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    $0x2,%edx
sub    %ebx,%edx
sub    %ebx,%edx
lea    (%rbx,%rbx,2),%ecx
mov    $0xfffffffe,%ebx
sub    %ecx,%ebx
test   %eax,%eax
cmovne %edx,%ebx
cmp    $0x65,%ebx
jl     1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 101
br i1 %2, label %3, label %13
3: ; preds = %0, %3
%4 = phi i32 [ %11, %3 ], [ %1, %0 ]
%5 = tail call i32 (...) @__VERIFIER_nondet_int()
%6 = icmp eq i32 %5, 0
%7 = mul nsw i32 %4, -2
%8 = add nsw i32 %7, 2
%9 = mul nsw i32 %4, -3
%10 = add nsw i32 %9, -2
%11 = select i1 %6, i32 %10, i32 %8
%12 = icmp slt i32 %11, 101
br i1 %12, label %3, label %13
13: ; preds = %3, %0
ret i32 0
}
int test_imm_80int64_lowword_reg(long long val) {
  return ((val) & (0x80 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_80int64_lowword_reg>:
test   $0x80,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_80int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 128
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
float psnd_scale_xref(float xref, float aref, float bref, int shift) {
  if (aref < 0.1)
    return xref;
  return bref - shift + 1 + (xref - 1.0) * aref;
}


x86 assembly (clang, -O0):
<psnd_scale_xref>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1140 <psnd_scale_xref+0x40>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118d <psnd_scale_xref+0x8d>
movss  -0x10(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  0xeba(%rip),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe99(%rip),%xmm2
subsd  %xmm2,%xmm0
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<psnd_scale_xref>:
cvtss2sd %xmm1,%xmm1
movsd  0xef4(%rip),%xmm3
ucomisd %xmm1,%xmm3
ja     1141 <psnd_scale_xref+0x41>
xorps  %xmm3,%xmm3
cvtsi2ss %edi,%xmm3
subss  %xmm3,%xmm2
addss  0xeeb(%rip),%xmm2
cvtss2sd %xmm2,%xmm2
cvtss2sd %xmm0,%xmm0
addsd  0xed3(%rip),%xmm0
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @psnd_scale_xref(float %0, float %1, float %2, i32 %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i32
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store i32 %3, i32* %9
%10 = load float, float* %7
%11 = fpext float %10 to double
%12 = fcmp olt double %11, 1.000000e-01
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load float, float* %6
store float %14, float* %5
br label %29
15: ; preds = %4
%16 = load float, float* %8
%17 = load i32, i32* %9
%18 = sitofp i32 %17 to float
%19 = fsub float %16, %18
%20 = fadd float %19, 1.000000e+00
%21 = fpext float %20 to double
%22 = load float, float* %6
%23 = fpext float %22 to double
%24 = fsub double %23, 1.000000e+00
%25 = load float, float* %7
%26 = fpext float %25 to double
%27 = call double @llvm.fmuladd.f64(double %24, double %26, double %21)
%28 = fptrunc double %27 to float
store float %28, float* %5
br label %29
29: ; preds = %15, %13
%30 = load float, float* %5
ret float %30
}

LLVM IR (-O2):
define float @psnd_scale_xref(float %0, float %1, float %2, i32 %3) {
%5 = fpext float %1 to double
%6 = fcmp olt double %5, 1.000000e-01
br i1 %6, label %16, label %7
7: ; preds = %4
%8 = sitofp i32 %3 to float
%9 = fsub float %2, %8
%10 = fadd float %9, 1.000000e+00
%11 = fpext float %10 to double
%12 = fpext float %0 to double
%13 = fadd double %12, -1.000000e+00
%14 = tail call double @llvm.fmuladd.f64(double %13, double %5, double %11)
%15 = fptrunc double %14 to float
br label %16
16: ; preds = %4, %7
%17 = phi float [ %15, %7 ], [ %0, %4 ]
ret float %17
}
/* Variables and functions */
int pell(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("O numero de Pell para n = 10 eh: %d", pell(10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <pell@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <pell@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"O numero de Pell para n = 10 eh: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @pell(i32 10)
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"O numero de Pell para n = 10 eh: %d\00"
define i32 @main() {
%1 = tail call i32 @pell(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
void __mm_free(void *, int);
void mm_free(void *ptr) { return __mm_free(ptr, -1); }


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

x86 assembly (clang, -O2):
<mm_free>:
mov    $0xffffffff,%esi
jmp    1030 <__mm_free@plt>

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

LLVM IR (-O2):
define void @mm_free(i8* %0) {
tail call void @__mm_free(i8* %0, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void Sys_Sleep(unsigned int millis) { usleep(millis * 1000); }


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

x86 assembly (clang, -O2):
<Sys_Sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @Sys_Sleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int f214(int *);
int f215(int *p) { return f214(p); }


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

x86 assembly (clang, -O2):
<f215>:
jmp    1030 <f214@plt>

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

LLVM IR (-O2):
define i32 @f215(i32* %0) {
%2 = tail call i32 @f214(i32* %0)
ret i32 %2
}
/* Variables and functions */
int shutdown(int, int);
int sock_close(int fd) {
  int err;
  err = shutdown(fd, 2);
  return err;
}


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

x86 assembly (clang, -O2):
<sock_close>:
mov    $0x2,%esi
jmp    1030 <shutdown@plt>

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

LLVM IR (-O2):
define i32 @sock_close(i32 %0) {
%2 = tail call i32 @shutdown(i32 %0, i32 2)
ret i32 %2
}
void g_type_is_a() {}


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

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

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

LLVM IR (-O2):
define void @g_type_is_a() {
ret void
}
/* Variables and functions */
int h(int);
int g(int n) { return h(n); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <h@plt>

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = tail call i32 @h(i32 %0)
ret i32 %2
}
/* Type definitions */
struct stddev {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ stddev_add(struct stddev *, int /*<<< orphan*/);
int /*<<< orphan*/ stddev_remove(struct stddev *, int /*<<< orphan*/);
void stddev_modify(struct stddev *sd, int64_t old_value, int64_t new_value) {
  stddev_remove(sd, old_value);
  stddev_add(sd, new_value);
}


x86 assembly (clang, -O0):
<stddev_modify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <stddev_remove@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <stddev_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stddev_modify>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1040 <stddev_remove@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <stddev_add@plt>

LLVM IR (-O0):
%struct.stddev = type { i32 }
define void @stddev_modify(%struct.stddev* %0, i32 %1, i32 %2) {
%4 = alloca %struct.stddev*
%5 = alloca i32
%6 = alloca i32
store %struct.stddev* %0, %struct.stddev** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.stddev*, %struct.stddev** %4
%8 = load i32, i32* %5
%9 = call i32 @stddev_remove(%struct.stddev* %7, i32 %8)
%10 = load %struct.stddev*, %struct.stddev** %4
%11 = load i32, i32* %6
%12 = call i32 @stddev_add(%struct.stddev* %10, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.stddev = type { i32 }
define void @stddev_modify(%struct.stddev* %0, i32 %1, i32 %2) {
%4 = tail call i32 @stddev_remove(%struct.stddev* %0, i32 %1)
%5 = tail call i32 @stddev_add(%struct.stddev* %0, i32 %2)
ret void
}
int test_imm_9Dint8_reg(signed char val) {
  return ((val) & (-0x9D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Dint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff63,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_9Dint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -157
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ new_lines_mark(char const *, int /*<<< orphan*/);
void new_lines(char const *line) { new_lines_mark(line, 0); }


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

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

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

LLVM IR (-O2):
define void @new_lines(i8* %0) {
%2 = tail call i32 @new_lines_mark(i8* %0, i32 0)
ret void
}
int c_string_equal(const char *restrict s1, const char *restrict s2) {
  do {
    if (*s1 != *s2)
      return 0;
  } while (*s1++);
  return 1;
}


x86 assembly (clang, -O0):
<c_string_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     112e <c_string_equal+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1152 <c_string_equal+0x52>
jmp    1133 <c_string_equal+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    110c <c_string_equal+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_string_equal>:
mov    (%rsi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %al,(%rdi)
jne    1122 <c_string_equal+0x22>
add    $0x1,%rdi
test   %al,%al
jne    1110 <c_string_equal+0x10>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @c_string_equal(i8* noalias nocapture %0, i8* noalias nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br label %5
5: ; preds = %9, %2
%6 = phi i8* [ %0, %2 ], [ %10, %9 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, %3
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %4, label %11, label %5
11: ; preds = %9, %5
%12 = phi i32 [ 0, %5 ], [ 1, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_nswap16p(int /*<<< orphan*/ *, int /*<<< orphan*/);
void le16_to_cpup(uint16_t *outp, uint16_t in) { cpu_nswap16p(outp, in); }


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

x86 assembly (clang, -O2):
<le16_to_cpup>:
jmp    1030 <cpu_nswap16p@plt>

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

LLVM IR (-O2):
define void @le16_to_cpup(i32* %0, i32 %1) {
%3 = tail call i32 @cpu_nswap16p(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_start();
int /*<<< orphan*/ I2C_stop();
int /*<<< orphan*/ I2C_write(unsigned char);
void DS1307_setdate(unsigned char dd, unsigned char mm, unsigned char yy) {
  I2C_start();
  I2C_write(0xD0);
  I2C_write(0x04);
  I2C_write(dd);
  I2C_write(mm);
  I2C_write(yy);
  I2C_stop();
}


x86 assembly (clang, -O0):
<DS1307_setdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    $0x0,%al
call   1040 <I2C_start@plt>
mov    $0xd0,%edi
call   1050 <I2C_write@plt>
mov    $0x4,%edi
call   1050 <I2C_write@plt>
movzbl -0x1(%rbp),%edi
call   1050 <I2C_write@plt>
movzbl -0x2(%rbp),%edi
call   1050 <I2C_write@plt>
movzbl -0x3(%rbp),%edi
call   1050 <I2C_write@plt>
mov    $0x0,%al
call   1030 <I2C_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DS1307_setdate>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <I2C_start@plt>
mov    $0xd0,%edi
call   1050 <I2C_write@plt>
mov    $0x4,%edi
call   1050 <I2C_write@plt>
mov    %ebx,%edi
call   1050 <I2C_write@plt>
mov    %ebp,%edi
call   1050 <I2C_write@plt>
mov    %r14d,%edi
call   1050 <I2C_write@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <I2C_stop@plt>

LLVM IR (-O0):
define void @DS1307_setdate(i8 zeroext %0, i8 zeroext %1, i8 zeroext %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 = call i32 (...) @I2C_start()
%8 = call i32 @I2C_write(i8 zeroext -48)
%9 = call i32 @I2C_write(i8 zeroext 4)
%10 = load i8, i8* %4
%11 = call i32 @I2C_write(i8 zeroext %10)
%12 = load i8, i8* %5
%13 = call i32 @I2C_write(i8 zeroext %12)
%14 = load i8, i8* %6
%15 = call i32 @I2C_write(i8 zeroext %14)
%16 = call i32 (...) @I2C_stop()
ret void
}

LLVM IR (-O2):
define void @DS1307_setdate(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 (...) @I2C_start()
%5 = tail call i32 @I2C_write(i8 zeroext -48)
%6 = tail call i32 @I2C_write(i8 zeroext 4)
%7 = tail call i32 @I2C_write(i8 zeroext %0)
%8 = tail call i32 @I2C_write(i8 zeroext %1)
%9 = tail call i32 @I2C_write(i8 zeroext %2)
%10 = tail call i32 (...) @I2C_stop()
ret void
}
int __attribute__((no, noclone)) my_nop(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @my_nop(i32 returned %0) {
ret i32 %0
}
void testVolatile() {
  volatile int v;
  v = 0;
}


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

x86 assembly (clang, -O2):
<testVolatile>:
movl   $0x0,-0x4(%rsp)
ret

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

LLVM IR (-O2):
define void @testVolatile() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ivepkg <command>\n\n Commands:\n    root 	    Install "
         "from fakeroot to root\n    register        Register a fakeroot's "
         "content to the database.\n    fakeroot        Install to fakeroot\n  "
         "  unpack          Unpack a tarball\n    install         Install to "
         "fakeroot, register, install to root\n");
}


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

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

LLVM IR (-O0):
@.str = [292 x i8] c"Usage: ivepkg <command>\0A\0A Commands:\0A root \09 Install from fakeroot to root\0A register Register a fakeroot's content to the database.\0A fakeroot Install to fakeroot\0A unpack Unpack a tarball\0A install Install to fakeroot, register, install to root\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([292 x i8], [292 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [291 x i8] c"Usage: ivepkg <command>\0A\0A Commands:\0A root \09 Install from fakeroot to root\0A register Register a fakeroot's content to the database.\0A fakeroot Install to fakeroot\0A unpack Unpack a tarball\0A install Install to fakeroot, register, install to root\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([291 x i8], [291 x i8]* @str, i64 0, i64 0))
ret void
}
void av_log(void *avcl, int level, const char *fmt, ...) {}


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

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

LLVM IR (-O0):
define void @av_log(i8* %0, i32 %1, i8* %2, ...) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @av_log(i8* nocapture %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_thread_affinity(int /*<<< orphan*/, int);
int /*<<< orphan*/ pthread_self();
void *thread_func(void *args) {
  int ID = *(int *)args;
  print_thread_affinity(pthread_self(), ID);
  return NULL;
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <pthread_self@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1040 <print_thread_affinity@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func>:
push   %rbx
mov    (%rdi),%ebx
xor    %eax,%eax
call   1030 <pthread_self@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <print_thread_affinity@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = call i32 (...) @pthread_self()
%8 = load i32, i32* %3
%9 = call i32 @print_thread_affinity(i32 %7, i32 %8)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread_func(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 (...) @pthread_self()
%5 = tail call i32 @print_thread_affinity(i32 %4, i32 %3)
ret i8* null
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int parse_mode_success(char *s, char *opt, char *opt_short) {
  return (!strncmp(s, opt, strlen(opt)) || !strncmp(s, opt_short, 1));
}


x86 assembly (clang, -O0):
<parse_mode_success>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1189 <parse_mode_success+0x69>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_mode_success>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1162 <parse_mode_success+0x42>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <strncmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
jmp    1167 <parse_mode_success+0x47>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @parse_mode_success(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** %5
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @strncmp(i8* %7, i8* %8, i32 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = load i8*, i8** %6
%16 = call i32 @strncmp(i8* %14, i8* %15, i32 1)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
br label %19
19: ; preds = %13, %3
%20 = phi i1 [ true, %3 ], [ %18, %13 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @parse_mode_success(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = tail call i32 @strncmp(i8* %0, i8* %2, i32 1)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %3
%12 = phi i32 [ 1, %3 ], [ %10, %7 ]
ret i32 %12
}
void foo_1_2_1_1_2_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_2_1_1_1_2() {
ret void
}
void nop(void) { asm volatile("nop"); }


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

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

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

LLVM IR (-O2):
define void @nop() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgdecgw(char *s) { sgen("%s\t%s", "decl", s); }


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

x86 assembly (clang, -O2):
<cgdecgw>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <sgen@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s\09%s\00"
@.str.1 = [5 x i8] c"decl\00"
define void @cgdecgw(i8* %0) {
%2 = tail call i32 @sgen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun4() {
  printf("what\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"what\0A\00"
define void @fun4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [5 x i8] c"what\00"
define void @fun4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
int cards_have_rank(int rank, int x[], int size) {
  int i;
  for (i = 0; i < size; ++i) {
    if (x[i] == rank)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cards_have_rank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <cards_have_rank+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <cards_have_rank+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <cards_have_rank+0x5b>
jmp    1146 <cards_have_rank+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <cards_have_rank+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cards_have_rank>:
test   %edx,%edx
jle    111e <cards_have_rank+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1121 <cards_have_rank+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <cards_have_rank+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cards_have_rank(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}