xunge/DecIR huggingface dataset:
long long fll4(long long j, signed short *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<fll4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movswq (%rcx,%rdx,2),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fll4>:
movswq (%rsi,%rdx,2),%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @fll4(i64 %0, i16* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i16*
%6 = alloca i64
store i64 %0, i64* %4
store i16* %1, i16** %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i16*, i16** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i16, i16* %8, i64 %9
%11 = load i16, i16* %10
%12 = sext i16 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @fll4(i64 %0, i16* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i16, i16* %1, i64 %2
%5 = load i16, i16* %4
%6 = sext i16 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
void set_mps(int mps) {}


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

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

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

LLVM IR (-O2):
define void @set_mps(i32 %0) {
ret void
}
int length(char *c) {
  int len = 0;
  while (c[len] != '\0') {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <length+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <length+0x10>
ret

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M700_f(char *s) {
  debug("M700_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M700_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M700_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M700_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M700_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void fun(int a[]) {
  int *p = a, *q = a + 9, temp;
  while (p < q) {
    temp = *q;
    *q = *p;
    *p = temp;
    p++;
    q--;
  }
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x24,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1165 <fun+0x65>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <fun+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    0x20(%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x4(%rax),%ecx
mov    (%rdi),%edx
mov    %edx,0x4(%rax)
mov    %ecx,(%rdi)
add    $0x4,%rdi
lea    -0x4(%rax),%rcx
cmp    %rax,%rdi
mov    %rcx,%rax
jb     1110 <fun+0x10>
ret

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

LLVM IR (-O2):
define void @fun(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
br label %3
3: ; preds = %1, %3
%4 = phi i32* [ %0, %1 ], [ %8, %3 ]
%5 = phi i32* [ %2, %1 ], [ %9, %3 ]
%6 = load i32, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %5
store i32 %6, i32* %4
%8 = getelementptr inbounds i32, i32* %4, i64 1
%9 = getelementptr inbounds i32, i32* %5, i64 -1
%10 = icmp ult i32* %8, %9
br i1 %10, label %3, label %11
11: ; preds = %3
ret void
}
/* Variables and functions */
int atoi(char *);
char *strchr(char *, char);
unsigned long long parse_assem1(char *str) {
  int highval, lowval;
  highval = atoi(str);
  str = strchr(str, ',');
  if (str)
    lowval = atoi(str + 1);
  else {
    return 0;
  }
  return (unsigned long long)((highval << 16) + lowval);
}


x86 assembly (clang, -O0):
<parse_assem1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116a <parse_assem1+0x4a>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1177 <parse_assem1+0x57>
movq   $0x0,-0x8(%rbp)
jmp    1186 <parse_assem1+0x66>
mov    -0x14(%rbp),%eax
shl    $0x10,%eax
add    -0x18(%rbp),%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_assem1>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x2c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1159 <parse_assem1+0x39>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <atoi@plt>
shl    $0x10,%ebp
add    %eax,%ebp
movslq %ebp,%rax
jmp    115b <parse_assem1+0x3b>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @parse_assem1(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 44)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @atoi(i8* %0)
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = tail call i32 @atoi(i8* %6)
%8 = shl i32 %5, 16
%9 = add nsw i32 %8, %7
%10 = sext i32 %9 to i64
br label %11
11: ; preds = %1, %4
%12 = phi i64 [ %10, %4 ], [ 0, %1 ]
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_getpid;
int /*<<< orphan*/ syscall_0(int /*<<< orphan*/);
pid_t getpid(void) {
  pid_t ret;
  ret = syscall_0(SYS_getpid);
  return ret;
}


x86 assembly (clang, -O0):
<getpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall_0@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpid>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall_0@plt>

LLVM IR (-O0):
@SYS_getpid = global i32 0
define i32 @getpid() {
%1 = alloca i32
%2 = load i32, i32* @SYS_getpid
%3 = call i32 @syscall_0(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@SYS_getpid = global i32 0
define i32 @getpid() {
%1 = load i32, i32* @SYS_getpid
%2 = tail call i32 @syscall_0(i32 %1)
ret i32 %2
}
int checkStruct() {}


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

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

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

LLVM IR (-O2):
define i32 @checkStruct() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_frame_aligned() {
  printf("NOT IMPLEMENTED:"
         "pa_frame_aligned"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_frame_aligned\0A\00"
define i32 @pa_frame_aligned() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_frame_aligned\00"
define i32 @pa_frame_aligned() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void rotr(int *a, int *b, int *c) {
  int swap;
  swap = *b;
  *b = *a;
  *a = *c;
  *c = swap;
}


x86 assembly (clang, -O0):
<rotr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr>:
mov    (%rsi),%eax
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @rotr(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32*, i32** %4
%11 = load i32, i32* %10
%12 = load i32*, i32** %5
store i32 %11, i32* %12
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %6
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @rotr(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %0
store i32 %5, i32* %1
%6 = load i32, i32* %2
store i32 %6, i32* %0
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
scalar_t__ ___sl_get_nondet_int();
void *dll_create_generic(void (*insert_fnc)()) {
  void *dll = NULL;
  insert_fnc(&dll);
  insert_fnc(&dll);
  while (___sl_get_nondet_int())
    insert_fnc(&dll);
  return dll;
}


x86 assembly (clang, -O0):
<dll_create_generic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   *-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   *-0x8(%rbp)
mov    $0x0,%al
call   1030 <___sl_get_nondet_int@plt>
cmp    $0x0,%rax
je     1155 <dll_create_generic+0x45>
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   *-0x8(%rbp)
jmp    1136 <dll_create_generic+0x26>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dll_create_generic>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
xor    %eax,%eax
call   *%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <___sl_get_nondet_int@plt>
test   %rax,%rax
je     1153 <dll_create_generic+0x43>
mov    %rsp,%r14
nop
mov    %r14,%rdi
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
call   1030 <___sl_get_nondet_int@plt>
test   %rax,%rax
jne    1140 <dll_create_generic+0x30>
mov    (%rsp),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @dll_create_generic(void (...)* nocapture %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = bitcast void (...)* %0 to void (i8**, ...)*
%5 = call i64 (...) @___sl_get_nondet_int()
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1, %7
%8 = call i64 (...) @___sl_get_nondet_int()
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %7
10: ; preds = %7, %1
%11 = load i8*, i8** %2
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void print_latency_stats(FILE *log_fp, int thd_id) {
  (void)log_fp;
  (void)thd_id;
}


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

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

LLVM IR (-O0):
define void @print_latency_stats(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
ret void
}

LLVM IR (-O2):
define void @print_latency_stats(i32* nocapture %0, i32 %1) {
ret void
}
int func(void) {
  int n = 3;
  int m = 5;
  n &&m;
  return 0;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     112b <func+0x2b>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Variables and functions */
int ff_d_up(int);
double ff_dd_up(double x) {
  return 4. * (ff_d_up(2. * x + 1.) - ff_d_up(2. * x - 1.));
}


x86 assembly (clang, -O0):
<ff_dd_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ff_d_up@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xeb9(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ff_d_up@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe91(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_dd_up>:
push   %rbx
sub    $0x10,%rsp
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xed9(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <ff_d_up@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
addsd  0xec4(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ff_d_up@plt>
sub    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xeb2(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ff_dd_up(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %3, double 1.000000e+00)
%5 = fptosi double %4 to i32
%6 = call i32 @ff_d_up(i32 %5)
%7 = load double, double* %2
%8 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %7, double -1.000000e+00)
%9 = fptosi double %8 to i32
%10 = call i32 @ff_d_up(i32 %9)
%11 = sub nsw i32 %6, %10
%12 = sitofp i32 %11 to double
%13 = fmul double 4.000000e+00, %12
ret double %13
}

LLVM IR (-O2):
define double @ff_dd_up(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double 1.000000e+00)
%3 = fptosi double %2 to i32
%4 = tail call i32 @ff_d_up(i32 %3)
%5 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -1.000000e+00)
%6 = fptosi double %5 to i32
%7 = tail call i32 @ff_d_up(i32 %6)
%8 = sub nsw i32 %4, %7
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 4.000000e+00
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  fprintf(stderr, "pcapin for this platform not built\n");
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"pcapin for this platform not built\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"pcapin for this platform not built\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ hzflg1(char *, int);
int strlen(char *);
void hzf_log1(char *strg) {
  int leng;
  leng = strlen(strg);
  hzflg1(strg, leng);
}


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

x86 assembly (clang, -O2):
<hzf_log1>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <hzflg1@plt>

LLVM IR (-O0):
define void @hzf_log1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i32 @hzflg1(i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @hzf_log1(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @hzflg1(i8* %0, i32 %2)
ret void
}
int fun839() { return 839; }


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

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

LLVM IR (-O0):
define i32 @fun839() {
ret i32 839
}

LLVM IR (-O2):
define i32 @fun839() {
ret i32 839
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
main() {
  while (1) {
    fprintf(stdout, "Code\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
lea    0xede(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
mov    %rbx,%rsi
call   1030 <fprintf@plt>
jmp    1130 <main+0x20>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"Code\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %2
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"Code\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ kill(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
void *pidSig() {
  while (1) {
    int pid, sig;
    scanf("%d %d", &pid, &sig);
    kill(pid, sig);
  }
}


x86 assembly (clang, -O0):
<pidSig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <kill@plt>
jmp    1128 <pidSig+0x8>

x86 assembly (clang, -O2):
<pidSig>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <kill@plt>
jmp    1140 <pidSig+0x20>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
define i8* @pidSig() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %0, %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @kill(i32 %5, i32 %6)
br label %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define noalias i8* @pidSig() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %0, %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @kill(i32 %7, i32 %8)
br label %5
}
void foo_2_1_2_1_1_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_1_2_2_1_2() {
ret void
}
int main() {
  int x = 2;
  while (x) {
    x = x - 1;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <main+0x2a>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int sort(const void *a, const void *b) { return (*(int *)a - *(int *)b); }


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

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

LLVM IR (-O0):
define i32 @sort(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @sort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ x;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int main() {
  FILE *fp;
  fp = fopen("C:\\Users\\marcoc\\Desktop\\test.txt", "wb");
  char x[10] = "asdfzxcv!!";
  fwrite(x, sizeof(x[0]), sizeof(x) / sizeof(x[0]), fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xed4(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0xa,%edx
call   1040 <fwrite@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xeef(%rip),%rsi
call   1030 <fopen@plt>
movabs $0x7663787a66647361,%rcx
78 63 76
mov    %rcx,0x8(%rsp)
movw   $0x2121,0x10(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
mov    %rax,%rcx
call   1040 <fwrite@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"C:\\Users\\marcoc\\Desktop\\test.txt\00"
@.str.1 = [3 x i8] c"wb\00"
@__const.main.x = [10 x i8] c"asdfzxcv!!"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %2
%5 = bitcast [10 x i8]* %3 to i8*
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i32 @fwrite(i8* %6, i32 1, i32 10, i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"C:\\Users\\marcoc\\Desktop\\test.txt\00"
@.str.1 = [3 x i8] c"wb\00"
@__const.main.x = [10 x i8] c"asdfzxcv!!"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @fwrite(i8* %3, i32 1, i32 10, i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XmbTextExtents() {
  printf("XmbTextExtents called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"XmbTextExtents called\00"
define i32 @XmbTextExtents() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned long djb2_hash(const char *str) {
  unsigned long hash;
  char ch;
  hash = 5381;
  while ((ch = *str++)) {
    hash = ((hash << 5) + hash) + ch;
  }
  return hash;
}


x86 assembly (clang, -O0):
<djb2_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     1149 <djb2_hash+0x49>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movsbq -0x11(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <djb2_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <djb2_hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <djb2_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @djb2_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncasecmp(char const *, char const *, int /*<<< orphan*/);
int prefix_icmp(const char *s, const char *prefix) {
  return (strncasecmp(s, prefix, strlen(prefix)) == 0);
}


x86 assembly (clang, -O0):
<prefix_icmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix_icmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @prefix_icmp(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncasecmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @prefix_icmp(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncasecmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
bool isEven(int number) { return number % 2 == 0 ? true : false; }


x86 assembly (clang, -O0):
<isEven>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEven>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isEven(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA(int, unsigned char);
void SetDOFSTDAF(unsigned char ucSetDat) {
  RegWriteA(0x0084, (unsigned char)(ucSetDat << 3));
}


x86 assembly (clang, -O0):
<SetDOFSTDAF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x3,%eax
mov    $0x84,%edi
movzbl %al,%esi
call   1030 <RegWriteA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetDOFSTDAF>:
shl    $0x3,%dil
movzbl %dil,%esi
mov    $0x84,%edi
jmp    1030 <RegWriteA@plt>

LLVM IR (-O0):
define void @SetDOFSTDAF(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 3
%6 = trunc i32 %5 to i8
%7 = call i32 @RegWriteA(i32 132, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @SetDOFSTDAF(i8 zeroext %0) {
%2 = shl i8 %0, 3
%3 = tail call i32 @RegWriteA(i32 132, i8 zeroext %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint16_t;
typedef int int8_t;

/* Variables and functions */
int8_t short_addr_compare(const uint8_t *p_first_addr,
                          const uint8_t *p_second_addr) {
  uint16_t first_addr = *(uint16_t *)(p_first_addr);
  uint16_t second_addr = *(uint16_t *)(p_second_addr);
  if (first_addr < second_addr) {
    return -1;
  } else if (first_addr > second_addr) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<short_addr_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    113c <short_addr_compare+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <short_addr_compare+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1156 <short_addr_compare+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <short_addr_compare+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_addr_compare>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @short_addr_compare(i32* nocapture %0, i32* nocapture %1) {
%3 = bitcast i32* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i32* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp slt i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
char *fcharplus(char *x, char y) {
  *x += y;
  if (!*x)
    foo(x);
  return x;
}


x86 assembly (clang, -O0):
<fcharplus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    %edx,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1147 <fcharplus+0x37>
mov    -0x8(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcharplus>:
push   %rbx
mov    %rdi,%rbx
add    %sil,(%rdi)
jne    1121 <fcharplus+0x11>
mov    %rbx,%rdi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @fcharplus(i8* returned %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, %1
store i8 %4, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @foo(i8* %0)
br label %8
8: ; preds = %6, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ICPrint() { printf("Hello, World!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define void @ICPrint() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void add_extension(const char *extension) {}


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

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

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

LLVM IR (-O2):
define void @add_extension(i8* nocapture %0) {
ret void
}
double sunmodel_jd_from_julian_cent(double t) {
  return t * 36525.0 + 2451545.0;
}


x86 assembly (clang, -O0):
<sunmodel_jd_from_julian_cent>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sunmodel_jd_from_julian_cent>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sunmodel_jd_from_julian_cent(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 3.652500e+04, double 0x4142B42C80000000)
ret double %4
}

LLVM IR (-O2):
define double @sunmodel_jd_from_julian_cent(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 3.652500e+04, double 0x4142B42C80000000)
ret double %2
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x > 0) {
    x = x + y;
    y = -2 * y;
  }
  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)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1155 <main+0x45>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0xfffffffe,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void ARGBUnattenuateRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBUnattenuateRow_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bubble_sort();
int /*<<< orphan*/ copy_string();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ initialize_array();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ test_token();
int main(int argc, char *argv[]) {
  test_token();
  printf("Starting tests.\n");
  fflush(stdout);
  initialize_array();
  copy_string();
  bubble_sort();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <test_token@plt>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    $0x0,%al
call   1070 <initialize_array@plt>
mov    $0x0,%al
call   1030 <copy_string@plt>
mov    $0x0,%al
call   1080 <bubble_sort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_token@plt>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1070 <initialize_array@plt>
xor    %eax,%eax
call   1040 <copy_string@plt>
xor    %eax,%eax
call   1080 <bubble_sort@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Starting tests.\0A\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_token()
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
%10 = call i32 (...) @initialize_array()
%11 = call i32 (...) @copy_string()
%12 = call i32 (...) @bubble_sort()
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [16 x i8] c"Starting tests.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_token()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 (...) @initialize_array()
%8 = tail call i32 (...) @copy_string()
%9 = tail call i32 (...) @bubble_sort()
ret i32 0
}
/* Variables and functions */
scalar_t__ get1dht();
int get2();
void get_dht(int kind) {
  int length;
  length = get2() - 2;
  while (length > 0)
    length -= get1dht();
}


x86 assembly (clang, -O0):
<get_dht>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get2@plt>
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    115b <get_dht+0x3b>
mov    $0x0,%al
call   1040 <get1dht@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
jmp    1138 <get_dht+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dht>:
push   %rbx
xor    %eax,%eax
call   1030 <get2@plt>
cmp    $0x3,%eax
jl     114d <get_dht+0x2d>
mov    %eax,%ebx
add    $0xfffffffe,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <get1dht@plt>
sub    %eax,%ebx
test   %ebx,%ebx
jg     1140 <get_dht+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @get_dht(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @get2()
%5 = sub nsw i32 %4, 2
store i32 %5, i32* %3
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = call i64 (...) @get1dht()
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = sub nsw i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %3
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @get_dht(i32 %0) {
%2 = tail call i32 (...) @get2()
%3 = icmp sgt i32 %2, 2
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = add nsw i32 %2, -2
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %10, %6 ], [ %5, %4 ]
%8 = tail call i64 (...) @get1dht()
%9 = trunc i64 %8 to i32
%10 = sub i32 %7, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %6, label %12
12: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ readsf_setup();
int /*<<< orphan*/ soundfiler_setup();
int /*<<< orphan*/ writesf_setup();
void d_soundfile_setup(void) {
  soundfiler_setup();
  readsf_setup();
  writesf_setup();
}


x86 assembly (clang, -O0):
<d_soundfile_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <soundfiler_setup@plt>
mov    $0x0,%al
call   1030 <readsf_setup@plt>
mov    $0x0,%al
call   1040 <writesf_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_soundfile_setup>:
push   %rax
xor    %eax,%eax
call   1050 <soundfiler_setup@plt>
xor    %eax,%eax
call   1030 <readsf_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <writesf_setup@plt>

LLVM IR (-O0):
define void @d_soundfile_setup() {
%1 = call i32 (...) @soundfiler_setup()
%2 = call i32 (...) @readsf_setup()
%3 = call i32 (...) @writesf_setup()
ret void
}

LLVM IR (-O2):
define void @d_soundfile_setup() {
%1 = tail call i32 (...) @soundfiler_setup()
%2 = tail call i32 (...) @readsf_setup()
%3 = tail call i32 (...) @writesf_setup()
ret void
}