xunge/DecIR huggingface dataset:
int norecurse1b(int i) { return i + 1; }


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

x86 assembly (clang, -O2):
<norecurse1b>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @norecurse1b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @norecurse1b(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
unsigned short *__ia64_mk_io_addr(unsigned long);
int /*<<< orphan*/ ia64_mfa();
unsigned int ___ia64_inw(unsigned long port) {
  volatile unsigned short *addr = __ia64_mk_io_addr(port);
  unsigned short ret;
  ret = *addr;
  ia64_mfa();
  return ret;
}


x86 assembly (clang, -O0):
<___ia64_inw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__ia64_mk_io_addr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    $0x0,%al
call   1040 <ia64_mfa@plt>
movzwl -0x12(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___ia64_inw>:
push   %rbx
call   1030 <__ia64_mk_io_addr@plt>
movzwl (%rax),%ebx
xor    %eax,%eax
call   1040 <ia64_mfa@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @___ia64_inw(i64 %0) {
%2 = alloca i64
%3 = alloca i16*
%4 = alloca i16
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i16* @__ia64_mk_io_addr(i64 %5)
store i16* %6, i16** %3
%7 = load i16*, i16** %3
%8 = load volatile i16, i16* %7
store i16 %8, i16* %4
%9 = call i32 (...) @ia64_mfa()
%10 = load i16, i16* %4
%11 = zext i16 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @___ia64_inw(i64 %0) {
%2 = tail call i16* @__ia64_mk_io_addr(i64 %0)
%3 = load volatile i16, i16* %2
%4 = tail call i32 (...) @ia64_mfa()
%5 = zext i16 %3 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xce() {
  Assert_real((isbdigit(206) == 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_isbdigit.c",
              1035, ("isbdigit should be 0 for 0xce"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xce>:
push   %rax
mov    $0xce,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x40b,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xce\00"
define void @t_isbdigit_0xce() {
%1 = call i64 @isbdigit(i32 206)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1035, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xce\00"
define void @t_isbdigit_0xce() {
%1 = tail call i64 @isbdigit(i32 206)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1035, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t __attribute__((always_)) poly1305_min(size_t a, size_t b) {
  return (a < b) ? a : b;
}


x86 assembly (clang, -O0):
<poly1305_min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <poly1305_min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <poly1305_min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly1305_min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @poly1305_min(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
%7 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @poly1305_min(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int quotient(int a, int b) { return a / b; }


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

x86 assembly (clang, -O2):
<quotient>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @quotient(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void usage(void) {
  fputs("Usage: bin-ary-test <array-size>\n"
        "where <array-size> is the size of the array to test.\n",
        stdout);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [87 x i8] c"Usage: bin-ary-test <array-size>\0Awhere <array-size> is the size of the array to test.\0A\00"
@stdout = global i32 0
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [87 x i8] c"Usage: bin-ary-test <array-size>\0Awhere <array-size> is the size of the array to test.\0A\00"
@stdout = global i32 0
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void Data_Stop(char *initializer_fct) {}


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

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

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

LLVM IR (-O2):
define void @Data_Stop(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void sighandler(int sig) {
  printf("[FAIL]\tGot signal %d, exiting\n", sig);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"[FAIL]\09Got signal %d, exiting\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"[FAIL]\09Got signal %d, exiting\0A\00"
define void @sighandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void ASN1_BMPSTRING_new(void) {}


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

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

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

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

/* Variables and functions */
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void Connect(int sockfd, struct sockaddr_in *servaddr) {
  if (connect(sockfd, (struct sockaddr *)servaddr, sizeof(*servaddr)) < 0) {
    perror("connect error");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<Connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1050 <connect@plt>
cmp    $0x0,%rax
jge    1170 <Connect+0x40>
lea    0xe9f(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Connect>:
push   %rax
mov    $0x4,%edx
call   1050 <connect@plt>
test   %rax,%rax
js     1142 <Connect+0x12>
pop    %rax
ret
lea    0xeb7(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [14 x i8] c"connect error\00"
define void @Connect(i32 %0, %struct.sockaddr_in* %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in*
store i32 %0, i32* %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
%5 = load i32, i32* %3
%6 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%7 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%8 = call i64 @connect(i32 %5, %struct.sockaddr* %7, i32 4)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [14 x i8] c"connect error\00"
define void @Connect(i32 %0, %struct.sockaddr_in* %1) {
%3 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%4 = tail call i64 @connect(i32 %0, %struct.sockaddr* %3, i32 4)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int foo(int);
int fn_6(int a, int b, int c) {
  int err;
  if ((err = foo(a)) != 0)
    goto fail;
  if ((err = foo(b)) != 0)
    goto fail;
  goto fail;
  if ((err = foo(c)) != 0)
    goto fail;
fail:
  return err;
}


x86 assembly (clang, -O0):
<fn_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <foo@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113a <fn_6+0x2a>
jmp    1158 <fn_6+0x48>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1153 <fn_6+0x43>
jmp    1158 <fn_6+0x48>
jmp    1158 <fn_6+0x48>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_6>:
push   %rbx
mov    %esi,%ebx
call   1030 <foo@plt>
test   %eax,%eax
je     111e <fn_6+0xe>
pop    %rbx
ret
mov    %ebx,%edi
pop    %rbx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @fn_6(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 = call i32 @foo(i32 %8)
store i32 %9, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
br label %18
12: ; preds = %3
%13 = load i32, i32* %5
%14 = call i32 @foo(i32 %13)
store i32 %14, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
br label %18
17: ; preds = %12
br label %18
18: ; preds = %17, %16, %11
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @fn_6(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @foo(i32 %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @foo(i32 %1)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %4, %3 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void write_bool(int b) {
  if (b)
    printf("true");
  else
    printf("false");
}


x86 assembly (clang, -O0):
<write_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <write_bool+0x26>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <write_bool+0x32>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bool>:
test   %edi,%edi
lea    0xeec(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define void @write_bool(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define void @write_bool(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret void
}
void updateMovieRating(unsigned int movieID, unsigned short rating) { return; }


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

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

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

LLVM IR (-O2):
define void @updateMovieRating(i32 %0, i16 zeroext %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ factorial();
int main(int argc, char const *argv[]) { factorial(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <factorial@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @factorial()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *itoa(int n) {
  static char buf[32];
  sprintf(buf, "%d", n);
  return (buf);
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@itoa.buf = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @itoa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @itoa.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @itoa.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@itoa.buf = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @itoa(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @itoa.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @itoa.buf, i64 0, i64 0)
}
void RAWToRGBA() {}


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

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

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

LLVM IR (-O2):
define void @RAWToRGBA() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *manu_char(char *pchar) {
  pchar = (char *)malloc(sizeof(char) * 16);
  memcpy(pchar, "hello", 6);
  return pchar;
}


x86 assembly (clang, -O0):
<manu_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
mov    $0x6,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manu_char>:
push   %rbx
mov    $0x10,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
mov    $0x6,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define i8* @manu_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @malloc(i32 16)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @memcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 6)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define i8* @manu_char(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 16)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @memcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 6)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_CONT;
scalar_t__ ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
                  int /*<<< orphan*/);
int ptrace_continue(pid_t pid) {
  if (ptrace(PTRACE_CONT, pid, NULL, 0) < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ptrace_continue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
jge    1148 <ptrace_continue+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <ptrace_continue+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrace_continue>:
push   %rax
mov    %edi,%esi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
@PTRACE_CONT = global i32 0
define i32 @ptrace_continue(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* @PTRACE_CONT
%5 = load i32, i32* %3
%6 = call i64 @ptrace(i32 %4, i32 %5, i32* null, i32 0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@PTRACE_CONT = global i32 0
define i32 @ptrace_continue(i32 %0) {
%2 = load i32, i32* @PTRACE_CONT
%3 = tail call i64 @ptrace(i32 %2, i32 %0, i32* null, i32 0)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
void test(char *s6, char *s7) {
  printf("Inside test\n");
  printf("sizeof(s6(%s) = %ld==ptrlength) strlen(s6) = %ld  "
         "sizeof(s7(%s)) = %ld=prtlen strlen(s7) = %ld\n",
         s6, sizeof(s6), strlen(s6), s7, sizeof(s7), strlen(s7));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe96(%rip),%rdi
mov    $0x8,%r9d
mov    %r9,%rdx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xf1a(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,(%rsp)
lea    0xe97(%rip),%rdi
mov    $0x8,%edx
mov    $0x8,%r9d
mov    %rbx,%rsi
mov    %r15,%rcx
mov    %r14,%r8
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Inside test\0A\00"
@.str.1 = [96 x i8] c"sizeof(s6(%s) = %ld==ptrlength) strlen(s6) = %ld sizeof(s7(%s)) = %ld=prtlen strlen(s7) = %ld\0A\00"
define void @test(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.1, i64 0, i64 0), i8* %6, i64 8, i64 %8, i8* %9, i64 8, i64 %11)
ret void
}

LLVM IR (-O2):
@.str.1 = [96 x i8] c"sizeof(s6(%s) = %ld==ptrlength) strlen(s6) = %ld sizeof(s7(%s)) = %ld=prtlen strlen(s7) = %ld\0A\00"
@str = [12 x i8] c"Inside test\00"
define void @test(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @.str.1, i64 0, i64 0), i8* %0, i64 8, i64 %4, i8* %1, i64 8, i64 %5)
ret void
}
void glutSwapBuffers(void) {}


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

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

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

LLVM IR (-O2):
define void @glutSwapBuffers() {
ret void
}
void Init_proc() {}


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

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

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

LLVM IR (-O2):
define void @Init_proc() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ send(int, void *, int /*<<< orphan*/, int /*<<< orphan*/);
void apex_http_response_data(int fd, void *data, ssize_t size) {
  send(fd, data, size, 0);
}


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

x86 assembly (clang, -O2):
<apex_http_response_data>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define void @apex_http_response_data(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_task(double *, double *);
void one_unregistered_array(void) {
  double PPP[12], QQQ[23];
#pragma starpu register PPP
  my_task(PPP, QQQ);
}


x86 assembly (clang, -O0):
<one_unregistered_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    -0x60(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1030 <my_task@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_unregistered_array>:
sub    $0x118,%rsp
mov    %rsp,%rdi
lea    0x60(%rsp),%rsi
call   1030 <my_task@plt>
add    $0x118,%rsp
ret

LLVM IR (-O0):
define void @one_unregistered_array() {
%1 = alloca [12 x double]
%2 = alloca [23 x double]
%3 = getelementptr inbounds [12 x double], [12 x double]* %1, i64 0, i64 0
%4 = getelementptr inbounds [23 x double], [23 x double]* %2, i64 0, i64 0
%5 = call i32 @my_task(double* %3, double* %4)
ret void
}

LLVM IR (-O2):
define void @one_unregistered_array() {
%1 = alloca [12 x double]
%2 = alloca [23 x double]
%3 = bitcast [12 x double]* %1 to i8*
%4 = bitcast [23 x double]* %2 to i8*
%5 = getelementptr inbounds [12 x double], [12 x double]* %1, i64 0, i64 0
%6 = getelementptr inbounds [23 x double], [23 x double]* %2, i64 0, i64 0
%7 = call i32 @my_task(double* %5, double* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ my_ls(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("wrong usage\n");
    exit(1);
  }
  my_ls(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1166 <main+0x36>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <my_ls@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <my_ls@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"wrong usage\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @my_ls(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"wrong usage\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @my_ls(i8* %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_irq8(void) { print("IRQ 8"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"IRQ 8\00"
define void @idt_irq8() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int srlv(int register2, int register3) { return register2 >> register3; }


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

x86 assembly (clang, -O2):
<srlv>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @srlv(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long get_time_ms() {
  struct timeval te;
  gettimeofday(&te, NULL);
  long long milliseconds = te.tv_sec * 1000LL + te.tv_usec / 1000;
  return milliseconds;
}


x86 assembly (clang, -O0):
<get_time_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_ms>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%rcx
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define i64 @get_time_ms() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
store i64 %11, i64* %2
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define i64 @get_time_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_load_ss(float *);
int /*<<< orphan*/ _mm_rsqrt_ss(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_store_ss(float *, int /*<<< orphan*/);
double rsqrt(double x) {
  __m128 xfv, xv;
  float xf;
  xf = (float)x;
  xfv = _mm_load_ss(&xf);
  xv = _mm_rsqrt_ss(xfv);
  _mm_store_ss(&xf, xv);
  return (double)xf;
}


x86 assembly (clang, -O0):
<rsqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1050 <_mm_load_ss@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <_mm_rsqrt_ss@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    -0x14(%rbp),%rdi
call   1030 <_mm_store_ss@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsqrt>:
push   %rbx
sub    $0x10,%rsp
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <_mm_load_ss@plt>
mov    %eax,%edi
call   1040 <_mm_rsqrt_ss@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <_mm_store_ss@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @rsqrt(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store double %0, double* %2
%6 = load double, double* %2
%7 = fptrunc double %6 to float
store float %7, float* %5
%8 = call i32 @_mm_load_ss(float* %5)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @_mm_rsqrt_ss(i32 %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @_mm_store_ss(float* %5, i32 %11)
%13 = load float, float* %5
%14 = fpext float %13 to double
ret double %14
}

LLVM IR (-O2):
define double @rsqrt(double %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = fptrunc double %0 to float
store float %4, float* %2
%5 = call i32 @_mm_load_ss(float* %2)
%6 = call i32 @_mm_rsqrt_ss(i32 %5)
%7 = call i32 @_mm_store_ss(float* %2, i32 %6)
%8 = load float, float* %2
%9 = fpext float %8 to double
ret double %9
}
void sps_dma_free_bam_handle(unsigned long h) {}


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

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

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

LLVM IR (-O2):
define void @sps_dma_free_bam_handle(i64 %0) {
ret void
}
unsigned int _check_times(unsigned x, unsigned y) {
  unsigned long long whole_ans =
      ((unsigned long long)x) * ((unsigned long long)y);
  unsigned word_ans = (unsigned)whole_ans;
  if (word_ans < whole_ans || word_ans > (1 << 28))
    (_throw_badalloc_fn("/scratch/repos/new/home/jordi_armengol_estape/"
                        "c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/"
                        "cyclone/refs/heads/master/bin/genfiles/toseqc.c",
                        284));
  return word_ans;
}


x86 assembly (clang, -O0):
<_check_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%rax
jb     114d <_check_times+0x3d>
cmpl   $0x10000000,-0x14(%rbp)
jbe    1160 <_check_times+0x50>
lea    0xeac(%rip),%rdi
mov    $0x11c,%esi
mov    $0x0,%al
call   1030 <_throw_badalloc_fn@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_times>:
push   %rbx
mov    %edi,%eax
mul    %esi
mov    %eax,%ebx
jo     1121 <_check_times+0x11>
cmp    $0x10000001,%ebx
jb     1134 <_check_times+0x24>
lea    0xed8(%rip),%rdi
mov    $0x11c,%esi
xor    %eax,%eax
call   1030 <_throw_badalloc_fn@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/toseqc.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = mul i64 %8, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = load i64, i64* %5
%17 = icmp ult i64 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %2
%19 = load i32, i32* %6
%20 = icmp ugt i32 %19, 268435456
br i1 %20, label %21, label %23
21: ; preds = %18, %2
%22 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 284)
br label %23
23: ; preds = %21, %18
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/FauxFaux/cyclone/refs/heads/master/bin/genfiles/toseqc.c\00"
define i32 @_check_times(i32 %0, i32 %1) {
%3 = tail call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %0, i32 %1)
%4 = extractvalue { i32, i1 } %3, 0
%5 = extractvalue { i32, i1 } %3, 1
%6 = icmp ugt i32 %4, 268435456
%7 = or i1 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_badalloc_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str, i64 0, i64 0), i32 284)
br label %10
10: ; preds = %2, %8
ret i32 %4
}
/* Type definitions */
typedef int bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_int(int /*<<< orphan*/ *, int *);
bool_t xdr_char(XDR *xdrs, char *cp) {
  int i;
  i = (*cp);
  if (!xdr_int(xdrs, &i)) {
    return (0);
  }
  *cp = i;
  return (1);
}


x86 assembly (clang, -O0):
<xdr_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <xdr_int@plt>
cmp    $0x0,%eax
jne    114c <xdr_char+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115e <xdr_char+0x4e>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_char>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movsbl (%rsi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <xdr_int@plt>
test   %eax,%eax
je     113a <xdr_char+0x2a>
mov    0xc(%rsp),%al
mov    %al,(%rbx)
mov    $0x1,%eax
jmp    113c <xdr_char+0x2c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @xdr_char(i32* %0, i8* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
store i32 %6, i32* %3
%7 = call i32 @xdr_int(i32* %0, i32* %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = trunc i32 %10 to i8
store i8 %11, i8* %1
br label %12
12: ; preds = %2, %9
%13 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %13
}
int blah(int zzz) {
  int foo;
  if (zzz >= 0)
    return 1;
  foo = (zzz >= 0 ? (zzz) : -(zzz));
  return foo;
}


x86 assembly (clang, -O0):
<blah>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111d <blah+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1146 <blah+0x46>
cmpl   $0x0,-0x8(%rbp)
jl     1132 <blah+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113a <blah+0x3a>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blah>:
mov    %edi,%ecx
neg    %ecx
test   %edi,%edi
mov    $0x1,%eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @blah(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = sub nsw i32 0, %0
%4 = select i1 %2, i32 1, i32 %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_loadu_si128(int /*<<< orphan*/ const *);
__m128i test_mm_loadu_si128(__m128i const *A) { return _mm_loadu_si128(A); }


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

x86 assembly (clang, -O2):
<test_mm_loadu_si128>:
jmp    1030 <_mm_loadu_si128@plt>

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

LLVM IR (-O2):
define i32 @test_mm_loadu_si128(i32* %0) {
%2 = tail call i32 @_mm_loadu_si128(i32* %0)
ret i32 %2
}
void SteamAPI_ISteamFriends_ActivateGameOverlay(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamFriends_ActivateGameOverlay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamFriends_ActivateGameOverlay>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamFriends_ActivateGameOverlay = [43 x i8] c"SteamAPI_ISteamFriends_ActivateGameOverlay\00"
define void @SteamAPI_ISteamFriends_ActivateGameOverlay(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @__func__.SteamAPI_ISteamFriends_ActivateGameOverlay, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamFriends_ActivateGameOverlay = [43 x i8] c"SteamAPI_ISteamFriends_ActivateGameOverlay\00"
define void @SteamAPI_ISteamFriends_ActivateGameOverlay(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @__func__.SteamAPI_ISteamFriends_ActivateGameOverlay, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ND_Screen_Clear();
int /*<<< orphan*/ ND_Screen_WriteString(char *);
void ND_Versions_Startup() {
  ND_Screen_Clear();
  ND_Screen_WriteString("NextDivel 0.0.1\n(C) Adrian Arroyo Calle 2013\n");
}


x86 assembly (clang, -O0):
<ND_Versions_Startup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ND_Screen_Clear@plt>
lea    0xece(%rip),%rdi
call   1040 <ND_Screen_WriteString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ND_Versions_Startup>:
push   %rax
xor    %eax,%eax
call   1030 <ND_Screen_Clear@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <ND_Screen_WriteString@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"NextDivel 0.0.1\0A(C) Adrian Arroyo Calle 2013\0A\00"
define void @ND_Versions_Startup() {
%1 = call i32 (...) @ND_Screen_Clear()
%2 = call i32 @ND_Screen_WriteString(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"NextDivel 0.0.1\0A(C) Adrian Arroyo Calle 2013\0A\00"
define void @ND_Versions_Startup() {
%1 = tail call i32 (...) @ND_Screen_Clear()
%2 = tail call i32 @ND_Screen_WriteString(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}
int compare(const void *key1, const void *key2) {
  return key1 < key2 ? -1 : key1 == key2 ? 0 : 1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <compare+0x27>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <compare+0x3f>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @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 = icmp ult i8* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %15
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = icmp eq i8* %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 0, i32 1
br label %15
15: ; preds = %9, %8
%16 = phi i32 [ -1, %8 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int __m128i;

/* Variables and functions */
int _mm_slli_epi32(int, int);
int _mm_srli_epi32(int, int);
__m128i ROTR(__m128i x, int n) {
  return _mm_srli_epi32(x, n) | _mm_slli_epi32(x, 32 - n);
}


x86 assembly (clang, -O0):
<ROTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <_mm_srli_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%esi
sub    -0x8(%rbp),%esi
call   1030 <_mm_slli_epi32@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROTR>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <_mm_srli_epi32@plt>
mov    %eax,%r14d
mov    $0x20,%esi
sub    %ebx,%esi
mov    %ebp,%edi
call   1030 <_mm_slli_epi32@plt>
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ROTR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_srli_epi32(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = call i32 @_mm_slli_epi32(i32 %8, i32 %10)
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ROTR(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_srli_epi32(i32 %0, i32 %1)
%4 = sub nsw i32 32, %1
%5 = tail call i32 @_mm_slli_epi32(i32 %0, i32 %4)
%6 = or i32 %5, %3
ret i32 %6
}
void av_bmg_get() {}


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

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

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

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