xunge/DecIR huggingface dataset:
int __attribute__((const)) lw6sys_chr_is_alnum(char c) {
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') ||
         (c >= 'A' && c <= 'Z');
}


x86 assembly (clang, -O0):
<lw6sys_chr_is_alnum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <lw6sys_chr_is_alnum+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <lw6sys_chr_is_alnum+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <lw6sys_chr_is_alnum+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    116d <lw6sys_chr_is_alnum+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <lw6sys_chr_is_alnum+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw6sys_chr_is_alnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x1a,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @lw6sys_chr_is_alnum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 90
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @lw6sys_chr_is_alnum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void Xil_ExceptionInit(void) {}


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

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

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

LLVM IR (-O2):
define void @Xil_ExceptionInit() {
ret void
}
int file_lock(int fd, int exclusive) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @file_lock(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *memdup(void const *src, size_t size) {
  void *r = (void *)malloc(size);
  memcpy(r, src, size);
  return r;
}


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

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @memdup(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 i64, i64* %4
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = tail call i64 @malloc(i64 %1)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
ret i8* %4
}
/* Type definitions */
struct msghdr {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recvmsg(int, struct msghdr *, int);
__attribute__((weak)) ssize_t __real_recvmsg(int fd, struct msghdr *msg,
                                             int flags) {
  return recvmsg(fd, msg, flags);
}


x86 assembly (clang, -O0):
<__real_recvmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <recvmsg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__real_recvmsg>:
jmp    1030 <recvmsg@plt>

LLVM IR (-O0):
%struct.msghdr = type { i32 }
define weak i32 @__real_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.msghdr*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.msghdr* %1, %struct.msghdr** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load %struct.msghdr*, %struct.msghdr** %5
%9 = load i32, i32* %6
%10 = call i32 @recvmsg(i32 %7, %struct.msghdr* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.msghdr = type { i32 }
define weak i32 @__real_recvmsg(i32 %0, %struct.msghdr* %1, i32 %2) {
%4 = tail call i32 @recvmsg(i32 %0, %struct.msghdr* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
void main() {
  int a = 42;
  foo(&a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2a,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2a,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 42, i32* %1
%2 = call i32 @foo(i32* %1)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 42, i32* %1
%3 = call i32 @foo(i32* %1)
ret void
}
char *strcat(char *dest, const char *src) {
  while (*dest != 0) {
    *dest = *dest++;
  }
  do {
    *dest++ = *src++;
  } while (*src != 0);
  return dest;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <strcat+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    110c <strcat+0xc>
jmp    113d <strcat+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113d <strcat+0x3d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    (%rdi),%al
test   %al,%al
je     1118 <strcat+0x18>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
jmp    1110 <strcat+0x10>
mov    (%rsi),%al
add    $0x1,%rsi
xchg   %ax,%ax
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1120 <strcat+0x20>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = load i8, i8* %1
br label %10
7: ; preds = %2, %7
%8 = phi i8* [ %9, %7 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %3, i8* %9
br label %7
10: ; preds = %5, %10
%11 = phi i8 [ %16, %10 ], [ %6, %5 ]
%12 = phi i8* [ %15, %10 ], [ %0, %5 ]
%13 = phi i8* [ %14, %10 ], [ %1, %5 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %12
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %10
18: ; preds = %10
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int tcpaccfhttp(int sock) {
  (void)sock;
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<tcpaccfhttp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpaccfhttp>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @tcpaccfhttp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @tcpaccfhttp(i32 %0) {
%2 = load i32, i32* @EINVAL
store i32 %2, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char buf[256];
  getcwd(buf, sizeof(buf));
  printf("current directory: %s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1040 <getcwd@plt>
lea    -0x110(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <getcwd@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"current directory: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @getcwd(i8* %3, i32 256)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"current directory: %s\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @getcwd(i8* %2, i32 256)
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int s3cfb_close_fifo(int id, int (*do_priv)(void *), void *param) { return 0; }


x86 assembly (clang, -O0):
<s3cfb_close_fifo>:
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):
<s3cfb_close_fifo>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @s3cfb_close_fifo(i32 %0, i32 (i8*)* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
int dbg_check_synced_i_size(const struct ubifs_info *c, struct inode *inode) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
%struct.inode = type opaque
define i32 @dbg_check_synced_i_size(%struct.ubifs_info* %0, %struct.inode* %1) {
%3 = alloca %struct.ubifs_info*
%4 = alloca %struct.inode*
store %struct.ubifs_info* %0, %struct.ubifs_info** %3
store %struct.inode* %1, %struct.inode** %4
ret i32 0
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.inode = type opaque
define i32 @dbg_check_synced_i_size(%struct.ubifs_info* nocapture readnone %0, %struct.inode* nocapture readnone %1) {
ret i32 0
}
int do_052() { return 52; }


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

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

LLVM IR (-O0):
define i32 @do_052() {
ret i32 52
}

LLVM IR (-O2):
define i32 @do_052() {
ret i32 52
}
/* Variables and functions */
size_t ft_tablen(char **tab) {
  int i;
  i = 0;
  while (tab && tab[i])
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_tablen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1132 <ft_tablen+0x32>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1142 <ft_tablen+0x42>
jmp    1150 <ft_tablen+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_tablen+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tablen>:
test   %rdi,%rdi
je     111f <ft_tablen+0x1f>
mov    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <ft_tablen+0x10>
mov    %eax,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @ft_tablen(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = and i64 %4, 4294967295
br label %11
11: ; preds = %9, %1
%12 = phi i64 [ 0, %1 ], [ %10, %9 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ insert_sort(int *, int);
void sortLoop0(int *arr, int len) { insert_sort(arr, len - 1); }


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

x86 assembly (clang, -O2):
<sortLoop0>:
add    $0xffffffff,%esi
jmp    1030 <insert_sort@plt>

LLVM IR (-O0):
define void @sortLoop0(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 = sub nsw i32 %6, 1
%8 = call i32 @insert_sort(i32* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @sortLoop0(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @insert_sort(i32* %0, i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int errno;
scalar_t__ getpgid(scalar_t__);
pid_t __sulong_posix_getpgid(pid_t pid) {
  {
    int native_errno = errno;
    pid_t result = getpgid(pid);
    if (result == (pid_t)-1) {
      result = (pid_t)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_getpgid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getpgid@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jne    1151 <__sulong_posix_getpgid+0x41>
xor    %eax,%eax
mov    0x2e97(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2e85(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_getpgid>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <getpgid@plt>
movslq (%rbx),%rcx
neg    %rcx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i64 @__sulong_posix_getpgid(i64 %0) {
%2 = load i32, i32* @errno
%3 = tail call i64 @getpgid(i64 %0)
%4 = icmp eq i64 %3, -1
%5 = load i32, i32* @errno
%6 = sub nsw i32 0, %5
%7 = sext i32 %6 to i64
%8 = select i1 %4, i64 %7, i64 %3
store i32 %2, i32* @errno
ret i64 %8
}
void general_protection() {
  __asm__ __volatile__("cli");
  SetTextColor(0x04 | 0x08, 0x00);
  kprintf("\nERROR: general_protection\n");
  do {
    __asm__ __volatile__("cli  \n\t"
                         "hlt");
  } while (1 == 1);
}


x86 assembly (clang, -O0):
<general_protection>:
push   %rbp
mov    %rsp,%rbp
cli
mov    $0xc,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <SetTextColor@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <kprintf@plt>
cli
hlt
mov    $0x1,%al
test   $0x1,%al
jne    1141 <general_protection+0x21>
jmp    1152 <general_protection+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<general_protection>:
push   %rax
cli
mov    $0xc,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <SetTextColor@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <kprintf@plt>
xchg   %ax,%ax
cli
hlt
jmp    1140 <general_protection+0x20>

LLVM IR (-O0):
@.str = [28 x i8] c"\0AERROR: general_protection\0A\00"
define void @general_protection() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %4, %0
br label %4
4: ; preds = %3
br i1 true, label %3, label %5
5: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0AERROR: general_protection\0A\00"
define void @general_protection() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
tail call void asm sideeffect "cli \0A\09hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %3
}
int lldesc_get_required_num_constrained(int data_size, int max_desc_size) {
  return (data_size + max_desc_size - 1) / max_desc_size;
}


x86 assembly (clang, -O0):
<lldesc_get_required_num_constrained>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lldesc_get_required_num_constrained>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @lldesc_get_required_num_constrained(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
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @lldesc_get_required_num_constrained(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int lpgr(unsigned long, unsigned long *);
int /*<<< orphan*/ printf(char *, unsigned long, int);
void t64(unsigned long value) {
  int cc;
  unsigned long n;
  cc = lpgr(value, &n);
  printf("new: %ld cc: %d\n", n, cc);
}


x86 assembly (clang, -O0):
<t64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <lpgr@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t64>:
push   %rax
mov    %rsp,%rsi
call   1040 <lpgr@plt>
mov    (%rsp),%rsi
lea    0xecc(%rip),%rdi
mov    %eax,%edx
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"new: %ld cc: %d\0A\00"
define void @t64(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i32 @lpgr(i64 %5, i64* %4)
store i32 %6, i32* %3
%7 = load i64, i64* %4
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"new: %ld cc: %d\0A\00"
define void @t64(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @lpgr(i64 %0, i64* %2)
%5 = load i64, i64* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %5, i32 %4)
ret void
}
void Delay() {
  unsigned int i = 55555555;
  while (i-- > 0) {
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x34fb5e3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jbe    1124 <Delay+0x24>
jmp    110b <Delay+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Delay() {
%1 = alloca i32
store i32 55555555, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = add i32 %3, -1
store i32 %4, i32* %1
%5 = icmp ugt i32 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @Delay() {
ret void
}
/* Variables and functions */
unsigned int usleep(int);
unsigned int sleep(unsigned int seconds) { return usleep(1000000 * seconds); }


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0xf4240,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
imul   $0xf4240,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define i32 @sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 1000000, %3
%5 = call i32 @usleep(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @sleep(i32 %0) {
%2 = mul i32 %0, 1000000
%3 = tail call i32 @usleep(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void fail(char const *msg) {
  perror(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @fail(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
char to_hex(char code) {
  static const char hex[] = "0123456789abcdef";
  return hex[(int)code & 15];
}


x86 assembly (clang, -O0):
<to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xee5(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@to_hex.hex = internal constant [17 x i8] c"0123456789abcdef\00"
define signext i8 @to_hex(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 15
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @to_hex.hex, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@to_hex.hex = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define signext i8 @to_hex(i8 signext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @to_hex.hex, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
void glColor4f(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glColor4f() {
ret void
}
int fim_exp_reg(array)
char *array;
{
  if (*array == '\0')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<fim_exp_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1124 <fim_exp_reg+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <fim_exp_reg+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fim_exp_reg>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @fim_exp_reg(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @fim_exp_reg(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int main(void) {
  long long a = 0;
  int b;
  a = __builtin_popcountll(1);
  b = __builtin_popcount(1);
  return (int)a + b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i64 0, i64* %2
store i64 1, i64* %2
store i32 1, i32* %3
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
void TIM2_UP_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM2_UP_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ S9xSA1SetPCBase(int /*<<< orphan*/);
int /*<<< orphan*/ SA1AbsoluteLong(int);
void Op5C(void) { S9xSA1SetPCBase(SA1AbsoluteLong(5)); }


x86 assembly (clang, -O0):
<Op5C>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <SA1AbsoluteLong@plt>
mov    %eax,%edi
call   1040 <S9xSA1SetPCBase@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op5C>:
push   %rax
mov    $0x5,%edi
call   1030 <SA1AbsoluteLong@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <S9xSA1SetPCBase@plt>

LLVM IR (-O0):
define void @Op5C() {
%1 = call i32 @SA1AbsoluteLong(i32 5)
%2 = call i32 @S9xSA1SetPCBase(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op5C() {
%1 = tail call i32 @SA1AbsoluteLong(i32 5)
%2 = tail call i32 @S9xSA1SetPCBase(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *, char const *,
                          int);
void putMember(const char *base, const char *name, int offset) {
  printf("%%define %s.%s\t\t(%s+%d)\n", base, name, base, offset);
}


x86 assembly (clang, -O0):
<putMember>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putMember>:
mov    %edx,%r8d
mov    %rsi,%rdx
mov    %rdi,%rcx
lea    0xee0(%rip),%rdi
mov    %rcx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%%define %s.%s\09\09(%s+%d)\0A\00"
define void @putMember(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 i8*, i8** %4
%10 = load i32, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"%%define %s.%s\09\09(%s+%d)\0A\00"
define void @putMember(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %0, i32 %2)
ret void
}
void foo737() {}


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

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

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

LLVM IR (-O2):
define void @foo737() {
ret void
}
int fun428() { return 428; }


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

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

LLVM IR (-O0):
define i32 @fun428() {
ret i32 428
}

LLVM IR (-O2):
define i32 @fun428() {
ret i32 428
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void pc_closesrc(void *handle) {
  assert(handle != NULL);
  fclose((FILE *)handle);
}


x86 assembly (clang, -O0):
<pc_closesrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_closesrc>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @pc_closesrc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
define void @pc_closesrc(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = bitcast i8* %0 to i32*
%6 = tail call i32 @fclose(i32* %5)
ret void
}
/* Variables and functions */
int ic;
long jc;
int m(char *, int, long);
int call(int pi, long pj) {
  volatile ic = pi - 42;
  volatile jc = pj + 42;
  return m("call", ic, jc);
}


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x2a,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2a,%rax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%eax
movslq %eax,%rdx
lea    0xebd(%rip),%rdi
call   1030 <m@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
add    $0xffffffd6,%edi
mov    %edi,-0x4(%rsp)
add    $0x2a,%esi
mov    %esi,-0x8(%rsp)
mov    -0x4(%rsp),%esi
movslq -0x8(%rsp),%rdx
lea    0xed2(%rip),%rdi
jmp    1030 <m@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"call\00"
@ic = global i32 0
@jc = global i64 0
define i32 @call(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 42
store volatile i32 %8, i32* %5
%9 = load i64, i64* %4
%10 = add nsw i64 %9, 42
%11 = trunc i64 %10 to i32
store volatile i32 %11, i32* %6
%12 = load volatile i32, i32* %5
%13 = load volatile i32, i32* %6
%14 = sext i32 %13 to i64
%15 = call i32 @m(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %12, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"call\00"
@ic = global i32 0
@jc = global i64 0
define i32 @call(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = add nsw i32 %0, -42
store volatile i32 %6, i32* %3
%7 = bitcast i32* %4 to i8*
%8 = trunc i64 %1 to i32
%9 = add i32 %8, 42
store volatile i32 %9, i32* %4
%10 = load volatile i32, i32* %3
%11 = load volatile i32, i32* %4
%12 = sext i32 %11 to i64
%13 = tail call i32 @m(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10, i64 %12)
ret i32 %13
}
void NullTextL(struct ADrawTag *ctx __attribute__((unused)),
               unsigned int x __attribute__((unused)),
               unsigned int y __attribute__((unused)),
               const char *string __attribute__((unused))) {}


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

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

LLVM IR (-O0):
%struct.ADrawTag = type opaque
define void @NullTextL(%struct.ADrawTag* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca %struct.ADrawTag*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store %struct.ADrawTag* %0, %struct.ADrawTag** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type opaque
define void @NullTextL(%struct.ADrawTag* nocapture %0, i32 %1, i32 %2, i8* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x4e() {
  Assert_real((isascii(78)),
              "/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_isascii.c",
              395, ("isascii should be 1 for N"));
}


x86 assembly (clang, -O0):
<t_isascii_0x4e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x18b,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x4e>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x18b,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for N\00"
define void @t_isascii_0x4e() {
%1 = call i32 @isascii(i32 78)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 395, 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for N\00"
define void @t_isascii_0x4e() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 395, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int in_byte(int);
int /*<<< orphan*/ out_byte(scalar_t__, int);
int bputc(int port, int c) {
  while ((in_byte(port + 5) & 0x20) == 0)
    ;
  out_byte(port + 0, c);
}


x86 assembly (clang, -O0):
<bputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    $0x5,%edi
call   1030 <in_byte@plt>
and    $0x20,%eax
cmp    $0x0,%eax
jne    114a <bputc+0x2a>
jmp    112e <bputc+0xe>
mov    -0x8(%rbp),%eax
add    $0x0,%eax
movslq %eax,%rdi
mov    -0xc(%rbp),%esi
call   1040 <out_byte@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bputc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
lea    0x5(%rbx),%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
call   1030 <in_byte@plt>
test   $0x20,%al
je     1130 <bputc+0x10>
movslq %ebx,%rdi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <out_byte@plt>

LLVM IR (-O0):
define i32 @bputc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
br label %6
6: ; preds = %12, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 5
%9 = call i32 @in_byte(i32 %8)
%10 = and i32 %9, 32
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6
br label %6
13: ; preds = %6
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 0
%16 = sext i32 %15 to i64
%17 = load i32, i32* %5
%18 = call i32 @out_byte(i64 %16, i32 %17)
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @bputc(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 5
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @in_byte(i32 %3)
%6 = and i32 %5, 32
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = sext i32 %0 to i64
%10 = tail call i32 @out_byte(i64 %9, i32 %1)
ret i32 undef
}
void module_update_tracepoints(void) {}


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

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

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

LLVM IR (-O2):
define void @module_update_tracepoints() {
ret void
}
/* Variables and functions */
float saturatef(double);
float self_shadow_smooth_ex(float x) { return saturatef(4.0 * x); }


x86 assembly (clang, -O0):
<self_shadow_smooth_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <saturatef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<self_shadow_smooth_ex>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
jmp    1030 <saturatef@plt>

LLVM IR (-O0):
define float @self_shadow_smooth_ex(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 4.000000e+00, %4
%6 = call float @saturatef(double %5)
ret float %6
}

LLVM IR (-O2):
define float @self_shadow_smooth_ex(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 4.000000e+00
%4 = tail call float @saturatef(double %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
void rmfirstch(const char *pw, char *ret) { strcpy(ret, pw + 1); }


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

x86 assembly (clang, -O2):
<rmfirstch>:
mov    %rsi,%rax
lea    0x1(%rdi),%rsi
mov    %rax,%rdi
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @rmfirstch(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = tail call i32 @strcpy(i8* %1, i8* %3)
ret void
}
unsigned Qint(unsigned qV) { return (qV & 0xFFFF0000); }


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

x86 assembly (clang, -O2):
<Qint>:
mov    %edi,%eax
and    $0xffff0000,%eax
ret

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

LLVM IR (-O2):
define i32 @Qint(i32 %0) {
%2 = and i32 %0, -65536
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, long);
int8_t *ll_ltoa(int64_t i) {
  char *buf = (char *)calloc(20, sizeof(char));
  snprintf((char *)buf, 20, "%ld", (long)i);
  return (int8_t *)buf;
}


x86 assembly (clang, -O0):
<ll_ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x14,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x14,%esi
lea    0xead(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ll_ltoa>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x14,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdx
mov    %rax,%rdi
mov    $0x14,%esi
mov    %r14,%rcx
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define i32* @ll_ltoa(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = call i64 @calloc(i32 20, i32 1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @snprintf(i8* %6, i32 20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
ret i32* %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32* @ll_ltoa(i64 %0) {
%2 = tail call i64 @calloc(i32 20, i32 1)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @snprintf(i8* %3, i32 20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = inttoptr i64 %2 to i32*
ret i32* %5
}
extern const char *env_findeq(const char *s) {
  for (; *s; ++s)
    if (*s == '=')
      return s;
  return 0;
}


x86 assembly (clang, -O0):
<env_findeq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <env_findeq+0x48>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    1132 <env_findeq+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1150 <env_findeq+0x50>
jmp    1137 <env_findeq+0x37>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <env_findeq+0x8>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_findeq>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <env_findeq+0x22>
cmp    $0x3d,%cl
je     1124 <env_findeq+0x24>
add    $0x1,%rax
jmp    1110 <env_findeq+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @env_findeq(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %8
i8 61, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i8* [ %3, %7 ], [ null, %2 ]
ret i8* %9
}
int is_unix(char *socket_name, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (socket_name[i] == ':')
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_unix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1152 <is_unix+0x52>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    113f <is_unix+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1159 <is_unix+0x59>
jmp    1144 <is_unix+0x44>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <is_unix+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unix>:
mov    $0x1,%eax
test   %esi,%esi
jle    111f <is_unix+0x1f>
mov    %esi,%ecx
xor    %edx,%edx
nopl   (%rax)
cmpb   $0x3a,(%rdi,%rdx,1)
je     1120 <is_unix+0x20>
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1110 <is_unix+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_unix(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 58
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %14, label %6
14: ; preds = %8, %6, %2
%15 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}