xunge/DecIR huggingface dataset:
void copyString(char *to, char *from) {
  for (; *from != '\0'; ++from, ++to) {
    *to = *from;
  }
  *to = '\0';
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <copyString+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <copyString+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
mov    (%rsi),%al
test   %al,%al
je     1121 <copyString+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <copyString+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @copyString(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ wait(int *);
void waitChild(int sigNum) {
  int child_status;
  printf("Child says hello from signal routine\n");
  wait(&child_status);
  printf("Child waiting finished %d \n", child_status);
}


x86 assembly (clang, -O0):
<waitChild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1040 <wait@plt>
mov    -0x8(%rbp),%esi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitChild>:
push   %rax
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rdi
call   1050 <wait@plt>
mov    0x4(%rsp),%esi
lea    0xeae(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Child says hello from signal routine\0A\00"
@.str.1 = [28 x i8] c"Child waiting finished %d \0A\00"
define void @waitChild(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @wait(i32* %3)
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"Child waiting finished %d \0A\00"
@str = [37 x i8] c"Child says hello from signal routine\00"
define void @waitChild(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%5 = call i32 @wait(i32* %2)
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
scalar_t__ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ request_manage(void *);
void *serve(void *arg) {
  if (pthread_detach(pthread_self()) != 0)
    pthread_exit(NULL);
  request_manage(arg);
  return NULL;
}


x86 assembly (clang, -O0):
<serve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%edi
call   1040 <pthread_detach@plt>
cmp    $0x0,%rax
je     116d <serve+0x2d>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
mov    -0x8(%rbp),%rdi
call   1060 <request_manage@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serve>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%edi
call   1040 <pthread_detach@plt>
test   %rax,%rax
je     115e <serve+0x1e>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
mov    %rbx,%rdi
call   1060 <request_manage@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @serve(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i64 @pthread_detach(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @pthread_exit(i32* null)
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @request_manage(i8* %0)
ret i8* null
}
/* Variables and functions */
int printf(char *, int);
int romanToInt(char *);
int main(int argc, char *argv[]) { return printf("%d\n", romanToInt(argv[1])); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <romanToInt@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @romanToInt(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 %6
}
/* Type definitions */
struct solo5_start_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ nothing();
int /*<<< orphan*/ puts(char *);
int solo5_app_main(const struct solo5_start_info *si __attribute__((unused))) {
  puts("\n**** Solo5 standalone test_wnox ****\n\n");
  nothing();
  puts("FAILURE\n");
  return 1;
}


x86 assembly (clang, -O0):
<solo5_app_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <nothing@plt>
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solo5_app_main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <nothing@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.solo5_start_info = type { i32 }
@.str = [40 x i8] c"\0A**** Solo5 standalone test_wnox ****\0A\0A\00"
@.str.1 = [9 x i8] c"FAILURE\0A\00"
define i32 @solo5_app_main(%struct.solo5_start_info* %0) {
%2 = alloca %struct.solo5_start_info*
store %struct.solo5_start_info* %0, %struct.solo5_start_info** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @nothing()
%5 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.solo5_start_info = type { i32 }
@.str = [40 x i8] c"\0A**** Solo5 standalone test_wnox ****\0A\0A\00"
@.str.1 = [9 x i8] c"FAILURE\0A\00"
define i32 @solo5_app_main(%struct.solo5_start_info* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @nothing()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void pr__charp(const char *p) { fputs(p, stdout); }


x86 assembly (clang, -O0):
<pr__charp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr__charp>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @pr__charp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @pr__charp(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
void mus_bshort_to_char(unsigned char *j, short x) {
  unsigned char *ox;
  ox = (unsigned char *)&x;
  j[0] = ox[0];
  j[1] = ox[1];
}


x86 assembly (clang, -O0):
<mus_bshort_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mus_bshort_to_char(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8*
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = bitcast i16* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @mus_bshort_to_char(i8* nocapture writeonly %0, i16 signext %1) {
%3 = trunc i16 %1 to i8
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
store i8 %3, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
void kinetisbase_init() {}


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

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

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

LLVM IR (-O2):
define void @kinetisbase_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void vfunc(int a) { printf("a=%d\n", a); }


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

x86 assembly (clang, -O2):
<vfunc>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"a=%d\0A\00"
define void @vfunc(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long utime(unsigned long *timer) {
  unsigned long utime;
  struct timeval tv;
  gettimeofday(&tv, NULL);
  utime = tv.tv_sec * 1000000 + tv.tv_usec;
  if (timer != NULL) {
    *timer = utime;
  }
  return utime;
}


x86 assembly (clang, -O0):
<utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x18(%rbp),%eax
add    -0x14(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114f <utime+0x3f>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rcx
movslq 0xc(%rsp),%rax
add    %rcx,%rax
test   %rbx,%rbx
je     1140 <utime+0x30>
mov    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @utime(i64* %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca %struct.timeval
store i64* %0, i64** %2
%5 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = sext i32 %11 to i64
store i64 %12, i64* %3
%13 = load i64*, i64** %2
%14 = icmp ne i64* %13, null
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i64, i64* %3
%17 = load i64*, i64** %2
store i64 %16, i64* %17
br label %18
18: ; preds = %15, %1
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @utime(i64* writeonly %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
%11 = sext i32 %10 to i64
%12 = icmp eq i64* %0, null
br i1 %12, label %14, label %13
13: ; preds = %1
store i64 %11, i64* %0
br label %14
14: ; preds = %13, %1
ret i64 %11
}
/* Variables and functions */
scalar_t__ ERR;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ nodelay(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
scalar_t__ wgetch(int /*<<< orphan*/);
void flush_input(void) {
  nodelay(stdscr, TRUE);
  while (wgetch(stdscr) != ERR)
    ;
}


x86 assembly (clang, -O0):
<flush_input>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1030 <nodelay@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <wgetch@plt>
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%rax
je     115e <flush_input+0x3e>
jmp    113b <flush_input+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_input>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
mov    (%r14),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1030 <nodelay@plt>
mov    0x2ea5(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14),%edi
call   1040 <wgetch@plt>
cmp    (%rbx),%rax
jne    1150 <flush_input+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@ERR = global i64 0
define void @flush_input() {
%1 = load i32, i32* @stdscr
%2 = load i32, i32* @TRUE
%3 = call i32 @nodelay(i32 %1, i32 %2)
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* @stdscr
%6 = call i64 @wgetch(i32 %5)
%7 = load i64, i64* @ERR
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@ERR = global i64 0
define void @flush_input() {
%1 = load i32, i32* @stdscr
%2 = load i32, i32* @TRUE
%3 = tail call i32 @nodelay(i32 %1, i32 %2)
br label %4
4: ; preds = %4, %0
%5 = load i32, i32* @stdscr
%6 = tail call i64 @wgetch(i32 %5)
%7 = load i64, i64* @ERR
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %4
9: ; preds = %4
ret void
}
unsigned int _avail_viface(void) { return "potatoes"; }


x86 assembly (clang, -O0):
<_avail_viface>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_avail_viface>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"potatoes\00"
define i32 @_avail_viface() {
ret i32 ptrtoint ([9 x i8]* @.str to i32)
}

LLVM IR (-O2):
@.str = [9 x i8] c"potatoes\00"
define i32 @_avail_viface() {
ret i32 ptrtoint ([9 x i8]* @.str to i32)
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "output\n");
  fprintf(stderr, "errput\n");
  return 0;
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"output\0A\00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"errput\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"output\0A\00"
@stderr = global i32 0
@.str.1 = [8 x i8] c"errput\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ wmemcmp;
typedef int /*<<< orphan*/ const wchar_t;

/* Variables and functions */
wchar_t *(wmemends)(const wchar_t *string, size_t string_size,
                    const wchar_t *desired, size_t desired_size) {
  return (wmemcmp)(string + (string_size - desired_size), desired, desired_size)
             ? NULL
             : (string + string_size);
}


x86 assembly (clang, -O0):
<wmemends>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     112a <wmemends+0x2a>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    113d <wmemends+0x3d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmemends>:
xor    %eax,%eax
test   %rcx,%rcx
lea    (%rdi,%rsi,4),%rcx
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
define i32* @wmemends(i32* readnone %0, i64 %1, i32* nocapture readnone %2, i64 %3) {
%5 = icmp eq i64 %3, 0
%6 = getelementptr inbounds i32, i32* %0, i64 %1
%7 = select i1 %5, i32* %6, i32* null
ret i32* %7
}
unsigned short int cast_ulong_ushort(unsigned long int x) {
  return (unsigned short int)x;
}


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

x86 assembly (clang, -O2):
<cast_ulong_ushort>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define zeroext i16 @cast_ulong_ushort(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @cast_ulong_ushort(i64 %0) {
%2 = trunc i64 %0 to i16
ret i16 %2
}
unsigned long PSEgetLibType(void) { return 4; }


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

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

LLVM IR (-O0):
define i64 @PSEgetLibType() {
ret i64 4
}

LLVM IR (-O2):
define i64 @PSEgetLibType() {
ret i64 4
}
char *basename(name) const char *name;
{
  const char *base = name;
  while (*name) {
    if (*name == '/')
      base = name + 1;
    ++name;
  }
  return (char *)base;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <basename+0x4a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1139 <basename+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <basename+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <basename+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <basename+0x10>
test   %dl,%dl
jne    1113 <basename+0x13>
ret

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
long long int computeSquare(long long int n) { return n * n; }


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

x86 assembly (clang, -O2):
<computeSquare>:
mov    %rdi,%rax
imul   %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @computeSquare(i64 %0) {
%2 = mul nsw i64 %0, %0
ret i64 %2
}
void VMR3HotUnplugCpu(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3HotUnplugCpu() {
ret void
}
/* Variables and functions */
char *brain_alloc_(long, int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(char *, char const *, long);
char *brain_strndup(char const *in_string, long in_size) {
  if (!in_string)
    in_string = "";
  char *result = brain_alloc_(in_size + 1, 0);
  memcpy(result, in_string, in_size);
  result[in_size] = 0;
  return result;
}


x86 assembly (clang, -O0):
<brain_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1146 <brain_strndup+0x26>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
xor    %esi,%esi
call   1030 <brain_alloc_@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brain_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %rdi,%rdi
lea    0xece(%rip),%r15
cmovne %rdi,%r15
lea    0x1(%rsi),%rdi
xor    %esi,%esi
call   1030 <brain_alloc_@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r14,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @brain_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %2
%10 = load i64, i64* %4
%11 = add nsw i64 %10, 1
%12 = call i8* @brain_alloc_(i64 %11, i32 0)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = load i64, i64* %4
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %5
%18 = load i64, i64* %4
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8 0, i8* %19
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @brain_strndup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
%5 = add nsw i64 %1, 1
%6 = tail call i8* @brain_alloc_(i64 %5, i32 0)
%7 = tail call i32 @memcpy(i8* %6, i8* %4, i64 %1)
%8 = getelementptr inbounds i8, i8* %6, i64 %1
store i8 0, i8* %8
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ msgctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int sim_delete_queue(int qid) {
  msgctl(qid, IPC_RMID, 0);
  return 0;
}


x86 assembly (clang, -O0):
<sim_delete_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <msgctl@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_delete_queue>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <msgctl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @sim_delete_queue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_RMID
%5 = call i32 @msgctl(i32 %3, i32 %4, i32 0)
ret i32 0
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @sim_delete_queue(i32 %0) {
%2 = load i32, i32* @IPC_RMID
%3 = tail call i32 @msgctl(i32 %0, i32 %2, i32 0)
ret i32 0
}
/* Variables and functions */
void *realloc(void *, int);
void *celt_realloc(void *ptr, int size) { return realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<celt_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define i8* @celt_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fiftyoneDegreesFree(void *);
void fiftyoneDegreesJSONFree(void *json) { fiftyoneDegreesFree(json); }


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

x86 assembly (clang, -O2):
<fiftyoneDegreesJSONFree>:
jmp    1030 <fiftyoneDegreesFree@plt>

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

LLVM IR (-O2):
define void @fiftyoneDegreesJSONFree(i8* %0) {
%2 = tail call i32 @fiftyoneDegreesFree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gp2x_joystick_deinit();
int /*<<< orphan*/ gp2x_joystick_init();
void gp2x_joystick_scan(void) {
  gp2x_joystick_deinit();
  gp2x_joystick_init();
}


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

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

LLVM IR (-O0):
define void @gp2x_joystick_scan() {
%1 = call i32 (...) @gp2x_joystick_deinit()
%2 = call i32 (...) @gp2x_joystick_init()
ret void
}

LLVM IR (-O2):
define void @gp2x_joystick_scan() {
%1 = tail call i32 (...) @gp2x_joystick_deinit()
%2 = tail call i32 (...) @gp2x_joystick_init()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void free_s16(int16_t *val) {}


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

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

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

LLVM IR (-O2):
define void @free_s16(i32* nocapture %0) {
ret void
}
int f8(int x, int y) {
  int s = (x >= 0);
  int t = (y < 0);
  return s != t;
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
mov    %edi,%eax
xor    %esi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @f8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
%9 = zext i1 %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp ne i32 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @f8(i32 %0, i32 %1) {
%3 = xor i32 %0, %1
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x6b() {
  Assert_real((isupper(107) == 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_isupper.c",
              540, ("isupper should be 0 for k"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x6b>:
push   %rax
mov    $0x6b,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x21c,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for k\00"
define void @t_isupper_0x6b() {
%1 = call i64 @isupper(i32 107)
%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 540, 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for k\00"
define void @t_isupper_0x6b() {
%1 = tail call i64 @isupper(i32 107)
%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 540, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_equality_operators(int lhs, int rhs) {
  __emit_expression_range(0, lhs == rhs);
  __emit_expression_range(0, lhs != rhs);
}


x86 assembly (clang, -O0):
<test_equality_operators>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_equality_operators>:
push   %rbx
xor    %eax,%eax
xor    %ebx,%ebx
cmp    %esi,%edi
sete   %al
setne  %bl
xor    %edi,%edi
mov    %eax,%esi
call   1030 <__emit_expression_range@plt>
xor    %edi,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_equality_operators(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
%9 = call i32 @__emit_expression_range(i32 0, i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = icmp ne i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @__emit_expression_range(i32 0, i32 %13)
ret void
}

LLVM IR (-O2):
define void @test_equality_operators(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
%5 = tail call i32 @__emit_expression_range(i32 0, i32 %4)
%6 = icmp ne i32 %0, %1
%7 = zext i1 %6 to i32
%8 = tail call i32 @__emit_expression_range(i32 0, i32 %7)
ret void
}
/* Variables and functions */
int get_env_error_rate();
int rand();
int if_emit() {
  int rate = get_env_error_rate();
  return ((rand() % 100) < rate);
}


x86 assembly (clang, -O0):
<if_emit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_env_error_rate@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    -0x4(%rbp),%edx
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_emit>:
push   %rbx
xor    %eax,%eax
call   1030 <get_env_error_rate@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rcx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setl   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @if_emit() {
%1 = alloca i32
%2 = call i32 (...) @get_env_error_rate()
store i32 %2, i32* %1
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 100
%5 = load i32, i32* %1
%6 = icmp slt i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @if_emit() {
%1 = tail call i32 (...) @get_env_error_rate()
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 100
%4 = icmp slt i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ GPTLerror(char *, char const *);
double utr_papitime() {
  static const char *thisfunc = "utr_papitime";
  (void)GPTLerror("%s: not enabled\n", thisfunc);
  return -1.;
}


x86 assembly (clang, -O0):
<utr_papitime>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0d(%rip),%rsi
lea    0xef3(%rip),%rdi
call   1030 <GPTLerror@plt>
movsd  0xed1(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<utr_papitime>:
push   %rax
lea    0xefd(%rip),%rdi
lea    0xee9(%rip),%rsi
call   1030 <GPTLerror@plt>
movsd  0xed4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@utr_papitime.thisfunc = internal global i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0)
@.str = [13 x i8] c"utr_papitime\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define double @utr_papitime() {
%1 = load i8*, i8** @utr_papitime.thisfunc
%2 = call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret double -1.000000e+00
}

LLVM IR (-O2):
@.str = [13 x i8] c"utr_papitime\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define double @utr_papitime() {
%1 = tail call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret double -1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ handle_SYS(int /*<<< orphan*/);
int gen_SYS(void) {
  handle_SYS(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_SYS>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_SYS@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_SYS() {
%1 = call i32 @handle_SYS(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_SYS() {
%1 = tail call i32 @handle_SYS(i32 0)
ret i32 0
}
void append_fieldcmd(key, s) char key;
char *s;
{ appendfield(s); }


x86 assembly (clang, -O0):
<append_fieldcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <appendfield@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_fieldcmd>:
mov    %rsi,%rdi
xor    %eax,%eax
jmp    1030 <appendfield@plt>

LLVM IR (-O0):
define void @append_fieldcmd(i32 %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = trunc i32 %0 to i8
store i8 %5, i8* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @appendfield to i32 (i8*, ...)*)(i8* %6)
ret void
}

LLVM IR (-O2):
define void @append_fieldcmd(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @appendfield to i32 (i8*, ...)*)(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t3() {
  int a[] = {55};
  int *b = a;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c",
          20, 55, *b);
  ;
}


x86 assembly (clang, -O0):
<t3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
lea    0xece(%rip),%rdi
mov    $0x14,%esi
mov    $0x37,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t3>:
lea    0xee9(%rip),%rdi
mov    $0x14,%esi
mov    $0x37,%edx
mov    $0x37,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@__const.t3.a = [1 x i32] [i32 55]
@.str = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c\00"
define void @t3() {
%1 = alloca [1 x i32]
%2 = alloca i32*
%3 = bitcast [1 x i32]* %1 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 20, i32 55, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c\00"
define void @t3() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 20, i32 55, i32 55)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void putLDCharCurUp(void) { printf("\x01B(0\x02D\x01B(B"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B(0-\1B(B\00"
define void @putLDCharCurUp() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void __aeabi_memcpy8(void *dest, const void *src, size_t n) {
  memcpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memcpy8>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @__aeabi_memcpy8(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mvaddch(int, int, char);
void seas(void) {
  mvaddch(4, 1, 'S');
  mvaddch(6, 1, 'E');
  mvaddch(8, 1, 'A');
  mvaddch(10, 1, 'S');
  mvaddch(12, 1, 'O');
  mvaddch(14, 1, 'N');
  mvaddch(16, 1, '`');
  mvaddch(18, 1, 'S');
}


x86 assembly (clang, -O0):
<seas>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x53,%edx
call   1030 <mvaddch@plt>
mov    $0x6,%edi
mov    $0x1,%esi
mov    $0x45,%edx
call   1030 <mvaddch@plt>
mov    $0x8,%edi
mov    $0x1,%esi
mov    $0x41,%edx
call   1030 <mvaddch@plt>
mov    $0xa,%edi
mov    $0x1,%esi
mov    $0x53,%edx
call   1030 <mvaddch@plt>
mov    $0xc,%edi
mov    $0x1,%esi
mov    $0x4f,%edx
call   1030 <mvaddch@plt>
mov    $0xe,%edi
mov    $0x1,%esi
mov    $0x4e,%edx
call   1030 <mvaddch@plt>
mov    $0x10,%edi
mov    $0x1,%esi
mov    $0x60,%edx
call   1030 <mvaddch@plt>
mov    $0x12,%edi
mov    $0x1,%esi
mov    $0x53,%edx
call   1030 <mvaddch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<seas>:
push   %rax
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x53,%edx
call   1030 <mvaddch@plt>
mov    $0x6,%edi
mov    $0x1,%esi
mov    $0x45,%edx
call   1030 <mvaddch@plt>
mov    $0x8,%edi
mov    $0x1,%esi
mov    $0x41,%edx
call   1030 <mvaddch@plt>
mov    $0xa,%edi
mov    $0x1,%esi
mov    $0x53,%edx
call   1030 <mvaddch@plt>
mov    $0xc,%edi
mov    $0x1,%esi
mov    $0x4f,%edx
call   1030 <mvaddch@plt>
mov    $0xe,%edi
mov    $0x1,%esi
mov    $0x4e,%edx
call   1030 <mvaddch@plt>
mov    $0x10,%edi
mov    $0x1,%esi
mov    $0x60,%edx
call   1030 <mvaddch@plt>
mov    $0x12,%edi
mov    $0x1,%esi
mov    $0x53,%edx
pop    %rax
jmp    1030 <mvaddch@plt>

LLVM IR (-O0):
define void @seas() {
%1 = call i32 @mvaddch(i32 4, i32 1, i8 signext 83)
%2 = call i32 @mvaddch(i32 6, i32 1, i8 signext 69)
%3 = call i32 @mvaddch(i32 8, i32 1, i8 signext 65)
%4 = call i32 @mvaddch(i32 10, i32 1, i8 signext 83)
%5 = call i32 @mvaddch(i32 12, i32 1, i8 signext 79)
%6 = call i32 @mvaddch(i32 14, i32 1, i8 signext 78)
%7 = call i32 @mvaddch(i32 16, i32 1, i8 signext 96)
%8 = call i32 @mvaddch(i32 18, i32 1, i8 signext 83)
ret void
}

LLVM IR (-O2):
define void @seas() {
%1 = tail call i32 @mvaddch(i32 4, i32 1, i8 signext 83)
%2 = tail call i32 @mvaddch(i32 6, i32 1, i8 signext 69)
%3 = tail call i32 @mvaddch(i32 8, i32 1, i8 signext 65)
%4 = tail call i32 @mvaddch(i32 10, i32 1, i8 signext 83)
%5 = tail call i32 @mvaddch(i32 12, i32 1, i8 signext 79)
%6 = tail call i32 @mvaddch(i32 14, i32 1, i8 signext 78)
%7 = tail call i32 @mvaddch(i32 16, i32 1, i8 signext 96)
%8 = tail call i32 @mvaddch(i32 18, i32 1, i8 signext 83)
ret void
}