xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ assert(int);
scalar_t__ close(int);
void handler(int sig) {
  assert(close(1) == 0);
  _exit(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <close@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    $0x1,%edi
call   1040 <close@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 @close(i32 1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i64 @close(i32 1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version(void) {
  printf("spi-hdlc-adapter "
         "0.07"
         " ("
         "01:41:40"
         " "
         "Mar 19 2022"
         ")\n");
  printf("Copyright (c) 2017 The OpenThread Authors, All Rights Reserved\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"spi-hdlc-adapter 0.07 (01:41:40 Mar 19 2022)\0A\00"
@.str.1 = [64 x i8] c"Copyright (c) 2017 The OpenThread Authors, All Rights Reserved\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [45 x i8] c"spi-hdlc-adapter 0.07 (01:41:40 Mar 19 2022)\00"
@str.2 = [63 x i8] c"Copyright (c) 2017 The OpenThread Authors, All Rights Reserved\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, char const *, int, char const *,
                          char const *);
void mu_assert_impl(const char *file, int line, const char *func, bool a,
                    const char *a_str) {
  if (!a) {
    printf("%s:%d in %s: assertion failed: %s\n", file, line, func, a_str);
    abort();
  }
}


x86 assembly (clang, -O0):
<mu_assert_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1166 <mu_assert_impl+0x46>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu_assert_impl>:
test   %ecx,%ecx
je     1125 <mu_assert_impl+0x5>
ret
push   %rax
mov    %rdx,%rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xecb(%rip),%rdi
mov    %rax,%rcx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"%s:%d in %s: assertion failed: %s\0A\00"
define void @mu_assert_impl(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %9
%12 = icmp ne i32 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = load i8*, i8** %8
%17 = load i8*, i8** %10
%18 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15, i8* %16, i8* %17)
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"%s:%d in %s: assertion failed: %s\0A\00"
define void @mu_assert_impl(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = icmp eq i32 %3, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i8* %4)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
_Bool __VERIFIER_nondet_bool() {
  _Bool initialValue;
  int byteOffset = 0;
  uint8_t *initialValueAsByte = (uint8_t *)&initialValue;
  for (; byteOffset < sizeof(_Bool); ++byteOffset) {
    initialValueAsByte[byteOffset] = 0;
  }
  return initialValue;
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_bool>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x1,%rax
jae    113f <__VERIFIER_nondet_bool+0x3f>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1113 <__VERIFIER_nondet_bool+0x13>
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i1 @__VERIFIER_nondet_bool() {
ret i1 undef
}
/* Variables and functions */
unsigned int FOPEN_MAX;
unsigned int scalanative_libc_fopen_max() { return FOPEN_MAX; }


x86 assembly (clang, -O0):
<scalanative_libc_fopen_max>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalanative_libc_fopen_max>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@FOPEN_MAX = global i32 0
define i32 @scalanative_libc_fopen_max() {
%1 = load i32, i32* @FOPEN_MAX
ret i32 %1
}

LLVM IR (-O2):
@FOPEN_MAX = global i32 0
define i32 @scalanative_libc_fopen_max() {
%1 = load i32, i32* @FOPEN_MAX
ret i32 %1
}
/* Variables and functions */
size_t strlen(const char *str) { return (*str) ? strlen(++str) + 1 : 0; }


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114a <strlen+0x3a>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
call   1030 <strlen@plt>
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1155 <strlen+0x45>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1155 <strlen+0x45>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(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 i64 [ %8, %4 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add i64 %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 i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int count2(int /*<<< orphan*/ const);
void countDigits2(size_t length, const uint32_t *dataArray, int *countArray) {
  while (length) {
    *countArray = count2(*dataArray);
    countArray++;
    dataArray++;
    length--;
  }
}


x86 assembly (clang, -O0):
<countDigits2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116b <countDigits2+0x5b>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <count2@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <countDigits2+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDigits2>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1146 <countDigits2+0x36>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <count2@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <countDigits2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @countDigits2(i64 %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %15, label %5
5: ; preds = %3, %5
%6 = phi i32* [ %11, %5 ], [ %2, %3 ]
%7 = phi i32* [ %12, %5 ], [ %1, %3 ]
%8 = phi i64 [ %13, %5 ], [ %0, %3 ]
%9 = load i32, i32* %7
%10 = tail call i32 @count2(i32 %9)
store i32 %10, i32* %6
%11 = getelementptr inbounds i32, i32* %6, i64 1
%12 = getelementptr inbounds i32, i32* %7, i64 1
%13 = add i64 %8, -1
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %3
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double pow(double, double);
double rand();
double pareto() {
  double alpha = 2.2, m = 1.0;
  return m / (pow((rand() / (double)RAND_MAX), 1.0 / alpha));
}


x86 assembly (clang, -O0):
<pareto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    0x2e8e(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pareto>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
mov    0x2eb9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  0xec0(%rip),%xmm1
call   1030 <pow@plt>
movsd  0xebb(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @pareto() {
%1 = alloca double
%2 = alloca double
store double 2.200000e+00, double* %1
store double 1.000000e+00, double* %2
%3 = load double, double* %2
%4 = call double (...) @rand()
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
%8 = load double, double* %1
%9 = fdiv double 1.000000e+00, %8
%10 = call double @pow(double %7, double %9)
%11 = fdiv double %3, %10
ret double %11
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @pareto() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fdiv double %1, %3
%5 = tail call double @pow(double %4, double 0x3FDD1745D1745D17)
%6 = fdiv double 1.000000e+00, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ send_errno(int /*<<< orphan*/);
int /*<<< orphan*/ send_success();
scalar_t__ symlink(char *, char *);
void do_symlink(int argc, char **argv) {
  assert(argc == 2);
  if (symlink(argv[0], argv[1]) == 0)
    send_success();
  else
    send_errno(errno);
}


x86 assembly (clang, -O0):
<do_symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <symlink@plt>
cmp    $0x0,%rax
jne    118a <do_symlink+0x4a>
mov    $0x0,%al
call   1050 <send_success@plt>
jmp    1198 <do_symlink+0x58>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
call   1060 <send_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_symlink>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
mov    (%rbx),%rdi
mov    0x8(%rbx),%rsi
call   1030 <symlink@plt>
test   %rax,%rax
je     1173 <do_symlink+0x33>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1060 <send_errno@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <send_success@plt>

LLVM IR (-O0):
@errno = global i32 0
define void @do_symlink(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @symlink(i8* %11, i8* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @send_success()
br label %22
19: ; preds = %2
%20 = load i32, i32* @errno
%21 = call i32 @send_errno(i32 %20)
br label %22
22: ; preds = %19, %17
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @do_symlink(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @symlink(i8* %6, i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i32 (...) @send_success()
br label %16
13: ; preds = %2
%14 = load i32, i32* @errno
%15 = tail call i32 @send_errno(i32 %14)
br label %16
16: ; preds = %13, %11
ret void
}
float *vec4(float *result, float x, float y, float z, float w) {
  result[0] = x;
  result[1] = y;
  result[2] = z;
  result[3] = w;
  return result;
}


x86 assembly (clang, -O0):
<vec4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4>:
mov    %rdi,%rax
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  %xmm2,0x8(%rdi)
movss  %xmm3,0xc(%rdi)
ret

LLVM IR (-O0):
define float* @vec4(float* %0, float %1, float %2, float %3, float %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %7
%12 = load float*, float** %6
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float, float* %8
%15 = load float*, float** %6
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float, float* %9
%18 = load float*, float** %6
%19 = getelementptr inbounds float, float* %18, i64 2
store float %17, float* %19
%20 = load float, float* %10
%21 = load float*, float** %6
%22 = getelementptr inbounds float, float* %21, i64 3
store float %20, float* %22
%23 = load float*, float** %6
ret float* %23
}

LLVM IR (-O2):
define float* @vec4(float* returned writeonly %0, float %1, float %2, float %3, float %4) {
store float %1, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
store float %2, float* %6
%7 = getelementptr inbounds float, float* %0, i64 2
store float %3, float* %7
%8 = getelementptr inbounds float, float* %0, i64 3
store float %4, float* %8
ret float* %0
}
/* Variables and functions */
int /*<<< orphan*/ checkLetter(char, int *);
char getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  char ch;
  int counter = 0;
  while ((ch = getchar())) {
    if (ch != '\n') {
      checkLetter(ch, &counter);
    } else {
      break;
    }
  }
  printf("%d", counter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
cmp    $0x0,%al
je     1181 <main+0x51>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1177 <main+0x47>
lea    -0xc(%rbp),%rsi
movsbl -0x5(%rbp),%edi
call   1050 <checkLetter@plt>
jmp    117c <main+0x4c>
jmp    1181 <main+0x51>
jmp    1146 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
test   %al,%al
je     116c <main+0x3c>
cmp    $0xa,%al
je     116c <main+0x3c>
movsbl %al,%edi
mov    %rbx,%rsi
call   1050 <checkLetter@plt>
jmp    1150 <main+0x20>
mov    0xc(%rsp),%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %15, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8, i8* %2
%13 = call i32 @checkLetter(i8 signext %12, i32* %3)
br label %15
14: ; preds = %7
br label %16
15: ; preds = %11
br label %4
16: ; preds = %14, %4
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %5, %0
%4 = call signext i8 (...) @getchar()
switch i8 %4, label %5 [
i8 10, label %7
i8 0, label %7
]
5: ; preds = %3
%6 = call i32 @checkLetter(i8 signext %4, i32* %1)
br label %3
7: ; preds = %3, %3
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
struct stat32 {
  int dummy;
};

/* Variables and functions */
int __stat_time32(char const *, struct stat32 *);
int __xstat64(int ver, const char *path, struct stat32 *buf) {
  return __stat_time32(path, buf);
}


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

x86 assembly (clang, -O2):
<__xstat64>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <__stat_time32@plt>

LLVM IR (-O0):
%struct.stat32 = type { i32 }
define i32 @__xstat64(i32 %0, i8* %1, %struct.stat32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.stat32*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.stat32* %2, %struct.stat32** %6
%7 = load i8*, i8** %5
%8 = load %struct.stat32*, %struct.stat32** %6
%9 = call i32 @__stat_time32(i8* %7, %struct.stat32* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.stat32 = type { i32 }
define i32 @__xstat64(i32 %0, i8* %1, %struct.stat32* %2) {
%4 = tail call i32 @__stat_time32(i8* %1, %struct.stat32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ comment();
int /*<<< orphan*/ nl();
int /*<<< orphan*/ outstr(char *);
header() {
  comment();
  outstr("small-c compiler rev 1.1");
  nl();
}


x86 assembly (clang, -O0):
<header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <comment@plt>
lea    0xeba(%rip),%rdi
call   1040 <outstr@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header>:
push   %rax
xor    %eax,%eax
call   1050 <comment@plt>
lea    0xec1(%rip),%rdi
call   1040 <outstr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"small-c compiler rev 1.1\00"
define i32 @header() {
%1 = alloca i32
%2 = call i32 (...) @comment()
%3 = call i32 @outstr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @nl()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [25 x i8] c"small-c compiler rev 1.1\00"
define i32 @header() {
%1 = tail call i32 (...) @comment()
%2 = tail call i32 @outstr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @nl()
ret i32 undef
}
float *mat3_inverse(float *result, float *m) {
  result = m;
  return result;
}


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

x86 assembly (clang, -O2):
<mat3_inverse>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define float* @mat3_inverse(float* nocapture readnone %0, float* readnone returned %1) {
ret float* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_random_seed() {
  printf("NOT IMPLEMENTED:"
         "pa_random_seed"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"NOT IMPLEMENTED:pa_random_seed\0A\00"
define i32 @pa_random_seed() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_random_seed\00"
define i32 @pa_random_seed() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
long PTR_ERR(const void *ptr) { return (long)ptr; }


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

x86 assembly (clang, -O2):
<PTR_ERR>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @PTR_ERR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @PTR_ERR(i8* %0) {
%2 = ptrtoint i8* %0 to i64
ret i64 %2
}
unsigned int f34(unsigned int x, unsigned long int y) {
  return (x >> y) | (x << (8 * 4 - y));
}


x86 assembly (clang, -O0):
<f34>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f34>:
mov    %rsi,%rcx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f34(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = lshr i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub i64 32, %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %9, %12
%14 = or i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f34(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = lshr i32 %0, %3
%5 = sub i32 32, %3
%6 = shl i32 %0, %5
%7 = or i32 %6, %4
ret i32 %7
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ epoll_ctl(int, int, int, struct epoll_event *);
int /*<<< orphan*/ unix_error(char *);
void Epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) {
  int ret;
  if ((ret = epoll_ctl(epfd, op, fd, event) < 0)) {
    unix_error("epoll ctl");
  }
  return;
}


x86 assembly (clang, -O0):
<Epoll_ctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <epoll_ctl@plt>
cmp    $0x0,%rax
setl   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x1c(%rbp)
test   $0x1,%al
jne    1166 <Epoll_ctl+0x46>
jmp    1172 <Epoll_ctl+0x52>
lea    0xe93(%rip),%rdi
call   1040 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Epoll_ctl>:
push   %rax
call   1030 <epoll_ctl@plt>
test   %rax,%rax
js     112d <Epoll_ctl+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <unix_error@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
@.str = [10 x i8] c"epoll ctl\00"
define void @Epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.epoll_event*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.epoll_event* %3, %struct.epoll_event** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load %struct.epoll_event*, %struct.epoll_event** %8
%14 = call i64 @epoll_ctl(i32 %10, i32 %11, i32 %12, %struct.epoll_event* %13)
%15 = icmp slt i64 %14, 0
%16 = zext i1 %15 to i32
store i32 %16, i32* %9
br i1 %15, label %17, label %19
17: ; preds = %4
%18 = call i32 @unix_error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %4
ret void
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
@.str = [10 x i8] c"epoll ctl\00"
define void @Epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3) {
%5 = tail call i64 @epoll_ctl(i32 %0, i32 %1, i32 %2, %struct.epoll_event* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @unix_error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret void
}
int numdivs(int num) {
  int i;
  int divs;
  for (i = 1, divs = 0; i <= num; i++) {
    if (num % i == 0)
      divs++;
  }
  return divs;
}


x86 assembly (clang, -O0):
<numdivs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114d <numdivs+0x4d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    113a <numdivs+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113f <numdivs+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <numdivs+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numdivs>:
test   %edi,%edi
jle    1115 <numdivs+0x15>
mov    %edi,%r9d
cmp    $0x1,%edi
jne    1118 <numdivs+0x18>
mov    $0x1,%esi
xor    %ecx,%ecx
jmp    1153 <numdivs+0x53>
xor    %eax,%eax
ret
mov    %r9d,%r8d
and    $0xfffffffe,%r8d
mov    $0x1,%esi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
mov    %r9d,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
adc    $0x0,%ecx
lea    0x1(%rsi),%edi
mov    %r9d,%eax
cltd
idiv   %edi
cmp    $0x1,%edx
adc    $0x0,%ecx
add    $0x2,%esi
cmp    %r8d,%edi
jne    1130 <numdivs+0x30>
test   $0x1,%r9b
je     1165 <numdivs+0x65>
mov    %r9d,%eax
cltd
idiv   %esi
cmp    $0x1,%edx
adc    $0x0,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @numdivs(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %34, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %0, 1
br i1 %5, label %24, label %6
6: ; preds = %3
%7 = and i32 %0, -2
br label %8
8: ; preds = %8, %6
%9 = phi i32 [ 0, %6 ], [ %20, %8 ]
%10 = phi i32 [ 1, %6 ], [ %21, %8 ]
%11 = phi i32 [ 0, %6 ], [ %22, %8 ]
%12 = srem i32 %0, %10
%13 = icmp eq i32 %12, 0
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %9, %14
%16 = add nuw i32 %10, 1
%17 = srem i32 %0, %16
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = add nuw nsw i32 %15, %19
%21 = add nuw i32 %10, 2
%22 = add i32 %11, 2
%23 = icmp eq i32 %22, %7
br i1 %23, label %24, label %8
24: ; preds = %8, %3
%25 = phi i32 [ undef, %3 ], [ %20, %8 ]
%26 = phi i32 [ 0, %3 ], [ %20, %8 ]
%27 = phi i32 [ 1, %3 ], [ %21, %8 ]
%28 = icmp eq i32 %4, 0
br i1 %28, label %34, label %29
29: ; preds = %24
%30 = srem i32 %0, %27
%31 = icmp eq i32 %30, 0
%32 = zext i1 %31 to i32
%33 = add nuw nsw i32 %26, %32
br label %34
34: ; preds = %29, %24, %1
%35 = phi i32 [ 0, %1 ], [ %25, %24 ], [ %33, %29 ]
ret i32 %35
}
int in_array(int a, int *v, int len) {
  int i = 0;
  for (i = 0; i <= len; i++) {
    if (v[i] == a) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<in_array>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     115b <in_array+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1148 <in_array+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1162 <in_array+0x62>
jmp    114d <in_array+0x4d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <in_array+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_array>:
test   %edx,%edx
js     111e <in_array+0x1e>
add    $0x1,%edx
xor    %eax,%eax
nopl   0x0(%rax)
cmp    %edi,(%rsi,%rax,4)
je     1121 <in_array+0x21>
add    $0x1,%rax
cmp    %rax,%rdx
jne    1110 <in_array+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @in_array(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* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 0, i32* %8
store i32 0, i32* %8
br label %9
9: ; preds = %23, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i32*, i32** %6
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %5
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 1, i32* %4
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %9
26: ; preds = %9
store i32 0, i32* %4
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @in_array(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = add nuw i32 %2, 1
%7 = zext i32 %6 to i64
br label %11
8: ; preds = %11
%9 = add nuw nsw i64 %12, 1
%10 = icmp eq i64 %9, %7
br i1 %10, label %16, label %11
11: ; preds = %5, %8
%12 = phi i64 [ 0, %5 ], [ %9, %8 ]
%13 = getelementptr inbounds i32, i32* %1, i64 %12
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, %0
br i1 %15, label %16, label %8
16: ; preds = %11, %8, %3
%17 = phi i32 [ 0, %3 ], [ 0, %8 ], [ 1, %11 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/
UpnpResponse_RemoteIOClient_RemoteInput_InputMouseDown(void *);
int /*<<< orphan*/ printf(char *, int, int, int);
void UpnpRemoteIOClient_RemoteInput_InputMouseDown(void *upnptoken, int X,
                                                   int Y, int Button) {
  printf("Invoke: UpnpRemoteIOClient_RemoteInput_InputMouseDown(%d,%d,%d);\r\n",
         X, Y, Button);
  UpnpResponse_RemoteIOClient_RemoteInput_InputMouseDown(upnptoken);
}


x86 assembly (clang, -O0):
<UpnpRemoteIOClient_RemoteInput_InputMouseDown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UpnpResponse_RemoteIOClient_RemoteInput_InputMouseDown@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UpnpRemoteIOClient_RemoteInput_InputMouseDown>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UpnpResponse_RemoteIOClient_RemoteInput_InputMouseDown@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"Invoke: UpnpRemoteIOClient_RemoteInput_InputMouseDown(%d,%d,%d);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteInput_InputMouseDown(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%13 = load i8*, i8** %5
%14 = call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputMouseDown(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [67 x i8] c"Invoke: UpnpRemoteIOClient_RemoteInput_InputMouseDown(%d,%d,%d);\0D\0A\00"
define void @UpnpRemoteIOClient_RemoteInput_InputMouseDown(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @UpnpResponse_RemoteIOClient_RemoteInput_InputMouseDown(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ check_global();
void main() {
  int x;
  x = 3;
  assert(x == 3);
  check_global();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    $0x0,%al
call   1040 <check_global@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <check_global@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 (...) @check_global()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 (...) @check_global()
ret void
}
int Tcl_DbCkfree(ptr, file, line)
char *ptr;
char *file;
int line;
{
  TclpFree(ptr);
  return 0;
}


x86 assembly (clang, -O0):
<Tcl_DbCkfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <TclpFree@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Tcl_DbCkfree(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @TclpFree to i32 (i8*, ...)*)(i8* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @Tcl_DbCkfree(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @TclpFree to i32 (i8*, ...)*)(i8* %0)
ret i32 0
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void write_file(int sockfd, const char *s) {
  int size = strlen(s);
  write(sockfd, s, size);
  return;
}


x86 assembly (clang, -O0):
<write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_file>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @write_file(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ RAND_MAX;

/* Variables and functions */
scalar_t__ rand();
int randMap(int min, int max) {
  double r;
  double x;
  r = ((double)rand() / ((double)(RAND_MAX) + (double)(1)));
  x = (r * max);
  return (int)x + min;
}


x86 assembly (clang, -O0):
<randMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randMap>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randMap(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = call i64 (...) @rand()
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+00
store double %9, double* %5
%10 = load double, double* %5
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to double
%13 = fmul double %10, %12
store double %13, double* %6
%14 = load double, double* %6
%15 = fptosi double %14 to i32
%16 = load i32, i32* %3
%17 = add nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @randMap(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = sitofp i32 %1 to double
%6 = fmul double %5, %4
%7 = fptosi double %6 to i32
%8 = add nsw i32 %7, %0
ret i32 %8
}
void XBlackPixel() {}


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

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

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

LLVM IR (-O2):
define void @XBlackPixel() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "Usage: ospfsformat [-c] [-l SRC:DST] fs.img NBLOCKS NINODES files...\n  "
      "     ospfsformat [-c] [-l SRC:DST] fs.img NBLOCKS NINODES -r DIR\n  "
      "\"-c\" means treat files with identical contents as hard links.\n  \"-l "
      "SRC:DST\" means add a symbolic link from SRC to DST.\n");
  abort();
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [259 x i8] c"Usage: ospfsformat [-c] [-l SRC:DST] fs.img NBLOCKS NINODES files...\0A ospfsformat [-c] [-l SRC:DST] fs.img NBLOCKS NINODES -r DIR\0A \22-c\22 means treat files with identical contents as hard links.\0A \22-l SRC:DST\22 means add a symbolic link from SRC to DST.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [259 x i8] c"Usage: ospfsformat [-c] [-l SRC:DST] fs.img NBLOCKS NINODES files...\0A ospfsformat [-c] [-l SRC:DST] fs.img NBLOCKS NINODES -r DIR\0A \22-c\22 means treat files with identical contents as hard links.\0A \22-l SRC:DST\22 means add a symbolic link from SRC to DST.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
int getNofMC_quadratic() { return 1; }


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

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

LLVM IR (-O0):
define i32 @getNofMC_quadratic() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getNofMC_quadratic() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int number = 2;
  int sum = 0;
  while (number <= 30) {
    sum = sum + number;
    number = number + 2;
  }
  printf("the sum of even numbers from [2 to 30] is: %d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"the sum of even numbers from [2 to 30] is: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 30
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 2
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"the sum of even numbers from [2 to 30] is: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 240)
ret i32 0
}
/* Variables and functions */
char *strchr(char const *, char);
char *strchrnul(const char *s, int c) {
  char *ptr = strchr(s, c);
  if (!ptr) {
    ptr = strchr(s, '\0');
  }
  return ptr;
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
movsbl %al,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114c <strchrnul+0x3c>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
push   %rbx
mov    %rdi,%rbx
movsbl %sil,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1134 <strchrnul+0x14>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%8 = getelementptr i8, i8* %0, i64 %7
br label %9
9: ; preds = %6, %2
%10 = phi i8* [ %4, %2 ], [ %8, %6 ]
ret i8* %10
}
int width(int v) { return v; }


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

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

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

LLVM IR (-O2):
define i32 @width(i32 returned %0) {
ret i32 %0
}