xunge/DecIR huggingface dataset:
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putendl(const char *s) {
  write(1, s, ft_strlen(s));
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xea7(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xec1(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
scalar_t__ alloc_ptr(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void bad_indirect_alloc(char *name) {
  char *new_name = (char *)alloc_ptr(strlen(name + 1));
}


x86 assembly (clang, -O0):
<bad_indirect_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
call   1030 <alloc_ptr@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_indirect_alloc>:
push   %rax
add    $0x1,%rdi
call   1040 <strlen@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <alloc_ptr@plt>

LLVM IR (-O0):
define void @bad_indirect_alloc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = call i32 @strlen(i8* %5)
%7 = call i64 @alloc_ptr(i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
ret void
}

LLVM IR (-O2):
define void @bad_indirect_alloc(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @strlen(i8* %2)
%4 = tail call i64 @alloc_ptr(i32 %3)
ret void
}
/* Variables and functions */
void *zerosize_ptr(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @zerosize_ptr() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @zerosize_ptr() {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ geteuid();
uid_t c_geteuid_() { return geteuid(); }


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

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

LLVM IR (-O0):
define i32 @c_geteuid_() {
%1 = call i32 (...) @geteuid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @c_geteuid_() {
%1 = tail call i32 (...) @geteuid()
ret i32 %1
}
/* Variables and functions */
char *ssplit_part(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stimestamp(char *);
char *scurrent_time() { return ssplit_part(stimestamp(""), " ", 1); }


x86 assembly (clang, -O0):
<scurrent_time>:
push   %rbp
mov    %rsp,%rbp
lea    0xed6(%rip),%rdi
call   1030 <stimestamp@plt>
mov    %eax,%edi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <ssplit_part@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scurrent_time>:
push   %rax
lea    0xed9(%rip),%rdi
call   1030 <stimestamp@plt>
lea    0xecc(%rip),%rsi
mov    %eax,%edi
mov    $0x1,%edx
pop    %rax
jmp    1040 <ssplit_part@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c" \00"
define i8* @scurrent_time() {
%1 = call i32 @stimestamp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = call i8* @ssplit_part(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i8* %2
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c" \00"
define i8* @scurrent_time() {
%1 = tail call i32 @stimestamp(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @ssplit_part(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i8* %2
}
void dvbapi_save_channel_cache(void) {}


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

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

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

LLVM IR (-O2):
define void @dvbapi_save_channel_cache() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *lcm_malloc(size_t sz) {
  if (sz)
    return malloc(sz);
  return NULL;
}


x86 assembly (clang, -O0):
<lcm_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <lcm_malloc+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <lcm_malloc+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @lcm_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
unsigned char b4toc(unsigned int d) {
  if (d < 10) {
    return '0' + d;
  } else if (d < 16) {
    return 'A' + (d - 10);
  } else {
    return 'F';
  }
}


x86 assembly (clang, -O0):
<b4toc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jae    111f <b4toc+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    113e <b4toc+0x3e>
cmpl   $0x10,-0x8(%rbp)
jae    113a <b4toc+0x3a>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    113e <b4toc+0x3e>
movb   $0x46,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b4toc>:
cmp    $0x9,%edi
ja     110b <b4toc+0xb>
add    $0x30,%dil
jmp    1116 <b4toc+0x16>
mov    $0x46,%al
cmp    $0xf,%edi
ja     1118 <b4toc+0x18>
add    $0x37,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @b4toc(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add i32 48, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %19
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp ult i32 %11, 16
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %3
%15 = sub i32 %14, 10
%16 = add i32 65, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %19
18: ; preds = %10
store i8 70, i8* %2
br label %19
19: ; preds = %18, %13, %6
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @b4toc(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add nuw nsw i8 %4, 48
br label %11
6: ; preds = %1
%7 = icmp ult i32 %0, 16
br i1 %7, label %8, label %11
8: ; preds = %6
%9 = trunc i32 %0 to i8
%10 = add nuw nsw i8 %9, 55
br label %11
11: ; preds = %6, %8, %3
%12 = phi i8 [ %5, %3 ], [ %10, %8 ], [ 70, %6 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("uim:"
         "Invalid arguments"
         "\n");
  printf("uim:"
         "Usage: uim [ -f <path-to-sysfs-kim> ] [ -b <bd address "
         "XX:XX:XX:XX:XX:XX> ]"
         "\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"uim:Invalid arguments\0A\00"
@.str.1 = [81 x i8] c"uim:Usage: uim [ -f <path-to-sysfs-kim> ] [ -b <bd address XX:XX:XX:XX:XX:XX> ]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"uim:Invalid arguments\00"
@str.2 = [80 x i8] c"uim:Usage: uim [ -f <path-to-sysfs-kim> ] [ -b <bd address XX:XX:XX:XX:XX:XX> ]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.2, i64 0, i64 0))
ret void
}
int foo(int a, int b) {
  if (!(a || b)) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112a <foo+0x2a>
cmpl   $0x0,-0xc(%rbp)
jne    112a <foo+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <foo+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
or     %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t __attribute__((always_)) inb(uint16_t port) {
  uint8_t data;
  asm volatile("inb %w1, %b0" : "=a"(data) : "Nd"(port));
  return data;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define i8* @inb(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inb(i32 %0) {
%2 = tail call i8* asm sideeffect "inb ${1:w}, ${0:b}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char *);
int /*<<< orphan*/ fatalerror(char *);
void argerror(char *s) {
  error("Error parsing command line. Unrecognized option:\n\t-%s\n", s);
  fatalerror("\nTry --help for help.\n");
}


x86 assembly (clang, -O0):
<argerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <error@plt>
lea    0xef4(%rip),%rdi
call   1040 <fatalerror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argerror>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <error@plt>
lea    0xf00(%rip),%rdi
pop    %rax
jmp    1040 <fatalerror@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Error parsing command line. Unrecognized option:\0A\09-%s\0A\00"
@.str.1 = [23 x i8] c"\0ATry --help for help.\0A\00"
define void @argerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @fatalerror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"Error parsing command line. Unrecognized option:\0A\09-%s\0A\00"
@.str.1 = [23 x i8] c"\0ATry --help for help.\0A\00"
define void @argerror(i8* %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @fatalerror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sqliteasyncqueryf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *, int /*<<< orphan*/,
                                     char *, char *);
void sqlitedetach(char *schema) {
  sqliteasyncqueryf(0, NULL, NULL, 0, "DETACH DATABASE %s", schema);
}


x86 assembly (clang, -O0):
<sqlitedetach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%edx
lea    0xed3(%rip),%r8
mov    %ecx,%edi
mov    %rdx,%rsi
call   1030 <sqliteasyncqueryf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlitedetach>:
mov    %rdi,%r9
lea    0xee6(%rip),%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <sqliteasyncqueryf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"DETACH DATABASE %s\00"
define void @sqlitedetach(i8* %0) {
%2 = tail call i32 @sqliteasyncqueryf(i32 0, i32* null, i32* null, i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned long readVAC(unsigned long add) {
  return (
      (*((unsigned long *)((((0xFFFD0000 | (add << 8)) >> 2) | 0xB0000000))) >>
       16) &
      0xFFFF);
}


x86 assembly (clang, -O0):
<readVAC>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x8,%rax
movabs $0xfffd0000,%rcx
or     %rcx,%rax
shr    $0x2,%rax
movabs $0xb0000000,%rcx
or     %rcx,%rax
mov    (%rax),%rax
shr    $0x10,%rax
and    $0xffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readVAC>:
shl    $0x6,%rdi
movabs $0x3fffffff4000bfc0,%rax
ff ff 3f
and    %rdi,%rax
mov    $0xbfff4002,%ecx
movzwl (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
define i64 @readVAC(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 8
%5 = or i64 4294770688, %4
%6 = lshr i64 %5, 2
%7 = or i64 %6, 2952790016
%8 = inttoptr i64 %7 to i64*
%9 = load i64, i64* %8
%10 = lshr i64 %9, 16
%11 = and i64 %10, 65535
ret i64 %11
}

LLVM IR (-O2):
define i64 @readVAC(i64 %0) {
%2 = shl i64 %0, 6
%3 = and i64 %2, 4611686015206211520
%4 = or i64 %3, 3221176320
%5 = inttoptr i64 %4 to i64*
%6 = load i64, i64* %5
%7 = lshr i64 %6, 16
%8 = and i64 %7, 65535
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x3d() {
  Assert_real((isxdigit(61) == 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_isxdigit.c",
              310, ("isxdigit should be 0 for ="));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x3d>:
push   %rax
mov    $0x3d,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x136,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for =\00"
define void @t_isxdigit_0x3d() {
%1 = call i64 @isxdigit(i32 61)
%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 310, 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for =\00"
define void @t_isxdigit_0x3d() {
%1 = tail call i64 @isxdigit(i32 61)
%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 310, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *compare_strz_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_strz_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_strz_context() {
ret i8* null
}
void init_apu() {}


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

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

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

LLVM IR (-O2):
define void @init_apu() {
ret void
}
/* Variables and functions */
bool nrf51_errata_35(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_35() {
ret i32 0
}
void audioSleep() {}


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

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

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

LLVM IR (-O2):
define void @audioSleep() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage(void) {
  fprintf(
      stdout,
      "Usage: mpd-notify [-c host] [-p port] [-h] [-v]\n"
      "\t-c host   the server's host name, IP address or Unix socket path\n"
      "\t-p port   the TCP port to connect to, or 0 for the default port. If\n"
      "\t          \"host\" is a Unix socket path, this parameter is ignored\n"
      "\t-h        display this help message and exit\n"
      "\t-v        display version number and exit\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [340 x i8] c"Usage: mpd-notify [-c host] [-p port] [-h] [-v]\0A\09-c host the server's host name, IP address or Unix socket path\0A\09-p port the TCP port to connect to, or 0 for the default port. If\0A\09 \22host\22 is a Unix socket path, this parameter is ignored\0A\09-h display this help message and exit\0A\09-v display version number and exit\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([340 x i8], [340 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [340 x i8] c"Usage: mpd-notify [-c host] [-p port] [-h] [-v]\0A\09-c host the server's host name, IP address or Unix socket path\0A\09-p port the TCP port to connect to, or 0 for the default port. If\0A\09 \22host\22 is a Unix socket path, this parameter is ignored\0A\09-h display this help message and exit\0A\09-v display version number and exit\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([340 x i8], [340 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int listen(int, int);
int tcp_listen(int skt) { return listen(skt, 2); }


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

x86 assembly (clang, -O2):
<tcp_listen>:
mov    $0x2,%esi
jmp    1030 <listen@plt>

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

LLVM IR (-O2):
define i32 @tcp_listen(i32 %0) {
%2 = tail call i32 @listen(i32 %0, i32 2)
ret i32 %2
}
/* Variables and functions */
int rom_present(char *);
int xtide_at_available(void) {
  return (rom_present(L"roms/hdd/xtide/ide_at.bin"));
}


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

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

LLVM IR (-O0):
@.str = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 120, i32 116, i32 105, i32 100, i32 101, i32 47, i32 105, i32 100, i32 101, i32 95, i32 97, i32 116, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @xtide_at_available() {
%1 = call i32 @rom_present(i8* bitcast ([26 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [26 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 104, i32 100, i32 100, i32 47, i32 120, i32 116, i32 105, i32 100, i32 101, i32 47, i32 105, i32 100, i32 101, i32 95, i32 97, i32 116, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @xtide_at_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([26 x i32]* @.str to i8*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ putc(unsigned char);
unsigned char getc(void) {
  unsigned char ret;
  while (!((*(volatile unsigned long *)0x50000010) & (1)))
    ;
  ret = (*(volatile unsigned char *)0x50000024);
  if (ret == 0x0d || ret == 0x0a) {
    putc(0x0d);
    putc(0x0a);
  } else {
    putc(ret);
  }
  return ret;
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x50000010,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113a <getc+0x2a>
jmp    113f <getc+0x2f>
jmp    1118 <getc+0x8>
mov    $0x50000024,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xd,%eax
je     1163 <getc+0x53>
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    117c <getc+0x6c>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%edi
call   1030 <putc@plt>
jmp    1185 <getc+0x75>
movzbl -0x1(%rbp),%edi
call   1030 <putc@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testq  $0x1,0x50000010
je     1120 <getc+0x10>
mov    0x50000024,%bl
cmp    $0xd,%bl
je     1141 <getc+0x31>
mov    %ebx,%eax
cmp    $0xa,%bl
jne    114d <getc+0x3d>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%al
movzbl %al,%edi
call   1030 <putc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @getc() {
%1 = alloca i8
br label %2
2: ; preds = %7, %0
%3 = load volatile i64, i64* inttoptr (i64 1342177296 to i64*)
%4 = and i64 %3, 1
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %2
br label %2
8: ; preds = %2
%9 = load volatile i8, i8* inttoptr (i64 1342177316 to i8*)
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 13
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = load i8, i8* %1
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %20
17: ; preds = %13, %8
%18 = call i32 @putc(i8 zeroext 13)
%19 = call i32 @putc(i8 zeroext 10)
br label %23
20: ; preds = %13
%21 = load i8, i8* %1
%22 = call i32 @putc(i8 zeroext %21)
br label %23
23: ; preds = %20, %17
%24 = load i8, i8* %1
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 1342177296 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 1342177316 to i8*)
switch i8 %6, label %9 [
i8 13, label %7
i8 10, label %7
]
7: ; preds = %5, %5
%8 = tail call i32 @putc(i8 zeroext 13)
br label %9
9: ; preds = %5, %7
%10 = phi i8 [ 10, %7 ], [ %6, %5 ]
%11 = tail call i32 @putc(i8 zeroext %10)
ret i8 %6
}
int do_786() { return 786; }


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

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

LLVM IR (-O0):
define i32 @do_786() {
ret i32 786
}

LLVM IR (-O2):
define i32 @do_786() {
ret i32 786
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SHSUB16(uint32_t x, uint32_t y) {
  int32_t r, s;
  r = (((((int32_t)x << 16) >> 16) - (((int32_t)y << 16) >> 16)) >> 1) &
      (int32_t)0x0000FFFF;
  s = (((((int32_t)x) >> 16) - (((int32_t)y) >> 16)) >> 1) &
      (int32_t)0x0000FFFF;
  return ((uint32_t)((s << 16) | (r)));
}


x86 assembly (clang, -O0):
<__SHSUB16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
sub    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
sub    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SHSUB16>:
movswl %di,%eax
movswl %si,%ecx
sub    %ecx,%eax
shr    %eax
movzwl %ax,%eax
sar    $0x10,%edi
sar    $0x10,%esi
sub    %esi,%edi
and    $0xfffffffe,%edi
shl    $0xf,%edi
or     %eax,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @__SHSUB16(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = ashr i32 %13, 16
%15 = sub nsw i32 %10, %14
%16 = ashr i32 %15, 1
%17 = and i32 %16, 65535
store i32 %17, i32* %5
%18 = load i64, i64* %3
%19 = trunc i64 %18 to i32
%20 = ashr i32 %19, 16
%21 = load i64, i64* %4
%22 = trunc i64 %21 to i32
%23 = ashr i32 %22, 16
%24 = sub nsw i32 %20, %23
%25 = ashr i32 %24, 1
%26 = and i32 %25, 65535
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = shl i32 %27, 16
%29 = load i32, i32* %5
%30 = or i32 %28, %29
%31 = sext i32 %30 to i64
ret i64 %31
}

LLVM IR (-O2):
define i64 @__SHSUB16(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 16
%5 = ashr exact i32 %4, 16
%6 = trunc i64 %1 to i32
%7 = shl i32 %6, 16
%8 = ashr exact i32 %7, 16
%9 = sub nsw i32 %5, %8
%10 = lshr i32 %9, 1
%11 = and i32 %10, 65535
%12 = ashr i32 %3, 16
%13 = ashr i32 %6, 16
%14 = sub nsw i32 %12, %13
%15 = shl nsw i32 %14, 15
%16 = and i32 %15, -65536
%17 = or i32 %11, %16
%18 = sext i32 %17 to i64
ret i64 %18
}
/* Variables and functions */
unsigned char receiveByte(unsigned char);
int receiveString(unsigned char reg, unsigned char terminator,
                  volatile char *buf) {
  int i = 0;
  unsigned char c;
  do {
    c = receiveByte(reg);
    buf[i++] = (char)c;
  } while (c != terminator);
  return i;
}


x86 assembly (clang, -O0):
<receiveString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <receiveByte@plt>
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%dl
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movzbl -0x15(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jne    112f <receiveString+0x1f>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receiveString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
movzbl %dil,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
call   1030 <receiveByte@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %r15b,%al
jne    1130 <receiveString+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @receiveString(i8 zeroext %0, i8 zeroext %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ %7, %4 ], [ 0, %3 ]
%6 = tail call zeroext i8 @receiveByte(i8 zeroext %0)
%7 = add nuw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %2, i64 %5
store volatile i8 %6, i8* %8
%9 = icmp eq i8 %6, %1
br i1 %9, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %7 to i32
ret i32 %11
}
void ByteToFloat() {}


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

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

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

LLVM IR (-O2):
define void @ByteToFloat() {
ret void
}
/* Variables and functions */
char *opStringDEBUG(int);
int /*<<< orphan*/ printf(char *, int, char *);
void printOpDEBUG(int ip, int op) {
  printf("IP: %d OP: %s\n", ip, opStringDEBUG(op));
}


x86 assembly (clang, -O0):
<printOpDEBUG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <opStringDEBUG@plt>
mov    -0xc(%rbp),%esi
mov    %rax,%rdx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printOpDEBUG>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <opStringDEBUG@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"IP: %d OP: %s\0A\00"
define void @printOpDEBUG(i32 %0, i32 %1) {
%3 = tail call i8* @opStringDEBUG(i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x6d() {
  Assert_real((isspace(109) == 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_isspace.c",
              550, ("isspace should be 0 for m"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x6d>:
push   %rax
mov    $0x6d,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x226,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for m\00"
define void @t_isspace_0x6d() {
%1 = call i64 @isspace(i32 109)
%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 550, i8* getelementptr inbounds ([26 x i8], [26 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for m\00"
define void @t_isspace_0x6d() {
%1 = tail call i64 @isspace(i32 109)
%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 550, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned ring_wrap(unsigned size, unsigned idx) {
  return idx >= size ? idx - size : idx;
}


x86 assembly (clang, -O0):
<ring_wrap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jb     1124 <ring_wrap+0x24>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112a <ring_wrap+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ring_wrap>:
mov    %esi,%eax
xor    %ecx,%ecx
cmp    %edi,%esi
cmovae %edi,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ring_wrap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp uge i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = sub i32 %9, %10
br label %14
12: ; preds = %2
%13 = load i32, i32* %4
br label %14
14: ; preds = %12, %8
%15 = phi i32 [ %11, %8 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @ring_wrap(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, %0
%4 = select i1 %3, i32 0, i32 %0
%5 = sub i32 %1, %4
ret i32 %5
}
/* Type definitions */
struct __sk_buff {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
void cilium_trace3(struct __sk_buff *skb, __u8 type, __u32 arg1, __u32 arg2,
                   __u32 arg3) {}


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

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

LLVM IR (-O0):
%struct.__sk_buff = type { i32 }
define void @cilium_trace3(%struct.__sk_buff* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.__sk_buff*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.__sk_buff* %0, %struct.__sk_buff** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32 }
define void @cilium_trace3(%struct.__sk_buff* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
unsigned int limit_within_bounds(unsigned int val) {
  return val <= (0x2000UL / 4) ? val : (~val + 1) & 0xFFFF;
}


x86 assembly (clang, -O0):
<limit_within_bounds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x800,%rax
ja     1121 <limit_within_bounds+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <limit_within_bounds+0x32>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<limit_within_bounds>:
mov    %edi,%eax
neg    %eax
cmp    $0x801,%edi
movzwl %ax,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @limit_within_bounds(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = icmp ule i64 %4, 2048
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* %2
%10 = xor i32 %9, -1
%11 = add i32 %10, 1
%12 = and i32 %11, 65535
br label %13
13: ; preds = %8, %6
%14 = phi i32 [ %7, %6 ], [ %12, %8 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @limit_within_bounds(i32 %0) {
%2 = icmp ult i32 %0, 2049
%3 = sub i32 0, %0
%4 = and i32 %3, 65535
%5 = select i1 %2, i32 %0, i32 %4
ret i32 %5
}
char *skipsp(lp)
char *lp;
{
  if (lp == 0)
    return 0;
  while (*lp == ' ' && *lp != 0)
    lp++;
  if (*lp)
    return lp;
  else
    return 0;
}


x86 assembly (clang, -O0):
<skipsp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <skipsp+0x20>
movq   $0x0,-0x8(%rbp)
jmp    118d <skipsp+0x8d>
jmp    1125 <skipsp+0x25>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
jne    114a <skipsp+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115a <skipsp+0x5a>
jmp    116b <skipsp+0x6b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1125 <skipsp+0x25>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1185 <skipsp+0x85>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118d <skipsp+0x8d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipsp>:
test   %rdi,%rdi
je     1126 <skipsp+0x26>
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    $0x20,%cl
je     1110 <skipsp+0x10>
xor    %edx,%edx
test   %cl,%cl
cmove  %rdx,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @skipsp(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %7, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 32
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %3, label %8
8: ; preds = %3
%9 = icmp eq i8 %5, 0
%10 = select i1 %9, i8* null, i8* %4
br label %11
11: ; preds = %8, %1
%12 = phi i8* [ null, %1 ], [ %10, %8 ]
ret i8* %12
}
int test_imm_7Bint8_mem(signed char *val) {
  return ((*val) & (-0x7B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Bint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff85,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Bint8_mem>:
testb  $0x85,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Bint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -123
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct statvfs64 {
  int dummy;
};
struct statfs64 {
  int dummy;
};

/* Variables and functions */
int __statfs64(char const *, struct statfs64 *);
int statvfs64(const char *file, struct statvfs64 *buf) {
  return __statfs64(file, (struct statfs64 *)buf);
}


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

x86 assembly (clang, -O2):
<statvfs64>:
jmp    1030 <__statfs64@plt>

LLVM IR (-O0):
%struct.statvfs64 = type { i32 }
%struct.statfs64 = type { i32 }
define i32 @statvfs64(i8* %0, %struct.statvfs64* %1) {
%3 = alloca i8*
%4 = alloca %struct.statvfs64*
store i8* %0, i8** %3
store %struct.statvfs64* %1, %struct.statvfs64** %4
%5 = load i8*, i8** %3
%6 = load %struct.statvfs64*, %struct.statvfs64** %4
%7 = bitcast %struct.statvfs64* %6 to %struct.statfs64*
%8 = call i32 @__statfs64(i8* %5, %struct.statfs64* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.statvfs64 = type { i32 }
%struct.statfs64 = type { i32 }
define i32 @statvfs64(i8* %0, %struct.statvfs64* %1) {
%3 = bitcast %struct.statvfs64* %1 to %struct.statfs64*
%4 = tail call i32 @__statfs64(i8* %0, %struct.statfs64* %3)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ pid_t;

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo366(i32 %0) {
ret void
}
/* Variables and functions */
int madvise(void *, size_t, int);
int posix_madvise(void *address, size_t size, int how) {
  return madvise(address, size, how);
}


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

x86 assembly (clang, -O2):
<posix_madvise>:
jmp    1030 <madvise@plt>

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

LLVM IR (-O2):
define i32 @posix_madvise(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @madvise(i8* %0, i64 %1, i32 %2)
ret i32 %4
}
unsigned char update_bit(unsigned char reg, unsigned char val) {
  return (reg ^ ((-val ^ reg) & (1 << 4)));
}


x86 assembly (clang, -O0):
<update_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movzbl -0x1(%rbp),%edx
xor    %edx,%ecx
and    $0x10,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_bit>:
neg    %sil
and    $0x10,%sil
and    $0xef,%dil
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define zeroext i8 @update_bit(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = sub nsw i32 0, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = xor i32 %9, %11
%13 = and i32 %12, 16
%14 = xor i32 %6, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @update_bit(i8 zeroext %0, i8 zeroext %1) {
%3 = sub i8 0, %1
%4 = and i8 %3, 16
%5 = and i8 %0, -17
%6 = or i8 %4, %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ glClearIndex(float);
void ClearIndex(float c) { glClearIndex(c); }


x86 assembly (clang, -O0):
<ClearIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <glClearIndex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearIndex>:
jmp    1030 <glClearIndex@plt>

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

LLVM IR (-O2):
define void @ClearIndex(float %0) {
%2 = tail call i32 @glClearIndex(float %0)
ret void
}
void foo310(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo310(i32 %0) {
ret void
}