#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 s_decept(double, double, double, double);
double s_multi(double, int, int, double);
int WFG9_t2(double *y, int y_size, int k, double *result) {
  int i;
  for (i = 0; i < k; i++)
    result[i] = s_decept(y[i], 0.35, 0.001, 0.05);
  for (i = k; i < y_size; i++)
    result[i] = s_multi(y[i], 30, 95, 0.35);
  return y_size;
}


x86 assembly (clang, -O0):
<WFG9_t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    118e <WFG9_t2+0x6e>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xea2(%rip),%xmm1
movsd  0xea2(%rip),%xmm2
movsd  0xea2(%rip),%xmm3
call   1040 <s_decept@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113d <WFG9_t2+0x1d>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11df <WFG9_t2+0xbf>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    $0x1e,%edi
mov    $0x5f,%esi
movsd  0xe41(%rip),%xmm1
call   1030 <s_multi@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1194 <WFG9_t2+0x74>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WFG9_t2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r13
mov    %edx,%r15d
mov    %esi,%r14d
mov    %rdi,%r12
test   %edx,%edx
jle    1173 <WFG9_t2+0x53>
mov    %r15d,%ebx
xor    %ebp,%ebp
movsd  (%r12,%rbp,8),%xmm0
movsd  0xeb2(%rip),%xmm1
movsd  0xeb2(%rip),%xmm2
movsd  0xeb2(%rip),%xmm3
call   1040 <s_decept@plt>
movsd  %xmm0,0x0(%r13,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1140 <WFG9_t2+0x20>
cmp    %r14d,%r15d
jge    11bc <WFG9_t2+0x9c>
movslq %r15d,%rax
lea    (%r12,%rax,8),%r12
lea    0x0(%r13,%rax,8),%r13
mov    %r14d,%ebp
sub    %r15d,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
movsd  (%r12,%rbx,8),%xmm0
mov    $0x1e,%edi
mov    $0x5f,%esi
movsd  0xe58(%rip),%xmm1
call   1030 <s_multi@plt>
movsd  %xmm0,0x0(%r13,%rbx,8)
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1190 <WFG9_t2+0x70>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @WFG9_t2(double* %0, i32 %1, i32 %2, double* %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double* %3, double** %8
store i32 0, i32* %9
br label %10
10: ; preds = %25, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %7
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load double*, double** %5
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = load double, double* %18
%20 = call double @s_decept(double %19, double 3.500000e-01, double 1.000000e-03, double 5.000000e-02)
%21 = load double*, double** %8
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %21, i64 %23
store double %20, double* %24
br label %25
25: ; preds = %14
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %10
28: ; preds = %10
%29 = load i32, i32* %7
store i32 %29, i32* %9
br label %30
30: ; preds = %45, %28
%31 = load i32, i32* %9
%32 = load i32, i32* %6
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %48
34: ; preds = %30
%35 = load double*, double** %5
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %35, i64 %37
%39 = load double, double* %38
%40 = call double @s_multi(double %39, i32 30, i32 95, double 3.500000e-01)
%41 = load double*, double** %8
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
store double %40, double* %44
br label %45
45: ; preds = %34
%46 = load i32, i32* %9
%47 = add nsw i32 %46, 1
store i32 %47, i32* %9
br label %30
48: ; preds = %30
%49 = load i32, i32* %6
ret i32 %49
}

LLVM IR (-O2):
define i32 @WFG9_t2(double* nocapture %0, i32 returned %1, i32 %2, double* nocapture writeonly %3) {
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = zext i32 %2 to i64
br label %12
8: ; preds = %12, %4
%9 = icmp slt i32 %2, %1
br i1 %9, label %10, label %29
10: ; preds = %8
%11 = sext i32 %2 to i64
br label %20
12: ; preds = %6, %12
%13 = phi i64 [ 0, %6 ], [ %18, %12 ]
%14 = getelementptr inbounds double, double* %0, i64 %13
%15 = load double, double* %14
%16 = tail call double @s_decept(double %15, double 3.500000e-01, double 1.000000e-03, double 5.000000e-02)
%17 = getelementptr inbounds double, double* %3, i64 %13
store double %16, double* %17
%18 = add nuw nsw i64 %13, 1
%19 = icmp eq i64 %18, %7
br i1 %19, label %8, label %12
20: ; preds = %10, %20
%21 = phi i64 [ %11, %10 ], [ %26, %20 ]
%22 = getelementptr inbounds double, double* %0, i64 %21
%23 = load double, double* %22
%24 = tail call double @s_multi(double %23, i32 30, i32 95, double 3.500000e-01)
%25 = getelementptr inbounds double, double* %3, i64 %21
store double %24, double* %25
%26 = add nsw i64 %21, 1
%27 = trunc i64 %26 to i32
%28 = icmp eq i32 %27, %1
br i1 %28, label %29, label %20
29: ; preds = %20, %8
ret i32 %1
}