#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 */
float sinf(float);
void apply_sin(float *A, float *B, float *C, unsigned N) {
  for (unsigned i = 0; i < N; i++)
    C[i] = sinf(A[i]) + sinf(B[i]);
}


x86 assembly (clang, -O0):
<apply_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    1187 <apply_sin+0x77>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
movss  (%rax,%rcx,4),%xmm0
call   1030 <sinf@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
addss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112e <apply_sin+0x1e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_sin>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %ecx,%ecx
je     11ca <apply_sin+0xba>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %ecx,%r13d
cmp    $0x1,%ecx
jne    1138 <apply_sin+0x28>
xor    %ebx,%ebx
jmp    119c <apply_sin+0x8c>
mov    %r13d,%ebp
and    $0xfffffffe,%ebp
xor    %ebx,%ebx
movss  (%r12,%rbx,4),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,0x4(%rsp)
movss  (%r15,%rbx,4),%xmm0
call   1030 <sinf@plt>
addss  0x4(%rsp),%xmm0
movss  %xmm0,(%r14,%rbx,4)
movss  0x4(%r12,%rbx,4),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,0x4(%rsp)
movss  0x4(%r15,%rbx,4),%xmm0
call   1030 <sinf@plt>
addss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%r14,%rbx,4)
add    $0x2,%rbx
cmp    %rbx,%rbp
jne    1140 <apply_sin+0x30>
test   $0x1,%r13b
je     11ca <apply_sin+0xba>
movss  (%r12,%rbx,4),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,0x4(%rsp)
movss  (%r15,%rbx,4),%xmm0
call   1030 <sinf@plt>
addss  0x4(%rsp),%xmm0
movss  %xmm0,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @apply_sin(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %24, label %6
6: ; preds = %4
%7 = zext i32 %3 to i64
%8 = and i64 %7, 1
%9 = icmp eq i32 %3, 1
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = and i64 %7, 4294967294
br label %25
12: ; preds = %25, %6
%13 = phi i64 [ 0, %6 ], [ %45, %25 ]
%14 = icmp eq i64 %8, 0
br i1 %14, label %24, label %15
15: ; preds = %12
%16 = getelementptr inbounds float, float* %0, i64 %13
%17 = load float, float* %16
%18 = tail call float @sinf(float %17)
%19 = getelementptr inbounds float, float* %1, i64 %13
%20 = load float, float* %19
%21 = tail call float @sinf(float %20)
%22 = fadd float %18, %21
%23 = getelementptr inbounds float, float* %2, i64 %13
store float %22, float* %23
br label %24
24: ; preds = %15, %12, %4
ret void
25: ; preds = %25, %10
%26 = phi i64 [ 0, %10 ], [ %45, %25 ]
%27 = phi i64 [ 0, %10 ], [ %46, %25 ]
%28 = getelementptr inbounds float, float* %0, i64 %26
%29 = load float, float* %28
%30 = tail call float @sinf(float %29)
%31 = getelementptr inbounds float, float* %1, i64 %26
%32 = load float, float* %31
%33 = tail call float @sinf(float %32)
%34 = fadd float %30, %33
%35 = getelementptr inbounds float, float* %2, i64 %26
store float %34, float* %35
%36 = or i64 %26, 1
%37 = getelementptr inbounds float, float* %0, i64 %36
%38 = load float, float* %37
%39 = tail call float @sinf(float %38)
%40 = getelementptr inbounds float, float* %1, i64 %36
%41 = load float, float* %40
%42 = tail call float @sinf(float %41)
%43 = fadd float %39, %42
%44 = getelementptr inbounds float, float* %2, i64 %36
store float %43, float* %44
%45 = add nuw nsw i64 %26, 2
%46 = add i64 %27, 2
%47 = icmp eq i64 %46, %11
br i1 %47, label %12, label %25
}