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


x86 assembly (clang, -O0):
<snowflake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1160 <snowflake+0x20>
jmp    1215 <snowflake+0xd5>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1060 <drawFlake@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 <snowflake+0xd0>
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
movss  -0x10(%rbp),%xmm0
call   1050 <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   1040 <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   1030 <snowflake@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe0a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    117e <snowflake+0x3e>
jmp    1215 <snowflake+0xd5>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @snowflake(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 sle i32 %10, 1
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 @drawFlake(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, 0x401921FB4D12D84A
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, 0x3FF41B2F70DBE03B
%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 @snowflake(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 2
br i1 %4, label %38, label %5
5: ; preds = %3
%6 = tail call i32 @drawFlake(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 @snowflake(i32 %10, i32 %13, i32 %7)
%14 = tail call i32 @cos(float 0x3FF41B2F80000000)
%15 = mul nsw i32 %14, %2
%16 = add nsw i32 %15, %0
%17 = tail call i32 @sin(float 0x3FF41B2F80000000)
%18 = mul nsw i32 %17, %2
%19 = add nsw i32 %18, %1
tail call void @snowflake(i32 %16, i32 %19, i32 %7)
%20 = tail call i32 @cos(float 0x40041B2F80000000)
%21 = mul nsw i32 %20, %2
%22 = add nsw i32 %21, %0
%23 = tail call i32 @sin(float 0x40041B2F80000000)
%24 = mul nsw i32 %23, %2
%25 = add nsw i32 %24, %1
tail call void @snowflake(i32 %22, i32 %25, i32 %7)
%26 = tail call i32 @cos(float 0x400E28C740000000)
%27 = mul nsw i32 %26, %2
%28 = add nsw i32 %27, %0
%29 = tail call i32 @sin(float 0x400E28C740000000)
%30 = mul nsw i32 %29, %2
%31 = add nsw i32 %30, %1
tail call void @snowflake(i32 %28, i32 %31, i32 %7)
%32 = tail call i32 @cos(float 0x40141B2F80000000)
%33 = mul nsw i32 %32, %2
%34 = add nsw i32 %33, %0
%35 = tail call i32 @sin(float 0x40141B2F80000000)
%36 = mul nsw i32 %35, %2
%37 = add nsw i32 %36, %1
tail call void @snowflake(i32 %34, i32 %37, i32 %7)
br label %38
38: ; preds = %5, %3
ret void
}