#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);
    if (i % 2 == 1) {
      printf("%8.5f %8.5f 1\n", x, y);
      printf("%8.5f %8.5f 0\n", -x, -y);
    }
  }
}


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     1275 <printSet+0x145>
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xea1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xe88(%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)
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1262 <printSet+0x132>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xdf7(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
lea    0xdc2(%rip),%rdi
call   1030 <printf@plt>
jmp    1267 <printSet+0x137>
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   %r12
push   %rbx
sub    $0x40,%rsp
movsd  %xmm0,0x28(%rsp)
test   %edi,%edi
js     1251 <printSet+0x121>
mov    %edi,%eax
shl    $0x5,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mulsd  0xea2(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
lea    (%rax,%rax,2),%r12d
imul   $0x68,%edi,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,0x20(%rsp)
xor    %ebp,%ebp
test   %r12d,%r12d
cmovle %ebp,%r12d
or     $0x1,%r12d
xorpd  %xmm0,%xmm0
lea    0xea0(%rip),%r14
lea    0xea8(%rip),%r15
jmp    11bd <printSet+0x8d>
nopl   0x0(%rax)
movsd  0x38(%rsp),%xmm0
addsd  0xe62(%rip),%xmm0
add    $0x1,%ebp
add    $0xffffffff,%ebx
cmp    %ebp,%r12d
je     1251 <printSet+0x121>
movsd  %xmm0,0x38(%rsp)
mulsd  0xe3d(%rip),%xmm0
divsd  0x30(%rsp),%xmm0
movsd  %xmm0,(%rsp)
call   1050 <cos@plt>
movapd %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
test   $0x1,%bpl
je     11a0 <printSet+0x70>
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  0x28(%rsp),%xmm1
divsd  0x20(%rsp),%xmm1
movapd 0x10(%rsp),%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
mov    %r14,%rdi
movapd %xmm2,%xmm0
call   1030 <printf@plt>
movapd 0xdef(%rip),%xmm2
movapd 0x10(%rsp),%xmm0
xorpd  %xmm2,%xmm0
movapd (%rsp),%xmm1
xorpd  %xmm2,%xmm1
mov    %r15,%rdi
call   1030 <printf@plt>
jmp    11a0 <printSet+0x70>
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%8.5f %8.5f 1\0A\00"
@.str.1 = [15 x i8] c"%8.5f %8.5f 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 = %57, %2
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %60
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 i32, i32* %6
%45 = srem i32 %44, 2
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %56
47: ; preds = %17
%48 = load double, double* %7
%49 = load double, double* %8
%50 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %48, double %49)
%51 = load double, double* %7
%52 = fneg double %51
%53 = load double, double* %8
%54 = fneg double %53
%55 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %52, double %54)
br label %56
56: ; preds = %47, %17
br label %57
57: ; preds = %56
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 1
store i32 %59, i32* %6
br label %13
60: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%8.5f %8.5f 1\0A\00"
@.str.1 = [15 x i8] c"%8.5f %8.5f 0\0A\00"
define void @printSet(i32 %0, double %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %35, 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, %32
%13 = phi i32 [ 0, %4 ], [ %33, %32 ]
%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 = and i32 %13, 1
%26 = icmp eq i32 %25, 0
br i1 %26, label %32, label %27
27: ; preds = %12
%28 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %22, double %24)
%29 = fneg double %22
%30 = fneg double %24
%31 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %29, double %30)
br label %32
32: ; preds = %12, %27
%33 = add nuw nsw i32 %13, 1
%34 = icmp eq i32 %33, %11
br i1 %34, label %35, label %12
35: ; preds = %32, %2
ret void
}