xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_cancel(scalar_t__);
int server_stop(pthread_t threadID) {
  printf("will cancel server thread #%02d\n", (int)threadID);
  pthread_cancel(threadID);
  return 0;
}


x86 assembly (clang, -O0):
<server_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <pthread_cancel@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_stop>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <pthread_cancel@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"will cancel server thread #%02d\0A\00"
define i32 @server_stop(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i64, i64* %2
%7 = call i32 @pthread_cancel(i64 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"will cancel server thread #%02d\0A\00"
define i32 @server_stop(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @pthread_cancel(i64 %0)
ret i32 0
}
long long add_longlong(long long x, long long y) { return x + y; }


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

x86 assembly (clang, -O2):
<add_longlong>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add_longlong(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 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @add_longlong(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *dll_fdopen(int, char const *);
FILE *__wrap_fdopen(int fildes, const char *mode) {
  return dll_fdopen(fildes, mode);
}


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

x86 assembly (clang, -O2):
<__wrap_fdopen>:
jmp    1030 <dll_fdopen@plt>

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

LLVM IR (-O2):
define i32* @__wrap_fdopen(i32 %0, i8* %1) {
%3 = tail call i32* @dll_fdopen(i32 %0, i8* %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
Usage() {
  printf("usage: revcnt <names> <reviews> \r\n");
  printf("\toccurances of names in reviews are counted.\r\n");
  printf("\tlines with no names are counted in unknown.\r\n");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"usage: revcnt <names> <reviews> \0D\0A\00"
@.str.1 = [47 x i8] c"\09occurances of names in reviews are counted.\0D\0A\00"
@.str.2 = [47 x i8] c"\09lines with no names are counted in unknown.\0D\0A\00"
define i32 @Usage() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@str = [34 x i8] c"usage: revcnt <names> <reviews> \0D\00"
@str.3 = [46 x i8] c"\09occurances of names in reviews are counted.\0D\00"
@str.4 = [46 x i8] c"\09lines with no names are counted in unknown.\0D\00"
define i32 @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.4, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int /*<<< orphan*/ am_free(char *);
int atoi(char *);
char *getRegExMatch(char const *, char const *, int);
int8_t parseRPCVersion(const char *response) {
  const char *result_regex = "\"rpc-version\":\\s*(\\d+)";
  char *result_str = NULL;
  int8_t result = -1;
  result_str = getRegExMatch(result_regex, response, 1);
  if (result_str) {
    result = atoi(result_str);
    am_free(result_str);
  }
  return result;
}


x86 assembly (clang, -O0):
<parseRPCVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <getRegExMatch@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     118c <parseRPCVersion+0x5c>
mov    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <am_free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseRPCVersion>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
mov    $0x1,%edx
call   1030 <getRegExMatch@plt>
test   %rax,%rax
je     1165 <parseRPCVersion+0x35>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <am_free@plt>
mov    %ebp,%eax
jmp    116a <parseRPCVersion+0x3a>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\22rpc-version\22:\\s*(\\d+)\00"
define i32 @parseRPCVersion(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* null, i8** %4
store i32 -1, i32* %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i8* @getRegExMatch(i8* %6, i8* %7, i32 1)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %5
%14 = load i8*, i8** %4
%15 = call i32 @am_free(i8* %14)
br label %16
16: ; preds = %11, %1
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [23 x i8] c"\22rpc-version\22:\\s*(\\d+)\00"
define i32 @parseRPCVersion(i8* %0) {
%2 = tail call i8* @getRegExMatch(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @atoi(i8* %2)
%6 = tail call i32 @am_free(i8* %2)
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %8
}
__attribute__((no)) int foo(int n) {
  if (n < 0)
    n = ~n;
  return n;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111a <foo+0x1a>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
sar    $0x1f,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = xor i32 %6, -1
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, %0
ret i32 %3
}
void *XSharpCreateImageFromDIB(void *screen, int width, int height, int stride,
                               int pixelFormat, unsigned char *data, int isMask,
                               unsigned long *palette) {
  return 0;
}


x86 assembly (clang, -O0):
<XSharpCreateImageFromDIB>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @XSharpCreateImageFromDIB(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5, i32 %6, i64* %7) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i64*
store i8* %0, i8** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i8* %5, i8** %14
store i32 %6, i32* %15
store i64* %7, i64** %16
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @XSharpCreateImageFromDIB(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* nocapture readnone %5, i32 %6, i64* nocapture readnone %7) {
ret i8* null
}
/* Variables and functions */
int EOF;
int getchar();
void read_input(int input[]) {
  int current_char = EOF;
  int index = 0;
  while ((current_char = getchar()) != EOF) {
    input[index++] = current_char;
  }
}


x86 assembly (clang, -O0):
<read_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1165 <read_input+0x55>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    112f <read_input+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_input>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    0x2ec3(%rip),%r14
cmp    (%r14),%eax
je     1142 <read_input+0x32>
nopw   0x0(%rax,%rax,1)
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <getchar@plt>
add    $0x4,%rbx
cmp    (%r14),%eax
jne    1130 <read_input+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @read_input(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %8, %5 ], [ 0, %1 ]
%7 = phi i32 [ %10, %5 ], [ %2, %1 ]
%8 = add nuw i64 %6, 1
%9 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %7, i32* %9
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %5
13: ; preds = %5, %1
ret void
}
/* Variables and functions */
int is_aligned(const void *addr, size_t n) { return ((size_t)addr) & (n - 1); }


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

x86 assembly (clang, -O2):
<is_aligned>:
lea    -0x1(%rsi),%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @is_aligned(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i64, i64* %4
%8 = sub i64 %7, 1
%9 = and i64 %6, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_aligned(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = add i64 %1, 4294967295
%5 = and i64 %4, %3
%6 = trunc i64 %5 to i32
ret i32 %6
}
char *lastelem(char *p) {
  char *out;
  out = p;
  for (; *p; p++)
    if (*p == '/')
      out = p + 1;
  return out;
}


x86 assembly (clang, -O0):
<lastelem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <lastelem+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1139 <lastelem+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113e <lastelem+0x3e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <lastelem+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastelem>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <lastelem+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <lastelem+0x10>
test   %dl,%dl
jne    1113 <lastelem+0x13>
ret

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

LLVM IR (-O2):
define i8* @lastelem(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
void swap_ints(int *a, int *b) {
  int c = *a;
  *a = *b;
  *b = c;
}


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

x86 assembly (clang, -O2):
<swap_ints>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap_ints(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap_ints(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ access_index_4(int *);
void call_access_index_4_on_local_array_Bad() {
  int arr[4];
  access_index_4(arr);
}


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

x86 assembly (clang, -O2):
<call_access_index_4_on_local_array_Bad>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <access_index_4@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @call_access_index_4_on_local_array_Bad() {
%1 = alloca [4 x i32]
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%3 = call i32 @access_index_4(i32* %2)
ret void
}

LLVM IR (-O2):
define void @call_access_index_4_on_local_array_Bad() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @access_index_4(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CodingError(char *);
int /*<<< orphan*/ perror(char *);
void *realloc(void *, int);
void *Realloc(void *OldMemory, int Size) {
  void *Memory;
  if ((Memory = realloc(OldMemory, Size)) == NULL && Size > 0) {
    perror("Realloc");
    CodingError("Realloc failed");
  }
  return (Memory);
}


x86 assembly (clang, -O0):
<Realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    117b <Realloc+0x4b>
cmpl   $0x0,-0xc(%rbp)
jle    117b <Realloc+0x4b>
lea    0xe96(%rip),%rdi
call   1050 <perror@plt>
lea    0xe92(%rip),%rdi
call   1030 <CodingError@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Realloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %ebp,%ebp
jle    1146 <Realloc+0x16>
test   %rbx,%rbx
je     1150 <Realloc+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xea9(%rip),%rdi
call   1050 <perror@plt>
lea    0xea5(%rip),%rdi
call   1030 <CodingError@plt>
jmp    1146 <Realloc+0x16>

LLVM IR (-O0):
@.str = [8 x i8] c"Realloc\00"
@.str.1 = [15 x i8] c"Realloc failed\00"
define i8* @Realloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @realloc(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @CodingError(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %13, %10, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [8 x i8] c"Realloc\00"
@.str.1 = [15 x i8] c"Realloc failed\00"
define i8* @Realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
%5 = icmp sgt i32 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @CodingError(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %7, %2
ret i8* %3
}
/* Variables and functions */
long _pathconf(int);
long pathconf(const char *p, int name) {
  p;
  return _pathconf(name);
}


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

x86 assembly (clang, -O2):
<pathconf>:
mov    %esi,%edi
jmp    1030 <_pathconf@plt>

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

LLVM IR (-O2):
define i64 @pathconf(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i64 @_pathconf(i32 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ make_strings(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char *s1, *s2;
  make_strings(s1, s2);
  printf("string 1 [%s] string 2 [%s] \n", s1, s2);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"string 1 [%s] string 2 [%s] \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @make_strings(i8* %4, i8* %5)
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"string 1 [%s] string 2 [%s] \0A\00"
define i32 @main() {
%1 = tail call i32 @make_strings(i8* undef, i8* undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* undef, i8* undef)
ret i32 0
}
/* Variables and functions */
int random();
char rdigit() { return (random() % 10) + 48; }


x86 assembly (clang, -O0):
<rdigit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdigit>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @rdigit() {
%1 = call i32 (...) @random()
%2 = srem i32 %1, 10
%3 = add nsw i32 %2, 48
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @rdigit() {
%1 = tail call i32 (...) @random()
%2 = srem i32 %1, 10
%3 = trunc i32 %2 to i8
%4 = add nsw i8 %3, 48
ret i8 %4
}
/* Variables and functions */
double log10(double);
double c_log10(double arg0) { return log10(arg0); }


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

x86 assembly (clang, -O2):
<c_log10>:
jmp    1030 <log10@plt>

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

LLVM IR (-O2):
define double @c_log10(double %0) {
%2 = tail call double @log10(double %0)
ret double %2
}
void fun() { return; }


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

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

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

LLVM IR (-O2):
define void @fun() {
ret void
}
main() {
  int i = 0;
  printf(i);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = call i32 (i8*, ...) @printf(i8* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) null)
ret i32 0
}
/* Variables and functions */
int read(int, void *, size_t);
int cbmarch_raw_read(int f, void *buf, size_t size) {
  return read(f, buf, size);
}


x86 assembly (clang, -O0):
<cbmarch_raw_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_raw_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @cbmarch_raw_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ *stdout;
int Gleep(FILE *f, char *where) {
  if (f == NULL)
    f = stdout;
  fprintf(f, "** Error: bad addr found in %s\n", where);
  return -1;
}


x86 assembly (clang, -O0):
<Gleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1139 <Gleep+0x29>
mov    0x2eae(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gleep>:
push   %rax
mov    %rsi,%rdx
test   %rdi,%rdi
jne    1123 <Gleep+0x13>
mov    0x2ec0(%rip),%rax
mov    (%rax),%rdi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32* null
@.str = [32 x i8] c"** Error: bad addr found in %s\0A\00"
define i32 @Gleep(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32*, i32** @stdout
store i32* %8, i32** %3
br label %9
9: ; preds = %7, %2
%10 = load i32*, i32** %3
%11 = load i8*, i8** %4
%12 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i32 -1
}

LLVM IR (-O2):
@stdout = global i32* null
@.str = [32 x i8] c"** Error: bad addr found in %s\0A\00"
define i32 @Gleep(i32* %0, i8* %1) {
%3 = icmp eq i32* %0, null
%4 = load i32*, i32** @stdout
%5 = select i1 %3, i32* %4, i32* %0
%6 = tail call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ MCP4461_SetValue(int, int, char);
void setHeadStepper1Current(char current) {
  MCP4461_SetValue(0x58, 0x03, current);
}


x86 assembly (clang, -O0):
<setHeadStepper1Current>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x58,%edi
mov    $0x3,%esi
movsbl -0x1(%rbp),%edx
call   1030 <MCP4461_SetValue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setHeadStepper1Current>:
mov    %edi,%edx
mov    $0x58,%edi
mov    $0x3,%esi
jmp    1030 <MCP4461_SetValue@plt>

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

LLVM IR (-O2):
define void @setHeadStepper1Current(i8 signext %0) {
%2 = tail call i32 @MCP4461_SetValue(i32 88, i32 3, i8 signext %0)
ret void
}
/* Variables and functions */
long atol(char *);
long asctol(char *s) {
  while (*s == '0' && s[1])
    s++;
  return atol(s);
}


x86 assembly (clang, -O0):
<asctol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jne    1142 <asctol+0x32>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <asctol+0x42>
jmp    1163 <asctol+0x53>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <asctol+0xc>
mov    -0x8(%rbp),%rdi
call   1030 <atol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asctol>:
mov    %rdi,%rax
mov    (%rdi),%cl
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,%rdi
cmp    $0x30,%cl
jne    1134 <asctol+0x24>
lea    0x1(%rdi),%rax
movzbl 0x1(%rdi),%ecx
test   %cl,%cl
jne    1120 <asctol+0x10>
jmp    1030 <atol@plt>

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

LLVM IR (-O2):
define i64 @asctol(i8* nocapture %0) {
%2 = load i8, i8* %0
br label %3
3: ; preds = %7, %1
%4 = phi i8 [ %2, %1 ], [ %9, %7 ]
%5 = phi i8* [ %0, %1 ], [ %8, %7 ]
%6 = icmp eq i8 %4, 48
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = tail call i64 @atol(i8* %5)
ret i64 %12
}
void ff_hevc_put_hevc_epel_hv48_8_sse4() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @endhostent() {
ret void
}
/* Variables and functions */
scalar_t__ exp(double);
double log(scalar_t__);
double log_add_exp(double a, double b) {
  double max_exp = a > b ? a : b;
  return log(exp(a - max_exp) + exp(b - max_exp)) + max_exp;
}


x86 assembly (clang, -O0):
<log_add_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1151 <log_add_exp+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    115b <log_add_exp+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
mov    %rax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
call   1040 <log@plt>
addsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_add_exp>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movapd %xmm0,%xmm2
maxsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
subsd  %xmm2,%xmm0
call   1030 <exp@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
subsd  (%rsp),%xmm0
call   1030 <exp@plt>
add    %rax,%rbx
mov    %rbx,%rdi
call   1040 <log@plt>
addsd  (%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @log_add_exp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
br label %13
13: ; preds = %11, %9
%14 = phi double [ %10, %9 ], [ %12, %11 ]
store double %14, double* %5
%15 = load double, double* %3
%16 = load double, double* %5
%17 = fsub double %15, %16
%18 = call i64 @exp(double %17)
%19 = load double, double* %4
%20 = load double, double* %5
%21 = fsub double %19, %20
%22 = call i64 @exp(double %21)
%23 = add nsw i64 %18, %22
%24 = call double @log(i64 %23)
%25 = load double, double* %5
%26 = fadd double %24, %25
ret double %26
}

LLVM IR (-O2):
define double @log_add_exp(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
%5 = fsub double %0, %4
%6 = tail call i64 @exp(double %5)
%7 = fsub double %1, %4
%8 = tail call i64 @exp(double %7)
%9 = add nsw i64 %8, %6
%10 = tail call double @log(i64 %9)
%11 = fadd double %4, %10
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ line_statement();
scalar_t__ tokenizer_finished();
void ubasic_run(void) {
  if (tokenizer_finished()) {
    ;
    return;
  }
  line_statement();
}


x86 assembly (clang, -O0):
<ubasic_run>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tokenizer_finished@plt>
cmp    $0x0,%rax
je     113a <ubasic_run+0x1a>
jmp    1141 <ubasic_run+0x21>
mov    $0x0,%al
call   1040 <line_statement@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ubasic_run>:
push   %rax
xor    %eax,%eax
call   1030 <tokenizer_finished@plt>
test   %rax,%rax
je     112f <ubasic_run+0xf>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <line_statement@plt>

LLVM IR (-O0):
define void @ubasic_run() {
%1 = call i64 (...) @tokenizer_finished()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %6
4: ; preds = %0
%5 = call i32 (...) @line_statement()
br label %6
6: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @ubasic_run() {
%1 = tail call i64 (...) @tokenizer_finished()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @line_statement()
br label %5
5: ; preds = %0, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_libname(void) { printf("v9\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"v9\00"
define void @get_libname() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_usage(const char *progname) {
  fprintf(stderr, "Command line usage: %s [flags] -- prefix [recipients]\n",
          progname);
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"Command line usage: %s [flags] -- prefix [recipients]\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"Command line usage: %s [flags] -- prefix [recipients]\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t rot16l8(uint16_t x) { return (x << 8) | (x >> 8); }


x86 assembly (clang, -O0):
<rot16l8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot16l8>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot16l8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot16l8(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() { printf("Usage: cc22531-sniffer -c CHANNEL -r REMOTE\n"); }


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"Usage: cc22531-sniffer -c CHANNEL -r REMOTE\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c"Usage: cc22531-sniffer -c CHANNEL -r REMOTE\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
void input_num() {
  int num;
  scanf("%d", &num);
  if (num != 0)
    input_num();
  printf("%d\n", num);
}


x86 assembly (clang, -O0):
<input_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
je     1157 <input_num+0x27>
call   1030 <input_num@plt>
mov    -0x4(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_num>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     1154 <input_num+0x24>
call   1030 <input_num@plt>
mov    0x4(%rsp),%esi
jmp    1156 <input_num+0x26>
xor    %esi,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @input_num() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = load i32, i32* %1
br label %8
8: ; preds = %6, %0
%9 = phi i32 [ %7, %6 ], [ 0, %0 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
__attribute__((hot)) int sr_compare_u32(const char *a, const char *b) {
  uint32_t av = *(const uint32_t *)a;
  uint32_t bv = *(const uint32_t *)b;
  if (av == bv)
    return 0;
  return (av > bv) ? 1 : -1;
}


x86 assembly (clang, -O0):
<sr_compare_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <sr_compare_u32+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1157 <sr_compare_u32+0x57>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sr_compare_u32>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setg   %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret
cs nopw 0x0(%rax,%rax,1)
nop

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

LLVM IR (-O2):
define i32 @sr_compare_u32(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = icmp sgt i64 %4, %6
%9 = select i1 %8, i32 1, i32 -1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  while (argc-- > 0) {
    printf("%s\n", *argv++);
  }
  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)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    115f <main+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1146 <main+0x36>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
add    $0x8,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\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
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp sgt i32 %7, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %5
%13 = load i8*, i8** %11
%14 = ptrtoint i8* %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %6
16: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i8** [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = add nsw i32 %6, -1
%8 = getelementptr inbounds i8*, i8** %5, i64 1
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp ugt i32 %6, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %2
ret i32 0
}
signed int compare(const char *a, const char *b) {
  unsigned long int return_value_strlen$1;
  return_value_strlen$1 = strlen(a);
  unsigned long int return_value_strlen$2;
  return_value_strlen$2 = strlen(b);
  if (!(return_value_strlen$1 == return_value_strlen$2))
    return -1;
  unsigned long int return_value_strlen$3;
  return_value_strlen$3 = strlen(a);
  signed int return_value_strupncmp$4;
  return_value_strupncmp$4 = strupncmp(a, b, (signed int)return_value_strlen$3);
  return return_value_strupncmp$4;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     1164 <compare+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    118f <compare+0x6f>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x30(%rbp),%rax
mov    %eax,%edx
mov    $0x0,%al
call   1030 <strupncmp@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    %rax,%rbx
jne    1154 <compare+0x34>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strupncmp@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %6
%12 = load i8*, i8** %5
%13 = call i64 @strlen(i8* %12)
store i64 %13, i64* %7
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = icmp eq i64 %14, %15
br i1 %16, label %18, label %17
17: ; preds = %2
store i32 -1, i32* %3
br label %27
18: ; preds = %2
%19 = load i8*, i8** %4
%20 = call i64 @strlen(i8* %19)
store i64 %20, i64* %8
%21 = load i8*, i8** %4
%22 = load i8*, i8** %5
%23 = load i64, i64* %8
%24 = trunc i64 %23 to i32
%25 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @strupncmp to i32 (i8*, i8*, i32, ...)*)(i8* %21, i8* %22, i32 %24)
store i32 %25, i32* %9
%26 = load i32, i32* %9
store i32 %26, i32* %3
br label %27
27: ; preds = %18, %17
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @compare(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = trunc i64 %3 to i32
%8 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @strupncmp to i32 (i8*, i8*, i32, ...)*)(i8* %0, i8* %1, i32 %7)
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ -1, %2 ]
ret i32 %10
}