#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 cos(double);
int /*<<< orphan*/ printf(char *, double, double);
double sin(double);
void printSet(int density, double maxRadius) {
  int points, i;
  double x, y, angle, radius;
  points = (96 * density);
  for (i = 0; i <= points; i++) {
    angle = (i * 3.1416) / (16.0 * density);
    radius = maxRadius * ((104 * density) - i) / (104 * density);
    x = radius * cos(angle);
    y = radius * sin(angle);
    printf("%8.5f %8.5f 1.0\n", (x + 6.5) / 13.0, (y + 6.0) / 12.0);
    printf("%8.5f %8.5f 0.0\n", (-x + 6.5) / 13.0, (-y + 6.0) / 12.0);
  }
}


x86 assembly (clang, -O0):
<printSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
imul   $0x60,-0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     12b4 <printSet+0x184>
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xea8(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
imul   $0x68,-0x4(%rbp),%eax
sub    -0x18(%rbp),%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
imul   $0x68,-0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe1c(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xe07(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdf3(%rip),%xmm1
addsd  -0x28(%rbp),%xmm1
movsd  0xdde(%rip),%xmm2
divsd  %xmm2,%xmm1
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xdc2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xdae(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xd7e(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  0xd6a(%rip),%xmm2
divsd  %xmm2,%xmm1
lea    0xda0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114e <printSet+0x1e>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSet>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
test   %edi,%edi
js     1282 <printSet+0x152>
mov    %edi,%eax
shl    $0x5,%eax
cvtsi2sd %edi,%xmm1
lea    (%rax,%rax,2),%eax
mulsd  0xeaa(%rip),%xmm1
movsd  %xmm1,0x18(%rsp)
imul   $0x68,%edi,%ebp
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  %xmm1,0x10(%rsp)
xor    %ebx,%ebx
test   %eax,%eax
cmovg  %eax,%ebx
or     $0x1,%ebx
xorpd  %xmm2,%xmm2
lea    0xeb7(%rip),%r14
lea    0xec1(%rip),%r15
movsd  %xmm0,0x20(%rsp)
xchg   %ax,%ax
movsd  %xmm2,0x30(%rsp)
mulsd  0xe6a(%rip),%xmm2
divsd  0x18(%rsp),%xmm2
movsd  %xmm2,0x28(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  %xmm0,%xmm1
divsd  0x10(%rsp),%xmm1
movsd  %xmm1,(%rsp)
movapd %xmm2,%xmm0
call   1050 <cos@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
call   1040 <sin@plt>
movapd %xmm0,%xmm2
mulsd  (%rsp),%xmm2
movsd  %xmm2,(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0xe15(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe11(%rip),%xmm1
divsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
movsd  0xe09(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  0xe05(%rip),%xmm2
divsd  %xmm2,%xmm1
mov    %r14,%rdi
call   1030 <printf@plt>
movsd  0xdd9(%rip),%xmm0
subsd  0x8(%rsp),%xmm0
divsd  0xdd3(%rip),%xmm0
movsd  0xdd3(%rip),%xmm1
subsd  (%rsp),%xmm1
divsd  0xdce(%rip),%xmm1
mov    %r15,%rdi
call   1030 <printf@plt>
movsd  0x30(%rsp),%xmm2
movsd  0x20(%rsp),%xmm0
addsd  0xdba(%rip),%xmm2
add    $0xffffffff,%ebp
add    $0xffffffff,%ebx
jne    1190 <printSet+0x60>
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%8.5f %8.5f 1.0\0A\00"
@.str.1 = [17 x i8] c"%8.5f %8.5f 0.0\0A\00"
define void @printSet(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%11 = load i32, i32* %3
%12 = mul nsw i32 96, %11
store i32 %12, i32* %5
store i32 0, i32* %6
br label %13
13: ; preds = %60, %2
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %63
17: ; preds = %13
%18 = load i32, i32* %6
%19 = sitofp i32 %18 to double
%20 = fmul double %19, 3.141600e+00
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to double
%23 = fmul double 1.600000e+01, %22
%24 = fdiv double %20, %23
store double %24, double* %9
%25 = load double, double* %4
%26 = load i32, i32* %3
%27 = mul nsw i32 104, %26
%28 = load i32, i32* %6
%29 = sub nsw i32 %27, %28
%30 = sitofp i32 %29 to double
%31 = fmul double %25, %30
%32 = load i32, i32* %3
%33 = mul nsw i32 104, %32
%34 = sitofp i32 %33 to double
%35 = fdiv double %31, %34
store double %35, double* %10
%36 = load double, double* %10
%37 = load double, double* %9
%38 = call double @cos(double %37)
%39 = fmul double %36, %38
store double %39, double* %7
%40 = load double, double* %10
%41 = load double, double* %9
%42 = call double @sin(double %41)
%43 = fmul double %40, %42
store double %43, double* %8
%44 = load double, double* %7
%45 = fadd double %44, 6.500000e+00
%46 = fdiv double %45, 1.300000e+01
%47 = load double, double* %8
%48 = fadd double %47, 6.000000e+00
%49 = fdiv double %48, 1.200000e+01
%50 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %46, double %49)
%51 = load double, double* %7
%52 = fneg double %51
%53 = fadd double %52, 6.500000e+00
%54 = fdiv double %53, 1.300000e+01
%55 = load double, double* %8
%56 = fneg double %55
%57 = fadd double %56, 6.000000e+00
%58 = fdiv double %57, 1.200000e+01
%59 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %54, double %58)
br label %60
60: ; preds = %17
%61 = load i32, i32* %6
%62 = add nsw i32 %61, 1
store i32 %62, i32* %6
br label %13
63: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%8.5f %8.5f 1.0\0A\00"
@.str.1 = [17 x i8] c"%8.5f %8.5f 0.0\0A\00"
define void @printSet(i32 %0, double %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %37, label %4
4: ; preds = %2
%5 = mul i32 %0, 96
%6 = sitofp i32 %0 to double
%7 = fmul double %6, 1.600000e+01
%8 = mul nsw i32 %0, 104
%9 = sitofp i32 %8 to double
%10 = call i32 @llvm.smax.i32(i32 %5, i32 0)
%11 = or i32 %10, 1
br label %12
12: ; preds = %4, %12
%13 = phi i32 [ 0, %4 ], [ %35, %12 ]
%14 = sitofp i32 %13 to double
%15 = fmul double %14, 3.141600e+00
%16 = fdiv double %15, %7
%17 = sub nsw i32 %8, %13
%18 = sitofp i32 %17 to double
%19 = fmul double %18, %1
%20 = fdiv double %19, %9
%21 = tail call double @cos(double %16)
%22 = fmul double %20, %21
%23 = tail call double @sin(double %16)
%24 = fmul double %20, %23
%25 = fadd double %22, 6.500000e+00
%26 = fdiv double %25, 1.300000e+01
%27 = fadd double %24, 6.000000e+00
%28 = fdiv double %27, 1.200000e+01
%29 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double %26, double %28)
%30 = fsub double 6.500000e+00, %22
%31 = fdiv double %30, 1.300000e+01
%32 = fsub double 6.000000e+00, %24
%33 = fdiv double %32, 1.200000e+01
%34 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %31, double %33)
%35 = add nuw nsw i32 %13, 1
%36 = icmp eq i32 %35, %11
br i1 %36, label %37, label %12
37: ; preds = %12, %2
ret void
}