xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ si_addr;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void SIGSEGV_Handler(int sig, siginfo_t *sip) {
  int *addr = (int *)sip->si_addr;
  _exit(addr != ((int *)0x2EA4F0));
}


x86 assembly (clang, -O0):
<SIGSEGV_Handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    $0x2ea4f0,%eax
cmp    %rax,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<SIGSEGV_Handler>:
push   %rax
xor    %edi,%edi
cmpq   $0x2ea4f0,(%rsi)
setne  %dil
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define void @SIGSEGV_Handler(i32 %0, %struct.TYPE_3__* %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_3__*
%5 = alloca i32*
store i32 %0, i32* %3
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %4
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = icmp ne i32* %10, inttoptr (i64 3056880 to i32*)
%12 = zext i1 %11 to i32
%13 = call i32 @_exit(i32 %12)
unreachable
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
define void @SIGSEGV_Handler(i32 %0, %struct.TYPE_3__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to i32*
%6 = icmp ne i32* %5, inttoptr (i64 3056880 to i32*)
%7 = zext i1 %6 to i32
%8 = tail call i32 @_exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *,
                           char const *);
void iptables_addpre(char *cmd, const char *Vip, const char *Sip,
                     const char *Sport) {
  sprintf(cmd,
          "/sbin/iptables"
          " -t nat -A PREROUTING -p tcp -d %s --dport %s -j DNAT --to %s",
          Vip, Sport, Sip);
}


x86 assembly (clang, -O0):
<iptables_addpre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xec1(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iptables_addpre>:
mov    %rdx,%r8
mov    %rsi,%rdx
lea    0xee3(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [76 x i8] c"/sbin/iptables -t nat -A PREROUTING -p tcp -d %s --dport %s -j DNAT --to %s\00"
define void @iptables_addpre(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %8
%12 = load i8*, i8** %7
%13 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [76 x i8] c"/sbin/iptables -t nat -A PREROUTING -p tcp -d %s --dport %s -j DNAT --to %s\00"
define void @iptables_addpre(i8* nocapture writeonly %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3, i8* %2)
ret void
}
void implement_switch_loop() {}


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

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

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

LLVM IR (-O2):
define void @implement_switch_loop() {
ret void
}
void check_stack_alignment(void) {}


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

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

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

LLVM IR (-O2):
define void @check_stack_alignment() {
ret void
}
/* Type definitions */
struct aiocb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int aio_cancel(int fd, struct aiocb *cb) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<aio_cancel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aio_cancel>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_cancel(i32 %0, %struct.aiocb* %1) {
%3 = alloca i32
%4 = alloca %struct.aiocb*
store i32 %0, i32* %3
store %struct.aiocb* %1, %struct.aiocb** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_cancel(i32 %0, %struct.aiocb* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
void Default_HardFault_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Default_HardFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Default_HardFault_Handler+0x9>
jmp    1109 <Default_HardFault_Handler+0x9>

x86 assembly (clang, -O2):
<Default_HardFault_Handler>:
jmp    1100 <Default_HardFault_Handler>

LLVM IR (-O0):
define void @Default_HardFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Default_HardFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int calFatorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int numero, fatorial;
  printf("\nInfo numero?: ");
  scanf("%d", &numero);
  fatorial = calFatorial(numero);
  printf("\nResult: %d\n\n", fatorial);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <calFatorial@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"\0AInfo numero?: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"\0AResult: %d\0A\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @calFatorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int errno;
int rename(char const *, char const *);
int __sulong_posix_rename(const char *old, const char *new) {
  {
    int native_errno = errno;
    int result = rename(old, new);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <rename@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1156 <__sulong_posix_rename+0x46>
xor    %eax,%eax
mov    0x2e91(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    0x2e80(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_rename>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <rename@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_rename(i8* nocapture %0, i8* nocapture %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @rename(i8* %0, i8* %1)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
store i32 %3, i32* @errno
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ console_printchr(char);
void console_print(char *str) {
  char *ptr = str;
  while (*ptr != 0) {
    char c = *ptr;
    console_printchr(c);
    ptr++;
  }
}


x86 assembly (clang, -O0):
<console_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <console_print+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edi
call   1030 <console_printchr@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <console_print+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <console_print+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <console_printchr@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <console_print+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @console_print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @console_printchr(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ safepath;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ simple_command(struct chirp_client *, int /*<<< orphan*/,
                                  char *, char *);
int /*<<< orphan*/ url_encode(char const *, char *, int);
int64_t chirp_client_opendir(struct chirp_client *c, const char *path,
                             time_t stoptime) {
  char safepath[1024];
  url_encode(path, safepath, sizeof(safepath));
  return simple_command(c, stoptime, "getdir %s\n", safepath);
}


x86 assembly (clang, -O0):
<chirp_client_opendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x420(%rbp),%rsi
mov    $0x400,%edx
call   1040 <url_encode@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x420(%rbp),%rcx
lea    0xea0(%rip),%rdx
call   1030 <simple_command@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_opendir>:
push   %rbp
push   %r14
push   %rbx
sub    $0x400,%rsp
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
call   1040 <url_encode@plt>
lea    0xeb6(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rcx
call   1030 <simple_command@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
@.str = [11 x i8] c"getdir %s\0A\00"
define i32 @chirp_client_opendir(%struct.chirp_client* %0, i8* %1, i32 %2) {
%4 = alloca %struct.chirp_client*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [1024 x i8]
store %struct.chirp_client* %0, %struct.chirp_client** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %5
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%10 = call i32 @url_encode(i8* %8, i8* %9, i32 1024)
%11 = load %struct.chirp_client*, %struct.chirp_client** %4
%12 = load i32, i32* %6
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = call i32 @simple_command(%struct.chirp_client* %11, i32 %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
@.str = [11 x i8] c"getdir %s\0A\00"
define i32 @chirp_client_opendir(%struct.chirp_client* %0, i8* %1, i32 %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @url_encode(i8* %1, i8* %5, i32 1024)
%7 = call i32 @simple_command(%struct.chirp_client* %0, i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 %7
}
void put32(char *addr, long val32) {
  *addr++ = val32;
  *addr++ = val32 >> 8;
  *addr++ = val32 >> 16;
  *addr = val32 >> 24;
}


x86 assembly (clang, -O0):
<put32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @put32(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %0
%5 = lshr i64 %1, 8
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %4
%8 = lshr i64 %1, 16
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %9, i8* %7
%11 = lshr i64 %1, 24
%12 = trunc i64 %11 to i8
store i8 %12, i8* %10
ret void
}
int channels_multi(int flags) {
  if (flags & 0x80)
    return 6;
  else if (flags & 1)
    return 5;
  else if ((flags & 0x3F) == 8)
    return 4;
  else
    return 2;
}


x86 assembly (clang, -O0):
<channels_multi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1124 <channels_multi+0x24>
movl   $0x6,-0x4(%rbp)
jmp    1161 <channels_multi+0x61>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113f <channels_multi+0x3f>
movl   $0x5,-0x4(%rbp)
jmp    1161 <channels_multi+0x61>
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
cmp    $0x8,%eax
jne    115a <channels_multi+0x5a>
movl   $0x4,-0x4(%rbp)
jmp    1161 <channels_multi+0x61>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<channels_multi>:
mov    $0x6,%eax
test   $0x80,%dil
jne    1126 <channels_multi+0x26>
mov    $0x5,%eax
test   $0x1,%dil
jne    1126 <channels_multi+0x26>
and    $0x3f,%edi
xor    %eax,%eax
cmp    $0x8,%edi
sete   %al
add    %eax,%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @channels_multi(i32 %0) {
%2 = and i32 %0, 128
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = and i32 %0, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = and i32 %0, 63
%9 = icmp eq i32 %8, 8
%10 = select i1 %9, i32 4, i32 2
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 6, %1 ], [ 5, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t OneWireBusStatus(uint32_t ui32Base) {
  ;
  return ((*((volatile uint32_t *)(ui32Base + 0x00000000))) &
          (0x00000100 | 0x00000200 | 0x00000400));
}


x86 assembly (clang, -O0):
<OneWireBusStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%eax
and    $0x700,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<OneWireBusStatus>:
movslq %edi,%rcx
mov    $0x700,%eax
and    (%rcx),%eax
ret

LLVM IR (-O0):
define i32 @OneWireBusStatus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 1792
ret i32 %8
}

LLVM IR (-O2):
define i32 @OneWireBusStatus(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = and i32 %4, 1792
ret i32 %5
}
void hand_handle_brkpipe(int sig) {}


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

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

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

LLVM IR (-O2):
define void @hand_handle_brkpipe(i32 %0) {
ret void
}
/* Variables and functions */
int memcmp(void const *, void const *, int);
int dtsp_udid_compare(const void *a, const void *b) { return memcmp(a, b, 16); }


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

x86 assembly (clang, -O2):
<dtsp_udid_compare>:
mov    $0x10,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @dtsp_udid_compare(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 16)
ret i32 %3
}
int getClockwiseAngle(int from, int to) {
  if (to < from) {
    to += 40;
  }
  return (to - from) * 9;
}


x86 assembly (clang, -O0):
<getClockwiseAngle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    111f <getClockwiseAngle+0x1f>
mov    -0x8(%rbp),%eax
add    $0x28,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
imul   $0x9,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getClockwiseAngle>:
lea    0x28(%rsi),%eax
cmp    %edi,%esi
cmovge %esi,%eax
sub    %edi,%eax
lea    (%rax,%rax,8),%eax
ret

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

LLVM IR (-O2):
define i32 @getClockwiseAngle(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = add nsw i32 %1, 40
%5 = select i1 %3, i32 %4, i32 %1
%6 = sub nsw i32 %5, %0
%7 = mul nsw i32 %6, 9
ret i32 %7
}
void f18_c() {
  int x = 0;
  while (1)
    x = 10;
}


x86 assembly (clang, -O0):
<f18_c>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x4(%rbp)
jmp    110b <f18_c+0xb>

x86 assembly (clang, -O2):
<f18_c>:
jmp    1100 <f18_c>

LLVM IR (-O0):
define void @f18_c() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
store i32 10, i32* %1
br label %2
}

LLVM IR (-O2):
define void @f18_c() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
uint32_t ht_hash_int32(const void *key) {
  int32_t integer;
  unsigned char *bytes;
  uint32_t hash;
  integer = ((int32_t)(intptr_t)(key));
  bytes = (unsigned char *)&integer;
  hash = 5381;
  for (int i = 0; i < 4; i++)
    hash = ((hash << 5) + hash) ^ bytes[i];
  return hash;
}


x86 assembly (clang, -O0):
<ht_hash_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1505,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x4,-0x20(%rbp)
jge    1158 <ht_hash_int32+0x58>
mov    -0x1c(%rbp),%eax
shl    $0x5,%eax
add    -0x1c(%rbp),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1126 <ht_hash_int32+0x26>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_hash_int32>:
mov    %rdi,%rax
mov    %eax,%ecx
movzbl %al,%edx
movzbl %ah,%esi
shr    $0x10,%eax
shr    $0x18,%ecx
xor    $0x2b5a5,%edx
mov    %edx,%edi
shl    $0x5,%edi
add    %edx,%edi
xor    %edi,%esi
mov    %esi,%edx
shl    $0x5,%edx
add    %esi,%edx
movzbl %al,%esi
xor    %edx,%esi
mov    %esi,%eax
shl    $0x5,%eax
add    %esi,%eax
xor    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ht_hash_int32(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = trunc i64 %2 to i32
%5 = lshr i32 %4, 8
%6 = trunc i64 %2 to i32
%7 = lshr i32 %6, 16
%8 = trunc i64 %2 to i32
%9 = lshr i32 %8, 24
%10 = and i32 %3, 255
%11 = xor i32 %10, 177573
%12 = mul nuw nsw i32 %11, 33
%13 = and i32 %5, 255
%14 = xor i32 %12, %13
%15 = mul nuw nsw i32 %14, 33
%16 = and i32 %7, 255
%17 = xor i32 %15, %16
%18 = mul i32 %17, 33
%19 = xor i32 %18, %9
ret i32 %19
}
/* Variables and functions */
int Child(int);
int Sibling(int);
int Youngest(int obj) {
  int nextobj;
  if (Child(obj) == 0)
    return 0;
  nextobj = Child(obj);
  while (Sibling(nextobj))
    nextobj = Sibling(nextobj);
  return nextobj;
}


x86 assembly (clang, -O0):
<Youngest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <Child@plt>
cmp    $0x0,%eax
jne    1148 <Youngest+0x28>
movl   $0x0,-0x4(%rbp)
jmp    117a <Youngest+0x5a>
mov    -0x8(%rbp),%edi
call   1030 <Child@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <Sibling@plt>
cmp    $0x0,%eax
je     1174 <Youngest+0x54>
mov    -0xc(%rbp),%edi
call   1040 <Sibling@plt>
mov    %eax,-0xc(%rbp)
jmp    1153 <Youngest+0x33>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Youngest>:
push   %rbx
mov    %edi,%ebx
call   1030 <Child@plt>
test   %eax,%eax
je     1156 <Youngest+0x36>
mov    %ebx,%edi
call   1030 <Child@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <Sibling@plt>
test   %eax,%eax
je     1158 <Youngest+0x38>
mov    %ebx,%edi
call   1040 <Sibling@plt>
jmp    1140 <Youngest+0x20>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Youngest(i32 %0) {
%2 = tail call i32 @Child(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = tail call i32 @Child(i32 %0)
%6 = tail call i32 @Sibling(i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4, %8
%9 = phi i32 [ %10, %8 ], [ %5, %4 ]
%10 = tail call i32 @Sibling(i32 %9)
%11 = tail call i32 @Sibling(i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %4, %1
%14 = phi i32 [ 0, %1 ], [ %5, %4 ], [ %10, %8 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
int RandomInteger(int low, int high) {
  int k;
  double d;
  d = (double)rand() / ((double)RAND_MAX + 1);
  k = d * (high - low + 1);
  return low + k;
}


x86 assembly (clang, -O0):
<RandomInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb7(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xec2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomInteger>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ebe(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
sub    %ebp,%ebx
add    $0x1,%ebx
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @RandomInteger(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i64 (...) @rand()
%8 = sitofp i64 %7 to double
%9 = load i64, i64* @RAND_MAX
%10 = sitofp i64 %9 to double
%11 = fadd double %10, 1.000000e+00
%12 = fdiv double %8, %11
store double %12, double* %6
%13 = load double, double* %6
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = sub nsw i32 %14, %15
%17 = add nsw i32 %16, 1
%18 = sitofp i32 %17 to double
%19 = fmul double %13, %18
%20 = fptosi double %19 to i32
store i32 %20, i32* %5
%21 = load i32, i32* %3
%22 = load i32, i32* %5
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @RandomInteger(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fadd double %6, 1.000000e+00
%8 = fdiv double %4, %7
%9 = sub i32 1, %0
%10 = add i32 %9, %1
%11 = sitofp i32 %10 to double
%12 = fmul double %8, %11
%13 = fptosi double %12 to i32
%14 = add nsw i32 %13, %0
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(unsigned short, int /*<<< orphan*/ *);
void _zip_write2(unsigned short i, FILE *fp) {
  putc(i & 0xff, fp);
  putc((i >> 8) & 0xff, fp);
  return;
}


x86 assembly (clang, -O0):
<_zip_write2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zip_write2>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
movzbl %bpl,%edi
call   1030 <putc@plt>
shr    $0x8,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @_zip_write2(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i16
%9 = load i32*, i32** %4
%10 = call i32 @putc(i16 zeroext %8, i32* %9)
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i16
%16 = load i32*, i32** %4
%17 = call i32 @putc(i16 zeroext %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @_zip_write2(i16 zeroext %0, i32* nocapture %1) {
%3 = and i16 %0, 255
%4 = tail call i32 @putc(i16 zeroext %3, i32* %1)
%5 = lshr i16 %0, 8
%6 = tail call i32 @putc(i16 zeroext %5, i32* %1)
ret void
}
int is_leap(unsigned int year) {
  year += 1900;
  return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
}


x86 assembly (clang, -O0):
<is_leap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    115b <is_leap+0x5b>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    1155 <is_leap+0x55>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap+0x9>
ret
add    $0x76c,%edi
imul   $0xc28f5c29,%edi,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leap+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1900
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = urem i32 %5, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i32, i32* %2
%10 = urem i32 %9, 100
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = urem i32 %13, 400
%15 = icmp eq i32 %14, 0
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ true, %8 ], [ %15, %12 ]
br label %18
18: ; preds = %16, %1
%19 = phi i1 [ false, %1 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_leap(i32 %0) {
%2 = add i32 %0, 1900
%3 = and i32 %0, 3
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = urem i32 %2, 100
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = urem i32 %2, 400
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %8, %1
%13 = phi i32 [ 0, %1 ], [ 1, %5 ], [ %11, %8 ]
ret i32 %13
}
int fun1391() { return 1391; }


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

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

LLVM IR (-O0):
define i32 @fun1391() {
ret i32 1391
}

LLVM IR (-O2):
define i32 @fun1391() {
ret i32 1391
}
/* Variables and functions */
char *obex_response_to_string(int);
char *OBEX_ResponseToString(int rsp) {
  ;
  return obex_response_to_string(rsp);
}


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

x86 assembly (clang, -O2):
<OBEX_ResponseToString>:
jmp    1030 <obex_response_to_string@plt>

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

LLVM IR (-O2):
define i8* @OBEX_ResponseToString(i32 %0) {
%2 = tail call i8* @obex_response_to_string(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x0f() {
  Assert_real((isprint(15) == 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_isprint.c",
              80, ("isprint should be 0 for 0x0f"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x0f>:
push   %rax
mov    $0xf,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x50,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x0f\00"
define void @t_isprint_0x0f() {
%1 = call i64 @isprint(i32 15)
%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 80, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x0f\00"
define void @t_isprint_0x0f() {
%1 = tail call i64 @isprint(i32 15)
%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 80, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double glmMax3d(double a, double b, double c) {
  if (a > b) {
    if (a > c)
      return a;
    else
      return c;
  } else {
    if (b > c)
      return b;
    else
      return c;
  }
}


x86 assembly (clang, -O0):
<glmMax3d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1151 <glmMax3d+0x51>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1142 <glmMax3d+0x42>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117a <glmMax3d+0x7a>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117a <glmMax3d+0x7a>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1170 <glmMax3d+0x70>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117a <glmMax3d+0x7a>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMax3d>:
maxsd  %xmm1,%xmm0
maxsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @glmMax3d(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load double, double* %5
%13 = load double, double* %7
%14 = fcmp ogt double %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load double, double* %5
store double %16, double* %4
br label %27
17: ; preds = %11
%18 = load double, double* %7
store double %18, double* %4
br label %27
19: ; preds = %3
%20 = load double, double* %6
%21 = load double, double* %7
%22 = fcmp ogt double %20, %21
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = load double, double* %6
store double %24, double* %4
br label %27
25: ; preds = %19
%26 = load double, double* %7
store double %26, double* %4
br label %27
27: ; preds = %25, %23, %17, %15
%28 = load double, double* %4
ret double %28
}

LLVM IR (-O2):
define double @glmMax3d(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %0, double %2
%7 = fcmp ogt double %1, %2
%8 = select i1 %7, double %1, double %2
%9 = select i1 %4, double %6, double %8
ret double %9
}
/* Type definitions */
struct clad_test {
  int dummy;
};

/* Variables and functions */
struct clad_test *clad_test_assert(struct clad_test *, int, char *, void *,
                                   void *, char const *);
struct clad_test *clad_test_ptreq(struct clad_test *test, void *p1, void *p2,
                                  const char *explain) {
  return clad_test_assert(
      test, p1 == p2, "Pointers should be equal: %p %p; %s ", p1, p2, explain);
}


x86 assembly (clang, -O0):
<clad_test_ptreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xeb1(%rip),%rdx
call   1030 <clad_test_assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_test_ptreq>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
xor    %esi,%esi
cmp    %rdx,%rcx
sete   %sil
lea    0xed7(%rip),%rdx
jmp    1030 <clad_test_assert@plt>

LLVM IR (-O0):
%struct.clad_test = type { i32 }
@.str = [37 x i8] c"Pointers should be equal: %p %p; %s \00"
define %struct.clad_test* @clad_test_ptreq(%struct.clad_test* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.clad_test*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.clad_test* %0, %struct.clad_test** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load %struct.clad_test*, %struct.clad_test** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = icmp eq i8* %10, %11
%13 = zext i1 %12 to i32
%14 = load i8*, i8** %6
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = call %struct.clad_test* @clad_test_assert(%struct.clad_test* %9, i32 %13, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15, i8* %16)
ret %struct.clad_test* %17
}

LLVM IR (-O2):
%struct.clad_test = type { i32 }
@.str = [37 x i8] c"Pointers should be equal: %p %p; %s \00"
define %struct.clad_test* @clad_test_ptreq(%struct.clad_test* %0, i8* %1, i8* %2, i8* %3) {
%5 = icmp eq i8* %1, %2
%6 = zext i1 %5 to i32
%7 = tail call %struct.clad_test* @clad_test_assert(%struct.clad_test* %0, i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret %struct.clad_test* %7
}
int cnt_comp_mask(const void *ap, const void *bp) {
  int a = *(int *)ap, b = *(int *)bp;
  return (a & 0x00FFFFFF) - (b & 0x00FFFFFF);
}


x86 assembly (clang, -O0):
<cnt_comp_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    $0xffffff,%eax
mov    -0x18(%rbp),%ecx
and    $0xffffff,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnt_comp_mask>:
mov    $0xffffff,%ecx
mov    (%rdi),%eax
and    %ecx,%eax
and    (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cnt_comp_mask(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = and i32 %4, 16777215
%8 = and i32 %6, 16777215
%9 = sub nsw i32 %7, %8
ret i32 %9
}
/* Variables and functions */
float cos(float);
float glmRandomNumberf(int /*<<< orphan*/, double);
float sin(float);
void glmGenerateRandomVector2f(float v[2]) {
  float a;
  a = glmRandomNumberf(0, 6.283185307179586476925286766559);
  v[0] = sin(a);
  v[1] = cos(a);
}


x86 assembly (clang, -O0):
<glmGenerateRandomVector2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
movsd  0xeba(%rip),%xmm0
call   1050 <glmRandomNumberf@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmGenerateRandomVector2f>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  0xec0(%rip),%xmm0
xor    %edi,%edi
call   1050 <glmRandomNumberf@plt>
movss  %xmm0,0xc(%rsp)
call   1030 <sin@plt>
movss  %xmm0,(%rbx)
movss  0xc(%rsp),%xmm0
call   1040 <cos@plt>
movss  %xmm0,0x4(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @glmGenerateRandomVector2f(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
%4 = call float @glmRandomNumberf(i32 0, double 0x401921FB54442D18)
store float %4, float* %3
%5 = load float, float* %3
%6 = call float @sin(float %5)
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
store float %6, float* %8
%9 = load float, float* %3
%10 = call float @cos(float %9)
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 1
store float %10, float* %12
ret void
}

LLVM IR (-O2):
define void @glmGenerateRandomVector2f(float* nocapture writeonly %0) {
%2 = tail call float @glmRandomNumberf(i32 0, double 0x401921FB54442D18)
%3 = tail call float @sin(float %2)
store float %3, float* %0
%4 = tail call float @cos(float %2)
%5 = getelementptr inbounds float, float* %0, i64 1
store float %4, float* %5
ret void
}
void main(void) {
  unsigned char *VMEM = (unsigned char *)0x8000;
  for (char i = 0; i < 384; i++) {
    *VMEM = 'x';
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8000,%eax
mov    %rax,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x180,%eax
jge    1134 <main+0x34>
mov    -0x8(%rbp),%rax
movb   $0x78,(%rax)
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    1111 <main+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @main() {
%1 = alloca i8*
%2 = alloca i8
store i8* inttoptr (i64 32768 to i8*), i8** %1
store i8 0, i8* %2
br label %3
3: ; preds = %9, %0
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 384
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = load i8*, i8** %1
store i8 120, i8* %8
br label %9
9: ; preds = %7
%10 = load i8, i8* %2
%11 = add i8 %10, 1
store i8 %11, i8* %2
br label %3
12: ; preds = %3
ret void
}

LLVM IR (-O2):
void zltor(name, name2) char *name, *name2;
{ nzltor(name, name2, 1, 0, 255); }


x86 assembly (clang, -O0):
<zltor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
mov    $0x0,%al
call   1030 <nzltor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zltor>:
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
xor    %eax,%eax
jmp    1030 <nzltor@plt>

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

LLVM IR (-O2):
define void @zltor(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, i32, i32, i32, ...) bitcast (i32 (...)* @nzltor to i32 (i8*, i8*, i32, i32, i32, ...)*)(i8* %0, i8* %1, i32 1, i32 0, i32 255)
ret void
}