xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t strlen(const char *str) {
  size_t i;
  for (i = 0; str[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <strlen+0x38>
jmp    1127 <strlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ powerpc405_init();
void _profile_init(void) { powerpc405_init(); }


x86 assembly (clang, -O0):
<_profile_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <powerpc405_init@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_profile_init() {
%1 = call i32 (...) @powerpc405_init()
ret void
}

LLVM IR (-O2):
define void @_profile_init() {
%1 = tail call i32 (...) @powerpc405_init()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XSelectionRequestEvent;

/* Variables and functions */
int get_XSelectionRequestEvent_type(void *_p) {
  return (int)((XSelectionRequestEvent *)_p)->type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XSelectionRequestEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XSelectionRequestEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *GetFileType(char *filename) {
  char *pType = NULL;
  while (*filename) {
    if (*filename++ == '.') {
      pType = filename;
    }
  }
  return pType;
}


x86 assembly (clang, -O0):
<GetFileType>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <GetFileType+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1140 <GetFileType+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <GetFileType+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFileType>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <GetFileType+0x23>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
cmp    $0x2e,%cl
cmove  %rdi,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <GetFileType+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @GetFileType(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ null, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 46
%10 = select i1 %9, i8* %8, i8* %6
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ null, %1 ], [ %10, %4 ]
ret i8* %14
}
int invert_wave(int wave) { return -wave + 1160; }


x86 assembly (clang, -O0):
<invert_wave>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
add    $0x488,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert_wave>:
mov    $0x488,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert_wave(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = add nsw i32 %4, 1160
ret i32 %5
}

LLVM IR (-O2):
define i32 @invert_wave(i32 %0) {
%2 = sub i32 1160, %0
ret i32 %2
}
unsigned power_of_2_min_u(unsigned x) {
  x |= (x >> 1);
  x |= (x >> 2);
  x |= (x >> 4);
  x |= (x >> 8);
  x |= (x >> 16);
  return x - (x >> 1);
}


x86 assembly (clang, -O0):
<power_of_2_min_u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_of_2_min_u>:
mov    %edi,%eax
shr    %eax
or     %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    %ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @power_of_2_min_u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = lshr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = lshr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 8
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = lshr i32 %19, 16
%21 = load i32, i32* %2
%22 = or i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = load i32, i32* %2
%25 = lshr i32 %24, 1
%26 = sub i32 %23, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @power_of_2_min_u(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = lshr i32 %3, 2
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 8
%9 = or i32 %8, %7
%10 = lshr i32 %9, 16
%11 = or i32 %10, %9
%12 = lshr i32 %11, 1
%13 = sub i32 %11, %12
ret i32 %13
}
void foo() {
  void **p;
  *p = 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @foo() {
%1 = alloca i8**
%2 = load i8**, i8*** %1
store i8* null, i8** %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *xstrdup(char const *);
char *strreplace(char **dest, const char *str) {
  if (*dest)
    free(*dest);
  *dest = xstrdup(str);
  return *dest;
}


x86 assembly (clang, -O0):
<strreplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114a <strreplace+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1040 <xstrdup@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strreplace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1137 <strreplace+0x17>
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <xstrdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strreplace(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** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %8, %2
%13 = load i8*, i8** %4
%14 = call i8* @xstrdup(i8* %13)
%15 = load i8**, i8*** %3
store i8* %14, i8** %15
%16 = load i8**, i8*** %3
%17 = load i8*, i8** %16
ret i8* %17
}

LLVM IR (-O2):
define i8* @strreplace(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %3)
br label %7
7: ; preds = %5, %2
%8 = tail call i8* @xstrdup(i8* %1)
store i8* %8, i8** %0
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ primefac(unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main() {
  unsigned n;
  printf("Enter a number:\n");
  scanf(" %u%*c", &n);
  primefac(n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <primefac@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number:\0A\00"
@.str.1 = [7 x i8] c" %u%*c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @primefac(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c" %u%*c\00"
@str = [16 x i8] c"Enter a number:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @primefac(i32 %5)
ret i32 0
}
/* Variables and functions */
void *calloc(unsigned int, int);
void *gsize_calloc(unsigned int n) { return calloc(n, sizeof(unsigned int)); }


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

x86 assembly (clang, -O2):
<gsize_calloc>:
mov    $0x4,%esi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @gsize_calloc(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 4)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
size_t _datasize(int /*<<< orphan*/ *, int);
size_t _footsize(int /*<<< orphan*/ *, int);
size_t dlmallocfork_save_size(void *_ptr, int max) {
  uint8_t *ptr = (uint8_t *)_ptr;
  return 4 + _datasize(ptr, max) + _footsize(ptr, max);
}


x86 assembly (clang, -O0):
<dlmallocfork_save_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <_datasize@plt>
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <_footsize@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlmallocfork_save_size>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <_datasize@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <_footsize@plt>
add    %r14,%rax
add    $0x4,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @dlmallocfork_save_size(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = call i64 @_datasize(i32* %8, i32 %9)
%11 = add i64 4, %10
%12 = load i32*, i32** %5
%13 = load i32, i32* %4
%14 = call i64 @_footsize(i32* %12, i32 %13)
%15 = add i64 %11, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @dlmallocfork_save_size(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i64 @_datasize(i32* %3, i32 %1)
%5 = add i64 %4, 4
%6 = tail call i64 @_footsize(i32* %3, i32 %1)
%7 = add i64 %5, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ swap_double(double *, double *);
void minmax_double(double *a, double *b) {
  if (*a > *b)
    swap_double(a, b);
}


x86 assembly (clang, -O0):
<minmax_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1143 <minmax_double+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <swap_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minmax_double>:
movsd  (%rdi),%xmm0
ucomisd (%rsi),%xmm0
jbe    111f <minmax_double+0xf>
jmp    1030 <swap_double@plt>
ret

LLVM IR (-O0):
define void @minmax_double(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp ogt double %6, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load double*, double** %3
%12 = load double*, double** %4
%13 = call i32 @swap_double(double* %11, double* %12)
br label %14
14: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
define void @minmax_double(double* %0, double* %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ogt double %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @swap_double(double* %0, double* %1)
br label %8
8: ; preds = %6, %2
ret void
}
void __attribute__((weak)) warning(const char *fmt, ...) {}


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

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

LLVM IR (-O0):
define weak void @warning(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define weak void @warning(i8* %0, ...) {
ret void
}
char *_globat_strchrnul(const char *haystack, int c) {
  while (*haystack && *haystack != c) {
    haystack++;
  }
  return (char *)haystack;
}


x86 assembly (clang, -O0):
<_globat_strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1130 <_globat_strchrnul+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <_globat_strchrnul+0x40>
jmp    1151 <_globat_strchrnul+0x51>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <_globat_strchrnul+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_globat_strchrnul>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <_globat_strchrnul+0x20>
cmp    %esi,%ecx
jne    1110 <_globat_strchrnul+0x10>
ret

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

LLVM IR (-O2):
define i8* @_globat_strchrnul(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret i8* %4
}
int bar1() {}


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

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

LLVM IR (-O0):
define i32 @bar1() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @bar1() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void extra() { printf("PASS\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
define void @extra() {
%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"PASS\00"
define void @extra() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double heaviside(double);
double ramp(double x) { return (heaviside(x) * x); }


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

x86 assembly (clang, -O2):
<ramp>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <heaviside@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ramp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @heaviside(double %3)
%5 = load double, double* %2
%6 = fmul double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @ramp(double %0) {
%2 = tail call double @heaviside(double %0)
%3 = fmul double %2, %0
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t read_uint16(uint32_t offset) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @read_uint16(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test45_M_foo__E();
int /*<<< orphan*/ test45_Q_cycle__E();
void test45_Test10_test__I() {
  test45_M_foo__E();
  test45_Q_cycle__E();
}


x86 assembly (clang, -O0):
<test45_Test10_test__I>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test45_M_foo__E@plt>
mov    $0x0,%al
call   1040 <test45_Q_cycle__E@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test45_Test10_test__I>:
push   %rax
xor    %eax,%eax
call   1030 <test45_M_foo__E@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test45_Q_cycle__E@plt>

LLVM IR (-O0):
define void @test45_Test10_test__I() {
%1 = call i32 (...) @test45_M_foo__E()
%2 = call i32 (...) @test45_Q_cycle__E()
ret void
}

LLVM IR (-O2):
define void @test45_Test10_test__I() {
%1 = tail call i32 (...) @test45_M_foo__E()
%2 = tail call i32 (...) @test45_Q_cycle__E()
ret void
}
void port_lock(void) {}


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

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

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

LLVM IR (-O2):
define void @port_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
float __VERIFIER_nondet_float();
int main(void) {
  float a = __VERIFIER_nondet_float();
  if (a < 0) {
    return 0;
  }
  if (a > 0) {
    __VERIFIER_assert(a > 0);
  } else {
    __VERIFIER_assert(a == 0);
  }
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_float@plt>
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1154 <main+0x34>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <main+0x87>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1182 <main+0x62>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
jmp    119f <main+0x7f>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_float@plt>
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1150 <main+0x30>
xor    %edi,%edi
ucomiss %xmm1,%xmm0
setae  %dil
movss  %xmm0,0xc(%rsp)
call   1030 <__VERIFIER_assert@plt>
cvttss2si 0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call float (...) @__VERIFIER_nondet_float()
store float %3, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %23
7: ; preds = %0
%8 = load float, float* %2
%9 = fcmp ogt float %8, 0.000000e+00
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load float, float* %2
%12 = fcmp ogt float %11, 0.000000e+00
%13 = zext i1 %12 to i32
%14 = call i32 @__VERIFIER_assert(i32 %13)
br label %20
15: ; preds = %7
%16 = load float, float* %2
%17 = fcmp oeq float %16, 0.000000e+00
%18 = zext i1 %17 to i32
%19 = call i32 @__VERIFIER_assert(i32 %18)
br label %20
20: ; preds = %15, %10
%21 = load float, float* %2
%22 = fptosi float %21 to i32
store i32 %22, i32* %1
br label %23
23: ; preds = %20, %6
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float (...) @__VERIFIER_nondet_float()
%2 = fcmp olt float %1, 0.000000e+00
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = fcmp oge float %1, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = tail call i32 @__VERIFIER_assert(i32 %5)
%7 = fptosi float %1 to i32
br label %8
8: ; preds = %0, %3
%9 = phi i32 [ %7, %3 ], [ 0, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __analyzer_eval(int);
void test_5(void) {
  int a[10];
  a[3] = 5;
  __analyzer_eval(a[3] == 5);
}


x86 assembly (clang, -O0):
<test_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x5,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__analyzer_eval@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_5>:
mov    $0x1,%edi
jmp    1030 <__analyzer_eval@plt>

LLVM IR (-O0):
define void @test_5() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
store i32 5, i32* %2
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 5
%6 = zext i1 %5 to i32
%7 = call i32 @__analyzer_eval(i32 %6)
ret void
}

LLVM IR (-O2):
define void @test_5() {
%1 = tail call i32 @__analyzer_eval(i32 1)
ret void
}
__attribute__((no, noclone)) signed __int128 t106_3mul(unsigned __int128 y) {
  signed __int128 r;
  if (__builtin_mul_overflow((unsigned __int128)(0), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t106_3mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
test   $0x1,%al
jne    114f <t106_3mul+0x3f>
jmp    1156 <t106_3mul+0x46>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define { i64, i64 } @t106_3mul(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.umul.with.overflow.i128(i128 0, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
%15 = icmp ugt i128 %14, 170141183460469231731687303715884105727
%16 = or i1 %13, %15
store i128 %14, i128* %6
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @bar()
br label %19
19: ; preds = %17, %2
%20 = load i128, i128* %6
store i128 %20, i128* %3
%21 = bitcast i128* %3 to { i64, i64 }*
%22 = load { i64, i64 }, { i64, i64 }* %21
ret { i64, i64 } %22
}

LLVM IR (-O2):
define { i64, i64 } @t106_3mul(i64 %0, i64 %1) {
ret { i64, i64 } zeroinitializer
}
void mystrcat(char *s1, char *s2) {
  while (*s1 != '\0') {
    s1++;
  }
  while (*s2 != '\0') {
    *s1 = *s2;
    s1++;
    s2++;
  }
  *s1 = '\0';
}


x86 assembly (clang, -O0):
<mystrcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <mystrcat+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <mystrcat+0xc>
jmp    1132 <mystrcat+0x32>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116b <mystrcat+0x6b>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1132 <mystrcat+0x32>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcat>:
mov    %rdi,%rcx
add    $0x1,%rdi
cmpb   $0x0,(%rcx)
jne    1100 <mystrcat>
mov    (%rsi),%al
test   %al,%al
je     1136 <mystrcat+0x36>
mov    $0xffffffffffffffff,%rcx
nopl   0x0(%rax)
mov    %al,(%rdi,%rcx,1)
movzbl 0x2(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1120 <mystrcat+0x20>
add    %rcx,%rdi
mov    %rdi,%rcx
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define void @mystrcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %16, %11 ], [ %1, %8 ]
%14 = phi i8* [ %15, %11 ], [ %4, %8 ]
store i8 %12, i8* %14
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = getelementptr inbounds i8, i8* %13, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %15, %11 ]
store i8 0, i8* %20
ret void
}
/* Variables and functions */
int /*<<< orphan*/ musb_iset16(int, int, int);
void reset_ep_datatog(int ep) { musb_iset16(ep, 0x02, 0x0040); }


x86 assembly (clang, -O0):
<reset_ep_datatog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
mov    $0x40,%edx
call   1030 <musb_iset16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_ep_datatog>:
mov    $0x2,%esi
mov    $0x40,%edx
jmp    1030 <musb_iset16@plt>

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

LLVM IR (-O2):
define void @reset_ep_datatog(i32 %0) {
%2 = tail call i32 @musb_iset16(i32 %0, i32 2, i32 64)
ret void
}
void RTCrc64Process(void) {}


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

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

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

LLVM IR (-O2):
define void @RTCrc64Process() {
ret void
}
/* Variables and functions */
int _atoi(char *);
int _inputtoi(char *str) {
  return (*str == 'x' || *str == 'X') ? 0x7fffffff : _atoi(str);
}


x86 assembly (clang, -O0):
<_inputtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x78,%eax
je     113c <_inputtoi+0x2c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x58,%eax
jne    1149 <_inputtoi+0x39>
mov    $0x7fffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1155 <_inputtoi+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <_atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_inputtoi>:
mov    (%rdi),%al
or     $0x20,%al
cmp    $0x78,%al
jne    111e <_inputtoi+0xe>
mov    $0x7fffffff,%eax
ret
jmp    1030 <_atoi@plt>

LLVM IR (-O0):
define i32 @_inputtoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 120
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 88
br i1 %11, label %12, label %13
12: ; preds = %7, %1
br label %16
13: ; preds = %7
%14 = load i8*, i8** %2
%15 = call i32 @_atoi(i8* %14)
br label %16
16: ; preds = %13, %12
%17 = phi i32 [ 2147483647, %12 ], [ %15, %13 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @_inputtoi(i8* %0) {
%2 = load i8, i8* %0
switch i8 %2, label %3 [
i8 120, label %5
i8 88, label %5
]
3: ; preds = %1
%4 = tail call i32 @_atoi(i8* %0)
br label %5
5: ; preds = %1, %1, %3
%6 = phi i32 [ %4, %3 ], [ 2147483647, %1 ], [ 2147483647, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct fmc_device {
  int dummy;
};

/* Variables and functions */
void fmc_writel(struct fmc_device *fmc, uint32_t val, int off) {
  uint32_t *p = (uint32_t *)off;
  *p = val;
}


x86 assembly (clang, -O0):
<fmc_writel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movslq -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmc_writel>:
movslq %edx,%rax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
%struct.fmc_device = type { i32 }
define void @fmc_writel(%struct.fmc_device* %0, i32 %1, i32 %2) {
%4 = alloca %struct.fmc_device*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store %struct.fmc_device* %0, %struct.fmc_device** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %7
%11 = load i32, i32* %5
%12 = load i32*, i32** %7
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
%struct.fmc_device = type { i32 }
define void @fmc_writel(%struct.fmc_device* nocapture readnone %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = inttoptr i64 %4 to i32*
store i32 %1, i32* %5
ret void
}
void usb_cleanup(void) {
  (*(volatile unsigned short *)((0x24100000) + 0xc)) &= ~1;
}


x86 assembly (clang, -O0):
<usb_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2410000c,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0xfffffffe,%eax
mov    %ax,%cx
mov    $0x2410000c,%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_cleanup>:
andw   $0xfffe,0x2410000c
24 fe
ret

LLVM IR (-O0):
define void @usb_cleanup() {
%1 = load volatile i16, i16* inttoptr (i64 605028364 to i16*)
%2 = zext i16 %1 to i32
%3 = and i32 %2, -2
%4 = trunc i32 %3 to i16
store volatile i16 %4, i16* inttoptr (i64 605028364 to i16*)
ret void
}

LLVM IR (-O2):
define void @usb_cleanup() {
%1 = load volatile i16, i16* inttoptr (i64 605028364 to i16*)
%2 = and i16 %1, -2
store volatile i16 %2, i16* inttoptr (i64 605028364 to i16*)
ret void
}
int execute_select() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_select() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_select() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int x;
  srand(time(NULL));
  x = rand() % 6 + 1;
  printf("Congrats, you rolled a %d", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Congrats, you rolled a %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 6
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Congrats, you rolled a %d\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 6
%5 = add nsw i32 %4, 1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getppid();
void checkppid() {
  if (getppid() == 1)
    exit(0);
}


x86 assembly (clang, -O0):
<checkppid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getppid@plt>
cmp    $0x1,%eax
jne    113b <checkppid+0x1b>
xor    %edi,%edi
call   1040 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkppid>:
push   %rax
xor    %eax,%eax
call   1030 <getppid@plt>
cmp    $0x1,%eax
je     112f <checkppid+0xf>
pop    %rax
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @checkppid() {
%1 = call i32 (...) @getppid()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 0)
unreachable
5: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @checkppid() {
%1 = tail call i32 (...) @getppid()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
ret void
}
/* Type definitions */
struct iovec {
  char *iov_base;
  int iov_len;
};
typedef int /*<<< orphan*/ discard_buf;

/* Variables and functions */
void discard_iovec(struct iovec *iov, unsigned int *num) {
  static char discard_buf[1024];
  *num = 1;
  iov->iov_base = discard_buf;
  iov->iov_len = sizeof(discard_buf);
}


x86 assembly (clang, -O0):
<discard_iovec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
lea    0x2f0f(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x400,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<discard_iovec>:
movl   $0x1,(%rsi)
lea    0x2f23(%rip),%rax
mov    %rax,(%rdi)
movl   $0x400,0x8(%rdi)
ret

LLVM IR (-O0):
%struct.iovec = type { i8*, i32 }
@discard_iovec.discard_buf = internal global [1024 x i8] zeroinitializer
define void @discard_iovec(%struct.iovec* %0, i32* %1) {
%3 = alloca %struct.iovec*
%4 = alloca i32*
store %struct.iovec* %0, %struct.iovec** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32 1, i32* %5
%6 = load %struct.iovec*, %struct.iovec** %3
%7 = getelementptr inbounds %struct.iovec, %struct.iovec* %6, i32 0, i32 0
store i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @discard_iovec.discard_buf, i64 0, i64 0), i8** %7
%8 = load %struct.iovec*, %struct.iovec** %3
%9 = getelementptr inbounds %struct.iovec, %struct.iovec* %8, i32 0, i32 1
store i32 1024, i32* %9
ret void
}

LLVM IR (-O2):
%struct.iovec = type { i8*, i32 }
@discard_iovec.discard_buf = internal global [1024 x i8] zeroinitializer
define void @discard_iovec(%struct.iovec* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 1, i32* %1
%3 = getelementptr inbounds %struct.iovec, %struct.iovec* %0, i64 0, i32 0
store i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @discard_iovec.discard_buf, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds %struct.iovec, %struct.iovec* %0, i64 0, i32 1
store i32 1024, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mutex_test_main();
void unit_test() { mutex_test_main(); }


x86 assembly (clang, -O0):
<unit_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mutex_test_main@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @unit_test() {
%1 = call i32 (...) @mutex_test_main()
ret void
}

LLVM IR (-O2):
define void @unit_test() {
%1 = tail call i32 (...) @mutex_test_main()
ret void
}
/* Variables and functions */
unsigned int BPHash(unsigned char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strlen(unsigned char *);
int main(int argc, char *argv[]) {
  unsigned char *str = argv[1];
  unsigned int hash = BPHash(str, strlen(str));
  if (hash == 0x5bfaf2f9)
    printf("You win!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1030 <BPHash@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x5bfaf2f9,-0x1c(%rbp)
jne    118a <main+0x5a>
lea    0xe7b(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <BPHash@plt>
cmp    $0x5bfaf2f9,%eax
jne    115a <main+0x2a>
lea    0xeab(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"You win!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = load i8*, i8** %6
%13 = call i32 @strlen(i8* %12)
%14 = call i32 @BPHash(i8* %11, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 1543172857
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"You win!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i32 @BPHash(i8* %4, i32 %5)
%7 = icmp eq i32 %6, 1543172857
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", 5);
  printf("%d\n", 6);
  printf("%d\n", 7);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
/* Variables and functions */
int f352(int *);
int f353(int *p) { return f352(p); }


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

x86 assembly (clang, -O2):
<f353>:
jmp    1030 <f352@plt>

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

LLVM IR (-O2):
define i32 @f353(i32* %0) {
%2 = tail call i32 @f352(i32* %0)
ret i32 %2
}
void markNum(unsigned char *vector, int num) {
  int byteNumber = num >> 3;
  int mask = 1 << (num & 7);
  vector[byteNumber] |= mask;
}


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

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

LLVM IR (-O0):
define void @markNum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 3
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, 7
%11 = shl i32 1, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %18, %12
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @markNum(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = and i32 %1, 7
%5 = shl nuw nsw i32 1, %4
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %5 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
/* Variables and functions */
unsigned short read2FromEco(unsigned char *);
void conv2FromEcoToX86(unsigned char *p) {
  unsigned short data;
  data = read2FromEco(p);
  *(unsigned short *)p = data;
}


x86 assembly (clang, -O0):
<conv2FromEcoToX86>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read2FromEco@plt>
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv2FromEcoToX86>:
push   %rbx
mov    %rdi,%rbx
call   1030 <read2FromEco@plt>
mov    %ax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @conv2FromEcoToX86(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call zeroext i16 @read2FromEco(i8* %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i16*
store i16 %6, i16* %8
ret void
}

LLVM IR (-O2):
define void @conv2FromEcoToX86(i8* %0) {
%2 = tail call zeroext i16 @read2FromEco(i8* %0)
%3 = bitcast i8* %0 to i16*
store i16 %2, i16* %3
ret void
}