xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(short, int /*<<< orphan*/, int);
int setSocketNonBlocking(short socket) {
  int flags = 0;
  flags = fcntl(socket, F_GETFL, 0);
  fcntl(socket, F_SETFL, flags | O_NONBLOCK);
  return flags;
}


x86 assembly (clang, -O0):
<setSocketNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    0x2e9f(%rip),%rcx
mov    (%rcx),%esi
xor    %edx,%edx
movswl %ax,%edi
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x2(%rbp),%ax
mov    0x2e8d(%rip),%rcx
mov    (%rcx),%esi
mov    -0x8(%rbp),%edx
mov    0x2e91(%rip),%rcx
or     (%rcx),%edx
movswl %ax,%edi
call   1030 <fcntl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setSocketNonBlocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,%ebp
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
or     %ebp,%edx
mov    %ebx,%edi
call   1030 <fcntl@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setSocketNonBlocking(i16 signext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
store i32 0, i32* %3
%4 = load i16, i16* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i16 signext %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i16, i16* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i16 signext %7, i32 %8, i32 %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setSocketNonBlocking(i16 signext %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i16 signext %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i16 signext %0, i32 %4, i32 %6)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int directive_proc(char *string, int line, FILE *f) {
  char *h_file = string;
  char t[1025];
}


x86 assembly (clang, -O0):
<directive_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3b0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3b0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @directive_proc(i8* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca [1025 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%10 = load i8*, i8** %5
store i8* %10, i8** %8
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @directive_proc(i8* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int kidfunc(void *arg) {
  fprintf(stderr, "child\n");
  sleep(12);
  fprintf(stderr, "child done\n");
}


x86 assembly (clang, -O0):
<kidfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xc,%edi
call   1040 <sleep@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kidfunc>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xc,%edi
call   1040 <sleep@plt>
mov    (%rbx),%edi
lea    0xebe(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"child\0A\00"
@.str.1 = [12 x i8] c"child done\0A\00"
define i32 @kidfunc(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sleep(i32 12)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"child\0A\00"
@.str.1 = [12 x i8] c"child done\0A\00"
define i32 @kidfunc(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 12)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Reserved46_DriverIRQHandler();
__attribute__((weak)) void Reserved46_IRQHandler(void) {
  Reserved46_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved46_IRQHandler() {
%1 = call i32 (...) @Reserved46_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved46_IRQHandler() {
%1 = tail call i32 (...) @Reserved46_DriverIRQHandler()
ret void
}
long SystemOperation(long n1, long n2) {
  if (n2 != 0) {
    return n1 / n2;
  } else {
    if (n1 >= 0) {
      return 2147483647;
    } else {
      return -2147483647;
    }
  }
}


x86 assembly (clang, -O0):
<SystemOperation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     112a <SystemOperation+0x2a>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rax,-0x8(%rbp)
jmp    114a <SystemOperation+0x4a>
cmpq   $0x0,-0x10(%rbp)
jl     1142 <SystemOperation+0x42>
movq   $0x7fffffff,-0x8(%rbp)
7f
jmp    114a <SystemOperation+0x4a>
movq   $0xffffffff80000001,-0x8(%rbp)
80
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SystemOperation>:
test   %rsi,%rsi
je     111a <SystemOperation+0x1a>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     112e <SystemOperation+0x2e>
mov    %rdi,%rax
cqto
idiv   %rsi
ret
test   %rdi,%rdi
mov    $0x7fffffff,%ecx
mov    $0xffffffff80000001,%rax
cmovns %rcx,%rax
ret
mov    %edi,%eax
xor    %edx,%edx
div    %esi
ret

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

LLVM IR (-O2):
define i64 @SystemOperation(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i64 %0, %1
br label %9
6: ; preds = %2
%7 = icmp sgt i64 %0, -1
%8 = select i1 %7, i64 2147483647, i64 -2147483647
br label %9
9: ; preds = %6, %4
%10 = phi i64 [ %5, %4 ], [ %8, %6 ]
ret i64 %10
}
void cleanup_thread_handler(void *p) {}


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

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

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

LLVM IR (-O2):
define void @cleanup_thread_handler(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *s) {
  char *dup;
  size_t len = strlen(s) + 1;
  dup = malloc(len);
  if (!dup)
    return NULL;
  memcpy(dup, s, len);
  return dup;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1173 <strdup+0x43>
movq   $0x0,-0x8(%rbp)
jmp    118c <strdup+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %1, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, world!\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ chaz_ConfWriter_append_conf(char *, char const *,
                                               char const *);
void chaz_ConfWriter_shorten_typedef(const char *sym) {
  chaz_ConfWriter_append_conf("  #define %s chy_%s\n", sym, sym);
}


x86 assembly (clang, -O0):
<chaz_ConfWriter_shorten_typedef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rdi
call   1030 <chaz_ConfWriter_append_conf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_ConfWriter_shorten_typedef>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    %rdx,%rsi
jmp    1030 <chaz_ConfWriter_append_conf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c" #define %s chy_%s\0A\00"
define void @chaz_ConfWriter_shorten_typedef(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @chaz_ConfWriter_append_conf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c" #define %s chy_%s\0A\00"
define void @chaz_ConfWriter_shorten_typedef(i8* %0) {
%2 = tail call i32 @chaz_ConfWriter_append_conf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void foo(void) { puts("foo is shared library"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"foo is shared library\00"
define void @foo() {
%1 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"foo is shared library\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print(const char *str) { printf("Hello %s\n", str); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((weak)) void USART3_IrqHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define weak void @USART3_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void *lstat() {}


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

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

LLVM IR (-O0):
define i8* @lstat() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @lstat() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ sync();
void l1_non_existant_write_syscall(void) {
  int *i = (void *)0xFFAFFFFC;
  *i = 0;
  sync();
}


x86 assembly (clang, -O0):
<l1_non_existant_write_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffaffffc,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <sync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l1_non_existant_write_syscall>:
mov    $0xffaffffc,%eax
movl   $0x0,(%rax)
xor    %eax,%eax
jmp    1030 <sync@plt>

LLVM IR (-O0):
define void @l1_non_existant_write_syscall() {
%1 = alloca i32*
store i32* inttoptr (i64 4289724412 to i32*), i32** %1
%2 = load i32*, i32** %1
store i32 0, i32* %2
%3 = call i32 (...) @sync()
ret void
}

LLVM IR (-O2):
define void @l1_non_existant_write_syscall() {
store i32 0, i32* inttoptr (i64 4289724412 to i32*)
%1 = tail call i32 (...) @sync()
ret void
}
/* Type definitions */
struct aiocb {
  int dummy;
};
typedef int ssize_t;

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


x86 assembly (clang, -O0):
<aio_return>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.aiocb = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_return(%struct.aiocb* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ __mf_set_options(char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int main() {
  char *k;
  __mf_set_options("-sigusr1-report -print-leaks");
  k = (char *)malloc(100);
  raise(SIGUSR1);
  free(k);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1060 <__mf_set_options@plt>
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1060 <__mf_set_options@plt>
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"-sigusr1-report -print-leaks\00"
@SIGUSR1 = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @__mf_set_options(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i64 @malloc(i32 100)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i32, i32* @SIGUSR1
%7 = call i32 @raise(i32 %6)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"-sigusr1-report -print-leaks\00"
@SIGUSR1 = global i32 0
define i32 @main() {
%1 = tail call i32 @__mf_set_options(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @malloc(i32 100)
%3 = inttoptr i64 %2 to i8*
%4 = load i32, i32* @SIGUSR1
%5 = tail call i32 @raise(i32 %4)
%6 = tail call i32 @free(i8* %3)
ret i32 0
}
int compare(const void *x, const void *y) {
  return *(const int *)x - *(const int *)y;
}


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
sub    (%rsi),%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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int hnumchars();
int hnumch_() { return (hnumchars()); }


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

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

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

LLVM IR (-O2):
define i32 @hnumch_() {
%1 = tail call i32 (...) @hnumchars()
ret i32 %1
}
int strrlen(char *s) {
  char *p = s;
  while (*p)
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<strrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <strrlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
char zero_to_f(char c) {
  const char *hex = "0123456789abcdef";
  return hex[c & 15];
}


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define signext i8 @zero_to_f(i8 signext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xe9() {
  Assert_real((isalnum(233) == 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_isalnum.c",
              1170, ("isalnum should be 0 for 0xe9"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xe9>:
push   %rax
mov    $0xe9,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x492,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xe9\00"
define void @t_isalnum_0xe9() {
%1 = call i64 @isalnum(i32 233)
%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 1170, 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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xe9\00"
define void @t_isalnum_0xe9() {
%1 = tail call i64 @isalnum(i32 233)
%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 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_program(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void caught_signal(int sig) {
  fprintf(stderr, "Caught signal %d\n", sig);
  exit_program(0);
}


x86 assembly (clang, -O0):
<caught_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit_program@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caught_signal>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <exit_program@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @caught_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit_program(i32 0)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @caught_signal(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit_program(i32 0)
ret void
}
/* Type definitions */
struct lobject {
  int dummy;
};
struct lemon {
  int dummy;
};

/* Variables and functions */
struct lobject *lobject_string(struct lemon *, struct lobject *);
struct lobject *lobject_get_default_string(struct lemon *lemon,
                                           struct lobject *self, int argc,
                                           struct lobject *argv[]) {
  return lobject_string(lemon, self);
}


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

x86 assembly (clang, -O2):
<lobject_get_default_string>:
jmp    1030 <lobject_string@plt>

LLVM IR (-O0):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_get_default_string(%struct.lemon* %0, %struct.lobject* %1, i32 %2, %struct.lobject** %3) {
%5 = alloca %struct.lemon*
%6 = alloca %struct.lobject*
%7 = alloca i32
%8 = alloca %struct.lobject**
store %struct.lemon* %0, %struct.lemon** %5
store %struct.lobject* %1, %struct.lobject** %6
store i32 %2, i32* %7
store %struct.lobject** %3, %struct.lobject*** %8
%9 = load %struct.lemon*, %struct.lemon** %5
%10 = load %struct.lobject*, %struct.lobject** %6
%11 = call %struct.lobject* @lobject_string(%struct.lemon* %9, %struct.lobject* %10)
ret %struct.lobject* %11
}

LLVM IR (-O2):
%struct.lemon = type { i32 }
%struct.lobject = type { i32 }
define %struct.lobject* @lobject_get_default_string(%struct.lemon* %0, %struct.lobject* %1, i32 %2, %struct.lobject** nocapture readnone %3) {
%5 = tail call %struct.lobject* @lobject_string(%struct.lemon* %0, %struct.lobject* %1)
ret %struct.lobject* %5
}
int validate_tar_registers(unsigned long *reg, unsigned long tar,
                           unsigned long ppr, unsigned long dscr) {
  int match = 1;
  if (reg[0] != tar)
    match = 0;
  if (reg[1] != ppr)
    match = 0;
  if (reg[2] != dscr)
    match = 0;
  if (!match)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<validate_tar_registers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
je     1133 <validate_tar_registers+0x33>
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
cmp    -0x20(%rbp),%rax
je     114c <validate_tar_registers+0x4c>
movl   $0x0,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
cmp    -0x28(%rbp),%rax
je     1165 <validate_tar_registers+0x65>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    117b <validate_tar_registers+0x7b>
movl   $0x1,-0x4(%rbp)
jmp    1182 <validate_tar_registers+0x82>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_tar_registers>:
xor    (%rdi),%rsi
xor    0x8(%rdi),%rdx
xor    0x10(%rdi),%rcx
or     %rdx,%rcx
xor    %eax,%eax
or     %rsi,%rcx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @validate_tar_registers(i64* nocapture %0, i64 %1, i64 %2, i64 %3) {
%5 = load i64, i64* %0
%6 = icmp ne i64 %5, %1
%7 = getelementptr inbounds i64, i64* %0, i64 1
%8 = load i64, i64* %7
%9 = icmp ne i64 %8, %2
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = icmp ne i64 %11, %3
%13 = select i1 %12, i1 true, i1 %9
%14 = select i1 %13, i1 true, i1 %6
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ sim_internal_fail();
void check_sr_access(unsigned int regnum) {
  if (regnum > 31) {
    sim_internal_fail();
  }
}


x86 assembly (clang, -O0):
<check_sr_access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1f,-0x4(%rbp)
jbe    112c <check_sr_access+0x1c>
mov    $0x0,%al
call   1030 <sim_internal_fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_sr_access>:
cmp    $0x20,%edi
jb     111c <check_sr_access+0xc>
xor    %eax,%eax
jmp    1030 <sim_internal_fail@plt>
ret

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

LLVM IR (-O2):
define void @check_sr_access(i32 %0) {
%2 = icmp ugt i32 %0, 31
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @sim_internal_fail()
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_52uint16_mem(unsigned short *val) {
  return ((*val) & (-0x52 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_52uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffae,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_52uint16_mem>:
movzwl (%rdi),%eax
test   $0xffae,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_52uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -82
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_52uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -82
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long long f(int *a, int *b, int *c) {
  long long d = (((long long)*a) * *b);
  return d;
}


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

x86 assembly (clang, -O2):
<f>:
movslq (%rdi),%rcx
movslq (%rsi),%rax
imul   %rcx,%rax
ret

LLVM IR (-O0):
define i64 @f(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = mul nsw i64 %10, %13
store i64 %14, i64* %7
%15 = load i64, i64* %7
ret i64 %15
}

LLVM IR (-O2):
define i64 @f(i32* nocapture %0, i32* nocapture %1, i32* nocapture readnone %2) {
%4 = load i32, i32* %0
%5 = sext i32 %4 to i64
%6 = load i32, i32* %1
%7 = sext i32 %6 to i64
%8 = mul nsw i64 %7, %5
ret i64 %8
}
int fun1091() { return 1091; }


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

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

LLVM IR (-O0):
define i32 @fun1091() {
ret i32 1091
}

LLVM IR (-O2):
define i32 @fun1091() {
ret i32 1091
}
/* Variables and functions */
int /*<<< orphan*/ cacguard2l(float *, int, int, int, int);
void cacguard2l_(float *cu, int *nx, int *ny, int *nxe, int *nye) {
  cacguard2l(cu, *nx, *ny, *nxe, *nye);
  return;
}


x86 assembly (clang, -O0):
<cacguard2l_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
call   1030 <cacguard2l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cacguard2l_>:
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
mov    (%r8),%r8d
jmp    1030 <cacguard2l@plt>

LLVM IR (-O0):
define void @cacguard2l_(float* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca float*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store float* %0, float** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
%18 = load i32*, i32** %10
%19 = load i32, i32* %18
%20 = call i32 @cacguard2l(float* %11, i32 %13, i32 %15, i32 %17, i32 %19)
ret void
}

LLVM IR (-O2):
define void @cacguard2l_(float* %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4) {
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = tail call i32 @cacguard2l(float* %0, i32 %6, i32 %7, i32 %8, i32 %9)
ret void
}
unsigned long x86_read_cr2() {
  unsigned long val;
  __asm__ __volatile__("mov %%cr2, %0" : "=r"(val));
  return val;
}


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

x86 assembly (clang, -O2):
<x86_read_cr2>:
mov    %cr2,%rax
ret

LLVM IR (-O0):
define i64 @x86_read_cr2() {
%1 = alloca i64
%2 = call i64 asm sideeffect "mov %cr2, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @x86_read_cr2() {
%1 = tail call i64 asm sideeffect "mov %cr2, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
char *gettext(char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                gettext("usage: namei [-mx] pathname [pathname ...]\n"));
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <gettext@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
lea    0xebf(%rip),%rdi
call   1030 <gettext@plt>
mov    %ebx,%edi
mov    %rax,%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: namei [-mx] pathname [pathname ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* @gettext(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @fprintf(i32 %1, i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: namei [-mx] pathname [pathname ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* @gettext(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32 %1, i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void INT_Excep_MTU4_TGIA4(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU4_TGIA4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Hello World!"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void _set_bit_le(int nr, unsigned long *p) { return; }


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

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

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

LLVM IR (-O2):
define void @_set_bit_le(i32 %0, i64* nocapture %1) {
ret void
}
void EVP_DecryptInit(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_DecryptInit() {
ret void
}
void qemu_trace_pc_helper(unsigned int pc) {}


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

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

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

LLVM IR (-O2):
define void @qemu_trace_pc_helper(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insert_str(char *, char *, int /*<<< orphan*/);
int strlen(char *);
void prepend_zeros_to_piece(char *source_destination, int field_size) {
  int str_len = strlen(source_destination);
  int i;
  for (i = str_len; i < field_size; i++) {
    insert_str("0", source_destination, 0);
  }
}


x86 assembly (clang, -O0):
<prepend_zeros_to_piece>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116d <prepend_zeros_to_piece+0x4d>
mov    -0x8(%rbp),%rsi
lea    0xea8(%rip),%rdi
xor    %edx,%edx
call   1040 <insert_str@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <prepend_zeros_to_piece+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepend_zeros_to_piece>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <strlen@plt>
cmp    %ebx,%eax
jge    1152 <prepend_zeros_to_piece+0x32>
sub    %eax,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <insert_str@plt>
add    $0xffffffff,%ebx
jne    1140 <prepend_zeros_to_piece+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define void @prepend_zeros_to_piece(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
store i32 %9, i32* %6
br label %10
10: ; preds = %17, %2
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = call i32 @insert_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %15, i32 0)
br label %17
17: ; preds = %14
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %10
20: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define void @prepend_zeros_to_piece(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = tail call i32 @insert_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0)
%8 = add i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
/* Variables and functions */
scalar_t__ isIdentifierCharacter(int);
const char *skipIdentifier(const char *cp) {
  while (isIdentifierCharacter((int)*cp))
    cp++;
  return cp;
}


x86 assembly (clang, -O0):
<skipIdentifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isIdentifierCharacter@plt>
cmp    $0x0,%rax
je     1143 <skipIdentifier+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipIdentifier+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipIdentifier>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isIdentifierCharacter@plt>
test   %rax,%rax
jne    1120 <skipIdentifier+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipIdentifier(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %9, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = call i64 @isIdentifierCharacter(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %3
12: ; preds = %3
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @skipIdentifier(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i64 @isIdentifierCharacter(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short);
void print_short(short n) { printf("%hd", n); }


x86 assembly (clang, -O0):
<print_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    0xeda(%rip),%rdi
movswl -0x2(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_short>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%hd\00"
define void @print_short(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 signext %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%hd\00"
define void @print_short(i16 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i16 signext %0)
ret void
}
void smal_collect_after_mark() {}


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

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

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

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

/* Variables and functions */
u_int64_t get_recv_bytes(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_recv_bytes() {
ret i32 0
}
void parser_free() {}


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

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

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

LLVM IR (-O2):
define void @parser_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ system(char *);
void testGets() {
  char str[50];
  gets(str);
  system(str);
}


x86 assembly (clang, -O0):
<testGets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x40(%rbp),%rdi
call   1030 <system@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testGets>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @testGets() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret void
}

LLVM IR (-O2):
define void @testGets() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @system(i8* %2)
ret void
}