xunge/DecIR huggingface dataset:
unsigned int power2gt(unsigned int x) {
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  return x + 1;
}


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

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

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

LLVM IR (-O2):
define i32 @power2gt(i32 %0) {
%2 = lshr i32 %0, 1
%3 = or i32 %2, %0
%4 = lshr i32 %3, 2
%5 = or i32 %4, %3
%6 = lshr i32 %5, 4
%7 = or i32 %6, %5
%8 = lshr i32 %7, 8
%9 = or i32 %8, %7
%10 = lshr i32 %9, 16
%11 = or i32 %10, %9
%12 = add i32 %11, 1
ret i32 %12
}
long echo_no(string, flag)
char *string[];
long *flag;
{
  *flag = 1L;
  return (1);
}


x86 assembly (clang, -O0):
<echo_no>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x1,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<echo_no>:
movq   $0x1,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @echo_no(i8** nocapture readnone %0, i64* nocapture writeonly %1) {
store i64 1, i64* %1
ret i64 1
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ setup_screen();
int main() {
  setup_screen();
  cleanup_screen();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setup_screen@plt>
mov    $0x0,%al
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup_screen()
%3 = call i32 (...) @cleanup_screen()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @setup_screen()
%2 = tail call i32 (...) @cleanup_screen()
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
char *arg_param(char *arg) {
  char *p = strchr(arg, ':');
  if (p)
    return ++p;
  else
    return p;
}


x86 assembly (clang, -O0):
<arg_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114e <arg_param+0x3e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1156 <arg_param+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_param>:
push   %rax
mov    $0x3a,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @arg_param(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
time_t now() {
  time_t t;
  t = time(NULL);
  return t;
}


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

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

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

LLVM IR (-O2):
define i32 @now() {
%1 = tail call i32 @time(i32* null)
ret i32 %1
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, res;
  scanf("%d", &num);
  res = is_prime(num);
  printf("%d\n", res);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void update_tag(void *p, unsigned long tag) {
  unsigned long *ptr = p;
  *ptr = tag | (~3UL & *ptr);
}


x86 assembly (clang, -O0):
<update_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
and    $0xfffffffffffffffc,%rax
or     %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_tag>:
mov    (%rdi),%rax
and    $0xfffffffffffffffc,%rax
or     %rsi,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @update_tag(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = load i64, i64* %4
%9 = load i64*, i64** %5
%10 = load i64, i64* %9
%11 = and i64 -4, %10
%12 = or i64 %8, %11
%13 = load i64*, i64** %5
store i64 %12, i64* %13
ret void
}

LLVM IR (-O2):
define void @update_tag(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = and i64 %4, -4
%6 = or i64 %5, %1
store i64 %6, i64* %3
ret void
}
int remote_status(exit_code_ptr, signal_ptr, coredump_ptr, block)
int *exit_code_ptr, *signal_ptr, *coredump_ptr;
int block;
{ return -1; }


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

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

LLVM IR (-O0):
define i32 @remote_status(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 i32 -1
}

LLVM IR (-O2):
define i32 @remote_status(i32* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32 %3) {
ret i32 -1
}
char *ckstrrchr(char *s, char c) {
  char *s2 = 0L;
  if (!s)
    return (0L);
  while (*s) {
    if (*s == c)
      s2 = s;
    s++;
  }
  return (s2);
}


x86 assembly (clang, -O0):
<ckstrrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112e <ckstrrchr+0x2e>
movq   $0x0,-0x8(%rbp)
jmp    1174 <ckstrrchr+0x74>
jmp    1133 <ckstrrchr+0x33>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116c <ckstrrchr+0x6c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    115b <ckstrrchr+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1133 <ckstrrchr+0x33>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @ckstrrchr(i8* %0, i8 signext %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %14, %7 ], [ %5, %4 ]
%9 = phi i8* [ %12, %7 ], [ null, %4 ]
%10 = phi i8* [ %13, %7 ], [ %0, %4 ]
%11 = icmp eq i8 %8, %1
%12 = select i1 %11, i8* %10, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %4, %2
%17 = phi i8* [ null, %2 ], [ null, %4 ], [ %12, %7 ]
ret i8* %17
}
/* Variables and functions */
scalar_t__ malloc(int const);
int *vector_int_alloc(const int dimension) {
  int *Vector;
  Vector = (int *)malloc(dimension * sizeof(int));
  return Vector;
}


x86 assembly (clang, -O0):
<vector_int_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_int_alloc>:
shl    $0x2,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @vector_int_alloc(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 4
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define i32* @vector_int_alloc(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
/* Variables and functions */
size_t strlen(const char *c) {
  size_t r = 0;
  while (*c++)
    r++;
  return r;
}


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

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int is_compression_bomb(size_t size_in, size_t size_out) {
  if (size_in == 0 || size_out < (1024 * 64))
    return 0;
  return (size_out / size_in > 25);
}


x86 assembly (clang, -O0):
<is_compression_bomb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1125 <is_compression_bomb+0x25>
cmpq   $0x10000,-0x18(%rbp)
jae    1131 <is_compression_bomb+0x31>
movl   $0x0,-0x4(%rbp)
jmp    114c <is_compression_bomb+0x4c>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    $0x19,%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_compression_bomb>:
xor    %eax,%eax
test   %rdi,%rdi
je     113a <is_compression_bomb+0x3a>
cmp    $0x10000,%rsi
jb     113a <is_compression_bomb+0x3a>
mov    %rsi,%rax
or     %rdi,%rax
shr    $0x20,%rax
je     1129 <is_compression_bomb+0x29>
mov    %rsi,%rax
xor    %edx,%edx
div    %rdi
mov    %rax,%rcx
jmp    1131 <is_compression_bomb+0x31>
mov    %esi,%eax
xor    %edx,%edx
div    %edi
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1a,%rcx
setae  %al
ret

LLVM IR (-O0):
define i32 @is_compression_bomb(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i64, i64* %5
%10 = icmp ult i64 %9, 65536
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 0, i32* %3
br label %18
12: ; preds = %8
%13 = load i64, i64* %5
%14 = load i64, i64* %4
%15 = udiv i64 %13, %14
%16 = icmp ugt i64 %15, 25
%17 = zext i1 %16 to i32
store i32 %17, i32* %3
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_compression_bomb(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp ult i64 %1, 65536
%5 = or i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = udiv i64 %1, %0
%8 = icmp ugt i64 %7, 25
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x61() {
  Assert_real((isbdigit(97) == 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_isbdigit.c",
              490, ("isbdigit should be 0 for a"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x61>:
push   %rax
mov    $0x61,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1ea,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for a\00"
define void @t_isbdigit_0x61() {
%1 = call i64 @isbdigit(i32 97)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 490, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for a\00"
define void @t_isbdigit_0x61() {
%1 = tail call i64 @isbdigit(i32 97)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 490, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *get_prog();
int /*<<< orphan*/ printf(char *, ...);
void usage(void) {
  printf("    usage: %s <config_file> [pid_file]\n", get_prog());
  printf("    check syslog for debug/error messages\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_prog@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1030 <get_prog@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed8(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [40 x i8] c" usage: %s <config_file> [pid_file]\0A\00"
@.str.1 = [43 x i8] c" check syslog for debug/error messages\0A\00"
define void @usage() {
%1 = call i8* (...) @get_prog()
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c" usage: %s <config_file> [pid_file]\0A\00"
@str = [42 x i8] c" check syslog for debug/error messages\00"
define void @usage() {
%1 = tail call i8* (...) @get_prog()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_2Fuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x2F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_2Fuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3080192
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int yas_kxsd9_read_reg(unsigned char, unsigned char *, int);
int yas_kxsd9_read_reg_byte(unsigned char adr) {
  unsigned char buf;
  int err;
  err = yas_kxsd9_read_reg(adr, &buf, 1);
  if (err == 0) {
    return buf;
  }
  return 0;
}


x86 assembly (clang, -O0):
<yas_kxsd9_read_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x1,%edx
movzbl -0x5(%rbp),%edi
call   1030 <yas_kxsd9_read_reg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1149 <yas_kxsd9_read_reg_byte+0x39>
movzbl -0x6(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <yas_kxsd9_read_reg_byte+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_kxsd9_read_reg_byte>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_kxsd9_read_reg@plt>
xor    %ecx,%ecx
test   %eax,%eax
movzbl 0x7(%rsp),%eax
cmovne %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @yas_kxsd9_read_reg_byte(i8 zeroext %0) {
%2 = alloca i8
%3 = call i32 @yas_kxsd9_read_reg(i8 zeroext %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 0
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 0
ret i32 %7
}
void mlx5e_arfs_destroy_tables(struct mlx5e_priv *priv) {}


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

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

LLVM IR (-O0):
%struct.mlx5e_priv = type opaque
define void @mlx5e_arfs_destroy_tables(%struct.mlx5e_priv* %0) {
%2 = alloca %struct.mlx5e_priv*
store %struct.mlx5e_priv* %0, %struct.mlx5e_priv** %2
ret void
}

LLVM IR (-O2):
%struct.mlx5e_priv = type opaque
define void @mlx5e_arfs_destroy_tables(%struct.mlx5e_priv* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  const char *prog;
  prog = getprogname();
  fprintf(
      stderr,
      "usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\n"
      "\t[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\n"
      "\t[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\n"
      "\t[-N userdb-dir] image-file directory | manifest [extra-directory "
      "...]\n",
      prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,-0x8(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1030 <getprogname@plt>
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%edi
lea    0xeb8(%rip),%rsi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [269 x i8] c"usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\0A\09[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\0A\09[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\0A\09[-N userdb-dir] image-file directory | manifest [extra-directory ...]\0A\00"
define void @usage() {
%1 = alloca i8*
%2 = call i8* (...) @getprogname()
store i8* %2, i8** %1
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %1
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [269 x i8] c"usage: %s [-t fs-type] [-o fs-options] [-d debug-mask] [-B endian]\0A\09[-S sector-size] [-M minimum-size] [-m maximum-size] [-s image-size]\0A\09[-b free-blocks] [-f free-files] [-F mtree-specfile] [-px]\0A\09[-N userdb-dir] image-file directory | manifest [extra-directory ...]\0A\00"
define void @usage() {
%1 = tail call i8* (...) @getprogname()
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t base16_encode_size(size_t in_len) { return (in_len * 2) + 1; }


x86 assembly (clang, -O0):
<base16_encode_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base16_encode_size>:
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @base16_encode_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 2
%5 = add i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @base16_encode_size(i64 %0) {
%2 = shl i64 %0, 1
%3 = or i64 %2, 1
ret i64 %3
}
int validator(int pValidator) {
  if (pValidator >= (-1000) && pValidator <= 1000) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<validator>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xfffffc18,-0x8(%rbp)
jl     112d <validator+0x2d>
cmpl   $0x3e8,-0x8(%rbp)
jg     112d <validator+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <validator+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validator>:
add    $0x3e8,%edi
xor    %eax,%eax
cmp    $0x7d1,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @validator(i32 %0) {
%2 = add i32 %0, 1000
%3 = icmp ult i32 %2, 2001
%4 = zext i1 %3 to i32
ret i32 %4
}
int updatebit_c(int num, int i, int v) {
  if (v)
    return num |= (1 << i);
  else
    return num &= ~(1 << i);
}


x86 assembly (clang, -O0):
<updatebit_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     112f <updatebit_c+0x2f>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1145 <updatebit_c+0x45>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<updatebit_c>:
mov    %edi,%eax
bts    %esi,%eax
btr    %esi,%edi
test   %edx,%edx
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @updatebit_c(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %6
%12 = shl i32 1, %11
%13 = load i32, i32* %5
%14 = or i32 %13, %12
store i32 %14, i32* %5
store i32 %14, i32* %4
br label %21
15: ; preds = %3
%16 = load i32, i32* %6
%17 = shl i32 1, %16
%18 = xor i32 %17, -1
%19 = load i32, i32* %5
%20 = and i32 %19, %18
store i32 %20, i32* %5
store i32 %20, i32* %4
br label %21
21: ; preds = %15, %10
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @updatebit_c(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = shl nuw i32 1, %1
%6 = or i32 %5, %0
%7 = xor i32 %5, -1
%8 = and i32 %7, %0
%9 = select i1 %4, i32 %8, i32 %6
ret i32 %9
}
void pramcache_load_bdev_cache(struct super_block *sb) {}


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

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

LLVM IR (-O0):
%struct.super_block = type opaque
define void @pramcache_load_bdev_cache(%struct.super_block* %0) {
%2 = alloca %struct.super_block*
store %struct.super_block* %0, %struct.super_block** %2
ret void
}

LLVM IR (-O2):
%struct.super_block = type opaque
define void @pramcache_load_bdev_cache(%struct.super_block* nocapture %0) {
ret void
}
/* Variables and functions */
int hamming_weight(char);
int hamming_distance(char c1, char c2) { return hamming_weight(c1 ^ c2); }


x86 assembly (clang, -O0):
<hamming_distance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
xor    %ecx,%eax
movsbl %al,%edi
call   1030 <hamming_weight@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamming_distance>:
xor    %esi,%edi
jmp    1030 <hamming_weight@plt>

LLVM IR (-O0):
define i32 @hamming_distance(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = xor i32 %6, %8
%10 = trunc i32 %9 to i8
%11 = call i32 @hamming_weight(i8 signext %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @hamming_distance(i8 signext %0, i8 signext %1) {
%3 = xor i8 %1, %0
%4 = tail call i32 @hamming_weight(i8 signext %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gln_styled_string(int, char const *);
void gln_standout_string(const char *message) {
  gln_styled_string((1), message);
}


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

x86 assembly (clang, -O2):
<gln_standout_string>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <gln_styled_string@plt>

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

LLVM IR (-O2):
define void @gln_standout_string(i8* %0) {
%2 = tail call i32 @gln_styled_string(i32 1, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ p16_eeprom();
int /*<<< orphan*/ p16_int_pin();
int /*<<< orphan*/ p16_int_portb();
int /*<<< orphan*/ p16_tmr0();
int /*<<< orphan*/ p16_tmr1();
int /*<<< orphan*/ p16_tmr2();
int /*<<< orphan*/ p16_wdt();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC16F628A_periferic(void) {
  p16_int_pin();
  p16_int_portb();
  p16_tmr0();
  p16_wdt();
  p16_eeprom();
  p16_tmr1();
  p16_tmr2();
  serial(0);
}


x86 assembly (clang, -O0):
<PIC16F628A_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10a0 <p16_int_pin@plt>
mov    $0x0,%al
call   1060 <p16_int_portb@plt>
mov    $0x0,%al
call   1030 <p16_tmr0@plt>
mov    $0x0,%al
call   1080 <p16_wdt@plt>
mov    $0x0,%al
call   1090 <p16_eeprom@plt>
mov    $0x0,%al
call   1070 <p16_tmr1@plt>
mov    $0x0,%al
call   1040 <p16_tmr2@plt>
xor    %edi,%edi
call   1050 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC16F628A_periferic>:
push   %rax
xor    %eax,%eax
call   10a0 <p16_int_pin@plt>
xor    %eax,%eax
call   1060 <p16_int_portb@plt>
xor    %eax,%eax
call   1030 <p16_tmr0@plt>
xor    %eax,%eax
call   1080 <p16_wdt@plt>
xor    %eax,%eax
call   1090 <p16_eeprom@plt>
xor    %eax,%eax
call   1070 <p16_tmr1@plt>
xor    %eax,%eax
call   1040 <p16_tmr2@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <serial@plt>

LLVM IR (-O0):
define void @PIC16F628A_periferic() {
%1 = call i32 (...) @p16_int_pin()
%2 = call i32 (...) @p16_int_portb()
%3 = call i32 (...) @p16_tmr0()
%4 = call i32 (...) @p16_wdt()
%5 = call i32 (...) @p16_eeprom()
%6 = call i32 (...) @p16_tmr1()
%7 = call i32 (...) @p16_tmr2()
%8 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F628A_periferic() {
%1 = tail call i32 (...) @p16_int_pin()
%2 = tail call i32 (...) @p16_int_portb()
%3 = tail call i32 (...) @p16_tmr0()
%4 = tail call i32 (...) @p16_wdt()
%5 = tail call i32 (...) @p16_eeprom()
%6 = tail call i32 (...) @p16_tmr1()
%7 = tail call i32 (...) @p16_tmr2()
%8 = tail call i32 @serial(i32 0)
ret void
}
/* Type definitions */
struct stat {
  long st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
long filesize(const char *filename) {
  struct stat buf;
  if (!stat(filename, &buf)) {
    return buf.st_size;
  }
  return 0;
}


x86 assembly (clang, -O0):
<filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
jne    113f <filesize+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <filesize+0x37>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filesize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
jne    1123 <filesize+0x13>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @filesize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 %7, i64 0
ret i64 %8
}
void send_next_data(char *s) {}


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

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

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

LLVM IR (-O2):
define void @send_next_data(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn12(int);
void fn13(int x) { fn12(6 + (x & 15)); }


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

x86 assembly (clang, -O2):
<fn13>:
and    $0xf,%edi
add    $0x6,%edi
jmp    1030 <fn12@plt>

LLVM IR (-O0):
define void @fn13(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = add nsw i32 6, %4
%6 = call i32 @fn12(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fn13(i32 %0) {
%2 = and i32 %0, 15
%3 = add nuw nsw i32 %2, 6
%4 = tail call i32 @fn12(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ RSAPublicKey_it;
int i2d_RSAPublicKey(const RSA *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &RSAPublicKey_it);
}


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

x86 assembly (clang, -O2):
<i2d_RSAPublicKey>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@RSAPublicKey_it = global i32 0
define i32 @i2d_RSAPublicKey(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @RSAPublicKey_it)
ret i32 %7
}

LLVM IR (-O2):
@RSAPublicKey_it = global i32 0
define i32 @i2d_RSAPublicKey(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @RSAPublicKey_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lf();
int /*<<< orphan*/ printL(char const *, long);
void printLN(const char *s, long l) {
  printL(s, l);
  lf();
}


x86 assembly (clang, -O0):
<printLN>:
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 <printL@plt>
mov    $0x0,%al
call   1040 <lf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @printLN(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 i32 @printL(i8* %5, i64 %6)
%8 = call i32 (...) @lf()
ret void
}

LLVM IR (-O2):
define void @printLN(i8* %0, i64 %1) {
%3 = tail call i32 @printL(i8* %0, i64 %1)
%4 = tail call i32 (...) @lf()
ret void
}
int emac1_aoctetstransmittedok_set(unsigned int dev_id,
                                   union emac1_aoctetstransmittedok_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac1_aoctetstransmittedok_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac1_aoctetstransmittedok_u = type opaque
define i32 @emac1_aoctetstransmittedok_set(i32 %0, %union.emac1_aoctetstransmittedok_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_aoctetstransmittedok_u*
store i32 %0, i32* %3
store %union.emac1_aoctetstransmittedok_u* %1, %union.emac1_aoctetstransmittedok_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_aoctetstransmittedok_u = type opaque
define i32 @emac1_aoctetstransmittedok_set(i32 %0, %union.emac1_aoctetstransmittedok_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ test_func2();
void test_func() { test_func2(); }


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

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

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

LLVM IR (-O2):
define void @test_func() {
%1 = tail call i32 (...) @test_func2()
ret void
}
void watchdog_stop() {
  (*((volatile unsigned long *)((0x7E004000) + 0x00))) &= ~(1 << 5);
}


x86 assembly (clang, -O0):
<watchdog_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e004000,%eax
mov    (%rax),%rcx
and    $0xffffffffffffffdf,%rcx
mov    $0x7e004000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<watchdog_stop>:
andq   $0xffffffffffffffdf,0x7e004000
7e df
ret

LLVM IR (-O0):
define void @watchdog_stop() {
%1 = load volatile i64, i64* inttoptr (i64 2113945600 to i64*)
%2 = and i64 %1, -33
store volatile i64 %2, i64* inttoptr (i64 2113945600 to i64*)
ret void
}

LLVM IR (-O2):
define void @watchdog_stop() {
%1 = load volatile i64, i64* inttoptr (i64 2113945600 to i64*)
%2 = and i64 %1, -33
store volatile i64 %2, i64* inttoptr (i64 2113945600 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blackstrap_log_error(char *, int, unsigned char);
long write(int, unsigned char *, int);
int i2c_bus_send_command(int fd, unsigned char command) {
  long err = write(fd, &command, 1);
  if (err != 1) {
    blackstrap_log_error("I2C command failed: fd %d, command %d", fd, command);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<i2c_bus_send_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
je     1170 <i2c_bus_send_command+0x50>
mov    -0x8(%rbp),%esi
lea    0xea5(%rip),%rdi
movzbl -0x9(%rbp),%edx
call   1040 <blackstrap_log_error@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <i2c_bus_send_command+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_bus_send_command>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    %bpl,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x1,%rcx
je     115d <i2c_bus_send_command+0x3d>
movzbl %bpl,%edx
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
call   1040 <blackstrap_log_error@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"I2C command failed: fd %d, command %d\00"
define i32 @i2c_bus_send_command(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i64
store i32 %0, i32* %4
store i8 %1, i8* %5
%7 = load i32, i32* %4
%8 = call i64 @write(i32 %7, i8* %5, i32 1)
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = icmp ne i64 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i8, i8* %5
%14 = call i32 @blackstrap_log_error(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %12, i8 zeroext %13)
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [38 x i8] c"I2C command failed: fd %d, command %d\00"
define i32 @i2c_bus_send_command(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i64 @write(i32 %0, i8* %3, i32 1)
%5 = icmp eq i64 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @blackstrap_log_error(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0, i8 zeroext %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
clock_t clock(void) { return (clock_t)0; }


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

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

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

LLVM IR (-O2):
define i32 @clock() {
ret i32 0
}
void swap(int arr[], int p1, int p2) {
  int t = arr[p1];
  arr[p1] = arr[p2];
  arr[p2] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int strlen(char const *);
int write(int, char const *, int);
int Write_fd_str(int fd, const char *buf) {
  int n;
  n = strlen(buf);
  return write(fd, buf, n);
}


x86 assembly (clang, -O0):
<Write_fd_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-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):
<Write_fd_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @Write_fd_str(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret i32 %4
}