#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double log(double);
double sqrt(double);
void lls(double *data, int size) {
  int i;
  for (i = 0; i < size; i++) {
    data[i] = log(log(sqrt(data[i] + 1.0) + 1.0) + 1.0);
  }
}


x86 assembly (clang, -O0):
<lls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1199 <lls+0x79>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  0xeae(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
call   1040 <sqrt@plt>
movsd  0xe9c(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  0xe8b(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <log@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <lls+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lls>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1194 <lls+0x74>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
movsd  0xec7(%rip),%xmm1
jmp    117a <lls+0x5a>
nopl   0x0(%rax,%rax,1)
call   1040 <sqrt@plt>
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <log@plt>
addsd  0xea2(%rip),%xmm0
call   1030 <log@plt>
movsd  0xe95(%rip),%xmm1
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
je     1194 <lls+0x74>
movsd  (%r15,%rbx,8),%xmm0
addsd  %xmm1,%xmm0
ucomisd 0xe7c(%rip),%xmm0
jb     1140 <lls+0x20>
sqrtsd %xmm0,%xmm0
jmp    114d <lls+0x2d>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @lls(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %26, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %29
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = fadd double %15, 1.000000e+00
%17 = call double @sqrt(double %16)
%18 = fadd double %17, 1.000000e+00
%19 = call double @log(double %18)
%20 = fadd double %19, 1.000000e+00
%21 = call double @log(double %20)
%22 = load double*, double** %3
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds double, double* %22, i64 %24
store double %21, double* %25
br label %26
26: ; preds = %10
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %6
29: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @lls(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %16, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = fadd double %9, 1.000000e+00
%11 = tail call double @sqrt(double %10)
%12 = fadd double %11, 1.000000e+00
%13 = tail call double @log(double %12)
%14 = fadd double %13, 1.000000e+00
%15 = tail call double @log(double %14)
store double %15, double* %8
%16 = add nuw nsw i64 %7, 1
%17 = icmp eq i64 %16, %5
br i1 %17, label %18, label %6
18: ; preds = %6, %2
ret void
}