xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ chatData;

/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void *recv_message(void *arg) {
  char chatData[1024];
  int n;
  int c_socket = (int)arg;
  while (1) {
    memset(chatData, 0, sizeof(chatData));
    if ((n = read(c_socket, chatData, sizeof(chatData))) > 0) {
      write(1, chatData, n);
    }
  }
}


x86 assembly (clang, -O0):
<recv_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
mov    -0x418(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1050 <read@plt>
mov    %eax,-0x414(%rbp)
cmp    $0x0,%eax
jle    1199 <recv_message+0x69>
lea    -0x410(%rbp),%rsi
mov    -0x414(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    1149 <recv_message+0x19>

x86 assembly (clang, -O2):
<recv_message>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1050 <read@plt>
test   %eax,%eax
jle    1140 <recv_message+0x10>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
jmp    1140 <recv_message+0x10>

LLVM IR (-O0):
define i8* @recv_message(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = ptrtoint i8* %6 to i32
store i32 %7, i32* %5
br label %8
8: ; preds = %1, %19
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i32 0, i32 1024)
%11 = load i32, i32* %5
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%13 = call i32 @read(i32 %11, i8* %12, i32 1024)
store i32 %13, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %8
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%17 = load i32, i32* %4
%18 = call i32 @write(i32 1, i8* %16, i32 %17)
br label %19
19: ; preds = %15, %8
br label %8
}

LLVM IR (-O2):
define noalias i8* @recv_message(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %12, %1
%7 = call i32 @memset(i8* %3, i32 0, i32 1024)
%8 = call i32 @read(i32 %5, i8* %3, i32 1024)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 @write(i32 1, i8* %3, i32 %8)
br label %12
12: ; preds = %10, %6
br label %6
}
void runtime() {}


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

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

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

LLVM IR (-O2):
define void @runtime() {
ret void
}
void __attribute__((stdcall)) test3(int a, ...) {}


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

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

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

LLVM IR (-O2):
define void @test3(i32 %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_indc_function_list();
void indc_init() { register_indc_function_list(); }


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

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

LLVM IR (-O0):
define void @indc_init() {
%1 = call i32 (...) @register_indc_function_list()
ret void
}

LLVM IR (-O2):
define void @indc_init() {
%1 = tail call i32 (...) @register_indc_function_list()
ret void
}
long __negsi2(long x) { return ~x + 1; }


x86 assembly (clang, -O0):
<__negsi2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
add    $0x1,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @__negsi2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = add nsw i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @__negsi2(i64 %0) {
%2 = sub i64 0, %0
ret i64 %2
}
/* Variables and functions */
size_t malloc_usable_size(const void *allocation) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @malloc_usable_size(i8* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
double map_val(double, double, double);
double map_range(double val, double minv, double maxv, double min, double max) {
  return map_val((val - minv) / (maxv - minv), min, max);
}


x86 assembly (clang, -O0):
<map_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <map_val@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_range>:
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
movaps %xmm3,%xmm1
movaps %xmm4,%xmm2
jmp    1030 <map_val@plt>

LLVM IR (-O0):
define double @map_range(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %8
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = fdiv double %13, %16
%18 = load double, double* %9
%19 = load double, double* %10
%20 = call double @map_val(double %17, double %18, double %19)
ret double %20
}

LLVM IR (-O2):
define double @map_range(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = fsub double %2, %1
%8 = fdiv double %6, %7
%9 = tail call double @map_val(double %8, double %3, double %4)
ret double %9
}
/* Variables and functions */
int PTHREAD_BARRIER_SERIAL_THREAD;
void test_PTHREAD_BARRIER_SERIAL_THREAD(void) {
  int dummy = PTHREAD_BARRIER_SERIAL_THREAD;
  (void)dummy;
}


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

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

LLVM IR (-O0):
@PTHREAD_BARRIER_SERIAL_THREAD = global i32 0
define void @test_PTHREAD_BARRIER_SERIAL_THREAD() {
%1 = alloca i32
%2 = load i32, i32* @PTHREAD_BARRIER_SERIAL_THREAD
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret void
}

LLVM IR (-O2):
@PTHREAD_BARRIER_SERIAL_THREAD = global i32 0
define void @test_PTHREAD_BARRIER_SERIAL_THREAD() {
ret void
}
void test_init() {}


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

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

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

LLVM IR (-O2):
define void @test_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ unsafe();
void handler(int s) {
  unsafe();
  alarm(1);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <unsafe@plt>
mov    $0x1,%edi
call   1040 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @unsafe()
%4 = call i32 @alarm(i32 1)
ret void
}

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i32 (...) @unsafe()
%3 = tail call i32 @alarm(i32 1)
ret void
}
void iptreemap_create_final(void *data __attribute__((unused)),
                            unsigned int flags __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @iptreemap_create_final(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rate(long long, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, long long *);
void sync_query() {
  long long t;
  scanf("%lld", &t);
  printf("%d\n", rate(t, 0));
}


x86 assembly (clang, -O0):
<sync_query>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <rate@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_query>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
xor    %esi,%esi
call   1030 <rate@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @sync_query() {
%1 = alloca i64
%2 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%3 = load i64, i64* %1
%4 = call i32 @rate(i64 %3, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @sync_query() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @rate(i64 %4, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
double mind(double a, double b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<mind>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <mind+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <mind+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mind>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @mind(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
typedef double *__m128d;

/* Variables and functions */
void __attribute__((__always___, __nodebug__))
_mm_storer_pd(double *dp, __m128d a) {
  dp[0] = a[1];
  dp[1] = a[0];
}


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

x86 assembly (clang, -O2):
<_mm_storer_pd>:
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  (%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @_mm_storer_pd(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 1
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
ret void
}

LLVM IR (-O2):
define void @_mm_storer_pd(double* nocapture writeonly %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = load double, double* %3
store double %4, double* %0
%5 = load double, double* %1
%6 = getelementptr inbounds double, double* %0, i64 1
store double %5, double* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t *ethernet_srcaddr(uint8_t *p_ethernet) { return p_ethernet + 6; }


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

x86 assembly (clang, -O2):
<ethernet_srcaddr>:
lea    0x18(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @ethernet_srcaddr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
ret i32* %4
}

LLVM IR (-O2):
define i32* @ethernet_srcaddr(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ xpose_inplace_nonsquare(int const, int const, double *);
int /*<<< orphan*/ xpose_inplace_square(int const, double *);
void pcapack_xpose(const int m, const int n, double *x) {
  if (m == n)
    xpose_inplace_square(n, x);
  else
    xpose_inplace_nonsquare(m, n, x);
  return;
}


x86 assembly (clang, -O0):
<pcapack_xpose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    114f <pcapack_xpose+0x2f>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <xpose_inplace_square@plt>
jmp    115e <pcapack_xpose+0x3e>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <xpose_inplace_nonsquare@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcapack_xpose>:
cmp    %esi,%edi
jne    112c <pcapack_xpose+0xc>
mov    %rdx,%rsi
jmp    1030 <xpose_inplace_square@plt>
jmp    1040 <xpose_inplace_nonsquare@plt>

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

LLVM IR (-O2):
define void @pcapack_xpose(i32 %0, i32 %1, double* %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @xpose_inplace_square(i32 %0, double* %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @xpose_inplace_nonsquare(i32 %0, i32 %1, double* %2)
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xb7() {
  Assert_real((iscntrl(183) == 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_iscntrl.c",
              920, ("iscntrl should be 0 for 0xb7"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xb7>:
push   %rax
mov    $0xb7,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x398,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xb7\00"
define void @t_iscntrl_0xb7() {
%1 = call i64 @iscntrl(i32 183)
%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 920, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xb7\00"
define void @t_iscntrl_0xb7() {
%1 = tail call i64 @iscntrl(i32 183)
%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 920, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct firmware {
  int dummy;
};
struct echoaudio {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ release_firmware(struct firmware const *);
void free_firmware(const struct firmware *fw_entry, struct echoaudio *chip) {
  release_firmware(fw_entry);
}


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

x86 assembly (clang, -O2):
<free_firmware>:
jmp    1030 <release_firmware@plt>

LLVM IR (-O0):
%struct.firmware = type { i32 }
%struct.echoaudio = type { i32 }
define void @free_firmware(%struct.firmware* %0, %struct.echoaudio* %1) {
%3 = alloca %struct.firmware*
%4 = alloca %struct.echoaudio*
store %struct.firmware* %0, %struct.firmware** %3
store %struct.echoaudio* %1, %struct.echoaudio** %4
%5 = load %struct.firmware*, %struct.firmware** %3
%6 = call i32 @release_firmware(%struct.firmware* %5)
ret void
}

LLVM IR (-O2):
%struct.firmware = type { i32 }
%struct.echoaudio = type { i32 }
define void @free_firmware(%struct.firmware* %0, %struct.echoaudio* nocapture readnone %1) {
%3 = tail call i32 @release_firmware(%struct.firmware* %0)
ret void
}
int ustrlen(const char *pcStr) {
  int iLen;
  ;
  iLen = 0;
  while (pcStr[iLen]) {
    iLen++;
  }
  return (iLen);
}


x86 assembly (clang, -O0):
<ustrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <ustrlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ustrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ustrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ustrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int creat(const char *pathname, mode_t mode) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "creat");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
lea    0xee6(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [6 x i8] c"creat\00"
define i32 @creat(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @assert(i32 0)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [6 x i8] c"creat\00"
define i32 @creat(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @assert(i32 0)
ret i32 undef
}
unsigned long long flip_pass(const unsigned long long P,
                             const unsigned long long O) {
  (void)P;
  (void)O;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @flip_pass(i64 %0, i64 %1) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *);
int main() {
  double a, b;
  scanf("%lf %lf", &a, &b);
  printf("MEDIA = %.5f\n", (a * 3.5 + b * 7.5) / 11);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xec0(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xeab(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe93(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeed(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xeb2(%rip),%xmm1
mulsd  0xeb2(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xeae(%rip),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [14 x i8] c"MEDIA = %.5f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %2, double* %3)
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fmul double %6, 7.500000e+00
%8 = call double @llvm.fmuladd.f64(double %5, double 3.500000e+00, double %7)
%9 = fdiv double %8, 1.100000e+01
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%lf %lf\00"
@.str.1 = [14 x i8] c"MEDIA = %.5f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), double* %1, double* %2)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fmul double %7, 7.500000e+00
%9 = call double @llvm.fmuladd.f64(double %6, double 3.500000e+00, double %8)
%10 = fdiv double %9, 1.100000e+01
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %10)
ret i32 0
}
/* Variables and functions */
long GetMouseWinY289();
long getmousewiny() { return GetMouseWinY289(); }


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

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

LLVM IR (-O0):
define i64 @getmousewiny() {
%1 = call i64 (...) @GetMouseWinY289()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getmousewiny() {
%1 = tail call i64 (...) @GetMouseWinY289()
ret i64 %1
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ _list_del(struct list_head *);
void list_del_init(struct list_head *entry) {
  _list_del(entry);
  INIT_LIST_HEAD(entry);
}


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

x86 assembly (clang, -O2):
<list_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_list_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call i32 @_list_del(%struct.list_head* %3)
%5 = load %struct.list_head*, %struct.list_head** %2
%6 = call i32 @INIT_LIST_HEAD(%struct.list_head* %5)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = tail call i32 @_list_del(%struct.list_head* %0)
%3 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mix(unsigned char *, unsigned int);
void invmix(unsigned char *buf, unsigned int s) { mix(buf, s); }


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

x86 assembly (clang, -O2):
<invmix>:
jmp    1030 <mix@plt>

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

LLVM IR (-O2):
define void @invmix(i8* %0, i32 %1) {
%3 = tail call i32 @mix(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int printReply(int);
int sendRequest(int, char *, char *, int);
int loginf(int sd, char argv[]) {
  int status = sendRequest(sd, "LOGIN", argv, 2);
  if (status > 0) {
    status = printReply(sd);
  }
  return status;
}


x86 assembly (clang, -O0):
<loginf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rsi
mov    $0x2,%ecx
call   1040 <sendRequest@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    115f <loginf+0x3f>
mov    -0x4(%rbp),%edi
call   1030 <printReply@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loginf>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%ebx
lea    0xed3(%rip),%rsi
mov    $0x2,%ecx
call   1040 <sendRequest@plt>
test   %eax,%eax
jle    1143 <loginf+0x23>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <printReply@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"LOGIN\00"
define i32 @loginf(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 i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @sendRequest(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7, i32 2)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %3
%13 = call i32 @printReply(i32 %12)
store i32 %13, i32* %5
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"LOGIN\00"
define i32 @loginf(i32 %0, i8* %1) {
%3 = tail call i32 @sendRequest(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i32 2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printReply(i32 %0)
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %8
}
void destroy_nop_lock(void *handle) { return; }


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

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

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

LLVM IR (-O2):
define void @destroy_nop_lock(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfiredb_free(void *region) {
  if (!region)
    return;
  free(region);
}


x86 assembly (clang, -O0):
<xfiredb_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <xfiredb_free+0x1c>
jmp    1135 <xfiredb_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @xfiredb_free(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 = %1, %3
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
float CLOCKS_PER_SEC;
scalar_t__ clock();
float timeit(void) {
  float time = -1.0;
  clock_t init_clock = clock();
  time = (float)init_clock / CLOCKS_PER_SEC;
  return time;
}


x86 assembly (clang, -O0):
<timeit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
cvtsi2ssq -0x10(%rbp),%xmm0
mov    0x2eab(%rip),%rax
divss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeit>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
divss  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global float 0.000000e+00
define float @timeit() {
%1 = alloca float
%2 = alloca i64
store float -1.000000e+00, float* %1
%3 = call i64 (...) @clock()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = sitofp i64 %4 to float
%6 = load float, float* @CLOCKS_PER_SEC
%7 = fdiv float %5, %6
store float %7, float* %1
%8 = load float, float* %1
ret float %8
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global float 0.000000e+00
define float @timeit() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to float
%3 = load float, float* @CLOCKS_PER_SEC
%4 = fdiv float %2, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long double __erfl(long double x) {
  fputs("__erfl not implemented\n", stderr);
  __set_errno(ENOSYS);
  return 0.0;
}


x86 assembly (clang, -O0):
<__erfl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__erfl>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
fldz
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"__erfl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__erfl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
@.str = [24 x i8] c"__erfl not implemented\0A\00"
@stderr = global i32 0
@ENOSYS = global i32 0
define x86_fp80 @__erfl(x86_fp80 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret x86_fp80 0xK00000000000000000000
}
/* Variables and functions */
scalar_t__ __a_cas(int, int, int volatile *);
int a_fetch_add(volatile int *x, int v) {
  int old;
  do
    old = *x;
  while (__a_cas(old, old + v, x));
  return old;
}


x86 assembly (clang, -O0):
<a_fetch_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x10(%rbp),%esi
add    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1030 <__a_cas@plt>
cmp    $0x0,%rax
jne    111f <a_fetch_add+0xf>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_fetch_add>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    (%r15),%ebx
lea    (%rbx,%r14,1),%esi
mov    %ebx,%edi
mov    %r15,%rdx
call   1030 <__a_cas@plt>
test   %rax,%rax
jne    1120 <a_fetch_add+0x10>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @a_fetch_add(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i32, i32* %0
%5 = add nsw i32 %4, %1
%6 = tail call i64 @__a_cas(i32 %4, i32 %5, i32* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ BM_variance(int /*<<< orphan*/ *, int /*<<< orphan*/, float);
float sqrt(int /*<<< orphan*/);
float BM_stdDev(uint32_t *values, uint32_t size, float m) {
  return sqrt(BM_variance(values, size, m));
}


x86 assembly (clang, -O0):
<BM_stdDev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movss  -0x10(%rbp),%xmm0
call   1030 <BM_variance@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @BM_stdDev(i32* %0, i32 %1, float %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca float
store i32* %0, i32** %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load float, float* %6
%10 = call i32 @BM_variance(i32* %7, i32 %8, float %9)
%11 = call float @sqrt(i32 %10)
ret float %11
}

LLVM IR (-O2):
define float @BM_stdDev(i32* %0, i32 %1, float %2) {
%4 = tail call i32 @BM_variance(i32* %0, i32 %1, float %2)
%5 = tail call float @sqrt(i32 %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char const, int);
void ft_putstr_fd(char const *s, int fd) {
  int i;
  i = 0;
  while (s[i] != '\0') {
    ft_putchar_fd(s[i], fd);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115f <ft_putstr_fd+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0xc(%rbp),%esi
movsbl %al,%edi
call   1030 <ft_putchar_fd@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ft_putstr_fd+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <ft_putstr_fd+0x35>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <ft_putchar_fd@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr_fd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = tail call i32 @ft_putchar_fd(i8 signext %7, i32 %1)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
int cmp_ushort_lt(const void *a, const void *b) {
  unsigned short a_ = *(unsigned short *)a;
  unsigned short b_ = *(unsigned short *)b;
  if (a_ < b_)
    return -1;
  if (a_ > b_)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_ushort_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1c(%rbp)
movzwl -0x1a(%rbp),%eax
movzwl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    113e <cmp_ushort_lt+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <cmp_ushort_lt+0x61>
movzwl -0x1a(%rbp),%eax
movzwl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jle    115a <cmp_ushort_lt+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <cmp_ushort_lt+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_ushort_lt>:
movzwl (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%ax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_ushort_lt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp ult i16 %4, %6
%8 = icmp ugt i16 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int get_netmask_prefix_len(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int prefix = get_netmask_prefix_len(0xffffff00);
  printf("prefix = %d\n", prefix);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffff00,%edi
call   1030 <get_netmask_prefix_len@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"prefix = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @get_netmask_prefix_len(i32 -256)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"prefix = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @get_netmask_prefix_len(i32 -256)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
double rndu();
double sqrt(int);
double rndBox(void) {
  double z = rndu() * ((sqrt(12 - 3 * 0.5 * 0.5) - 0.5) / 2 - 0.5) + 0.5;
  if (rndu() < 0.5)
    z = -z;
  return z;
}


x86 assembly (clang, -O0):
<rndBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rndu@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0xb,%edi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xeb2(%rip),%xmm2
subsd  %xmm2,%xmm1
movsd  0xeae(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xe9a(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rndu@plt>
movaps %xmm0,%xmm1
movsd  0xe6f(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11bc <rndBox+0x9c>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndBox>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <rndu@plt>
movsd  %xmm0,(%rsp)
mov    $0xb,%edi
call   1040 <sqrt@plt>
movsd  0xebe(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  (%rsp),%xmm0
addsd  %xmm2,%xmm0
movapd %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rndu@plt>
movapd 0xe9d(%rip),%xmm1
movapd (%rsp),%xmm3
xorpd  %xmm3,%xmm1
cmpltsd 0xe83(%rip),%xmm0
movapd %xmm0,%xmm2
andnpd %xmm3,%xmm2
andpd  %xmm1,%xmm0
orpd   %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rndBox() {
%1 = alloca double
%2 = call double (...) @rndu()
%3 = call double @sqrt(i32 11)
%4 = fsub double %3, 5.000000e-01
%5 = fdiv double %4, 2.000000e+00
%6 = fsub double %5, 5.000000e-01
%7 = call double @llvm.fmuladd.f64(double %2, double %6, double 5.000000e-01)
store double %7, double* %1
%8 = call double (...) @rndu()
%9 = fcmp olt double %8, 5.000000e-01
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load double, double* %1
%12 = fneg double %11
store double %12, double* %1
br label %13
13: ; preds = %10, %0
%14 = load double, double* %1
ret double %14
}

LLVM IR (-O2):
define double @rndBox() {
%1 = tail call double (...) @rndu()
%2 = tail call double @sqrt(i32 11)
%3 = fadd double %2, -5.000000e-01
%4 = fmul double %3, 5.000000e-01
%5 = fadd double %4, -5.000000e-01
%6 = tail call double @llvm.fmuladd.f64(double %1, double %5, double 5.000000e-01)
%7 = tail call double (...) @rndu()
%8 = fcmp olt double %7, 5.000000e-01
%9 = fneg double %6
%10 = select i1 %8, double %9, double %6
ret double %10
}
void _disable() { return; }


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

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

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

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