xunge/DecIR huggingface dataset:
char *decode_pixelformat(unsigned int format) {
  static char buf[5];
  buf[0] = format & 0xff;
  buf[1] = (format & 0xff00) >> 8;
  buf[2] = (format & 0xff0000) >> 16;
  buf[3] = (format & 0xff000000) >> 24;
  buf[4] = 0;
  return buf;
}


x86 assembly (clang, -O0):
<decode_pixelformat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,0x2f0c(%rip)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
shr    $0x8,%eax
mov    %al,0x2efc(%rip)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
shr    $0x10,%eax
mov    %al,0x2eec(%rip)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %al,0x2edc(%rip)
movb   $0x0,0x2ed6(%rip)
lea    0x2ecb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_pixelformat>:
mov    %edi,%ecx
mov    %cl,0x2f19(%rip)
lea    0x2f12(%rip),%rax
mov    %ch,0x2f0d(%rip)
mov    %edi,%edx
shr    $0x10,%edx
mov    %dl,0x2f03(%rip)
shr    $0x18,%ecx
mov    %cl,0x2efb(%rip)
movb   $0x0,0x2ef5(%rip)
ret

LLVM IR (-O0):
@decode_pixelformat.buf = internal global [5 x i8] zeroinitializer
define i8* @decode_pixelformat(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = trunc i32 %4 to i8
store i8 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 0)
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = lshr i32 %7, 8
%9 = trunc i32 %8 to i8
store i8 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 1)
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = lshr i32 %11, 16
%13 = trunc i32 %12 to i8
store i8 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 2)
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = trunc i32 %16 to i8
store i8 %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 3)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 4)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@decode_pixelformat.buf = internal global [5 x i8] zeroinitializer
define i8* @decode_pixelformat(i32 %0) {
%2 = trunc i32 %0 to i8
store i8 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 0)
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 1)
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
store i8 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 2)
%7 = lshr i32 %0, 24
%8 = trunc i32 %7 to i8
store i8 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 3)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 4)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @decode_pixelformat.buf, i64 0, i64 0)
}
void flextVkInit() {}


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

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

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

LLVM IR (-O2):
define void @flextVkInit() {
ret void
}
/* Variables and functions */
int compare(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", compare("apple", "apple"));
  printf("%d\n", compare("hello", "world"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed9(%rip),%rsi
mov    %rsi,%rdi
call   1040 <compare@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1040 <compare@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedc(%rip),%rdi
mov    %rdi,%rsi
call   1040 <compare@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1040 <compare@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"apple\00"
@.str.2 = [6 x i8] c"hello\00"
@.str.3 = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 @compare(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @compare(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
OP(ed, c1) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ldl_le_p(const void *ptr) { return *(uint32_t *)ptr; }


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

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

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

LLVM IR (-O2):
define i32 @ldl_le_p(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("The world is a vaampire.\n");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"The world is a vaampire.\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [25 x i8] c"The world is a vaampire.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void const *, int);
int binary_writer_write_internal(char *dest, const void *src, int n) {
  memcpy(dest, src, n);
  return n;
}


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

x86 assembly (clang, -O2):
<binary_writer_write_internal>:
push   %rbx
mov    %edx,%ebx
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @binary_writer_write_internal(i8* %0, i8* %1, i32 returned %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret i32 %2
}
/* Variables and functions */
void simple_deref() {
  int *p = NULL;
  int *q = p;
  *p = 42;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @simple_deref() {
%1 = alloca i32*
%2 = alloca i32*
store i32* null, i32** %1
%3 = load i32*, i32** %1
store i32* %3, i32** %2
%4 = load i32*, i32** %1
store i32 42, i32* %4
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ core10_print(char *, char const *);
void U_EMRPOLYPOLYLINE16_print(const char *contents) {
  core10_print("U_EMRPOLYPOLYLINE16", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYPOLYLINE16_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <core10_print@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"U_EMRPOLYPOLYLINE16\00"
define void @U_EMRPOLYPOLYLINE16_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core10_print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"U_EMRPOLYPOLYLINE16\00"
define void @U_EMRPOLYPOLYLINE16_print(i8* %0) {
%2 = tail call i32 @core10_print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char spaciatic(char input) {
  if (input == ' ') {
    return 1;
  }
  if (input == 10) {
    return 1;
  }
  if (input == 13) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<spaciatic>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jne    1120 <spaciatic+0x20>
movb   $0x1,-0x1(%rbp)
jmp    1150 <spaciatic+0x50>
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jne    1136 <spaciatic+0x36>
movb   $0x1,-0x1(%rbp)
jmp    1150 <spaciatic+0x50>
movsbl -0x2(%rbp),%eax
cmp    $0xd,%eax
jne    114c <spaciatic+0x4c>
movb   $0x1,-0x1(%rbp)
jmp    1150 <spaciatic+0x50>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spaciatic>:
cmp    $0x20,%dil
ja     111d <spaciatic+0x1d>
mov    $0x1,%al
movzbl %dil,%ecx
movabs $0x100002400,%rdx
bt     %rcx,%rdx
jae    111d <spaciatic+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i8 @spaciatic(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 10, label %3
i8 13, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i8 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i8 %4
}
void atomic_inc(volatile int *num) {
  __asm__ __volatile__("lock incl %0" : "=m"(*num));
}


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

x86 assembly (clang, -O2):
<atomic_inc>:
lock incl (%rdi)
ret

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

LLVM IR (-O2):
define void @atomic_inc(i32* %0) {
tail call void asm sideeffect "lock incl $0", "=*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0)
ret void
}
/* Variables and functions */
long double pow(int, size_t);
long double roundld(long double);
long double precise_round(long double value, size_t decimal_paces) {
  long double fac = pow(10, decimal_paces);
  return roundld(value * fac) / fac;
}


x86 assembly (clang, -O0):
<precise_round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0xa,%edi
call   1030 <pow@plt>
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x30(%rbp)
fmulp  %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <roundld@plt>
fldt   -0x30(%rbp)
fdivrp %st,%st(1)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<precise_round>:
sub    $0x28,%rsp
mov    %rdi,%rsi
fldt   0x30(%rsp)
fstpt  0x1c(%rsp)
mov    $0xa,%edi
call   1030 <pow@plt>
fld    %st(0)
fxch   %st(1)
fstpt  0x10(%rsp)
fldt   0x1c(%rsp)
fmulp  %st,%st(1)
fstpt  (%rsp)
call   1040 <roundld@plt>
fldt   0x10(%rsp)
fdivrp %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @precise_round(x86_fp80 %0, i64 %1) {
%3 = alloca x86_fp80
%4 = alloca i64
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call x86_fp80 @pow(i32 10, i64 %6)
store x86_fp80 %7, x86_fp80* %5
%8 = load x86_fp80, x86_fp80* %3
%9 = load x86_fp80, x86_fp80* %5
%10 = fmul x86_fp80 %8, %9
%11 = call x86_fp80 @roundld(x86_fp80 %10)
%12 = load x86_fp80, x86_fp80* %5
%13 = fdiv x86_fp80 %11, %12
ret x86_fp80 %13
}

LLVM IR (-O2):
define x86_fp80 @precise_round(x86_fp80 %0, i64 %1) {
%3 = tail call x86_fp80 @pow(i32 10, i64 %1)
%4 = fmul x86_fp80 %3, %0
%5 = tail call x86_fp80 @roundld(x86_fp80 %4)
%6 = fdiv x86_fp80 %5, %3
ret x86_fp80 %6
}
/* Type definitions */
struct track_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hash_insert(struct track_info *);
int /*<<< orphan*/ is_filtered(struct track_info *);
int /*<<< orphan*/ views_add_track(struct track_info *);
void lib_add_track(struct track_info *ti) {
  if (!hash_insert(ti)) {
    return;
  }
  if (!is_filtered(ti))
    views_add_track(ti);
}


x86 assembly (clang, -O0):
<lib_add_track>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hash_insert@plt>
cmp    $0x0,%eax
jne    1153 <lib_add_track+0x23>
jmp    116e <lib_add_track+0x3e>
mov    -0x8(%rbp),%rdi
call   1050 <is_filtered@plt>
cmp    $0x0,%eax
jne    116e <lib_add_track+0x3e>
mov    -0x8(%rbp),%rdi
call   1040 <views_add_track@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib_add_track>:
push   %rbx
mov    %rdi,%rbx
call   1030 <hash_insert@plt>
test   %eax,%eax
je     1149 <lib_add_track+0x19>
mov    %rbx,%rdi
call   1050 <is_filtered@plt>
test   %eax,%eax
je     114b <lib_add_track+0x1b>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <views_add_track@plt>

LLVM IR (-O0):
%struct.track_info = type { i32 }
define void @lib_add_track(%struct.track_info* %0) {
%2 = alloca %struct.track_info*
store %struct.track_info* %0, %struct.track_info** %2
%3 = load %struct.track_info*, %struct.track_info** %2
%4 = call i32 @hash_insert(%struct.track_info* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
br label %14
7: ; preds = %1
%8 = load %struct.track_info*, %struct.track_info** %2
%9 = call i32 @is_filtered(%struct.track_info* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %7
%12 = load %struct.track_info*, %struct.track_info** %2
%13 = call i32 @views_add_track(%struct.track_info* %12)
br label %14
14: ; preds = %6, %11, %7
ret void
}

LLVM IR (-O2):
%struct.track_info = type { i32 }
define void @lib_add_track(%struct.track_info* %0) {
%2 = tail call i32 @hash_insert(%struct.track_info* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @is_filtered(%struct.track_info* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @views_add_track(%struct.track_info* %0)
br label %9
9: ; preds = %1, %7, %4
ret void
}
int main() {
  int c, b;
  b = -c;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%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
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
store i32 %5, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print1(void *para) { printf("task2\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"task2\00"
define void @print1(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
double divide(int keep) { return keep ? (1.0 / (2.0 + divide(--keep))) : 0; }


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1155 <divide+0x45>
mov    -0x4(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x4(%rbp)
call   1030 <divide@plt>
movsd  0xecd(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1162 <divide+0x52>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1162 <divide+0x52>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
test   %edi,%edi
je     113a <divide+0x2a>
push   %rax
add    $0xffffffff,%edi
call   1030 <divide@plt>
movapd %xmm0,%xmm1
addsd  0xed7(%rip),%xmm1
movsd  0xed7(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x8,%rsp
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @divide(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
store i32 %7, i32* %2
%8 = call double @divide(i32 %7)
%9 = fadd double 2.000000e+00, %8
%10 = fdiv double 1.000000e+00, %9
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %5
%13 = phi double [ %10, %5 ], [ 0.000000e+00, %11 ]
ret double %13
}

LLVM IR (-O2):
define double @divide(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi double [ %9, %5 ], [ 0.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call double @divide(i32 %6)
%8 = fadd double %7, 2.000000e+00
%9 = fdiv double 1.000000e+00, %8
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void visit(void *buffer) { printf("%s\n", (char *)buffer); }


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

x86 assembly (clang, -O2):
<visit>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @visit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_6375() {
  Assert_real((isqrt(6375) == 79),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1405, ("Integer square root of 6375 should be 79"));
}


x86 assembly (clang, -O0):
<t_sqrt_6375>:
push   %rbp
mov    %rsp,%rbp
mov    $0x18e7,%edi
call   1030 <isqrt@plt>
cmp    $0x4f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x57d,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_6375>:
push   %rax
mov    $0x18e7,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x4f,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x57d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 6375 should be 79\00"
define void @t_sqrt_6375() {
%1 = call i32 @isqrt(i32 6375)
%2 = icmp eq i32 %1, 79
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1405, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 6375 should be 79\00"
define void @t_sqrt_6375() {
%1 = tail call i32 @isqrt(i32 6375)
%2 = icmp eq i32 %1, 79
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1405, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t nsec(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((int64_t)tv.tv_sec * 1000000000) + (int64_t)tv.tv_usec * 1000;
}


x86 assembly (clang, -O0):
<nsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,%eax,%eax
mov    -0x10(%rbp),%rcx
imul   $0x3e8,%ecx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3b9aca00,0x10(%rsp),%ecx
3b
imul   $0x3e8,0x8(%rsp),%eax
add    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @nsec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 1000
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @nsec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = mul nsw i32 %10, 1000
%12 = add nsw i32 %11, %7
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ info_msg(char *);
void cmd_help(char *arg) {
  info_msg(
      "To get started with cmus, read cmus-tutorial(7) and cmus(1) man pages");
}


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

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

LLVM IR (-O0):
@.str = [70 x i8] c"To get started with cmus, read cmus-tutorial(7) and cmus(1) man pages\00"
define void @cmd_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @info_msg(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"To get started with cmus, read cmus-tutorial(7) and cmus(1) man pages\00"
define void @cmd_help(i8* nocapture readnone %0) {
%2 = tail call i32 @info_msg(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ perror(char *);
void *xmalloc(int size) {
  void *mem;
  if (size < 1) {
    size = 1;
  }
  mem = malloc(size);
  if (mem == NULL) {
    perror("xmalloc");
  }
  return mem;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    113c <xmalloc+0x1c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <xmalloc+0x3f>
lea    0xea6(%rip),%rdi
call   1040 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
test   %edi,%edi
mov    $0x1,%eax
cmovle %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113d <xmalloc+0x1d>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
jmp    1138 <xmalloc+0x18>

LLVM IR (-O0):
@.str = [8 x i8] c"xmalloc\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %7
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"xmalloc\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = select i1 %2, i32 %0, i32 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reset_virtual_fifo();
void _cc3_camera_reset() {
  printf("cc3_camera_reset()\n");
  reset_virtual_fifo();
}


x86 assembly (clang, -O0):
<_cc3_camera_reset>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <reset_virtual_fifo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cc3_camera_reset>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <reset_virtual_fifo@plt>

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

LLVM IR (-O2):
@str = [19 x i8] c"cc3_camera_reset()\00"
define void @_cc3_camera_reset() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @reset_virtual_fifo()
ret void
}
int sysfs_create_link(struct kobject *kobj, struct kobject *target,
                      const char *name) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
define i32 @sysfs_create_link(%struct.kobject* %0, %struct.kobject* %1, i8* %2) {
%4 = alloca %struct.kobject*
%5 = alloca %struct.kobject*
%6 = alloca i8*
store %struct.kobject* %0, %struct.kobject** %4
store %struct.kobject* %1, %struct.kobject** %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.kobject = type opaque
define i32 @sysfs_create_link(%struct.kobject* nocapture readnone %0, %struct.kobject* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void usage(char const *imgname) {
  printf("Usage: %s image.hss\n", imgname);
  exit(255);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s image.hss\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 255)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s image.hss\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 255)
unreachable
}
/* Type definitions */
typedef size_t uint32_t;
typedef int int16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprintfChannelMatlab(FILE *pFile, int16_t *array, uint32_t size) {
  for (uint32_t i = 0; i < size; ++i) {
    fprintf(pFile, "%d ", array[i]);
  }
}


x86 assembly (clang, -O0):
<fprintfChannelMatlab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1166 <fprintfChannelMatlab+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <fprintfChannelMatlab+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprintfChannelMatlab>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rdx,%rdx
je     1148 <fprintfChannelMatlab+0x38>
mov    %rdx,%r13
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xed0(%rip),%r12
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <fprintfChannelMatlab+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @fprintfChannelMatlab(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %19, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i32*, i32** %4
%14 = load i32*, i32** %5
%15 = load i64, i64* %7
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %12
%20 = load i64, i64* %7
%21 = add i64 %20, 1
store i64 %21, i64* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @fprintfChannelMatlab(i32* nocapture %0, i32* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %2
br i1 %12, label %5, label %6
}
/* Variables and functions */
int write(int, void *, int);
int libc_write(int fd, void *a, int nbytes) { return write(fd, a, nbytes); }


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

x86 assembly (clang, -O2):
<libc_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @libc_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ACCOUNT_clientLoginResRecv(char *, int);
int dbsvproto_ClientLoginRes_recv(int _c, char *info, int size) {
  if (!ACCOUNT_clientLoginResRecv(info, size)) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<dbsvproto_ClientLoginRes_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <ACCOUNT_clientLoginResRecv@plt>
cmp    $0x0,%eax
jne    1143 <dbsvproto_ClientLoginRes_recv+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <dbsvproto_ClientLoginRes_recv+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbsvproto_ClientLoginRes_recv>:
push   %rax
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <ACCOUNT_clientLoginResRecv@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @dbsvproto_ClientLoginRes_recv(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @ACCOUNT_clientLoginResRecv(i8* %1, i32 %2)
%5 = icmp eq i32 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ recursion_check();
void os_error(const char *message) {
  recursion_check();
  printf("Operating system error: ");
  printf("%s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<os_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <recursion_check@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<os_error>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <recursion_check@plt>
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Operating system error: \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @os_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @recursion_check()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"Operating system error: \00"
define void @os_error(i8* nocapture %0) {
%2 = tail call i32 (...) @recursion_check()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *realloc(void *, size_t);
void *xrealloc(void *mem, size_t sz) {
  mem = realloc(mem, sz);
  if (!mem && sz)
    die("Out of memory");
  return mem;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <xrealloc+0x43>
cmpq   $0x0,-0x10(%rbp)
je     1163 <xrealloc+0x43>
lea    0xea2(%rip),%rdi
call   1040 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <xrealloc+0x25>
test   %r14,%r14
jne    1145 <xrealloc+0x25>
lea    0xec0(%rip),%rdi
call   1040 <die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i64, i64* %4
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %10, %2
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %3
}
/* Variables and functions */
char *strstr(char const *, char const *);
char *xstr_str(const char *s1, const char *s2) { return strstr(s1, s2); }


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

x86 assembly (clang, -O2):
<xstr_str>:
jmp    1030 <strstr@plt>

LLVM IR (-O0):
define i8* @xstr_str(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 = call i8* @strstr(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @xstr_str(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7U;
    local1 = 0UL;
    while (local1 < 0U) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 690137161UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    114b <RandomFunc+0x4b>
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp,%rax,4),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1126 <RandomFunc+0x26>
mov    -0x14(%rbp),%eax
and    $0x2922a849,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%eax
shl    $0x7,%eax
and    $0x120a000,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = zext i32 %9 to i64
%11 = and i64 %10, 914778474
%12 = shl i64 %11, 7
%13 = trunc i64 %12 to i32
%14 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %13, i32* %14
store i32 0, i32* %6
br label %15
15: ; preds = %18, %2
%16 = load i32, i32* %6
%17 = icmp ult i32 %16, 0
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%24 = load i32, i32* %23
%25 = and i32 %24, %22
store i32 %25, i32* %23
%26 = load i32, i32* %6
%27 = add i32 %26, 1
store i32 %27, i32* %6
br label %15
28: ; preds = %15
%29 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%30 = load i32, i32* %29
%31 = zext i32 %30 to i64
%32 = and i64 %31, 690137161
%33 = trunc i64 %32 to i32
%34 = load i32*, i32** %4
%35 = getelementptr inbounds i32, i32* %34, i64 0
store i32 %33, i32* %35
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 7
%5 = and i32 %4, 18915328
store i32 %5, i32* %1
ret void
}
/* Variables and functions */
int FastIntMax(int /*<<< orphan*/, int);
int /*<<< orphan*/ FastIntMin(int, int);
int FastIntClamp(int min, int max, int x) {
  return FastIntMax(FastIntMin(x, max), min);
}


x86 assembly (clang, -O0):
<FastIntClamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <FastIntMin@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1030 <FastIntMax@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastIntClamp>:
push   %rbx
mov    %edi,%ebx
mov    %edx,%edi
call   1040 <FastIntMin@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <FastIntMax@plt>

LLVM IR (-O0):
define i32 @FastIntClamp(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = call i32 @FastIntMin(i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @FastIntMax(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @FastIntClamp(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @FastIntMin(i32 %2, i32 %1)
%5 = tail call i32 @FastIntMax(i32 %4, i32 %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("################################################\n");
  printf("################################################\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
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
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str.1 = [49 x i8] c"################################################\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.1, i64 0, i64 0))
ret i32 0
}