xunge/DecIR huggingface dataset:
/* Variables and functions */
long long a(int);
long long pow(int, int);
int /*<<< orphan*/ printf(char *, long long);
int main() {
  long long int sum_of_squares, squares_of_sum;
  sum_of_squares = a(100);
  squares_of_sum = pow((50 * 101), 2);
  printf("%lld", squares_of_sum - sum_of_squares);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <a@plt>
mov    %rax,-0x10(%rbp)
mov    $0x13ba,%edi
mov    $0x2,%esi
call   1050 <pow@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
sub    -0x10(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1040 <a@plt>
mov    %rax,%rbx
mov    $0x13ba,%edi
mov    $0x2,%esi
call   1050 <pow@plt>
sub    %rbx,%rax
lea    0xea9(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i64 @a(i32 100)
store i64 %4, i64* %2
%5 = call i64 @pow(i32 5050, i32 2)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %2
%8 = sub nsw i64 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i32 @main() {
%1 = tail call i64 @a(i32 100)
%2 = tail call i64 @pow(i32 5050, i32 2)
%3 = sub nsw i64 %2, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ asinf(float);
long double sinl(int /*<<< orphan*/);
long double sinasinf(float x) { return (sinl(asinf(x))); }


x86 assembly (clang, -O0):
<sinasinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <asinf@plt>
mov    %eax,%edi
call   1030 <sinl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinasinf>:
push   %rax
call   1040 <asinf@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sinl@plt>

LLVM IR (-O0):
define x86_fp80 @sinasinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @asinf(float %3)
%5 = call x86_fp80 @sinl(i32 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @sinasinf(float %0) {
%2 = tail call i32 @asinf(float %0)
%3 = tail call x86_fp80 @sinl(i32 %2)
ret x86_fp80 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ hybris_set_mutex_attr(unsigned int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
pthread_mutex_t *hybris_alloc_init_mutex(unsigned int android_mutex) {
  pthread_mutex_t *realmutex = malloc(sizeof(pthread_mutex_t));
  pthread_mutexattr_t attr;
  hybris_set_mutex_attr(android_mutex, &attr);
  pthread_mutex_init(realmutex, &attr);
  return realmutex;
}


x86 assembly (clang, -O0):
<hybris_alloc_init_mutex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1030 <hybris_set_mutex_attr@plt>
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <pthread_mutex_init@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hybris_alloc_init_mutex>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%r14
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <hybris_set_mutex_attr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <pthread_mutex_init@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @hybris_alloc_init_mutex(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32* @malloc(i32 4)
store i32* %5, i32** %3
%6 = load i32, i32* %2
%7 = call i32 @hybris_set_mutex_attr(i32 %6, i32* %4)
%8 = load i32*, i32** %3
%9 = call i32 @pthread_mutex_init(i32* %8, i32* %4)
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define i32* @hybris_alloc_init_mutex(i32 %0) {
%2 = alloca i32
%3 = tail call i32* @malloc(i32 4)
%4 = bitcast i32* %2 to i8*
%5 = call i32 @hybris_set_mutex_attr(i32 %0, i32* %2)
%6 = call i32 @pthread_mutex_init(i32* %3, i32* %2)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void foo(void) { puts("Hello, World"); }


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 = [13 x i8] c"Hello, World\00"
define void @foo() {
%1 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, World\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *Q_malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *copystring(char *s) {
  char *b;
  b = Q_malloc(strlen(s) + 1);
  strcpy(b, s);
  return b;
}


x86 assembly (clang, -O0):
<copystring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <Q_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copystring>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <Q_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copystring(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @Q_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @copystring(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @Q_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
scalar_t__ closesocket(int);
scalar_t__ shutdown(int, int);
int lw_sock_close(int *sock) {
  int result = 0;
  int sock_to_close;
  sock_to_close = *sock;
  (*sock) = -1;
  if (shutdown(sock_to_close, 2) != 0) {
  }
  if (closesocket(sock_to_close) != 0) {
  } else {
    result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<lw_sock_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x10(%rbp),%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
cmp    $0x0,%rax
je     1162 <lw_sock_close+0x42>
jmp    1162 <lw_sock_close+0x42>
mov    -0x10(%rbp),%edi
call   1040 <closesocket@plt>
cmp    $0x0,%rax
je     1179 <lw_sock_close+0x59>
jmp    1180 <lw_sock_close+0x60>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw_sock_close>:
push   %rbx
mov    (%rdi),%ebx
movl   $0xffffffff,(%rdi)
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
call   1040 <closesocket@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @lw_sock_close(i32* nocapture %0) {
%2 = load i32, i32* %0
store i32 -1, i32* %0
%3 = tail call i64 @shutdown(i32 %2, i32 2)
%4 = tail call i64 @closesocket(i32 %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void f(struct pem_pass_data *data) {}


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

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

LLVM IR (-O0):
%struct.pem_pass_data = type opaque
define void @f(%struct.pem_pass_data* %0) {
%2 = alloca %struct.pem_pass_data*
store %struct.pem_pass_data* %0, %struct.pem_pass_data** %2
ret void
}

LLVM IR (-O2):
%struct.pem_pass_data = type opaque
define void @f(%struct.pem_pass_data* nocapture %0) {
ret void
}
int cmp_char(void *a, void *b) { return *(char *)a > *(char *)b; }


x86 assembly (clang, -O0):
<cmp_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_char>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
setg   %al
ret

LLVM IR (-O0):
define i32 @cmp_char(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x94() {
  Assert_real((isxdigit(148) == 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_isxdigit.c",
              745, ("isxdigit should be 0 for 0x94"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x94\00"
define void @t_isxdigit_0x94() {
%1 = tail call i64 @isxdigit(i32 148)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 745, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int __attribute__((const)) abs(const int val) { return val < 0 ? -val : val; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(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 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ isalpha(char);
int /*<<< orphan*/ printf(char *);
char tolower(char);
int play_again(void) {
  char yesno;
  printf("\nWould you like to try another one? ");
  while (!isalpha(yesno = getchar()))
    ;
  if (tolower(yesno) != 'n')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<play_again>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1060 <isalpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117b <play_again+0x3b>
jmp    1180 <play_again+0x40>
jmp    1154 <play_again+0x14>
movsbl -0x5(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%eax
cmp    $0x6e,%eax
je     11a1 <play_again+0x61>
movl   $0x1,-0x4(%rbp)
jmp    11a8 <play_again+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play_again>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1060 <isalpha@plt>
test   %eax,%eax
je     1150 <play_again+0x10>
mov    %ebx,%edi
call   1050 <tolower@plt>
xor    %ecx,%ecx
cmp    $0x6e,%al
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0AWould you like to try another one? \00"
define i32 @play_again() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %9, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = call i32 @isalpha(i8 signext %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 110
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %1
br label %17
16: ; preds = %10
store i32 0, i32* %1
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0AWould you like to try another one? \00"
define i32 @play_again() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = tail call i32 @isalpha(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call signext i8 @tolower(i8 signext %3)
%8 = icmp ne i8 %7, 110
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
double calculate_dot(double *, double *, double *, double *, double *, double *,
                     int);
double sqrt(double);
double calculate_nrm(double *xi, double *yi, double *zi, int nlns) {
  double dot = calculate_dot(xi, yi, zi, xi, yi, zi, nlns);
  return sqrt(dot);
}


x86 assembly (clang, -O0):
<calculate_nrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x1c(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <calculate_dot@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <sqrt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_nrm>:
push   %rax
mov    %ecx,(%rsp)
mov    %rdi,%rcx
mov    %rsi,%r8
mov    %rdx,%r9
call   1030 <calculate_dot@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1142 <calculate_nrm+0x22>
sqrtsd %xmm0,%xmm0
pop    %rax
ret
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @calculate_nrm(double* %0, double* %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca double
store double* %0, double** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%10 = load double*, double** %5
%11 = load double*, double** %6
%12 = load double*, double** %7
%13 = load double*, double** %5
%14 = load double*, double** %6
%15 = load double*, double** %7
%16 = load i32, i32* %8
%17 = call double @calculate_dot(double* %10, double* %11, double* %12, double* %13, double* %14, double* %15, i32 %16)
store double %17, double* %9
%18 = load double, double* %9
%19 = call double @sqrt(double %18)
ret double %19
}

LLVM IR (-O2):
define double @calculate_nrm(double* %0, double* %1, double* %2, i32 %3) {
%5 = tail call double @calculate_dot(double* %0, double* %1, double* %2, double* %0, double* %1, double* %2, i32 %3)
%6 = tail call double @sqrt(double %5)
ret double %6
}
int hicsetskybox(long picnum, long palnum, char *faces[6]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hicsetskybox(i64 %0, i64 %1, i8** nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int send(int, void *, unsigned int, int /*<<< orphan*/);
int NetWrite(int sock_client, void *buffer, unsigned int buf_len) {
  if (sock_client < 0)
    return sock_client;
  return send(sock_client, buffer, buf_len, 0);
}


x86 assembly (clang, -O0):
<NetWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1137 <NetWrite+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <NetWrite+0x3b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NetWrite>:
test   %edi,%edi
js     111b <NetWrite+0xb>
xor    %ecx,%ecx
jmp    1030 <send@plt>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @NetWrite(i32 %0, i8* %1, i32 %2) {
%4 = icmp slt i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 0)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ %0, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, int, int);
main() {
  ({
    int i = 5 && 3;
    die("5 && 3", i, i != 1);
  });
  ({
    int i = 5 > 3;
    die("5 > 3", i, i != 1);
  });
  ({
    int i = 2 > 3;
    die("2 > 3", i, i != 0);
  });
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
cmpl   $0x1,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edx
lea    0xecb(%rip),%rdi
call   1030 <die@plt>
mov    %eax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%esi
cmpl   $0x1,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edx
lea    0xead(%rip),%rdi
call   1030 <die@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%esi
cmpl   $0x0,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edx
lea    0xe8e(%rip),%rdi
call   1030 <die@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <die@plt>
lea    0xedc(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <die@plt>
lea    0xecf(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <die@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"5 && 3\00"
@.str.1 = [6 x i8] c"5 > 3\00"
@.str.2 = [6 x i8] c"2 > 3\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 1, i32* %1
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = icmp ne i32 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @die(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %10)
store i32 %11, i32* %2
%12 = load i32, i32* %2
store i32 1, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 1
%16 = zext i1 %15 to i32
%17 = call i32 @die(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %16)
store i32 %17, i32* %4
%18 = load i32, i32* %4
store i32 0, i32* %5
%19 = load i32, i32* %5
%20 = load i32, i32* %5
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
%23 = call i32 @die(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %19, i32 %22)
store i32 %23, i32* %6
%24 = load i32, i32* %6
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"5 && 3\00"
@.str.1 = [6 x i8] c"5 > 3\00"
@.str.2 = [6 x i8] c"2 > 3\00"
define i32 @main() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
%2 = tail call i32 @die(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 0)
%3 = tail call i32 @die(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
atx_abt() {
  printf("Aborting run\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<atx_abt>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<atx_abt>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Aborting run\0A\00"
define i32 @atx_abt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"Aborting run\00"
define i32 @atx_abt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int toint(char);
int person_organization_association(char fascn[40]) {
  int temp;
  temp = toint(fascn[37]);
  return (temp);
}


x86 assembly (clang, -O0):
<person_organization_association>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x25(%rax),%edi
call   1030 <toint@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<person_organization_association>:
movsbl 0x25(%rdi),%edi
jmp    1030 <toint@plt>

LLVM IR (-O0):
define i32 @person_organization_association(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 37
%6 = load i8, i8* %5
%7 = call i32 @toint(i8 signext %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @person_organization_association(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 37
%3 = load i8, i8* %2
%4 = tail call i32 @toint(i8 signext %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *argv0, int exit_code) {
  printf("Usage: %s [-ht] <file>\n"
         "\n"
         "Options:\n"
         "  -h         display help\n"
         "  -t         number of threads used\n",
         argv0);
  exit(exit_code);
}


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

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

LLVM IR (-O0):
@.str = [96 x i8] c"Usage: %s [-ht] <file>\0A\0AOptions:\0A -h display help\0A -t number of threads used\0A\00"
define void @usage(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 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [96 x i8] c"Usage: %s [-ht] <file>\0A\0AOptions:\0A -h display help\0A -t number of threads used\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 %1)
unreachable
}
/* Type definitions */
struct nhrp_peer {
  int dummy;
};
struct nhrp_interface {
  int dummy;
};
struct nhrp_address {
  int dummy;
};

/* Variables and functions */
struct nhrp_peer *nhrp_peer_route_full(struct nhrp_interface *,
                                       struct nhrp_address *, int, int, long,
                                       long);
struct nhrp_peer *nhrp_peer_route(struct nhrp_interface *iface,
                                  struct nhrp_address *dest, int flags,
                                  int type_mask) {
  return nhrp_peer_route_full(iface, dest, flags, type_mask, 0L, 0L);
}


x86 assembly (clang, -O0):
<nhrp_peer_route>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   1030 <nhrp_peer_route_full@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nhrp_peer_route>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <nhrp_peer_route_full@plt>

LLVM IR (-O0):
%struct.nhrp_peer = type { i32 }
%struct.nhrp_interface = type { i32 }
%struct.nhrp_address = type { i32 }
define %struct.nhrp_peer* @nhrp_peer_route(%struct.nhrp_interface* %0, %struct.nhrp_address* %1, i32 %2, i32 %3) {
%5 = alloca %struct.nhrp_interface*
%6 = alloca %struct.nhrp_address*
%7 = alloca i32
%8 = alloca i32
store %struct.nhrp_interface* %0, %struct.nhrp_interface** %5
store %struct.nhrp_address* %1, %struct.nhrp_address** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.nhrp_interface*, %struct.nhrp_interface** %5
%10 = load %struct.nhrp_address*, %struct.nhrp_address** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call %struct.nhrp_peer* @nhrp_peer_route_full(%struct.nhrp_interface* %9, %struct.nhrp_address* %10, i32 %11, i32 %12, i64 0, i64 0)
ret %struct.nhrp_peer* %13
}

LLVM IR (-O2):
%struct.nhrp_peer = type { i32 }
%struct.nhrp_interface = type { i32 }
%struct.nhrp_address = type { i32 }
define %struct.nhrp_peer* @nhrp_peer_route(%struct.nhrp_interface* %0, %struct.nhrp_address* %1, i32 %2, i32 %3) {
%5 = tail call %struct.nhrp_peer* @nhrp_peer_route_full(%struct.nhrp_interface* %0, %struct.nhrp_address* %1, i32 %2, i32 %3, i64 0, i64 0)
ret %struct.nhrp_peer* %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int syscall(int, char const *, struct stat *);
int stat(const char *restrict path, struct stat *restrict buf) {
  return syscall(106, path, buf);
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x6a,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x6a,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @stat(i8* noalias %0, %struct.stat* noalias %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 @syscall(i32 106, i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @stat(i8* noalias %0, %struct.stat* noalias %1) {
%3 = tail call i32 @syscall(i32 106, i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int strcmp(char const *, char const *);
int qstrcmp(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
}


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

x86 assembly (clang, -O2):
<qstrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @qstrcmp(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 i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @qstrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_degree_of_quaddobl_polynomial(int k, int *d) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(389, &k, d, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_degree_of_quaddobl_polynomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x185,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_degree_of_quaddobl_polynomial>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x185,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_degree_of_quaddobl_polynomial(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc(i32 389, i32* %3, i32* %7, double* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_degree_of_quaddobl_polynomial(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 389, i32* %3, i32* %1, double* undef)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ closeAckFile();
int /*<<< orphan*/ closeServFile();
int /*<<< orphan*/ closeSynFile();
void closeFiles() {
  closeServFile();
  closeSynFile();
  closeAckFile();
}


x86 assembly (clang, -O0):
<closeFiles>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <closeServFile@plt>
mov    $0x0,%al
call   1040 <closeSynFile@plt>
mov    $0x0,%al
call   1050 <closeAckFile@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeFiles>:
push   %rax
xor    %eax,%eax
call   1030 <closeServFile@plt>
xor    %eax,%eax
call   1040 <closeSynFile@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <closeAckFile@plt>

LLVM IR (-O0):
define void @closeFiles() {
%1 = call i32 (...) @closeServFile()
%2 = call i32 (...) @closeSynFile()
%3 = call i32 (...) @closeAckFile()
ret void
}

LLVM IR (-O2):
define void @closeFiles() {
%1 = tail call i32 (...) @closeServFile()
%2 = tail call i32 (...) @closeSynFile()
%3 = tail call i32 (...) @closeAckFile()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_stream_locklatch_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_stream@%p::locklatch (rtpp_stream_locklatch) is invoked "
          "after destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<rtpp_stream_locklatch_fin>:
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   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<rtpp_stream_locklatch_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [87 x i8] c"Method rtpp_stream@%p::locklatch (rtpp_stream_locklatch) is invoked after destruction\0A\00"
define void @rtpp_stream_locklatch_fin(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 ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [87 x i8] c"Method rtpp_stream@%p::locklatch (rtpp_stream_locklatch) is invoked after destruction\0A\00"
define void @rtpp_stream_locklatch_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("haha");
  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 <puts@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 = [5 x i8] c"haha\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"haha\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int maxsum(int[], int);
  int x[] = {31, -41, 59, 26, -53, 58, 97, -93, -23, 84};
  printf("%d\n", maxsum(x, (int)sizeof(x) / sizeof(x[0])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1050 <maxsum@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1040 <maxsum@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x i32] [i32 31, i32 -41, i32 59, i32 26, i32 -53, i32 58, i32 97, i32 -93, i32 -23, i32 84]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @maxsum(i32* %4, i32 10)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x i32] [i32 31, i32 -41, i32 59, i32 26, i32 -53, i32 58, i32 97, i32 -93, i32 -23, i32 84]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @maxsum(i32* %3, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
extern void primNoFree(void *p) {}


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

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

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

LLVM IR (-O2):
define void @primNoFree(i8* nocapture %0) {
ret void
}
float glmMin2f(float a, float b) {
  if (a < b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<glmMin2f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <glmMin2f+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <glmMin2f+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMin2f>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @glmMin2f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @glmMin2f(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
void disable_hblk_interrupt() {
  (*(volatile unsigned long *)(((0xFFFFF000) + 0x014))) = 0x00020;
}


x86 assembly (clang, -O0):
<disable_hblk_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff014,%eax
movq   $0x20,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_hblk_interrupt>:
mov    $0xfffff014,%eax
movq   $0x20,(%rax)
ret

LLVM IR (-O0):
define void @disable_hblk_interrupt() {
store volatile i64 32, i64* inttoptr (i64 4294963220 to i64*)
ret void
}

LLVM IR (-O2):
define void @disable_hblk_interrupt() {
store volatile i64 32, i64* inttoptr (i64 4294963220 to i64*)
ret void
}
unsigned char *put_int32(unsigned char *buffer, int val) {
  *buffer++ = val & 0xff;
  *buffer++ = (val & 0xff00) >> 8;
  *buffer++ = (val & 0xff0000) >> 16;
  *buffer++ = (val & 0xff000000) >> 24;
  return buffer;
}


x86 assembly (clang, -O0):
<put_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_int32>:
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @put_int32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
store i8 %7, i8* %8
%10 = load i32, i32* %4
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
store i8 %13, i8* %14
%16 = load i32, i32* %4
%17 = and i32 %16, 16711680
%18 = ashr i32 %17, 16
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
store i8 %19, i8* %20
%22 = load i32, i32* %4
%23 = and i32 %22, -16777216
%24 = lshr i32 %23, 24
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
store i8 %25, i8* %26
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
define i8* @put_int32(i8* writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %0
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %4
%8 = lshr i32 %1, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %9, i8* %7
%11 = lshr i32 %1, 24
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %12, i8* %10
ret i8* %13
}
unsigned int killprot_hash(char *nick) {
  unsigned int hash = 0;
  while (*nick)
    hash = (hash << 5) - hash + *nick++;
  return hash & 127;
}


x86 assembly (clang, -O0):
<killprot_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <killprot_hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
sub    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <killprot_hash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<killprot_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <killprot_hash+0x2b>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movzbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <killprot_hash+0x10>
and    $0x7f,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @killprot_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 31
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 127
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_vectors();
int main() {
  if (!test_vectors())
    printf("test vector ok\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_vectors@plt>
cmp    $0x0,%eax
jne    114b <main+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_vectors@plt>
test   %eax,%eax
jne    1138 <main+0x18>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"test vector ok\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_vectors()
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"test vector ok\00"
define i32 @main() {
%1 = tail call i32 (...) @test_vectors()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void USB_HP_CAN_TX_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @USB_HP_CAN_TX_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}