#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 */
int cos(float);
int /*<<< orphan*/ drawCircle(int, int, int);
int sin(float);
void circularLace(int cx, int cy, int r) {
  if (r < 2) {
    return;
  }
  drawCircle(cx, cy, r);
  float t = 0.0f;
  for (t = 0.0; t < 2 * 3.1415926 - (3.1415926 / 3); t += (3.1415926 / 3)) {
    int x = r * cos(t) + cx;
    int y = r * sin(t) + cy;
    circularLace(x, y, r / 3);
  }
  return;
}


x86 assembly (clang, -O0):
<circularLace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1160 <circularLace+0x20>
jmp    1215 <circularLace+0xd5>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <drawCircle@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1210 <circularLace+0xd0>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
call   1060 <cos@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
imul   %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movss  -0x10(%rbp),%xmm0
call   1050 <sin@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1040 <circularLace@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    117e <circularLace+0x3e>
jmp    1215 <circularLace+0xd5>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circularLace>:
cmp    $0x2,%edx
jge    1146 <circularLace+0x6>
ret
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ebx
mov    %esi,%r15d
mov    %edi,%r14d
call   1030 <drawCircle@plt>
mov    %ebx,%eax
mov    $0xaaaaaaab,%r12d
imul   %rax,%r12
shr    $0x21,%r12
xorps  %xmm0,%xmm0
call   1060 <cos@plt>
imul   %ebx,%eax
lea    (%rax,%r14,1),%ebp
xorps  %xmm0,%xmm0
call   1050 <sin@plt>
imul   %ebx,%eax
lea    (%rax,%r15,1),%esi
mov    %ebp,%edi
mov    %r12d,%edx
call   1040 <circularLace@plt>
movss  0xe65(%rip),%xmm0
call   1060 <cos@plt>
imul   %ebx,%eax
lea    (%rax,%r14,1),%ebp
movss  0xe51(%rip),%xmm0
call   1050 <sin@plt>
imul   %ebx,%eax
lea    (%rax,%r15,1),%esi
mov    %ebp,%edi
mov    %r12d,%edx
call   1040 <circularLace@plt>
movss  0xe37(%rip),%xmm0
call   1060 <cos@plt>
imul   %ebx,%eax
lea    (%rax,%r14,1),%ebp
movss  0xe23(%rip),%xmm0
call   1050 <sin@plt>
imul   %ebx,%eax
lea    (%rax,%r15,1),%esi
mov    %ebp,%edi
mov    %r12d,%edx
call   1040 <circularLace@plt>
movss  0xe09(%rip),%xmm0
call   1060 <cos@plt>
imul   %ebx,%eax
lea    (%rax,%r14,1),%ebp
movss  0xdf5(%rip),%xmm0
call   1050 <sin@plt>
imul   %ebx,%eax
lea    (%rax,%r15,1),%esi
mov    %ebp,%edi
mov    %r12d,%edx
call   1040 <circularLace@plt>
movss  0xddb(%rip),%xmm0
call   1060 <cos@plt>
imul   %ebx,%eax
lea    (%rax,%r14,1),%ebp
movss  0xdc7(%rip),%xmm0
call   1050 <sin@plt>
imul   %ebx,%eax
lea    (%rax,%r15,1),%esi
mov    %ebp,%edi
mov    %r12d,%edx
call   1040 <circularLace@plt>
movss  0xdad(%rip),%xmm0
call   1060 <cos@plt>
imul   %ebx,%eax
add    %eax,%r14d
movss  0xd9a(%rip),%xmm0
call   1050 <sin@plt>
imul   %eax,%ebx
add    %r15d,%ebx
mov    %r14d,%edi
mov    %ebx,%esi
mov    %r12d,%edx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <circularLace@plt>

LLVM IR (-O0):
define void @circularLace(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %13
12: ; preds = %3
br label %45
13: ; preds = %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @drawCircle(i32 %14, i32 %15, i32 %16)
store float 0.000000e+00, float* %7
store float 0.000000e+00, float* %7
br label %18
18: ; preds = %39, %13
%19 = load float, float* %7
%20 = fpext float %19 to double
%21 = fcmp olt double %20, 0x4014F1A6C03A5EE8
br i1 %21, label %22, label %44
22: ; preds = %18
%23 = load i32, i32* %6
%24 = load float, float* %7
%25 = call i32 @cos(float %24)
%26 = mul nsw i32 %23, %25
%27 = load i32, i32* %4
%28 = add nsw i32 %26, %27
store i32 %28, i32* %8
%29 = load i32, i32* %6
%30 = load float, float* %7
%31 = call i32 @sin(float %30)
%32 = mul nsw i32 %29, %31
%33 = load i32, i32* %5
%34 = add nsw i32 %32, %33
store i32 %34, i32* %9
%35 = load i32, i32* %8
%36 = load i32, i32* %9
%37 = load i32, i32* %6
%38 = sdiv i32 %37, 3
br label %39
39: ; preds = %22
%40 = load float, float* %7
%41 = fpext float %40 to double
%42 = fadd double %41, 0x3FF0C1523361E587
%43 = fptrunc double %42 to float
store float %43, float* %7
br label %18
44: ; preds = %18
br label %45
45: ; preds = %44, %12
ret void
}

LLVM IR (-O2):
define void @circularLace(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 2
br i1 %4, label %44, label %5
5: ; preds = %3
%6 = tail call i32 @drawCircle(i32 %0, i32 %1, i32 %2)
%7 = udiv i32 %2, 3
%8 = tail call i32 @cos(float 0.000000e+00)
%9 = mul nsw i32 %8, %2
%10 = add nsw i32 %9, %0
%11 = tail call i32 @sin(float 0.000000e+00)
%12 = mul nsw i32 %11, %2
%13 = add nsw i32 %12, %1
tail call void @circularLace(i32 %10, i32 %13, i32 %7)
%14 = tail call i32 @cos(float 0x3FF0C15240000000)
%15 = mul nsw i32 %14, %2
%16 = add nsw i32 %15, %0
%17 = tail call i32 @sin(float 0x3FF0C15240000000)
%18 = mul nsw i32 %17, %2
%19 = add nsw i32 %18, %1
tail call void @circularLace(i32 %16, i32 %19, i32 %7)
%20 = tail call i32 @cos(float 0x4000C15240000000)
%21 = mul nsw i32 %20, %2
%22 = add nsw i32 %21, %0
%23 = tail call i32 @sin(float 0x4000C15240000000)
%24 = mul nsw i32 %23, %2
%25 = add nsw i32 %24, %1
tail call void @circularLace(i32 %22, i32 %25, i32 %7)
%26 = tail call i32 @cos(float 0x400921FB60000000)
%27 = mul nsw i32 %26, %2
%28 = add nsw i32 %27, %0
%29 = tail call i32 @sin(float 0x400921FB60000000)
%30 = mul nsw i32 %29, %2
%31 = add nsw i32 %30, %1
tail call void @circularLace(i32 %28, i32 %31, i32 %7)
%32 = tail call i32 @cos(float 0x4010C15240000000)
%33 = mul nsw i32 %32, %2
%34 = add nsw i32 %33, %0
%35 = tail call i32 @sin(float 0x4010C15240000000)
%36 = mul nsw i32 %35, %2
%37 = add nsw i32 %36, %1
tail call void @circularLace(i32 %34, i32 %37, i32 %7)
%38 = tail call i32 @cos(float 0x4014F1A6C0000000)
%39 = mul nsw i32 %38, %2
%40 = add nsw i32 %39, %0
%41 = tail call i32 @sin(float 0x4014F1A6C0000000)
%42 = mul nsw i32 %41, %2
%43 = add nsw i32 %42, %1
tail call void @circularLace(i32 %40, i32 %43, i32 %7)
br label %44
44: ; preds = %5, %3
ret void
}