xunge/DecIR huggingface dataset:
void DecodeAC(int index, int *matrix) {
  int *mptr;
  for (mptr = matrix + index; mptr < matrix + 64; mptr++) {
    *mptr = 0;
  }
}


x86 assembly (clang, -O0):
<DecodeAC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x100,%rcx
cmp    %rcx,%rax
jae    1151 <DecodeAC+0x51>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    111e <DecodeAC+0x1e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DecodeAC>:
cmp    $0x3f,%edi
jg     1134 <DecodeAC+0x24>
push   %rax
movslq %edi,%rax
lea    (%rsi,%rax,4),%rdi
shl    $0x2,%rax
mov    $0x100,%edx
sub    %rax,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @DecodeAC(i32 %0, i32* nocapture writeonly %1) {
%3 = sext i32 %0 to i64
%4 = icmp slt i32 %0, 64
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = getelementptr i32, i32* %1, i64 %3
%7 = bitcast i32* %6 to i8*
%8 = mul nsw i64 %3, -4
%9 = add nsw i64 %8, 256
br label %10
10: ; preds = %5, %2
ret void
}
void raw_safe_halt(void) { __asm__ __volatile__("sti; hlt" : : : "memory"); }


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

x86 assembly (clang, -O2):
<raw_safe_halt>:
sti
hlt
ret

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

LLVM IR (-O2):
define void @raw_safe_halt() {
tail call void asm sideeffect "sti; hlt", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int fibo1(int);
int main() {
  int x = 5;
  int result = fibo1(x);
  if (result == 5) {
    __VERIFIER_error();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fibo1@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jne    1152 <main+0x32>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <fibo1@plt>
cmp    $0x5,%eax
jne    1137 <main+0x17>
xor    %eax,%eax
call   1040 <__VERIFIER_error@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
store i32 5, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fibo1(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 5
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @__VERIFIER_error()
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fibo1(i32 5)
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_error()
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 10, y = 20;
  if (x < y)
    printf("x: %d is less than y: %d", x, y);
  else
    printf("comparison is false");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1152 <main+0x42>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1160 <main+0x50>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"x: %d is less than y: %d\00"
@.str.1 = [20 x i8] c"comparison is false\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
br label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"x: %d is less than y: %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int end_time();
uint64_t benchmark_end(uint64_t begin) {
  uint64_t diff = end_time() - begin;
  if (diff >= 0x80000000)
    diff = -1;
  return diff;
}


x86 assembly (clang, -O0):
<benchmark_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <end_time@plt>
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x80000000,-0x8(%rbp)
jb     113c <benchmark_end+0x2c>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark_end>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <end_time@plt>
sub    %ebx,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @benchmark_end(i32 %0) {
%2 = tail call i32 (...) @end_time()
%3 = sub nsw i32 %2, %0
%4 = icmp sgt i32 %3, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
void psi_set_uint32_le(void *buf, unsigned idx, unsigned long val) {
  unsigned char *tmp;
  tmp = (unsigned char *)buf + idx;
  tmp[0] = val & 0xff;
  tmp[1] = (val >> 8) & 0xff;
  tmp[2] = (val >> 16) & 0xff;
  tmp[3] = (val >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<psi_set_uint32_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_set_uint32_le>:
mov    %esi,%eax
mov    %edx,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @psi_set_uint32_le(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8* %11, i8** %7
%12 = load i64, i64* %6
%13 = and i64 %12, 255
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %7
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 %14, i8* %16
%17 = load i64, i64* %6
%18 = lshr i64 %17, 8
%19 = and i64 %18, 255
%20 = trunc i64 %19 to i8
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i64, i64* %6
%24 = lshr i64 %23, 16
%25 = and i64 %24, 255
%26 = trunc i64 %25 to i8
%27 = load i8*, i8** %7
%28 = getelementptr inbounds i8, i8* %27, i64 2
store i8 %26, i8* %28
%29 = load i64, i64* %6
%30 = lshr i64 %29, 24
%31 = and i64 %30, 255
%32 = trunc i64 %31 to i8
%33 = load i8*, i8** %7
%34 = getelementptr inbounds i8, i8* %33, i64 3
store i8 %32, i8* %34
ret void
}

LLVM IR (-O2):
define void @psi_set_uint32_le(i8* nocapture writeonly %0, i32 %1, i64 %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = trunc i64 %2 to i8
store i8 %6, i8* %5
%7 = lshr i64 %2, 8
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %9
%10 = lshr i64 %2, 16
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %5, i64 2
store i8 %11, i8* %12
%13 = lshr i64 %2, 24
%14 = trunc i64 %13 to i8
%15 = getelementptr inbounds i8, i8* %5, i64 3
store i8 %14, i8* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ failtest(char *, int, char *);
void test_test_3() {
  ;
  failtest("testing %d %s", 1, "two");
  { return; };
}


x86 assembly (clang, -O0):
<test_test_3>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
lea    0xee7(%rip),%rdx
call   1030 <failtest@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_test_3>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rdx
mov    $0x1,%esi
jmp    1030 <failtest@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"testing %d %s\00"
@.str.1 = [4 x i8] c"two\00"
define void @test_test_3() {
%1 = call i32 @failtest(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"testing %d %s\00"
@.str.1 = [4 x i8] c"two\00"
define void @test_test_3() {
%1 = tail call i32 @failtest(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void _Jv_Realloc() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_Realloc() {
ret void
}
double mus_little_endian_double(unsigned char *inp) {
  double o;
  int i;
  unsigned char *outp;
  outp = (unsigned char *)&o;
  for (i = 0; i < 8; i++)
    outp[i] = inp[i];
  return (o);
}


x86 assembly (clang, -O0):
<mus_little_endian_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1145 <mus_little_endian_double+0x45>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <mus_little_endian_double+0x17>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_little_endian_double>:
movsd  (%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @mus_little_endian_double(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ error_msg(char *, char const *);
int /*<<< orphan*/ *find_filter(char const *);
int ensure_filter_name(const char *name, int sel_stat) {
  if (find_filter(name) == NULL) {
    error_msg("no such filter %s", name);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ensure_filter_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <find_filter@plt>
cmp    $0x0,%rax
jne    115e <ensure_filter_name+0x3e>
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1030 <error_msg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <ensure_filter_name+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_filter_name>:
push   %rbx
mov    %rdi,%rbx
call   1040 <find_filter@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <ensure_filter_name+0x15>
pop    %rbx
ret
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <error_msg@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"no such filter %s\00"
define i32 @ensure_filter_name(i8* %0, i32 %1) {
%3 = tail call i32* @find_filter(i8* %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error_msg(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(int);
scalar_t__ isprint(int);
int /*<<< orphan*/ isspace(int);
int ispunct(int c) { return isprint(c) && !isalnum(c) && !isspace(c); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1180 <ispunct+0x50>
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <isprint@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115a <ispunct+0x2a>
mov    %ebp,%edi
call   1030 <isalnum@plt>
test   %eax,%eax
jne    115a <ispunct+0x2a>
mov    %ebp,%edi
call   1040 <isspace@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isprint(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @isalnum(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @isspace(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6, %1
%16 = phi i1 [ false, %6 ], [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @isalnum(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @isspace(i32 %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
size_t strlen(char const *);
size_t mutt_strlen(const char *a) { return a ? strlen(a) : 0; }


x86 assembly (clang, -O0):
<mutt_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <mutt_strlen+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <mutt_strlen+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <mutt_strlen+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutt_strlen>:
test   %rdi,%rdi
je     111a <mutt_strlen+0xa>
jmp    1030 <strlen@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @mutt_strlen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i64 [ %7, %5 ], [ 0, %8 ]
ret i64 %10
}

LLVM IR (-O2):
define i64 @mutt_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ add_browsermatch(char *, char *);
void c_add_browserm(char *v1, char *v2, void *t) { add_browsermatch(v1, v2); }


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

x86 assembly (clang, -O2):
<c_add_browserm>:
jmp    1030 <add_browsermatch@plt>

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

LLVM IR (-O2):
define void @c_add_browserm(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @add_browsermatch(i8* %0, i8* %1)
ret void
}
int send_file() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @send_file() {
ret i32 0
}
void glTexImage2D(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glTexImage2D() {
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_bpchardoublefunc(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_bpchardoublefunc() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_bpchardoublefunc() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_insert(struct list *, struct list *);
void list_append(struct list *list, struct list *new_link) {
  list_insert((struct list *)list, new_link);
}


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

x86 assembly (clang, -O2):
<list_append>:
jmp    1030 <list_insert@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_append(%struct.list* %0, %struct.list* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list*
store %struct.list* %0, %struct.list** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load %struct.list*, %struct.list** %4
%7 = call i32 @list_insert(%struct.list* %5, %struct.list* %6)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_append(%struct.list* %0, %struct.list* %1) {
%3 = tail call i32 @list_insert(%struct.list* %0, %struct.list* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *argv0) {
  fprintf(stderr, "Usage: %s <destination ip> <server advert>\n", argv0);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: %s <destination ip> <server advert>\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: %s <destination ip> <server advert>\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_LITTLE_GUY_RESET_INPUT() { clear_io_bit(0x72, 6); }


x86 assembly (clang, -O0):
<TOSH_MAKE_LITTLE_GUY_RESET_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x72,%edi
mov    $0x6,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_LITTLE_GUY_RESET_INPUT>:
mov    $0x72,%edi
mov    $0x6,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_LITTLE_GUY_RESET_INPUT() {
%1 = call i32 @clear_io_bit(i32 114, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_LITTLE_GUY_RESET_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 114, i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Snippet(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("usage: query <filename>\n");
    return 0;
  }
  Snippet(argv[1]);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <Snippet@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1131 <main+0x11>
mov    0x8(%rsi),%rdi
call   1040 <Snippet@plt>
jmp    113d <main+0x1d>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"usage: query <filename>\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* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @Snippet(i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@str = [24 x i8] c"usage: query <filename>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @Snippet(i8* %8)
br label %10
10: ; preds = %6, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
unsigned short f();
unsigned short g();
main() {
  if (f() != (unsigned short)-1)
    abort();
  if (g() != (unsigned short)-1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
movzwl %ax,%eax
cmp    $0xffff,%eax
je     116b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1050 <g@plt>
movzwl %ax,%eax
cmp    $0xffff,%eax
je     1187 <main+0x47>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
cmp    $0xffff,%ax
jne    1162 <main+0x22>
xor    %eax,%eax
call   1050 <g@plt>
cmp    $0xffff,%ax
jne    1162 <main+0x22>
xor    %edi,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call zeroext i16 (...) @f()
%3 = zext i16 %2 to i32
%4 = icmp ne i32 %3, 65535
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call zeroext i16 (...) @g()
%9 = zext i16 %8 to i32
%10 = icmp ne i32 %9, 65535
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call zeroext i16 (...) @f()
%2 = icmp eq i16 %1, -1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call zeroext i16 (...) @g()
%7 = icmp eq i16 %6, -1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @exit(i32 0)
unreachable
}
void transfer_YUV444P_to_YUV444P(unsigned char *input_y, unsigned char *input_u,
                                 unsigned char *input_v,
                                 unsigned char *output_y,
                                 unsigned char *output_u,
                                 unsigned char *output_v, int j) {
  output_y[j] = *input_y;
  output_u[j] = *input_u;
  output_v[j] = *input_v;
}


x86 assembly (clang, -O0):
<transfer_YUV444P_to_YUV444P>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x20(%rbp),%rax
movslq 0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    (%rax),%dl
mov    -0x28(%rbp),%rax
movslq 0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%dl
mov    -0x30(%rbp),%rax
movslq 0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_YUV444P_to_YUV444P>:
movslq 0x8(%rsp),%r10
mov    (%rdi),%al
mov    %al,(%rcx,%r10,1)
mov    (%rsi),%al
mov    %al,(%r8,%r10,1)
mov    (%rdx),%al
mov    %al,(%r9,%r10,1)
ret

LLVM IR (-O0):
define void @transfer_YUV444P_to_YUV444P(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load i8*, i8** %8
%16 = load i8, i8* %15
%17 = load i8*, i8** %11
%18 = load i32, i32* %14
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
store i8 %16, i8* %20
%21 = load i8*, i8** %9
%22 = load i8, i8* %21
%23 = load i8*, i8** %12
%24 = load i32, i32* %14
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
%27 = load i8*, i8** %10
%28 = load i8, i8* %27
%29 = load i8*, i8** %13
%30 = load i32, i32* %14
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
store i8 %28, i8* %32
ret void
}

LLVM IR (-O2):
define void @transfer_YUV444P_to_YUV444P(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture writeonly %3, i8* nocapture writeonly %4, i8* nocapture writeonly %5, i32 %6) {
%8 = load i8, i8* %0
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds i8, i8* %3, i64 %9
store i8 %8, i8* %10
%11 = load i8, i8* %1
%12 = getelementptr inbounds i8, i8* %4, i64 %9
store i8 %11, i8* %12
%13 = load i8, i8* %2
%14 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 %13, i8* %14
ret void
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
int is_update_in_progress() {
  outb(0x70, 0x0a);
  return inb(0x71) & 0x80;
}


x86 assembly (clang, -O0):
<is_update_in_progress>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
mov    $0x71,%edi
call   1040 <inb@plt>
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_update_in_progress>:
push   %rax
mov    $0x70,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
mov    $0x71,%edi
call   1040 <inb@plt>
and    $0x80,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_update_in_progress() {
%1 = call i32 @outb(i32 112, i32 10)
%2 = call i32 @inb(i32 113)
%3 = and i32 %2, 128
ret i32 %3
}

LLVM IR (-O2):
define i32 @is_update_in_progress() {
%1 = tail call i32 @outb(i32 112, i32 10)
%2 = tail call i32 @inb(i32 113)
%3 = and i32 %2, 128
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ colmgr_reset();
void setup(void) { colmgr_reset(); }


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

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

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

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 (...) @colmgr_reset()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *stdout;
void output_end(FILE *outp) {
  if (outp != stdout)
    fflush(outp);
  else
    fprintf(outp, "---\n");
}


x86 assembly (clang, -O0):
<output_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%rax
je     114e <output_end+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
jmp    115e <output_end+0x3e>
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_end>:
mov    %rdi,%rcx
mov    0x2eb6(%rip),%rax
cmp    %rdi,(%rax)
je     1137 <output_end+0x17>
mov    %rcx,%rdi
jmp    1030 <fflush@plt>
lea    0xec2(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@stdout = global i32* null
@.str = [5 x i8] c"---\0A\00"
define void @output_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32*, i32** @stdout
%5 = icmp ne i32* %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32*, i32** %2
%8 = call i32 @fflush(i32* %7)
br label %12
9: ; preds = %1
%10 = load i32*, i32** %2
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [5 x i8] c"---\0A\00"
define void @output_end(i32* nocapture %0) {
%2 = load i32*, i32** @stdout
%3 = icmp eq i32* %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fflush(i32* %0)
br label %8
6: ; preds = %1
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
br label %8
8: ; preds = %6, %4
ret void
}
long powint(int factor, unsigned int exponent) {
  long product = 1;
  while (exponent--)
    product *= factor;
  return product;
}


x86 assembly (clang, -O0):
<powint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1138 <powint+0x38>
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1112 <powint+0x12>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<powint>:
test   %esi,%esi
je     111b <powint+0x1b>
movslq %edi,%rcx
lea    -0x1(%rsi),%eax
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x7,%eax
jae    1121 <powint+0x21>
mov    $0x1,%eax
jmp    1155 <powint+0x55>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
nopl   0x0(%rax)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xfffffff8,%esi
jne    1130 <powint+0x30>
test   %edx,%edx
je     1169 <powint+0x69>
nopl   0x0(%rax)
imul   %rcx,%rax
add    $0xffffffff,%edx
jne    1160 <powint+0x60>
ret

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

LLVM IR (-O2):
define i64 @powint(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %34, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 1, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = mul nsw i64 %12, %5
%15 = mul nsw i64 %14, %5
%16 = mul nsw i64 %15, %5
%17 = mul nsw i64 %16, %5
%18 = mul nsw i64 %17, %5
%19 = mul nsw i64 %18, %5
%20 = mul nsw i64 %19, %5
%21 = mul nsw i64 %20, %5
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi i64 [ undef, %4 ], [ %21, %11 ]
%26 = phi i64 [ 1, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi i64 [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = mul nsw i64 %29, %5
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi i64 [ 1, %2 ], [ %25, %24 ], [ %31, %28 ]
ret i64 %35
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void write_u16_le(unsigned char *buf, uint16_t n) {
  buf[1] = n >> 8 & 0xff;
  buf[0] = n & 0xff;
}


x86 assembly (clang, -O0):
<write_u16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_u16_le>:
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @write_u16_le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @write_u16_le(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %5
%6 = trunc i32 %1 to i8
store i8 %6, i8* %0
ret void
}
int minthree(int a, int b, int c) {
  return ((((a < b) ? a : b) < c) ? ((a < b) ? a : b) : c);
}


x86 assembly (clang, -O0):
<minthree>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <minthree+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112a <minthree+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <minthree+0x5e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114d <minthree+0x4d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1153 <minthree+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1164 <minthree+0x64>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minthree>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
cmp    %edx,%eax
cmovge %edx,%eax
ret

LLVM IR (-O0):
define i32 @minthree(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %4
br label %14
12: ; preds = %3
%13 = load i32, i32* %5
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = load i32, i32* %4
br label %26
24: ; preds = %18
%25 = load i32, i32* %5
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
br label %30
28: ; preds = %14
%29 = load i32, i32* %6
br label %30
30: ; preds = %28, %26
%31 = phi i32 [ %27, %26 ], [ %29, %28 ]
ret i32 %31
}

LLVM IR (-O2):
define i32 @minthree(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
%6 = icmp slt i32 %5, %2
%7 = select i1 %6, i32 %5, i32 %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x94() {
  Assert_real((islower(148) == 0),
              "/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/ctype/test_islower.c",
              745, ("islower should be 0 for 0x94"));
}


x86 assembly (clang, -O0):
<t_islower_0x94>:
push   %rbp
mov    %rsp,%rbp
mov    $0x94,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2e9,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x94>:
push   %rax
mov    $0x94,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x94\00"
define void @t_islower_0x94() {
%1 = call i64 @islower(i32 148)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x94\00"
define void @t_islower_0x94() {
%1 = tail call i64 @islower(i32 148)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo749(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo749(i32 %0) {
ret void
}
/* Type definitions */
struct mem_region {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __coverity_free__(void *);
void mem_free(struct mem_region *region, void *mem, const char *location) {
  __coverity_free__(mem);
}


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

x86 assembly (clang, -O2):
<mem_free>:
mov    %rsi,%rdi
jmp    1030 <__coverity_free__@plt>

LLVM IR (-O0):
%struct.mem_region = type { i32 }
define void @mem_free(%struct.mem_region* %0, i8* %1, i8* %2) {
%4 = alloca %struct.mem_region*
%5 = alloca i8*
%6 = alloca i8*
store %struct.mem_region* %0, %struct.mem_region** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = call i32 @__coverity_free__(i8* %7)
ret void
}

LLVM IR (-O2):
%struct.mem_region = type { i32 }
define void @mem_free(%struct.mem_region* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @__coverity_free__(i8* %1)
ret void
}
void OnNoFullscreenSetWindow(int x, int y, int width, int height) {}


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

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

LLVM IR (-O0):
define void @OnNoFullscreenSetWindow(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @OnNoFullscreenSetWindow(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int defcmp(const char *s1, const char *s2) {
  if ((long long)(size_t)s1 < (long long)(size_t)s2)
    return -1;
  return (long long)(size_t)s1 > (long long)(size_t)s2;
}


x86 assembly (clang, -O0):
<defcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jge    1129 <defcmp+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <defcmp+0x3f>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @defcmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp slt i8* %0, %1
%4 = icmp sgt i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
void gdk_window_get_position() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_get_position() {
ret void
}
/* Variables and functions */
int nrf_802154_request_sleep(int);
bool nrf_802154_sleep(void) {
  bool result;
  (void)(0x0001UL);
  result = nrf_802154_request_sleep(0x01);
  (void)(0x0001UL);
  return result;
}


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

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

LLVM IR (-O0):
define i32 @nrf_802154_sleep() {
%1 = alloca i32
%2 = call i32 @nrf_802154_request_sleep(i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @nrf_802154_sleep() {
%1 = tail call i32 @nrf_802154_request_sleep(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ g_store(int);
void astore2(void) { g_store(2); }


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

x86 assembly (clang, -O2):
<astore2>:
mov    $0x2,%edi
jmp    1030 <g_store@plt>

LLVM IR (-O0):
define void @astore2() {
%1 = call i32 @g_store(i32 2)
ret void
}

LLVM IR (-O2):
define void @astore2() {
%1 = tail call i32 @g_store(i32 2)
ret void
}
void pcie_walk_rcec(struct pci_dev *rcec, int (*cb)(struct pci_dev *, void *),
                    void *userdata) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pcie_walk_rcec(%struct.pci_dev* nocapture %0, i32 (%struct.pci_dev*, i8*)* nocapture %1, i8* nocapture %2) {
ret void
}
int get_pclk1(void) { return 36000000; }


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

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

LLVM IR (-O0):
define i32 @get_pclk1() {
ret i32 36000000
}

LLVM IR (-O2):
define i32 @get_pclk1() {
ret i32 36000000
}