#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 */
size_t atanf(float);
scalar_t__ cos(float);
scalar_t__ sin(float);
void makect(size_t nc, size_t *ip, float *c) {
  size_t j, nch;
  float delta;
  ip[1] = nc;
  if (nc > 1) {
    nch = nc >> 1;
    delta = atanf(1.0f) / nch;
    c[0] = (float)cos(delta * nch);
    c[nch] = 0.5f * c[0];
    for (j = 1; j < nch; j++) {
      c[j] = 0.5f * (float)cos(delta * j);
      c[nc - j] = 0.5f * (float)sin(delta * j);
    }
  }
}


x86 assembly (clang, -O0):
<makect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
cmpq   $0x1,-0x8(%rbp)
jbe    1363 <makect+0x233>
mov    -0x8(%rbp),%rax
shr    %rax
mov    %rax,-0x28(%rbp)
movss  0xe96(%rip),%xmm0
call   1030 <atanf@plt>
mov    -0x28(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x34(%rbp)
test   %rax,%rax
movss  %xmm0,-0x30(%rbp)
js     11b5 <makect+0x85>
movss  -0x34(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x3c(%rbp)
test   %rax,%rax
movss  %xmm0,-0x38(%rbp)
js     1206 <makect+0xd6>
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x40(%rbp),%xmm0
movss  -0x38(%rbp),%xmm1
mulss  %xmm1,%xmm0
call   1050 <cos@plt>
cvtsi2ss %rax,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movss  0xdce(%rip),%xmm0
mulss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    135e <makect+0x22e>
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x4c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x48(%rbp)
test   %rax,%rax
movss  %xmm0,-0x44(%rbp)
js     12a0 <makect+0x170>
movss  -0x48(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x4c(%rbp),%xmm0
movss  -0x44(%rbp),%xmm1
mulss  %xmm1,%xmm0
call   1050 <cos@plt>
cvtsi2ss %rax,%xmm0
movss  0xd40(%rip),%xmm1
mulss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x54(%rbp)
test   %rax,%rax
movss  %xmm0,-0x50(%rbp)
js     1318 <makect+0x1e8>
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x58(%rbp),%xmm0
movss  -0x50(%rbp),%xmm1
mulss  %xmm1,%xmm0
call   1040 <sin@plt>
cvtsi2ss %rax,%xmm1
movss  0xcc8(%rip),%xmm0
mulss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    124b <makect+0x11b>
jmp    1363 <makect+0x233>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makect>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsi)
cmp    $0x2,%rdi
jb     1285 <makect+0x155>
mov    %rdx,%r12
mov    %rdi,%r14
mov    %rdi,%r15
shr    %r15
movss  0xea1(%rip),%xmm0
call   1030 <atanf@plt>
mov    %rax,%rcx
or     %r15,%rcx
shr    $0x20,%rcx
je     1181 <makect+0x51>
xor    %edx,%edx
div    %r15
test   %rax,%rax
js     118b <makect+0x5b>
cvtsi2ss %rax,%xmm1
jmp    11a0 <makect+0x70>
xor    %edx,%edx
div    %r15d
test   %rax,%rax
jns    117a <makect+0x4a>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm1
xorps  %xmm0,%xmm0
cvtsi2ss %r15,%xmm0
movss  %xmm1,0x8(%rsp)
mulss  %xmm1,%xmm0
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  %xmm0,(%r12)
mulss  0xe37(%rip),%xmm0
movss  %xmm0,(%r12,%r15,4)
cmp    $0x4,%r14
jb     1285 <makect+0x155>
cmp    $0x3,%r15
mov    $0x2,%r13d
cmovae %r15,%r13
lea    (%r12,%r14,4),%r14
add    $0xfffffffffffffffc,%r14
mov    $0x1,%ebx
jmp    1264 <makect+0x134>
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
movss  0x8(%rsp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
call   1050 <cos@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0xdd7(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,(%r12,%rbx,4)
movss  0xc(%rsp),%xmm0
call   1040 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
mulss  0xdb2(%rip),%xmm0
movss  %xmm0,(%r14)
add    $0x1,%rbx
add    $0xfffffffffffffffc,%r14
cmp    %rbx,%r13
je     1285 <makect+0x155>
test   %rbx,%rbx
jns    1200 <makect+0xd0>
mov    %rbx,%rax
shr    %rax
mov    %ebx,%ecx
and    $0x1,%ecx
or     %rax,%rcx
xorps  %xmm0,%xmm0
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
jmp    1208 <makect+0xd8>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @makect(i64 %0, i64* %1, float* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca float*
%7 = alloca i64
%8 = alloca i64
%9 = alloca float
store i64 %0, i64* %4
store i64* %1, i64** %5
store float* %2, float** %6
%10 = load i64, i64* %4
%11 = load i64*, i64** %5
%12 = getelementptr inbounds i64, i64* %11, i64 1
store i64 %10, i64* %12
%13 = load i64, i64* %4
%14 = icmp ugt i64 %13, 1
br i1 %14, label %15, label %68
15: ; preds = %3
%16 = load i64, i64* %4
%17 = lshr i64 %16, 1
store i64 %17, i64* %8
%18 = call i64 @atanf(float 1.000000e+00)
%19 = load i64, i64* %8
%20 = udiv i64 %18, %19
%21 = uitofp i64 %20 to float
store float %21, float* %9
%22 = load float, float* %9
%23 = load i64, i64* %8
%24 = uitofp i64 %23 to float
%25 = fmul float %22, %24
%26 = call i64 @cos(float %25)
%27 = sitofp i64 %26 to float
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 0
store float %27, float* %29
%30 = load float*, float** %6
%31 = getelementptr inbounds float, float* %30, i64 0
%32 = load float, float* %31
%33 = fmul float 5.000000e-01, %32
%34 = load float*, float** %6
%35 = load i64, i64* %8
%36 = getelementptr inbounds float, float* %34, i64 %35
store float %33, float* %36
store i64 1, i64* %7
br label %37
37: ; preds = %64, %15
%38 = load i64, i64* %7
%39 = load i64, i64* %8
%40 = icmp ult i64 %38, %39
br i1 %40, label %41, label %67
41: ; preds = %37
%42 = load float, float* %9
%43 = load i64, i64* %7
%44 = uitofp i64 %43 to float
%45 = fmul float %42, %44
%46 = call i64 @cos(float %45)
%47 = sitofp i64 %46 to float
%48 = fmul float 5.000000e-01, %47
%49 = load float*, float** %6
%50 = load i64, i64* %7
%51 = getelementptr inbounds float, float* %49, i64 %50
store float %48, float* %51
%52 = load float, float* %9
%53 = load i64, i64* %7
%54 = uitofp i64 %53 to float
%55 = fmul float %52, %54
%56 = call i64 @sin(float %55)
%57 = sitofp i64 %56 to float
%58 = fmul float 5.000000e-01, %57
%59 = load float*, float** %6
%60 = load i64, i64* %4
%61 = load i64, i64* %7
%62 = sub i64 %60, %61
%63 = getelementptr inbounds float, float* %59, i64 %62
store float %58, float* %63
br label %64
64: ; preds = %41
%65 = load i64, i64* %7
%66 = add i64 %65, 1
store i64 %66, i64* %7
br label %37
67: ; preds = %37
br label %68
68: ; preds = %67, %3
ret void
}

LLVM IR (-O2):
define void @makect(i64 %0, i64* nocapture writeonly %1, float* nocapture writeonly %2) {
%4 = getelementptr inbounds i64, i64* %1, i64 1
store i64 %0, i64* %4
%5 = icmp ugt i64 %0, 1
br i1 %5, label %6, label %35
6: ; preds = %3
%7 = lshr i64 %0, 1
%8 = tail call i64 @atanf(float 1.000000e+00)
%9 = udiv i64 %8, %7
%10 = uitofp i64 %9 to float
%11 = uitofp i64 %7 to float
%12 = fmul float %11, %10
%13 = tail call i64 @cos(float %12)
%14 = sitofp i64 %13 to float
store float %14, float* %2
%15 = fmul float %14, 5.000000e-01
%16 = getelementptr inbounds float, float* %2, i64 %7
store float %15, float* %16
%17 = icmp ugt i64 %0, 3
br i1 %17, label %18, label %35
18: ; preds = %6
%19 = call i64 @llvm.umax.i64(i64 %7, i64 2)
br label %20
20: ; preds = %18, %20
%21 = phi i64 [ %33, %20 ], [ 1, %18 ]
%22 = uitofp i64 %21 to float
%23 = fmul float %10, %22
%24 = tail call i64 @cos(float %23)
%25 = sitofp i64 %24 to float
%26 = fmul float %25, 5.000000e-01
%27 = getelementptr inbounds float, float* %2, i64 %21
store float %26, float* %27
%28 = tail call i64 @sin(float %23)
%29 = sitofp i64 %28 to float
%30 = fmul float %29, 5.000000e-01
%31 = sub i64 %0, %21
%32 = getelementptr inbounds float, float* %2, i64 %31
store float %30, float* %32
%33 = add nuw nsw i64 %21, 1
%34 = icmp eq i64 %33, %19
br i1 %34, label %35, label %20
35: ; preds = %20, %6, %3
ret void
}