xunge/DecIR huggingface dataset:
void Swap(int *A, int i, int j) {
  int temp;
  temp = A[i];
  A[i] = A[j];
  A[j] = temp;
}


x86 assembly (clang, -O0):
<Swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @Swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Type definitions */
typedef int u_int64_t;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_be32(int, int /*<<< orphan*/ *);
void __put_unaligned_be64(u_int64_t val, u_char *p) {
  __put_unaligned_be32(val >> 32, p);
  __put_unaligned_be32(val, p + 4);
}


x86 assembly (clang, -O0):
<__put_unaligned_be64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
mov    -0x10(%rbp),%rsi
call   1030 <__put_unaligned_be32@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
call   1030 <__put_unaligned_be32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_be64>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <__put_unaligned_be32@plt>
add    $0x10,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_be32@plt>

LLVM IR (-O0):
define void @__put_unaligned_be64(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 = ashr i32 %5, 32
%7 = load i32*, i32** %4
%8 = call i32 @__put_unaligned_be32(i32 %6, i32* %7)
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 4
%12 = call i32 @__put_unaligned_be32(i32 %9, i32* %11)
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_be64(i32 %0, i32* %1) {
%3 = tail call i32 @__put_unaligned_be32(i32 poison, i32* %1)
%4 = getelementptr inbounds i32, i32* %1, i64 4
%5 = tail call i32 @__put_unaligned_be32(i32 %0, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc5(int status, void *arg) {
  printf("Executing exitfunc"
         "5"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


x86 assembly (clang, -O0):
<exitfunc5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc5>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Executing exitfunc5 (status=%d, arg=%lu)\0A\00"
define void @exitfunc5(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Executing exitfunc5 (status=%d, arg=%lu)\0A\00"
define void @exitfunc5(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
const char *f_name_out(long long int i) {
  switch (i) {
  case 0:
    return "r";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<f_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
test   %rax,%rax
jne    112a <f_name_out+0x2a>
jmp    111a <f_name_out+0x1a>
lea    0xedf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <f_name_out+0x32>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_name_out>:
xor    %eax,%eax
test   %rdi,%rdi
lea    0xef4(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i8* @f_name_out(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %6 [
i64 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* null, i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i8* @f_name_out(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_probe_req(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0000 | 0x0040);
}


x86 assembly (clang, -O0):
<ieee80211_is_probe_req>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x40,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_probe_req>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x40,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_probe_req(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 64)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_probe_req(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 64)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int sd_network_get_domains(char ***ret) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_network_get_domains>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_network_get_domains>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_network_get_domains(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_network_get_domains(i8*** nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
void __android_log_assert(const char *cond, const char *tag, const char *fmt,
                          ...) {}


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

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

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

LLVM IR (-O2):
define void @__android_log_assert(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, ...) {
ret void
}
int utcstr_2_yr(char *utc) {
  int Y[4];
  int i, year;
  for (i = 0; i < 4; i++) {
    Y[i] = utc[i] - '0';
  }
  year = Y[0] * 1000 + Y[1] * 100 + Y[2] * 10 + Y[3];
  return year;
}


x86 assembly (clang, -O0):
<utcstr_2_yr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    113e <utcstr_2_yr+0x3e>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
sub    $0x30,%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    110f <utcstr_2_yr+0xf>
imul   $0x3e8,-0x20(%rbp),%eax
imul   $0x64,-0x1c(%rbp),%ecx
add    %ecx,%eax
imul   $0xa,-0x18(%rbp),%ecx
add    %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utcstr_2_yr>:
movsbl (%rdi),%eax
movsbl 0x1(%rdi),%ecx
movsbl 0x2(%rdi),%edx
movsbl 0x3(%rdi),%esi
imul   $0x3e8,%eax,%eax
imul   $0x64,%ecx,%ecx
add    %eax,%ecx
lea    (%rdx,%rdx,4),%eax
lea    (%rcx,%rax,2),%eax
add    %esi,%eax
add    $0xffff2fb0,%eax
ret

LLVM IR (-O0):
define i32 @utcstr_2_yr(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i32]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
br label %6
6: ; preds = %20, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i8*, i8** %2
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 48
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %18
store i32 %16, i32* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %6
23: ; preds = %6
%24 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%25 = load i32, i32* %24
%26 = mul nsw i32 %25, 1000
%27 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 1
%28 = load i32, i32* %27
%29 = mul nsw i32 %28, 100
%30 = add nsw i32 %26, %29
%31 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%32 = load i32, i32* %31
%33 = mul nsw i32 %32, 10
%34 = add nsw i32 %30, %33
%35 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
%36 = load i32, i32* %35
%37 = add nsw i32 %34, %36
store i32 %37, i32* %5
%38 = load i32, i32* %5
ret i32 %38
}

LLVM IR (-O2):
define i32 @utcstr_2_yr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = mul nsw i32 %3, 1000
%14 = mul nsw i32 %6, 100
%15 = add nsw i32 %14, %13
%16 = mul nsw i32 %9, 10
%17 = add nsw i32 %15, %16
%18 = add nsw i32 %17, %12
%19 = add nsw i32 %18, -53328
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig() { printf("inside a signal\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"inside a signal\0A\00"
define void @sig() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"inside a signal\00"
define void @sig() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
void bar(unsigned long x, unsigned long y) {
  __asm__ __volatile__("" ::"r"(x), "r"(y) : "memory");
}


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

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

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

LLVM IR (-O2):
define void @bar(i64 %0, i64 %1) {
tail call void asm sideeffect "", "r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void suggest_help(void) { fprintf(stderr, "sld: type `sld -h' for help\n"); }


x86 assembly (clang, -O0):
<suggest_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<suggest_help>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"sld: type `sld -h' for help\0A\00"
define void @suggest_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"sld: type `sld -h' for help\0A\00"
define void @suggest_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x76() {
  Assert_real((isprint(118)),
              "/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",
              595, ("isprint should be 1 for v"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x76>:
push   %rax
mov    $0x76,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x253,%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 = [26 x i8] c"isprint should be 1 for v\00"
define void @t_isprint_0x76() {
%1 = call i32 @isprint(i32 118)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 595, 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for v\00"
define void @t_isprint_0x76() {
%1 = tail call i32 @isprint(i32 118)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 595, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *langEnumControlsJoyMouse() { return "Mouse"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Mouse\00"
define i8* @langEnumControlsJoyMouse() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"Mouse\00"
define i8* @langEnumControlsJoyMouse() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int f_ne_cr2(float a1) { return !(((100) != (a1))); }


x86 assembly (clang, -O0):
<f_ne_cr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_ne_cr2>:
cmpeqss 0xef7(%rip),%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f_ne_cr2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp une float 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f_ne_cr2(float %0) {
%2 = fcmp oeq float %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hola mundo");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Hola mundo\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hola mundo\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void zero_poly(int poly[]) {
  int i;
  for (i = 0; i < (32 * 2); i++)
    poly[i] = 0;
}


x86 assembly (clang, -O0):
<zero_poly>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1136 <zero_poly+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <zero_poly+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_poly>:
xorps  %xmm0,%xmm0
movups %xmm0,0xf0(%rdi)
movups %xmm0,0xe0(%rdi)
movups %xmm0,0xd0(%rdi)
movups %xmm0,0xc0(%rdi)
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @zero_poly(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 64
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 0, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @zero_poly(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
/* Variables and functions */
int accept_client_in();
int accept_client(void) { return accept_client_in(); }


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

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

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

LLVM IR (-O2):
define i32 @accept_client() {
%1 = tail call i32 (...) @accept_client_in()
ret i32 %1
}
/* Variables and functions */
void *realloc(void *, unsigned long);
int /*<<< orphan*/ runtime_error(char *);
void *mem_realloc(void *ptr, unsigned long size) {
  void *reptr = realloc(ptr, size);
  if (!reptr) {
    runtime_error("out of memory");
  }
  return reptr;
}


x86 assembly (clang, -O0):
<mem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <mem_realloc+0x38>
lea    0xead(%rip),%rdi
call   1030 <runtime_error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <mem_realloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <runtime_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @mem_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @runtime_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @mem_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @runtime_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void wepkeygen_usage(char *prog) {
  printf("Usage:  %s [-s] keystring\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<wepkeygen_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<wepkeygen_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: %s [-s] keystring\0A\00"
define void @wepkeygen_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s [-s] keystring\0A\00"
define void @wepkeygen_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char **);
int /*<<< orphan*/ topostfix(char *);
int main() {
  char infix[100], postfix[100];
  printf("\nenter the infix expression :");
  scanf("%s", &infix);
  topostfix(infix);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <topostfix@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <topostfix@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\0Aenter the infix expression :\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [100 x i8]* %1 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = call i32 @topostfix(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0Aenter the infix expression :\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [100 x i8]* %1 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4)
%6 = call i32 @topostfix(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DeleteLevelData(void *levelattr) { free(levelattr); }


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

x86 assembly (clang, -O2):
<DeleteLevelData>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @DeleteLevelData(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int strisdigit(str)
char *str;
{
  if (str == 0 || *str == 0)
    return 0;
  for (; *str; str++)
    if (*str > '9' || *str < '0')
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<strisdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1123 <strisdigit+0x23>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112f <strisdigit+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    118a <strisdigit+0x8a>
jmp    1134 <strisdigit+0x34>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1183 <strisdigit+0x83>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1161 <strisdigit+0x61>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jge    116d <strisdigit+0x6d>
movl   $0x0,-0x4(%rbp)
jmp    118a <strisdigit+0x8a>
jmp    1172 <strisdigit+0x72>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <strisdigit+0x34>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strisdigit>:
xor    %eax,%eax
test   %rdi,%rdi
je     1138 <strisdigit+0x38>
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <strisdigit+0x38>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xc6,%cl
cmp    $0xf6,%cl
jb     1138 <strisdigit+0x38>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <strisdigit+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strisdigit(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8* [ %12, %11 ], [ %0, %3 ]
%8 = phi i8 [ %13, %11 ], [ %4, %3 ]
%9 = add i8 %8, -58
%10 = icmp ult i8 %9, -10
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %11, %1, %3
%16 = phi i32 [ 0, %3 ], [ 0, %1 ], [ 0, %6 ], [ 1, %11 ]
ret i32 %16
}
/* Variables and functions */
int hex_to_int(char const *);
unsigned int lhex_to_int(const char *h) {
  return hex_to_int(h) * 0x100 + hex_to_int(h + 2);
}


x86 assembly (clang, -O0):
<lhex_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hex_to_int@plt>
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1030 <hex_to_int@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lhex_to_int>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <hex_to_int@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
add    $0x2,%rbx
mov    %rbx,%rdi
call   1030 <hex_to_int@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lhex_to_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @hex_to_int(i8* %3)
%5 = mul nsw i32 %4, 256
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = call i32 @hex_to_int(i8* %7)
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @lhex_to_int(i8* %0) {
%2 = tail call i32 @hex_to_int(i8* %0)
%3 = shl nsw i32 %2, 8
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = tail call i32 @hex_to_int(i8* %4)
%6 = add nsw i32 %3, %5
ret i32 %6
}
/* Variables and functions */
double glmComputeVectorLength2d(double *);
int /*<<< orphan*/ glmMakeVector2d(double *, double const *, double const *);
double glmComputeDistance2d(const double p1[2], const double p2[2]) {
  double d[2];
  glmMakeVector2d(d, p1, p2);
  return glmComputeVectorLength2d(d);
}


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

x86 assembly (clang, -O2):
<glmComputeDistance2d>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <glmMakeVector2d@plt>
mov    %rbx,%rdi
call   1030 <glmComputeVectorLength2d@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @glmComputeDistance2d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [2 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%7 = load double*, double** %3
%8 = load double*, double** %4
%9 = call i32 @glmMakeVector2d(double* %6, double* %7, double* %8)
%10 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%11 = call double @glmComputeVectorLength2d(double* %10)
ret double %11
}

LLVM IR (-O2):
define double @glmComputeDistance2d(double* %0, double* %1) {
%3 = alloca [2 x double]
%4 = bitcast [2 x double]* %3 to i8*
%5 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%6 = call i32 @glmMakeVector2d(double* %5, double* %0, double* %1)
%7 = call double @glmComputeVectorLength2d(double* %5)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl_fd(char *, int);
int putstr_exit(int ret, char *str) {
  if (str)
    ft_putendl_fd(str, 2);
  else
    ft_putendl_fd("error putstr_exit, str == NULL", 2);
  return (ret);
}


x86 assembly (clang, -O0):
<putstr_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113d <putstr_exit+0x2d>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1030 <ft_putendl_fd@plt>
jmp    114e <putstr_exit+0x3e>
lea    0xebc(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putendl_fd@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putstr_exit>:
push   %rbx
mov    %edi,%ebx
test   %rsi,%rsi
je     111d <putstr_exit+0xd>
mov    %rsi,%rdi
jmp    1124 <putstr_exit+0x14>
lea    0xedc(%rip),%rdi
mov    $0x2,%esi
call   1030 <ft_putendl_fd@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"error putstr_exit, str == NULL\00"
define i32 @putstr_exit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @ft_putendl_fd(i8* %8, i32 2)
br label %12
10: ; preds = %2
%11 = call i32 @ft_putendl_fd(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 2)
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [31 x i8] c"error putstr_exit, str == NULL\00"
define i32 @putstr_exit(i32 returned %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @ft_putendl_fd(i8* %1, i32 2)
br label %8
6: ; preds = %2
%7 = tail call i32 @ft_putendl_fd(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 2)
br label %8
8: ; preds = %6, %4
ret i32 %0
}
char serial_getc(void) {
  while (!((*((volatile unsigned long *)0xE2900010)) & (1 << 0)))
    ;
  return (*((volatile unsigned long *)0xE2900024));
}


x86 assembly (clang, -O0):
<serial_getc>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <serial_getc+0x9>
mov    $0xe2900010,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <serial_getc+0x2b>
jmp    1130 <serial_getc+0x30>
jmp    1109 <serial_getc+0x9>
mov    $0xe2900024,%eax
mov    (%rax),%rax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_getc>:
mov    $0xe2900010,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x1,(%rax)
je     1110 <serial_getc+0x10>
mov    0x14(%rax),%rax
ret

LLVM IR (-O0):
define signext i8 @serial_getc() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i64, i64* inttoptr (i64 3801088016 to i64*)
%3 = and i64 %2, 1
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = load volatile i64, i64* inttoptr (i64 3801088036 to i64*)
%9 = trunc i64 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @serial_getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 3801088016 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3801088036 to i64*)
%7 = trunc i64 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xf7() {
  Assert_real((isprint(247) == 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",
              1240, ("isprint should be 0 for 0xf7"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xf7>:
push   %rax
mov    $0xf7,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d8,%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 0xf7\00"
define void @t_isprint_0xf7() {
%1 = call i64 @isprint(i32 247)
%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 1240, 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 0xf7\00"
define void @t_isprint_0xf7() {
%1 = tail call i64 @isprint(i32 247)
%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 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xf8() {
  Assert_real((isprint(248) == 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",
              1245, ("isprint should be 0 for 0xf8"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xf8>:
push   %rax
mov    $0xf8,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4dd,%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 0xf8\00"
define void @t_isprint_0xf8() {
%1 = call i64 @isprint(i32 248)
%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 1245, 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 0xf8\00"
define void @t_isprint_0xf8() {
%1 = tail call i64 @isprint(i32 248)
%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 1245, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void local_irq_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @local_irq_disable() {
ret void
}
double Tween_QuadraticInOutEasing(double k) {
  k *= 2;
  if (k < 1) {
    return 0.5 * k * k;
  }
  --k;
  return -0.5 * (k * (k - 2) - 1);
}


x86 assembly (clang, -O0):
<Tween_QuadraticInOutEasing>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xedd(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114a <Tween_QuadraticInOutEasing+0x4a>
movsd  0xeea(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1193 <Tween_QuadraticInOutEasing+0x93>
movsd  0xec6(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe9a(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe86(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_QuadraticInOutEasing>:
addsd  %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1127 <Tween_QuadraticInOutEasing+0x27>
movsd  0xf06(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret
movsd  0xed9(%rip),%xmm2
addsd  %xmm2,%xmm0
movsd  0xed5(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
mulsd  0xec9(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Tween_QuadraticInOutEasing(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fmul double %4, 2.000000e+00
store double %5, double* %3
%6 = load double, double* %3
%7 = fcmp olt double %6, 1.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load double, double* %3
%10 = fmul double 5.000000e-01, %9
%11 = load double, double* %3
%12 = fmul double %10, %11
store double %12, double* %2
br label %21
13: ; preds = %1
%14 = load double, double* %3
%15 = fadd double %14, -1.000000e+00
store double %15, double* %3
%16 = load double, double* %3
%17 = load double, double* %3
%18 = fsub double %17, 2.000000e+00
%19 = call double @llvm.fmuladd.f64(double %16, double %18, double -1.000000e+00)
%20 = fmul double -5.000000e-01, %19
store double %20, double* %2
br label %21
21: ; preds = %13, %8
%22 = load double, double* %2
ret double %22
}

LLVM IR (-O2):
define double @Tween_QuadraticInOutEasing(double %0) {
%2 = fmul double %0, 2.000000e+00
%3 = fcmp olt double %2, 1.000000e+00
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = fmul double %2, 5.000000e-01
%6 = fmul double %2, %5
br label %12
7: ; preds = %1
%8 = fadd double %2, -1.000000e+00
%9 = fadd double %8, -2.000000e+00
%10 = tail call double @llvm.fmuladd.f64(double %8, double %9, double -1.000000e+00)
%11 = fmul double %10, -5.000000e-01
br label %12
12: ; preds = %7, %4
%13 = phi double [ %6, %4 ], [ %11, %7 ]
ret double %13
}
int mtime_join_listener() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @mtime_join_listener() {
ret i32 0
}
/* Variables and functions */
size_t alength(char **a) {
  size_t result = 0;
  if (a != NULL) {
    while (a[result] != NULL)
      result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<alength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <alength+0x49>
jmp    1120 <alength+0x20>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1144 <alength+0x44>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <alength+0x20>
jmp    1149 <alength+0x49>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @alength(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %9, 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 i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %4, %3 ]
ret i64 %10
}
int validGridP(int cvw_i, int grid) {
  if (cvw_i >= 0 && cvw_i < grid)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<validGridP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112c <validGridP+0x2c>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    112c <validGridP+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <validGridP+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validGridP>:
test   %edi,%edi
setns  %al
cmp    %esi,%edi
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @validGridP(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
%4 = icmp slt i32 %0, %1
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void grow(int *n) { *n = ((*n + 1) * 3) / 2; }


x86 assembly (clang, -O0):
<grow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
imul   $0x3,%eax,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<grow>:
mov    (%rdi),%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rax,2),%eax
add    $0x3,%eax
shr    $0x1f,%eax
add    %ecx,%eax
add    $0x3,%eax
sar    %eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @grow(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %5, 3
%7 = sdiv i32 %6, 2
%8 = load i32*, i32** %2
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @grow(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 3
%4 = add i32 %3, 3
%5 = sdiv i32 %4, 2
store i32 %5, i32* %0
ret void
}