#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  =>  +;\n", x, y);
    printf("%8.5f, %8.5f  =>  -;\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     125c <printSet+0x12c>
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)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xe0b(%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    0xddd(%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    $0x58,%rsp
test   %edi,%edi
js     123d <printSet+0x10d>
mov    %edi,%eax
shl    $0x5,%eax
cvtsi2sd %edi,%xmm1
mulsd  0xead(%rip),%xmm1
movsd  %xmm1,0x20(%rsp)
lea    (%rax,%rax,2),%eax
imul   $0x68,%edi,%ebp
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
movsd  %xmm1,0x18(%rsp)
xor    %ebx,%ebx
test   %eax,%eax
cmovg  %eax,%ebx
or     $0x1,%ebx
xorpd  %xmm2,%xmm2
lea    0xeaf(%rip),%r14
lea    0xebe(%rip),%r15
movsd  %xmm0,0x28(%rsp)
xchg   %ax,%ax
movsd  %xmm2,0x38(%rsp)
mulsd  0xe6a(%rip),%xmm2
divsd  0x20(%rsp),%xmm2
movsd  %xmm2,0x30(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
mulsd  %xmm0,%xmm1
divsd  0x18(%rsp),%xmm1
movapd %xmm1,(%rsp)
movapd %xmm2,%xmm0
call   1050 <cos@plt>
mulsd  (%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
movsd  0x30(%rsp),%xmm0
call   1040 <sin@plt>
movapd (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,(%rsp)
mov    %r14,%rdi
movaps 0x40(%rsp),%xmm0
call   1030 <printf@plt>
movapd 0xe1e(%rip),%xmm2
movapd 0x40(%rsp),%xmm0
xorpd  %xmm2,%xmm0
movapd (%rsp),%xmm1
xorpd  %xmm2,%xmm1
mov    %r15,%rdi
call   1030 <printf@plt>
movsd  0x38(%rsp),%xmm2
movsd  0x28(%rsp),%xmm0
addsd  0xddf(%rip),%xmm2
add    $0xffffffff,%ebp
add    $0xffffffff,%ebx
jne    1190 <printSet+0x60>
add    $0x58,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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