xunge/DecIR huggingface dataset:
char *sname(s)
register char *s;
{
  register char *p = s;
  while (*s)
    if (*s++ == '/')
      p = s;
  return (p);
}


x86 assembly (clang, -O0):
<sname>:
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     1145 <sname+0x45>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1140 <sname+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <sname+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sname>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <sname+0x22>
lea    0x1(%rax),%rdx
nopl   (%rax)
cmp    $0x2f,%cl
cmove  %rdx,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <sname+0x10>
ret

LLVM IR (-O0):
define i8* @sname(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 %18
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 47
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = load i8*, i8** %2
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %9
br label %5
18: ; preds = %5
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @sname(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = icmp eq i8 %5, 47
%10 = select i1 %9, i8* %8, i8* %6
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i8* [ %0, %1 ], [ %10, %4 ]
ret i8* %14
}
long number_digits(long n) {
  long cont;
  cont = 0;
  if (n == 0) {
    cont = 1;
  } else {
    while (n > 0) {
      cont++;
      n /= 10;
    }
  }
  return cont;
}


x86 assembly (clang, -O0):
<number_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1128 <number_digits+0x28>
movq   $0x1,-0x10(%rbp)
jmp    1160 <number_digits+0x60>
jmp    112d <number_digits+0x2d>
cmpq   $0x0,-0x8(%rbp)
jle    115b <number_digits+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    112d <number_digits+0x2d>
jmp    1160 <number_digits+0x60>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_digits>:
test   %rdi,%rdi
je     113b <number_digits+0x3b>
jle    1141 <number_digits+0x41>
xor    %ecx,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rcx
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <number_digits+0x20>
mov    %rcx,%rax
ret
mov    $0x1,%eax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @number_digits(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %3
br label %17
7: ; preds = %1
br label %8
8: ; preds = %11, %7
%9 = load i64, i64* %2
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i64, i64* %3
%13 = add nsw i64 %12, 1
store i64 %13, i64* %3
%14 = load i64, i64* %2
%15 = sdiv i64 %14, 10
store i64 %15, i64* %2
br label %8
16: ; preds = %8
br label %17
17: ; preds = %16, %6
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @number_digits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp sgt i64 %0, 0
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i64 [ %8, %5 ], [ 0, %3 ]
%7 = phi i64 [ %9, %5 ], [ %0, %3 ]
%8 = add nuw nsw i64 %6, 1
%9 = udiv i64 %7, 10
%10 = icmp ult i64 %7, 10
br i1 %10, label %11, label %5
11: ; preds = %5, %3, %1
%12 = phi i64 [ 1, %1 ], [ 0, %3 ], [ %8, %5 ]
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigdelset(int /*<<< orphan*/ *, int);
void c_sigdelset_(sigset_t *set, int *sig, int dmy) { sigdelset(set, *sig); }


x86 assembly (clang, -O0):
<c_sigdelset_>:
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),%rax
mov    (%rax),%esi
call   1030 <sigdelset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_sigdelset_>:
mov    (%rsi),%esi
jmp    1030 <sigdelset@plt>

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

LLVM IR (-O2):
define void @c_sigdelset_(i32* %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @sigdelset(i32* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ MB_CUR_MAX;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "");
  printf("MB_CUR_MAX = %lu\n", MB_CUR_MAX);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
call   1040 <setlocale@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [18 x i8] c"MB_CUR_MAX = %lu\0A\00"
@MB_CUR_MAX = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LC_ALL
%3 = call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @MB_CUR_MAX
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [18 x i8] c"MB_CUR_MAX = %lu\0A\00"
@MB_CUR_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @MB_CUR_MAX
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ error(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int open_listener_socket(void) {
  int s = socket(PF_INET, SOCK_STREAM, 0);
  if (s == -1)
    error("Can't open listener socket");
  return s;
}


x86 assembly (clang, -O0):
<open_listener_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    115a <open_listener_socket+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_listener_socket>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    114d <open_listener_socket+0x2d>
lea    0xeb8(%rip),%rdi
call   1030 <error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [27 x i8] c"Can't open listener socket\00"
define i32 @open_listener_socket() {
%1 = alloca i32
%2 = load i32, i32* @PF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [27 x i8] c"Can't open listener socket\00"
define i32 @open_listener_socket() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @error(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 %3
}
void persuade(struct battle_char *origin, struct battle_char *target) {}


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

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

LLVM IR (-O0):
%struct.battle_char = type opaque
define void @persuade(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
ret void
}

LLVM IR (-O2):
%struct.battle_char = type opaque
define void @persuade(%struct.battle_char* nocapture %0, %struct.battle_char* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned int);
void vAssign(unsigned char *psA, unsigned char *psB, unsigned int uiLen) {
  memcpy(psA, psB, uiLen);
}


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

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

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

LLVM IR (-O2):
define void @vAssign(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int SSL_read(int /*<<< orphan*/ *, char *, size_t);
int recv(int, char *, size_t, int /*<<< orphan*/);
__attribute__((always_)) int tmail_sock_recv(void *fd, char *bf, size_t sz,
                                             bool protected
                                             __attribute__((__unused__))) {
  if (protected)
    return SSL_read((SSL *)fd, bf, sz);
  return recv(*(int *)fd, bf, sz, 0);
}


x86 assembly (clang, -O0):
<tmail_sock_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     115a <tmail_sock_recv+0x3a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <SSL_read@plt>
mov    %eax,-0x4(%rbp)
jmp    1172 <tmail_sock_recv+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmail_sock_recv>:
test   %ecx,%ecx
je     1129 <tmail_sock_recv+0x9>
jmp    1040 <SSL_read@plt>
mov    (%rdi),%edi
xor    %ecx,%ecx
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @tmail_sock_recv(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load i8*, i8** %6
%14 = bitcast i8* %13 to i32*
%15 = load i8*, i8** %7
%16 = load i64, i64* %8
%17 = call i32 @SSL_read(i32* %14, i8* %15, i64 %16)
store i32 %17, i32* %5
br label %25
18: ; preds = %4
%19 = load i8*, i8** %6
%20 = bitcast i8* %19 to i32*
%21 = load i32, i32* %20
%22 = load i8*, i8** %7
%23 = load i64, i64* %8
%24 = call i32 @recv(i32 %21, i8* %22, i64 %23, i32 0)
store i32 %24, i32* %5
br label %25
25: ; preds = %18, %12
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @tmail_sock_recv(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = bitcast i8* %0 to i32*
br i1 %5, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @SSL_read(i32* %6, i8* %1, i64 %2)
br label %12
9: ; preds = %4
%10 = load i32, i32* %6
%11 = tail call i32 @recv(i32 %10, i8* %1, i64 %2, i32 0)
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ %8, %7 ], [ %11, %9 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ DymosimError(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *,
                           char const *, double);
void GuardedError(const char *xexpr, double x, const char *op) {
  char buf[1000];
  sprintf(buf, "\nModel error - %s (%.400s) = %s (%g)\n", op, xexpr, op, x);
  DymosimError(buf);
}


x86 assembly (clang, -O0):
<GuardedError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%r8
movsd  -0x10(%rbp),%xmm0
lea    0xea9(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <DymosimError@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GuardedError>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%rdx
mov    %rdi,%rcx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rdx,%r8
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <DymosimError@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"\0AModel error - %s (%.400s) = %s (%g)\0A\00"
define void @GuardedError(i8* %0, double %1, i8* %2) {
%4 = alloca i8*
%5 = alloca double
%6 = alloca i8*
%7 = alloca [1000 x i8]
store i8* %0, i8** %4
store double %1, double* %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %6
%12 = load double, double* %5
%13 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11, double %12)
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%15 = call i32 @DymosimError(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"\0AModel error - %s (%.400s) = %s (%g)\0A\00"
define void @GuardedError(i8* %0, double %1, i8* %2) {
%4 = alloca [1000 x i8]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i8* %2, double %1)
%7 = call i32 @DymosimError(i8* %5)
ret void
}
unsigned int getlong(unsigned char *p) {
  return *p + p[1] * 256 + (p[2] + p[3] * 256) * 65536;
}


x86 assembly (clang, -O0):
<getlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
mov    -0x8(%rbp),%rdx
movzbl 0x3(%rdx),%edx
shl    $0x8,%edx
add    %edx,%ecx
shl    $0x10,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getlong(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = mul nsw i32 %9, 256
%11 = add nsw i32 %5, %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 3
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = mul nsw i32 %19, 256
%21 = add nsw i32 %15, %20
%22 = mul nsw i32 %21, 65536
%23 = add nsw i32 %11, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @getlong(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw i32 %13, 24
%15 = shl nuw nsw i32 %10, 16
%16 = or i32 %7, %3
%17 = or i32 %16, %15
%18 = or i32 %17, %14
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void st103_set_istr(uint16_t istr) {
  *((volatile uint16_t *)((0x40005C00UL) + 0x44)) = istr;
}


x86 assembly (clang, -O0):
<st103_set_istr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x40005c44,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<st103_set_istr>:
mov    %edi,0x40005c44
ret

LLVM IR (-O0):
define void @st103_set_istr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1073765444 to i32*)
ret void
}

LLVM IR (-O2):
define void @st103_set_istr(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1073765444 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateIntClear(unsigned long ulIntFlags) {
  DEBUG_ASSERT(!(ulIntFlags & ~(0x00000008 | 0x00000004 | 0x00000001 |
                                0x00000002 | 0x00000010)));
  (*((volatile unsigned long *)(0x400FC020))) |= ulIntFlags;
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateIntClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffffffffffe0,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    $0x400fc020,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400fc020,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateIntClear>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x20,%rbx
setb   %dil
call   1040 <DEBUG_ASSERT@plt>
or     %rbx,0x400fc020
40
xor    %eax,%eax
pop    %rbx
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -32
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %2
%10 = load volatile i64, i64* inttoptr (i64 1074774048 to i64*)
%11 = or i64 %10, %9
store volatile i64 %11, i64* inttoptr (i64 1074774048 to i64*)
%12 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateIntClear(i64 %0) {
%2 = icmp ult i64 %0, 32
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = load volatile i64, i64* inttoptr (i64 1074774048 to i64*)
%6 = or i64 %5, %0
store volatile i64 %6, i64* inttoptr (i64 1074774048 to i64*)
%7 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stdout;
scalar_t__ strchr(char *, int);
void princhar(int c) {
  if (strchr("\\'\"<>();~$^&*|{}[]?", c) != 0)
    fputc('\\', stdout);
  putchar(c);
}


x86 assembly (clang, -O0):
<princhar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     1167 <princhar+0x37>
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    $0x5c,%edi
call   1050 <fputc@plt>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<princhar>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1159 <princhar+0x29>
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    $0x5c,%edi
call   1050 <fputc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\\'\22<>();~$^&*|{}[]?\00"
@stdout = global i32 0
define void @princhar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @strchr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @stdout
%8 = call i32 @fputc(i8 signext 92, i32 %7)
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = call i32 @putchar(i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\\'\22<>();~$^&*|{}[]?\00"
@stdout = global i32 0
define void @princhar(i32 %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputc(i8 signext 92, i32 %5)
br label %7
7: ; preds = %4, %1
%8 = tail call i32 @putchar(i32 %0)
ret void
}
int bar(int x, unsigned long y, void *z) { return 0; }


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

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

LLVM IR (-O0):
define i32 @bar(i32 %0, i64 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i64 %1, i8* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ robber_erase(int);
int /*<<< orphan*/ robber_place(int);
int robber_left(int hex) {
  robber_erase(hex);
  hex--;
  if (hex == 2 || hex == 20)
    hex--;
  if (hex == 0)
    hex = 21;
  robber_place(hex);
  return hex;
}


x86 assembly (clang, -O0):
<robber_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <robber_erase@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     1150 <robber_left+0x30>
cmpl   $0x14,-0x4(%rbp)
jne    1159 <robber_left+0x39>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    116a <robber_left+0x4a>
movl   $0x15,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <robber_place@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<robber_left>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <robber_erase@plt>
cmp    $0x15,%ebx
je     1134 <robber_left+0x14>
cmp    $0x3,%ebx
jne    1139 <robber_left+0x19>
add    $0xfffffffe,%ebx
jmp    113c <robber_left+0x1c>
add    $0xffffffff,%ebx
test   %ebx,%ebx
mov    $0x15,%ebp
cmovne %ebx,%ebp
mov    %ebp,%edi
call   1030 <robber_place@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @robber_left(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @robber_erase(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 2
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 20
br i1 %11, label %12, label %15
12: ; preds = %9, %1
%13 = load i32, i32* %2
%14 = add nsw i32 %13, -1
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 21, i32* %2
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %2
%21 = call i32 @robber_place(i32 %20)
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @robber_left(i32 %0) {
%2 = tail call i32 @robber_erase(i32 %0)
%3 = add nsw i32 %0, -1
switch i32 %0, label %6 [
i32 21, label %4
i32 3, label %4
]
4: ; preds = %1, %1
%5 = add nsw i32 %0, -2
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %3, %1 ]
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 21, i32 %7
%10 = tail call i32 @robber_place(i32 %9)
ret i32 %9
}
void builtin_env(struct Value *argument, struct Value *env,
                 struct Value **out) {
  (void)argument;
  *out = env;
}


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

x86 assembly (clang, -O2):
<builtin_env>:
mov    %rsi,(%rdx)
ret

LLVM IR (-O0):
%struct.Value = type opaque
define void @builtin_env(%struct.Value* %0, %struct.Value* %1, %struct.Value** %2) {
%4 = alloca %struct.Value*
%5 = alloca %struct.Value*
%6 = alloca %struct.Value**
store %struct.Value* %0, %struct.Value** %4
store %struct.Value* %1, %struct.Value** %5
store %struct.Value** %2, %struct.Value*** %6
%7 = load %struct.Value*, %struct.Value** %4
%8 = load %struct.Value*, %struct.Value** %5
%9 = load %struct.Value**, %struct.Value*** %6
store %struct.Value* %8, %struct.Value** %9
ret void
}

LLVM IR (-O2):
%struct.Value = type opaque
define void @builtin_env(%struct.Value* nocapture readnone %0, %struct.Value* %1, %struct.Value** nocapture writeonly %2) {
store %struct.Value* %1, %struct.Value** %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t SuperNET_broadcast(char *msg, int32_t duration) { return (0); }


x86 assembly (clang, -O0):
<SuperNET_broadcast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @SuperNET_broadcast(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @SuperNET_broadcast(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
int null_write(const char *a, int n) {
  (void)a;
  return n;
}


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

x86 assembly (clang, -O2):
<null_write>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @null_write(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
ret i32 %6
}

LLVM IR (-O2):
define i32 @null_write(i8* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
void outsb(unsigned short port, const void *addr, unsigned long count) {
  asm volatile("cld ; rep ; outsb"
               : "=S"(addr), "=c"(count)
               : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
cld
rep outsb %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsb>:
mov    %rdx,%rcx
mov    %edi,%edx
cld
rep outsb %ds:(%rsi),(%dx)
ret

LLVM IR (-O0):
define void @outsb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "cld ; rep ; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @outsb(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; outsb", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xe2() {
  Assert_real((isupper(226) == 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",
              1135, ("isupper should be 0 for 0xe2"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xe2>:
push   %rax
mov    $0xe2,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46f,%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 = [29 x i8] c"isupper should be 0 for 0xe2\00"
define void @t_isupper_0xe2() {
%1 = call i64 @isupper(i32 226)
%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 1135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xe2\00"
define void @t_isupper_0xe2() {
%1 = tail call i64 @isupper(i32 226)
%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 1135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int bar();
int foo();
int main() {
  return !(foo() + bar() == 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
cmp    $0x5,%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <bar@plt>
add    %ebx,%eax
xor    %ecx,%ecx
cmp    $0x5,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = call i32 (...) @bar()
%4 = add nsw i32 %2, %3
%5 = icmp eq i32 %4, 5
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
%3 = add nsw i32 %2, %1
%4 = icmp ne i32 %3, 5
%5 = zext i1 %4 to i32
ret i32 %5
}
void cudF(unsigned char *x) { char *y = x; }


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

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

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

LLVM IR (-O2):
define void @cudF(i8* nocapture %0) {
ret void
}
void badconv(ch) char *ch;
{ errx(1, "%%%s: bad conversion character", ch); }


x86 assembly (clang, -O0):
<badconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badconv>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%%%s: bad conversion character\00"
define void @badconv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @errx to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%%%s: bad conversion character\00"
define void @badconv(i8* %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @errx to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int strcmp(const char *a, const char *b) {
  while (*a == *b) {
    if (!*a)
      return 0;
    a++;
    b++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1158 <strcmp+0x58>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113b <strcmp+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    115f <strcmp+0x5f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%cl
mov    $0x1,%eax
cmp    (%rsi),%cl
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
test   %cl,%cl
je     1125 <strcmp+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <strcmp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11, %2
%18 = phi i32 [ 1, %2 ], [ 1, %11 ], [ 0, %6 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x92() {
  Assert_real((isxdigit(146) == 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",
              735, ("isxdigit should be 0 for 0x92"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x92>:
push   %rax
mov    $0x92,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2df,%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 = [30 x i8] c"isxdigit should be 0 for 0x92\00"
define void @t_isxdigit_0x92() {
%1 = call i64 @isxdigit(i32 146)
%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 735, i8* getelementptr inbounds ([30 x i8], [30 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 = [30 x i8] c"isxdigit should be 0 for 0x92\00"
define void @t_isxdigit_0x92() {
%1 = tail call i64 @isxdigit(i32 146)
%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 735, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int sumar(int numero1, int numero2) { return numero1 + numero2; }


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

x86 assembly (clang, -O2):
<sumar>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @sumar(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @sumar(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int integer_sqrt(int);
void integer_sqrt_test(void) {
  assert(integer_sqrt(1) == 1);
  assert(integer_sqrt(625) == 25);
  assert(integer_sqrt(624) == -1);
}


x86 assembly (clang, -O0):
<integer_sqrt_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <integer_sqrt@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x271,%edi
call   1040 <integer_sqrt@plt>
cmp    $0x19,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x270,%edi
call   1040 <integer_sqrt@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer_sqrt_test>:
push   %rax
mov    $0x1,%edi
call   1040 <integer_sqrt@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x271,%edi
call   1040 <integer_sqrt@plt>
xor    %edi,%edi
cmp    $0x19,%eax
sete   %dil
call   1030 <assert@plt>
mov    $0x270,%edi
call   1040 <integer_sqrt@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @integer_sqrt_test() {
%1 = call i32 @integer_sqrt(i32 1)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @integer_sqrt(i32 625)
%6 = icmp eq i32 %5, 25
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @integer_sqrt(i32 624)
%10 = icmp eq i32 %9, -1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
define void @integer_sqrt_test() {
%1 = tail call i32 @integer_sqrt(i32 1)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @integer_sqrt(i32 625)
%6 = icmp eq i32 %5, 25
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @integer_sqrt(i32 624)
%10 = icmp eq i32 %9, -1
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
/* Variables and functions */
int rand();
int random_num() {
  int r = rand() % 27;
  return r;
}


x86 assembly (clang, -O0):
<random_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x1b,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_num>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x4bda12f7,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_num() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 27
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @random_num() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 27
ret i32 %2
}
int heap_maximum(int *a) { return a[1]; }


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

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

LLVM IR (-O0):
define i32 @heap_maximum(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @heap_maximum(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y;
};
struct TYPE_4__ {
  TYPE_1__ xcrossing;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcrossing_y(void *_p) {
  return (int)((XEvent *)_p)->xcrossing.y;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xcrossing_y(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xcrossing_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int do_896() { return 896; }


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

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

LLVM IR (-O0):
define i32 @do_896() {
ret i32 896
}

LLVM IR (-O2):
define i32 @do_896() {
ret i32 896
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xa3() {
  Assert_real((isupper(163) == 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",
              820, ("isupper should be 0 for 0xa3"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xa3>:
push   %rax
mov    $0xa3,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x334,%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 = [29 x i8] c"isupper should be 0 for 0xa3\00"
define void @t_isupper_0xa3() {
%1 = call i64 @isupper(i32 163)
%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 820, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xa3\00"
define void @t_isupper_0xa3() {
%1 = tail call i64 @isupper(i32 163)
%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 820, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}