xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ h();
int main() { h(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @h()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @h()
ret i32 0
}
unsigned int min(unsigned int x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0) {
ret i32 0
}
int match_four_chars(unsigned char *head, const unsigned char *match) {
  int i;
  for (i = 0; i < 4; i++)
    if (head[i] != match[i])
      return (0);
  return (1);
}


x86 assembly (clang, -O0):
<match_four_chars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    115c <match_four_chars+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1149 <match_four_chars+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1163 <match_four_chars+0x63>
jmp    114e <match_four_chars+0x4e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <match_four_chars+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_four_chars>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1123 <match_four_chars+0x23>
mov    0x1(%rdi),%cl
cmp    0x1(%rsi),%cl
jne    1123 <match_four_chars+0x23>
mov    0x2(%rdi),%cl
cmp    0x2(%rsi),%cl
jne    1123 <match_four_chars+0x23>
mov    0x3(%rdi),%cl
xor    %eax,%eax
cmp    0x3(%rsi),%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @match_four_chars(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %25
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %1, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %8, %10
br i1 %11, label %12, label %25
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %13
%15 = getelementptr inbounds i8, i8* %1, i64 2
%16 = load i8, i8* %15
%17 = icmp eq i8 %14, %16
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = getelementptr inbounds i8, i8* %0, i64 3
%20 = load i8, i8* %19
%21 = getelementptr inbounds i8, i8* %1, i64 3
%22 = load i8, i8* %21
%23 = icmp eq i8 %20, %22
%24 = zext i1 %23 to i32
br label %25
25: ; preds = %18, %12, %6, %2
%26 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 0, %12 ], [ %24, %18 ]
ret i32 %26
}
/* Variables and functions */
char *v2_sfor2ptr(char *);
char *sfor2ptr(char *for_string) { return v2_sfor2ptr(for_string); }


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

x86 assembly (clang, -O2):
<sfor2ptr>:
jmp    1030 <v2_sfor2ptr@plt>

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

LLVM IR (-O2):
define i8* @sfor2ptr(i8* %0) {
%2 = tail call i8* @v2_sfor2ptr(i8* %0)
ret i8* %2
}
int Length(input) const char *input;
{
  int len = 0;
  const char *s = input;
  while (*s) {
    s++;
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<Length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <Length+0x3e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <Length+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Length>:
cmpb   $0x0,(%rdi)
je     111c <Length+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <Length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add nuw nsw i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ seek(int /*<<< orphan*/, int /*<<< orphan*/, int);
main() { seek(0, 0, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    $0x2,%edx
mov    %esi,%edi
call   1030 <seek@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <seek@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @seek(i32 0, i32 0, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @seek(i32 0, i32 0, i32 2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __pid_t;

/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int /*<<< orphan*/ __libc_waitpid(int /*<<< orphan*/, int *, int);
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
__pid_t __attribute__((weak)) waitpid(__pid_t pid, int *stat_loc, int options) {
  __pid_t result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_waitpid(pid, stat_loc, options);
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<waitpid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    -0x1c(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <__libc_waitpid@plt>
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitpid>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <__libc_waitpid@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%9 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* %8)
%11 = load i32, i32* %4
%12 = load i32*, i32** %5
%13 = load i32, i32* %6
%14 = call i32 @__libc_waitpid(i32 %11, i32* %12, i32 %13)
store i32 %14, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @pthread_setcanceltype(i32 %15, i32* null)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @waitpid(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%7 = call i32 @pthread_setcanceltype(i32 %6, i32* %4)
%8 = call i32 @__libc_waitpid(i32 %0, i32* %1, i32 %2)
%9 = load i32, i32* %4
%10 = call i32 @pthread_setcanceltype(i32 %9, i32* null)
ret i32 %8
}
/* Variables and functions */
double EvaluateExpression();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("input an expression, end with '#': ");
  printf("the result is: %.2f\n", EvaluateExpression());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <EvaluateExpression@plt>
lea    0xee7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"input an expression, end with '#': \00"
@.str.1 = [21 x i8] c"the result is: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call double (...) @EvaluateExpression()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"input an expression, end with '#': \00"
@.str.1 = [21 x i8] c"the result is: %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = tail call double (...) @EvaluateExpression()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %2)
ret i32 0
}
/* Type definitions */
struct __netgrent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_SUCCESS;
int /*<<< orphan*/ internal_nis_endnetgrent(struct __netgrent *);
enum nss_status _nss_nis_endnetgrent(struct __netgrent *netgrp) {
  internal_nis_endnetgrent(netgrp);
  return NSS_STATUS_SUCCESS;
}


x86 assembly (clang, -O0):
<_nss_nis_endnetgrent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <internal_nis_endnetgrent@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_nis_endnetgrent>:
push   %rax
call   1030 <internal_nis_endnetgrent@plt>
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.__netgrent = type { i32 }
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_nis_endnetgrent(%struct.__netgrent* %0) {
%2 = alloca %struct.__netgrent*
store %struct.__netgrent* %0, %struct.__netgrent** %2
%3 = load %struct.__netgrent*, %struct.__netgrent** %2
%4 = call i32 @internal_nis_endnetgrent(%struct.__netgrent* %3)
%5 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
%struct.__netgrent = type { i32 }
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_nis_endnetgrent(%struct.__netgrent* %0) {
%2 = tail call i32 @internal_nis_endnetgrent(%struct.__netgrent* %0)
%3 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %3
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
unsigned long micros(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return (ts.tv_sec * 1000000L + ts.tv_nsec / 1000L);
}


x86 assembly (clang, -O0):
<micros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<micros>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,0x8(%rsp),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  0x10(%rsp)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @micros() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sdiv i64 %8, 1000
%10 = add nsw i64 %6, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @micros() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = mul nsw i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = sdiv i64 %9, 1000
%11 = add nsw i64 %10, %7
ret i64 %11
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void *gcalloc(int number, int size) {
  void *p = calloc(number, size);
  if (p == NULL) {
    printf("Memory allocation error!\n");
    exit(1);
  } else
    return p;
}


x86 assembly (clang, -O0):
<gcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <gcalloc+0x3e>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcalloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     113d <gcalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@str = [25 x i8] c"Memory allocation error!\00"
define noalias i8* @gcalloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int Partition(int *, int, int);
void QuickSort(int *a, int p, int r) {
  if (p < r) {
    int q = Partition(a, p, r);
    QuickSort(a, p, q - 1);
    QuickSort(a, p + 1, r);
  }
}


x86 assembly (clang, -O0):
<QuickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <QuickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <QuickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <QuickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuickSort>:
push   %rbp
push   %r14
push   %rbx
cmp    %edx,%esi
jge    1152 <QuickSort+0x32>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <Partition@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <QuickSort@plt>
add    $0x1,%ebp
cmp    %ebp,%r14d
jne    1130 <QuickSort+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @QuickSort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @Partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %4
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @QuickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @Partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @QuickSort(i32* %0, i32 %6, i32 %8)
%9 = add i32 %6, 1
%10 = icmp eq i32 %9, %2
br i1 %10, label %11, label %5
11: ; preds = %5, %3
ret void
}
unsigned int fpu_fcom_c1(double a, double b) { return 0; }


x86 assembly (clang, -O0):
<fpu_fcom_c1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fpu_fcom_c1(double %0, double %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int read_i2c_reg(int, int, int /*<<< orphan*/ *);
int piups_get_vaux2conv(int file_i2c, uint16_t *vaux2conv) {
  return read_i2c_reg(file_i2c, 0x56, vaux2conv);
}


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

x86 assembly (clang, -O2):
<piups_get_vaux2conv>:
mov    %rsi,%rdx
mov    $0x56,%esi
jmp    1030 <read_i2c_reg@plt>

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

LLVM IR (-O2):
define i32 @piups_get_vaux2conv(i32 %0, i32* %1) {
%3 = tail call i32 @read_i2c_reg(i32 %0, i32 86, i32* %1)
ret i32 %3
}
Activate() {}


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

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

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

LLVM IR (-O2):
define i32 @Activate() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ PR_SET_NAME;
int /*<<< orphan*/ prctl(int /*<<< orphan*/, char const *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void THREAD_SETNAME(char const *_name) { prctl(PR_SET_NAME, _name, 0, 0, 0); }


x86 assembly (clang, -O0):
<THREAD_SETNAME>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <prctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<THREAD_SETNAME>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <prctl@plt>

LLVM IR (-O0):
@PR_SET_NAME = global i32 0
define void @THREAD_SETNAME(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @PR_SET_NAME
%4 = load i8*, i8** %2
%5 = call i32 @prctl(i32 %3, i8* %4, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@PR_SET_NAME = global i32 0
define void @THREAD_SETNAME(i8* %0) {
%2 = load i32, i32* @PR_SET_NAME
%3 = tail call i32 @prctl(i32 %2, i8* %0, i32 0, i32 0, i32 0)
ret void
}
void *test_anti_range_139(short n) {
  extern void *alloc_anti_range_139(short) __attribute__((alloc_size(1)));
  if (-1 <= n && n <= 2)
    n = -1 - 1;
  return alloc_anti_range_139(n);
}


x86 assembly (clang, -O0):
<test_anti_range_139>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jg     1143 <test_anti_range_139+0x33>
movswl -0x2(%rbp),%eax
cmp    $0x2,%eax
jg     1143 <test_anti_range_139+0x33>
movw   $0xfffe,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_139@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_139>:
lea    0x1(%rdi),%eax
cmp    $0x4,%ax
mov    $0xfffe,%eax
cmovae %edi,%eax
movswl %ax,%edi
jmp    1030 <alloc_anti_range_139@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_139(i16 signext %0) {
%2 = add i16 %0, 1
%3 = icmp ult i16 %2, 4
%4 = select i1 %3, i16 -2, i16 %0
%5 = tail call i8* @alloc_anti_range_139(i16 signext %4)
ret i8* %5
}
void _exit(int status) {
  while (666)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

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

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ write_line(char *);
void html_toc_end(void) { write_line("<HR>"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"<HR>\00"
define void @html_toc_end() {
%1 = call i32 @write_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"<HR>\00"
define void @html_toc_end() {
%1 = tail call i32 @write_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void test19_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @test19_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool is_object_end(const uint8_t c) {
  switch (c) {
  case 0x9:
  case 0xA:
  case 0xD:
  case 0x20:
  case '\0':
  case '#':
  case '.':
  case ';':
    return true;
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<is_object_end>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     1183 <is_object_end+0x83>
jmp    111a <is_object_end+0x1a>
mov    -0xc(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1183 <is_object_end+0x83>
jmp    112e <is_object_end+0x2e>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1183 <is_object_end+0x83>
jmp    113f <is_object_end+0x3f>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     1183 <is_object_end+0x83>
jmp    1150 <is_object_end+0x50>
mov    -0xc(%rbp),%eax
sub    $0x23,%eax
je     1183 <is_object_end+0x83>
jmp    1161 <is_object_end+0x61>
mov    -0xc(%rbp),%eax
sub    $0x2e,%eax
je     1183 <is_object_end+0x83>
jmp    1172 <is_object_end+0x72>
mov    -0xc(%rbp),%eax
sub    $0x3b,%eax
jne    118f <is_object_end+0x8f>
jmp    1183 <is_object_end+0x83>
movl   $0x1,-0x4(%rbp)
jmp    1196 <is_object_end+0x96>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_object_end>:
cmp    $0x3b,%edi
ja     111d <is_object_end+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x800400900002601,%rdx
bt     %rcx,%rdx
jae    111d <is_object_end+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_object_end(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 9, label %5
i32 10, label %5
i32 13, label %5
i32 32, label %5
i32 0, label %5
i32 35, label %5
i32 46, label %5
i32 59, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_object_end(i32 %0) {
switch i32 %0, label %2 [
i32 9, label %3
i32 10, label %3
i32 13, label %3
i32 32, label %3
i32 0, label %3
i32 35, label %3
i32 46, label %3
i32 59, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ x_msg(int, char *, int, int, char const *, int);
int index_verify(int index, int size, const char *file, int line) {
  if (index < 0 || index >= size) {
    x_msg((1 << 4),
          "Assertion Failed: Array index=%d out of bounds for array size=%d in "
          "%s:%d",
          index, size, file, line);
  }
  return index;
}


x86 assembly (clang, -O0):
<index_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     113b <index_verify+0x2b>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     115a <index_verify+0x4a>
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
mov    $0x10,%edi
lea    0xeab(%rip),%rsi
call   1030 <x_msg@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_verify>:
push   %rbx
mov    %ecx,%r9d
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%ebx
test   %edi,%edi
js     1123 <index_verify+0x13>
cmp    %ecx,%ebx
jl     1136 <index_verify+0x26>
lea    0xed6(%rip),%rsi
mov    $0x10,%edi
mov    %ebx,%edx
call   1030 <x_msg@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [74 x i8] c"Assertion Failed: Array index=%d out of bounds for array size=%d in %s:%d\00"
define i32 @index_verify(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11, %4
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i8*, i8** %7
%19 = load i32, i32* %8
%20 = call i32 @x_msg(i32 16, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i8* %18, i32 %19)
br label %21
21: ; preds = %15, %11
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
@.str = [74 x i8] c"Assertion Failed: Array index=%d out of bounds for array size=%d in %s:%d\00"
define i32 @index_verify(i32 returned %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp sgt i32 %0, -1
%6 = icmp slt i32 %0, %1
%7 = and i1 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @x_msg(i32 16, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i8* %2, i32 %3)
br label %10
10: ; preds = %4, %8
ret i32 %0
}
void put_user_word(short val, short *addr) {
  __asm__("movw %0,%%fs:%1" : : "ir"(val), "m"(*addr));
}


x86 assembly (clang, -O0):
<put_user_word>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rcx
mov    %ax,%fs:(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_user_word>:
mov    %di,%fs:(%rsi)
ret

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

LLVM IR (-O2):
define void @put_user_word(i16 signext %0, i16* %1) {
tail call void asm sideeffect "movw $0,%fs:$1", "ir,*m,~{dirflag},~{fpsr},~{flags}"(i16 %0, i16* elementtype(i16) %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rand();
void rand_to_output(size_t count, uint32_t *output) {
  for (size_t i = 0; i < count; i++) {
    *output++ = rand();
  }
}


x86 assembly (clang, -O0):
<rand_to_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1161 <rand_to_output+0x51>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <rand_to_output+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_to_output>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1144 <rand_to_output+0x34>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <rand_to_output+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @rand_to_output(i64 %0, i32* nocapture writeonly %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = phi i32* [ %9, %5 ], [ %1, %2 ]
%8 = tail call i32 (...) @rand()
%9 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %8, i32* %7
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %0
br i1 %11, label %4, label %5
}
int OriOperation(void) {
  int retSize = 1;
  return retSize;
}


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

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

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

LLVM IR (-O2):
define i32 @OriOperation() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ BIO_new_fd(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ ERR_print_errors(int /*<<< orphan*/);
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ warnx(char *, char const *);
void fatal(const char *msg) {
  warnx("%s", msg);
  ERR_print_errors(BIO_new_fd(STDERR_FILENO, 0));
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1050 <warnx@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <BIO_new_fd@plt>
mov    %eax,%edi
call   1030 <ERR_print_errors@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    %rdi,%rsi
lea    0xeb5(%rip),%rdi
call   1050 <warnx@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <BIO_new_fd@plt>
mov    %eax,%edi
call   1030 <ERR_print_errors@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@STDERR_FILENO = global i32 0
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @warnx(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @STDERR_FILENO
%6 = call i32 @BIO_new_fd(i32 %5, i32 0)
%7 = call i32 @ERR_print_errors(i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@STDERR_FILENO = global i32 0
define void @fatal(i8* %0) {
%2 = tail call i32 @warnx(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @STDERR_FILENO
%4 = tail call i32 @BIO_new_fd(i32 %3, i32 0)
%5 = tail call i32 @ERR_print_errors(i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
scalar_t__ inet_ntop(int /*<<< orphan*/, struct in_addr *, char *, int);
char *inaddr_ntoa_r(struct in_addr saddr, char *buf, int buf_len) {
  return ((char *)inet_ntop(AF_INET, &saddr, buf, buf_len));
}


x86 assembly (clang, -O0):
<inaddr_ntoa_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    -0x8(%rbp),%rsi
call   1030 <inet_ntop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inaddr_ntoa_r>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <inet_ntop@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i8* @inaddr_ntoa_r(i32 %0, i8* %1, i32 %2) {
%4 = alloca %struct.in_addr
%5 = alloca i8*
%6 = alloca i32
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i32 0, i32 0
store i32 %0, i32* %7
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* @AF_INET
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i64 @inet_ntop(i32 %8, %struct.in_addr* %4, i8* %9, i32 %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i8* @inaddr_ntoa_r(i32 %0, i8* %1, i32 %2) {
%4 = alloca %struct.in_addr
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i64 0, i32 0
store i32 %0, i32* %5
%6 = load i32, i32* @AF_INET
%7 = call i64 @inet_ntop(i32 %6, %struct.in_addr* %4, i8* %1, i32 %2)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ filecopy(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int main() {
  int c;
  FILE *fp, *nfp;
  fp = fopen("words", "r");
  nfp = fopen("derps", "w");
  filecopy(fp, nfp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xebb(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <filecopy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <filecopy@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"words\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"derps\00"
@.str.3 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** %3
%6 = call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = call i32 @filecopy(i32* %7, i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"words\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [6 x i8] c"derps\00"
@.str.3 = [2 x i8] c"w\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @filecopy(i32* %1, i32* %2)
ret i32 0
}
int bp_sw_stupid_5SS_eval(int type, void *data, char *seq) {
  if (*(seq) == 'G' && *(seq + 1) == 'T')
    return 0;
  else
    return (-10000000);
}


x86 assembly (clang, -O0):
<bp_sw_stupid_5SS_eval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x47,%eax
jne    113c <bp_sw_stupid_5SS_eval+0x3c>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x54,%eax
jne    113c <bp_sw_stupid_5SS_eval+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1143 <bp_sw_stupid_5SS_eval+0x43>
movl   $0xff676980,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bp_sw_stupid_5SS_eval>:
cmpb   $0x47,(%rdx)
jne    110d <bp_sw_stupid_5SS_eval+0xd>
xor    %eax,%eax
cmpb   $0x54,0x1(%rdx)
je     1112 <bp_sw_stupid_5SS_eval+0x12>
mov    $0xff676980,%eax
ret

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

LLVM IR (-O2):
define i32 @bp_sw_stupid_5SS_eval(i32 %0, i8* nocapture readnone %1, i8* nocapture %2) {
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 71
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %2, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 84
br i1 %9, label %11, label %10
10: ; preds = %6, %3
br label %11
11: ; preds = %6, %10
%12 = phi i32 [ -10000000, %10 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_swap(void) { output_line("ex de,hl"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"ex de,hl\00"
define void @gen_swap() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ex de,hl\00"
define void @gen_swap() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void SIMD_ALIGNED_FREE(void *p1) {
  if (p1)
    free(*((void **)p1 - 1));
}


x86 assembly (clang, -O0):
<SIMD_ALIGNED_FREE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <SIMD_ALIGNED_FREE+0x24>
mov    -0x8(%rbp),%rax
mov    -0x8(%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIMD_ALIGNED_FREE>:
test   %rdi,%rdi
je     111e <SIMD_ALIGNED_FREE+0xe>
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @SIMD_ALIGNED_FREE(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -8
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
br label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ complain(char *);
void *xcalloc(size_t n, size_t s) {
  void *p;
  if (n == 0 || s == 0)
    return NULL;
  if ((p = calloc(n, s)) == NULL)
    complain("calloc: %m");
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <xcalloc+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xcalloc+0x33>
movq   $0x0,-0x8(%rbp)
jmp    1182 <xcalloc+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    117a <xcalloc+0x5a>
lea    0xe8b(%rip),%rdi
call   1040 <complain@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1137 <xcalloc+0x17>
test   %rsi,%rsi
je     1137 <xcalloc+0x17>
call   1030 <calloc@plt>
test   %rax,%rax
je     1139 <xcalloc+0x19>
pop    %rcx
ret
lea    0xec0(%rip),%rdi
call   1040 <complain@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"calloc: %m\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i64, i64* %5
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9, %2
store i8* null, i8** %3
br label %22
13: ; preds = %9
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = call i8* @calloc(i64 %14, i64 %15)
store i8* %16, i8** %6
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = call i32 @complain(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %13
%21 = load i8*, i8** %6
store i8* %21, i8** %3
br label %22
22: ; preds = %20, %12
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
@.str = [11 x i8] c"calloc: %m\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @complain(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %6, %9, %2
%12 = phi i8* [ null, %2 ], [ null, %9 ], [ %7, %6 ]
ret i8* %12
}
int cc_debugfs_global_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cc_debugfs_global_init() {
ret i32 0
}
/* Variables and functions */
unsigned int startHandleMessage(void *, char *, int, void **, unsigned int *);
unsigned int startAssertEvent(void *handle, char *message, void **rulesBinding,
                              unsigned int *replyCount) {
  return startHandleMessage(handle, message, 2, rulesBinding, replyCount);
}


x86 assembly (clang, -O0):
<startAssertEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x2,%edx
call   1030 <startHandleMessage@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startAssertEvent>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    $0x2,%edx
jmp    1030 <startHandleMessage@plt>

LLVM IR (-O0):
define i32 @startAssertEvent(i8* %0, i8* %1, i8** %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8**, i8*** %7
%12 = load i32*, i32** %8
%13 = call i32 @startHandleMessage(i8* %9, i8* %10, i32 2, i8** %11, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @startAssertEvent(i8* %0, i8* %1, i8** %2, i32* %3) {
%5 = tail call i32 @startHandleMessage(i8* %0, i8* %1, i32 2, i8** %2, i32* %3)
ret i32 %5
}