xunge/DecIR huggingface dataset:
void limitGameMemory(void *limit) { *((void **)0x80000034) = limit; }


x86 assembly (clang, -O0):
<limitGameMemory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x80000034,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<limitGameMemory>:
mov    $0x80000034,%eax
mov    %rdi,(%rax)
ret

LLVM IR (-O0):
define void @limitGameMemory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8* %3, i8** inttoptr (i64 2147483700 to i8**)
ret void
}

LLVM IR (-O2):
define void @limitGameMemory(i8* %0) {
store i8* %0, i8** inttoptr (i64 2147483700 to i8**)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char const *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write_err(char *);
void usage(const char *msg) {
  if (msg)
    error(msg);
  write_err("Usage: sysloguread [-g GID] [-u UID] [-U] IP PORT ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1150 <usage+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <error@plt>
lea    0xea9(%rip),%rdi
call   1050 <write_err@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
test   %rdi,%rdi
je     113b <usage+0xb>
call   1030 <error@plt>
lea    0xebe(%rip),%rdi
call   1050 <write_err@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Usage: sysloguread [-g GID] [-u UID] [-U] IP PORT ...\0A\00"
define void @usage(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @error(i8* %6)
br label %8
8: ; preds = %5, %1
%9 = call i32 @write_err(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [55 x i8] c"Usage: sysloguread [-g GID] [-u UID] [-U] IP PORT ...\0A\00"
define void @usage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @error(i8* %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @write_err(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version(void) {
  printf("Open Cobol ESQL (Ocesql)\n");
  printf("Version 1.1.0\n");
  printf("\n");
  printf("February 27, 2015\n");
  printf("\n");
  printf("Tokyo System House Co., Ltd. <opencobol@tsh-world.co.jp>\n");
}


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

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xee5(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xedd(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed9(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Open Cobol ESQL (Ocesql)\0A\00"
@.str.1 = [15 x i8] c"Version 1.1.0\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [19 x i8] c"February 27, 2015\0A\00"
@.str.4 = [58 x i8] c"Tokyo System House Co., Ltd. <opencobol@tsh-world.co.jp>\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Open Cobol ESQL (Ocesql)\00"
@str.5 = [14 x i8] c"Version 1.1.0\00"
@str.6 = [18 x i8] c"February 27, 2015\00"
@str.7 = [57 x i8] c"Tokyo System House Co., Ltd. <opencobol@tsh-world.co.jp>\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.7, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Visual;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_Visual(void) {
  Visual *_p = (Visual *)malloc(sizeof(Visual));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_Visual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_Visual+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_Visual>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_Visual+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_Visual() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_Visual() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
void SPI_RP_TX_ISR(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   void *(*)(void *), int /*<<< orphan*/ *);
int pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void run_in_thread(void *(*func)(void *thread_arg)) {
  pthread_t tid;
  int rc;
  rc = pthread_create(&tid, NULL, func, NULL);
  assert(rc == 0);
  rc = pthread_join(tid, NULL);
  assert(rc == 0);
}


x86 assembly (clang, -O0):
<run_in_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
call   1040 <pthread_create@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_join@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_in_thread>:
push   %rax
mov    %rdi,%rdx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <pthread_create@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
mov    0x4(%rsp),%edi
xor    %esi,%esi
call   1050 <pthread_join@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @run_in_thread(i8* (i8*)* %0) {
%2 = alloca i8* (i8*)*
%3 = alloca i32
%4 = alloca i32
store i8* (i8*)* %0, i8* (i8*)** %2
%5 = load i8* (i8*)*, i8* (i8*)** %2
%6 = call i32 @pthread_create(i32* %3, i32* null, i8* (i8*)* %5, i32* null)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %3
%12 = call i32 @pthread_join(i32 %11, i32* null)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret void
}

LLVM IR (-O2):
define void @run_in_thread(i8* (i8*)* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @pthread_create(i32* %2, i32* null, i8* (i8*)* %0, i32* null)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @pthread_join(i32 %8, i32* null)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}
/* Variables and functions */
unsigned int min(unsigned int, unsigned int);
unsigned int vminu2(unsigned int a, unsigned int b) {
  unsigned int r, s;
  unsigned int t, u;
  r = a & 0x0000ffff;
  s = b & 0x0000ffff;
  t = min(r, s);
  r = a & 0xffff0000;
  s = b & 0xffff0000;
  u = min(r, s);
  r = t | u;
  return r;
}


x86 assembly (clang, -O0):
<vminu2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <min@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <min@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vminu2>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
movzwl %bp,%edi
movzwl %bx,%esi
call   1030 <min@plt>
mov    %eax,%r14d
and    $0xffff0000,%ebp
and    $0xffff0000,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <min@plt>
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vminu2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = and i32 %9, 65535
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = and i32 %11, 65535
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @min(i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %3
%17 = and i32 %16, -65536
store i32 %17, i32* %5
%18 = load i32, i32* %4
%19 = and i32 %18, -65536
store i32 %19, i32* %6
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = call i32 @min(i32 %20, i32 %21)
store i32 %22, i32* %8
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = or i32 %23, %24
store i32 %25, i32* %5
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @vminu2(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = and i32 %1, 65535
%5 = tail call i32 @min(i32 %3, i32 %4)
%6 = and i32 %0, -65536
%7 = and i32 %1, -65536
%8 = tail call i32 @min(i32 %6, i32 %7)
%9 = or i32 %8, %5
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void _dl_exit(int status) { exit(status); }


x86 assembly (clang, -O0):
<_dl_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<_dl_exit>:
push   %rax
call   1030 <exit@plt>

LLVM IR (-O0):
define void @_dl_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_dl_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
void atomic_thread_fence_int(int memorder) { __atomic_thread_fence(memorder); }


x86 assembly (clang, -O0):
<atomic_thread_fence_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     1142 <atomic_thread_fence_int+0x42>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1142 <atomic_thread_fence_int+0x42>
jmp    1142 <atomic_thread_fence_int+0x42>
jmp    1142 <atomic_thread_fence_int+0x42>
mfence
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_thread_fence_int>:
add    $0xffffffff,%edi
cmp    $0x4,%edi
ja     111c <atomic_thread_fence_int+0x1c>
lea    0xef1(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
ret
mfence
ret

LLVM IR (-O0):
define void @atomic_thread_fence_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %8 [
i32 1, label %4
i32 2, label %4
i32 3, label %5
i32 4, label %6
i32 5, label %7
]
4: ; preds = %1, %1
fence acquire
br label %8
5: ; preds = %1
fence release
br label %8
6: ; preds = %1
fence acq_rel
br label %8
7: ; preds = %1
fence seq_cst
br label %8
8: ; preds = %7, %6, %5, %4, %1
ret void
}

LLVM IR (-O2):
define void @atomic_thread_fence_int(i32 %0) {
switch i32 %0, label %6 [
i32 1, label %2
i32 2, label %2
i32 3, label %3
i32 4, label %4
i32 5, label %5
]
2: ; preds = %1, %1
fence acquire
br label %6
3: ; preds = %1
fence release
br label %6
4: ; preds = %1
fence acq_rel
br label %6
5: ; preds = %1
fence seq_cst
br label %6
6: ; preds = %5, %4, %3, %2, %1
ret void
}
/* Variables and functions */
double atan(double);
double m_atan(double x) { return atan(x); }


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

x86 assembly (clang, -O2):
<m_atan>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define double @m_atan(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
void test_five(int x, int y, int z) {
#pragma omp parallel for simd collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      for (int i = 0; i < z; i++)
        ;
}


x86 assembly (clang, -O0):
<test_five>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117f <test_five+0x7f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <test_five+0x6c>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <test_five+0x59>
jmp    114b <test_five+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113a <test_five+0x3a>
jmp    115e <test_five+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <test_five+0x27>
jmp    1171 <test_five+0x71>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <test_five+0x14>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_five(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, unsigned int *);
int otoi(unsigned char *str) {
  unsigned int result;
  (void)sscanf((char *)str, "%o", &result);
  return (int)result;
}


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

x86 assembly (clang, -O2):
<otoi>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%o\00"
define i32 @otoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%o\00"
define i32 @otoi(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
int host_attr_wrap() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @host_attr_wrap() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ evutil_socket_t;

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int /*<<< orphan*/ setsockopt(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int *, int);
void set_tcp_no_delay(evutil_socket_t fd) {
  int one = 1;
  setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof one);
}


x86 assembly (clang, -O0):
<set_tcp_no_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_tcp_no_delay>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rax
ret

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define void @set_tcp_no_delay(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_NODELAY
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define void @set_tcp_no_delay(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_asm();
int /*<<< orphan*/ red_off();
int /*<<< orphan*/ red_on();
void blink_red2(void) {
  for (;;) {
    red_on();
    delay_asm();
    red_off();
    delay_asm();
  }
}


x86 assembly (clang, -O0):
<blink_red2>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <blink_red2+0x9>
mov    $0x0,%al
call   1050 <red_on@plt>
mov    $0x0,%al
call   1040 <delay_asm@plt>
mov    $0x0,%al
call   1030 <red_off@plt>
mov    $0x0,%al
call   1040 <delay_asm@plt>
jmp    1139 <blink_red2+0x9>

x86 assembly (clang, -O2):
<blink_red2>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <red_on@plt>
xor    %eax,%eax
call   1040 <delay_asm@plt>
xor    %eax,%eax
call   1030 <red_off@plt>
xor    %eax,%eax
call   1040 <delay_asm@plt>
jmp    1140 <blink_red2+0x10>

LLVM IR (-O0):
define void @blink_red2() {
br label %1
1: ; preds = %1, %0
%2 = call i32 (...) @red_on()
%3 = call i32 (...) @delay_asm()
%4 = call i32 (...) @red_off()
%5 = call i32 (...) @delay_asm()
br label %1
}

LLVM IR (-O2):
define void @blink_red2() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @red_on()
%3 = tail call i32 (...) @delay_asm()
%4 = tail call i32 (...) @red_off()
%5 = tail call i32 (...) @delay_asm()
br label %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dbg_set_chain(int /*<<< orphan*/);
int /*<<< orphan*/ get_block_data_from_vpi(int, int *);
int /*<<< orphan*/ get_response_from_vpi();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ send_command_to_vpi(int);
int /*<<< orphan*/ send_data_to_vpi(int);
int dbg_wb_read_block32(uint32_t adr, uint32_t *data, int len) {
  if (0)
    printf("xbrsp-rtl_sim: block read len: %d from addr: 0x%.8x\n", len, adr);
  dbg_set_chain(0);
  send_command_to_vpi(0xa);
  send_data_to_vpi(adr);
  send_data_to_vpi(len);
  get_block_data_from_vpi(len, data);
  get_response_from_vpi();
  return 0;
}


x86 assembly (clang, -O0):
<dbg_wb_read_block32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %edi,%edi
call   1040 <dbg_set_chain@plt>
mov    $0xa,%edi
call   1030 <send_command_to_vpi@plt>
mov    -0x4(%rbp),%edi
call   1060 <send_data_to_vpi@plt>
mov    -0x14(%rbp),%edi
call   1060 <send_data_to_vpi@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <get_block_data_from_vpi@plt>
mov    $0x0,%al
call   1050 <get_response_from_vpi@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_wb_read_block32>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edi,%edi
call   1040 <dbg_set_chain@plt>
mov    $0xa,%edi
call   1030 <send_command_to_vpi@plt>
mov    %ebp,%edi
call   1060 <send_data_to_vpi@plt>
mov    %ebx,%edi
call   1060 <send_data_to_vpi@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1070 <get_block_data_from_vpi@plt>
xor    %eax,%eax
call   1050 <get_response_from_vpi@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dbg_wb_read_block32(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = call i32 @dbg_set_chain(i32 0)
%8 = call i32 @send_command_to_vpi(i32 10)
%9 = load i32, i32* %4
%10 = call i32 @send_data_to_vpi(i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @send_data_to_vpi(i32 %11)
%13 = load i32, i32* %6
%14 = load i32*, i32** %5
%15 = call i32 @get_block_data_from_vpi(i32 %13, i32* %14)
%16 = call i32 (...) @get_response_from_vpi()
ret i32 0
}

LLVM IR (-O2):
define i32 @dbg_wb_read_block32(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @dbg_set_chain(i32 0)
%5 = tail call i32 @send_command_to_vpi(i32 10)
%6 = tail call i32 @send_data_to_vpi(i32 %0)
%7 = tail call i32 @send_data_to_vpi(i32 %2)
%8 = tail call i32 @get_block_data_from_vpi(i32 %2, i32* %1)
%9 = tail call i32 (...) @get_response_from_vpi()
ret i32 0
}
/* Variables and functions */
int pow(int, int);
int quadradoPontos(int p1, int p2) { return pow(p2 - p1, 2); }


x86 assembly (clang, -O0):
<quadradoPontos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quadradoPontos>:
sub    %edi,%esi
mov    %esi,%edi
mov    $0x2,%esi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define i32 @quadradoPontos(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
%8 = call i32 @pow(i32 %7, i32 2)
ret i32 %8
}

LLVM IR (-O2):
define i32 @quadradoPontos(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = tail call i32 @pow(i32 %3, i32 2)
ret i32 %4
}
/* Variables and functions */
int rand();
int generateRandomNumber() {
  int random_number;
  random_number = rand() % 4 + 1;
  if (random_number % 2 == 1)
    random_number++;
  return random_number;
}


x86 assembly (clang, -O0):
<generateRandomNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    114a <generateRandomNumber+0x3a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateRandomNumber>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3(%rax),%esi
test   %eax,%eax
cmovns %eax,%esi
and    $0xfffffffc,%esi
mov    %eax,%ecx
sub    %esi,%ecx
add    $0x1,%ecx
mov    %ecx,%edx
shr    $0x7,%dl
add    %cl,%dl
and    $0xfe,%dl
mov    %ecx,%edi
sub    %dl,%dil
neg    %esi
cmp    $0x1,%dil
lea    0x2(%rax,%rsi,1),%eax
cmove  %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @generateRandomNumber() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 4
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @generateRandomNumber() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 4
%3 = add nsw i32 %2, 1
%4 = trunc i32 %3 to i8
%5 = srem i8 %4, 2
%6 = icmp eq i8 %5, 1
%7 = add nsw i32 %2, 2
%8 = select i1 %6, i32 %7, i32 %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, int, char *, char *);
int run_string(char *);
void TEST_run_string(void) {
  do {
    if ((1) != (run_string("main() { return 1; }")))
      error("Line %d: must be the same: '%s' and '%s'", 6, "1",
            "run_string(\"main() { return 1; }\")");
  } while (0);
}


x86 assembly (clang, -O0):
<TEST_run_string>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <TEST_run_string+0x9>
lea    0xed0(%rip),%rdi
call   1030 <run_string@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
je     1163 <TEST_run_string+0x43>
lea    0xeca(%rip),%rdi
mov    $0x6,%esi
lea    0xee7(%rip),%rdx
lea    0xee2(%rip),%rcx
call   1040 <error@plt>
jmp    1168 <TEST_run_string+0x48>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_run_string>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <run_string@plt>
cmp    $0x1,%eax
jne    1134 <TEST_run_string+0x14>
pop    %rax
ret
lea    0xeda(%rip),%rdi
lea    0xefc(%rip),%rdx
lea    0xef7(%rip),%rcx
mov    $0x6,%esi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"main() { return 1; }\00"
@.str.1 = [41 x i8] c"Line %d: must be the same: '%s' and '%s'\00"
@.str.2 = [2 x i8] c"1\00"
@.str.3 = [35 x i8] c"run_string(\22main() { return 1; }\22)\00"
define void @TEST_run_string() {
br label %1
1: ; preds = %0
%2 = call i32 @run_string(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32 1, %2
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
br label %7
7: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"main() { return 1; }\00"
@.str.1 = [41 x i8] c"Line %d: must be the same: '%s' and '%s'\00"
@.str.2 = [2 x i8] c"1\00"
@.str.3 = [35 x i8] c"run_string(\22main() { return 1; }\22)\00"
define void @TEST_run_string() {
%1 = tail call i32 @run_string(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_print(char *);
int recv(int, char *, int, int /*<<< orphan*/);
int common_read(int fd, int buflen, char *buffer) {
  int read_size = recv(fd, buffer, buflen, 0);
  if (read_size < 0)
    error_print("read error\n");
  return read_size;
}


x86 assembly (clang, -O0):
<common_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115c <common_read+0x3c>
lea    0xea9(%rip),%rdi
call   1040 <error_print@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<common_read>:
push   %rbx
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1141 <common_read+0x21>
lea    0xec4(%rip),%rdi
call   1040 <error_print@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"read error\0A\00"
define i32 @common_read(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %6
%10 = load i32, i32* %5
%11 = call i32 @recv(i32 %8, i8* %9, i32 %10, i32 0)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @error_print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [12 x i8] c"read error\0A\00"
define i32 @common_read(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @recv(i32 %0, i8* %2, i32 %1, i32 0)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error_print(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
void __attribute__((no)) * test1(void) {
  void *temp;
  temp = __builtin_return_address(0);
  return temp;
}


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

x86 assembly (clang, -O2):
<test1>:
mov    (%rsp),%rax
ret

LLVM IR (-O0):
define i8* @test1() {
%1 = alloca i8*
%2 = call i8* @llvm.returnaddress(i32 0)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @test1() {
%1 = tail call i8* @llvm.returnaddress(i32 0)
ret i8* %1
}
/* Variables and functions */
int natural35(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Sum of even valued terms of Fibonacci Seq <4 million: %d",
         natural35(1000));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e8,%edi
call   1040 <natural35@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [57 x i8] c"Sum of even valued terms of Fibonacci Seq <4 million: %d\00"
define i32 @main() {
%1 = call i32 @natural35(i32 1000)
%2 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c"Sum of even valued terms of Fibonacci Seq <4 million: %d\00"
define i32 @main() {
%1 = tail call i32 @natural35(i32 1000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
float sqrtf(float const);
float vectorLength(const float v[3]) {
  return sqrtf(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


x86 assembly (clang, -O0):
<vectorLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectorLength>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113f <vectorLength+0x2f>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @vectorLength(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call float @sqrtf(float %9)
ret float %10
}
/* Variables and functions */
int ENODEV;
int chromeos_set_need_recovery(void) { return -ENODEV; }


x86 assembly (clang, -O0):
<chromeos_set_need_recovery>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2ed3(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chromeos_set_need_recovery>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @chromeos_set_need_recovery() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @chromeos_set_need_recovery() {
%1 = load i32, i32* @ENODEV
%2 = sub nsw i32 0, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(long);
int /*<<< orphan*/ perror(char *);
void *my_malloc(long int size) {
  void *ptr;
  ptr = (void *)malloc(size);
  if (!ptr) {
    perror("Out of memory!\n");
    exit(1);
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <my_malloc+0x3a>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %12, label %9
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @my_malloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to i8*
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xb2() {
  Assert_real((isalpha(178) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              895, ("isalpha should be 0 for 0xb2"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xb2>:
push   %rax
mov    $0xb2,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x37f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xb2\00"
define void @t_isalpha_0xb2() {
%1 = tail call i64 @isalpha(i32 178)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 895, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int nand_wait_dma_mode(void) { return 0 ? 1 : 0; }


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

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

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

LLVM IR (-O2):
define i32 @nand_wait_dma_mode() {
ret i32 0
}
/* Variables and functions */
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ create_path(char *);
int /*<<< orphan*/ free(char *);
int real_creat(char *, int);
int /*<<< orphan*/ strcat(char *, char *);
char *strdup(char *);
scalar_t__ strstr(char *, char *);
void create_whiteout(char *wpath) {
  return;
  char *dup_wpath;
  int ret = 0;
  if (strstr(wpath, ".whiteout"))
    return;
  strcat(wpath, ".whiteout");
  dup_wpath = strdup(wpath);
  if (!dup_wpath)
    return;
  create_path(dup_wpath);
  ret = real_creat(dup_wpath, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
  if (ret >= 0)
    close(ret);
  free(dup_wpath);
  return;
}


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

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

LLVM IR (-O0):
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define void @create_whiteout(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define void @create_whiteout(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, oldx;
  x = __VERIFIER_nondet_int();
  while (x > 0 && 2 * x <= oldx) {
    oldx = x;
    x = __VERIFIER_nondet_int();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jle    1147 <main+0x37>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1157 <main+0x47>
jmp    116c <main+0x5c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jle    1135 <main+0x25>
mov    %eax,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
jle    1135 <main+0x25>
mov    %eax,%ecx
add    %eax,%ecx
cmp    %ebx,%ecx
mov    %eax,%ebx
jle    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %2
%10 = mul nsw i32 2, %9
%11 = load i32, i32* %3
%12 = icmp sle i32 %10, %11
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32, i32* %2
store i32 %16, i32* %3
%17 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %17, i32* %2
br label %5
18: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %5, %3 ], [ %1, %0 ]
%5 = tail call i32 (...) @__VERIFIER_nondet_int()
%6 = icmp sgt i32 %5, 0
%7 = shl nsw i32 %5, 1
%8 = icmp sle i32 %7, %4
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %3, label %10
10: ; preds = %3, %0
ret i32 0
}
void BN_num_bits_word(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_num_bits_word() {
ret void
}
void pci_restore_msix_state(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_restore_msix_state(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void trifree(void *memptr) {
  if (memptr) {
    free(memptr);
  }
}


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

x86 assembly (clang, -O2):
<trifree>:
test   %rdi,%rdi
je     111a <trifree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @trifree(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @trifree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void multidim_arr5_Bad() {
  int a[1][10];
  a[0][0] = 0;
  a[0][10] = 0;
}


x86 assembly (clang, -O0):
<multidim_arr5_Bad>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @multidim_arr5_Bad() {
ret void
}
/* Type definitions */
struct in_addr {
  int s_addr;
};

/* Variables and functions */
int inet_addr(char const *);
int read_ip_addr(struct in_addr *in_addr, const char *str) {
  in_addr->s_addr = inet_addr(str);
  if (in_addr->s_addr == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<read_ip_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    114a <read_ip_addr+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <read_ip_addr+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ip_addr>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <inet_addr@plt>
mov    %eax,(%rbx)
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @read_ip_addr(%struct.in_addr* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.in_addr*
%5 = alloca i8*
store %struct.in_addr* %0, %struct.in_addr** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i32 @inet_addr(i8* %6)
%8 = load %struct.in_addr*, %struct.in_addr** %4
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
store i32 %7, i32* %9
%10 = load %struct.in_addr*, %struct.in_addr** %4
%11 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @read_ip_addr(%struct.in_addr* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 @inet_addr(i8* %1)
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %0, i64 0, i32 0
store i32 %3, i32* %4
%5 = icmp eq i32 %3, -1
%6 = sext i1 %5 to i32
ret i32 %6
}