#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 */
typedef double GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_LINES;
double cos(int);
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glColor4f(int, double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glLineWidth(double);
int /*<<< orphan*/ glVertex3f(double, double, double);
int rand();
double randomNumber(double);
double sin(int);
void drawCorona() {
  GLfloat x, y;
  GLfloat rad = 0.95;
  int i = 0;
  glLineWidth(2.5);
  glBegin(GL_LINES);
  glColor3f(1.0, 1.0, 1.0);
  x = rad * cos(359 * 3.14159 / 180.0);
  y = rad * sin(359 * 3.14159 / 180.0);
  for (i = 0; i < 360; i++) {
    if (rand() % 2 == 1) {
      glColor4f(1, 1, 0, 1.0);
      glVertex3f(x, y, 0.0);
      x = (GLfloat)rad * cos(i * 3.14159 / 180.0);
      y = (GLfloat)rad * sin(i * 3.14159 / 180.0);
      glColor4f(1, 0.6, 0.2, 0.1);
      glVertex3f(x * (1.9 - randomNumber(0.15)), y * (1.9 - randomNumber(0.15)),
                 0.0);
    }
  }
  glEnd();
  glLineWidth(1.0);
}


x86 assembly (clang, -O0):
<drawCorona>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  0xe60(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movsd  0xe44(%rip),%xmm0
call   1030 <glLineWidth@plt>
mov    0x2e20(%rip),%rax
mov    (%rax),%edi
call   10b0 <glBegin@plt>
movsd  0xe21(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1090 <glColor3f@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    $0x6,%edi
call   10a0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x6,%edi
call   1080 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x168,-0x1c(%rbp)
jge    13b1 <drawCorona+0x211>
mov    $0x0,%al
call   10c0 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    139e <drawCorona+0x1fe>
mov    $0x1,%edi
movsd  0xd93(%rip),%xmm2
xorps  %xmm1,%xmm1
movaps %xmm2,%xmm0
call   1040 <glColor4f@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
xorps  %xmm2,%xmm2
call   1050 <glVertex3f@plt>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  0xda7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd93(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   10a0 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  0xd66(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd52(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1080 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x1,%edi
movsd  0xd0f(%rip),%xmm0
movsd  0xd0f(%rip),%xmm1
movsd  0xd0f(%rip),%xmm2
call   1040 <glColor4f@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xce0(%rip),%xmm0
call   1070 <randomNumber@plt>
movaps %xmm0,%xmm2
movsd  -0x48(%rbp),%xmm0
movsd  0xcc3(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xcac(%rip),%xmm0
call   1070 <randomNumber@plt>
movsd  -0x40(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x38(%rbp),%xmm0
movsd  0xc8a(%rip),%xmm2
subsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
xorps  %xmm2,%xmm2
call   1050 <glVertex3f@plt>
jmp    13a3 <drawCorona+0x203>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    123b <drawCorona+0x9b>
mov    $0x0,%al
call   1060 <glEnd@plt>
movsd  0xc40(%rip),%xmm0
call   1030 <glLineWidth@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawCorona>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
movsd  0xe52(%rip),%xmm0
call   1030 <glLineWidth@plt>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
call   10b0 <glBegin@plt>
movsd  0xe3f(%rip),%xmm0
movapd %xmm0,%xmm1
movapd %xmm0,%xmm2
call   1090 <glColor3f@plt>
mov    $0x6,%edi
call   10a0 <cos@plt>
mulsd  0xe28(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x6,%edi
call   1080 <sin@plt>
mulsd  0xe10(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
xorpd  %xmm1,%xmm1
mov    $0x168,%ebp
jmp    1325 <drawCorona+0x185>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorpd  %xmm1,%xmm1
mov    $0x1,%edi
movsd  0xdd7(%rip),%xmm0
movaps %xmm0,%xmm2
call   1040 <glColor4f@plt>
xorps  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1050 <glVertex3f@plt>
movsd  0x18(%rsp),%xmm0
mulsd  0xdbd(%rip),%xmm0
divsd  0xdbd(%rip),%xmm0
cvttsd2si %xmm0,%ebx
mov    %ebx,%edi
call   10a0 <cos@plt>
movapd %xmm0,%xmm1
movsd  0xd96(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    %ebx,%edi
call   1080 <sin@plt>
mulsd  0xd7d(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%edi
movsd  0xd82(%rip),%xmm0
movsd  0xd82(%rip),%xmm1
movsd  0xd82(%rip),%xmm2
call   1040 <glColor4f@plt>
movsd  0xd7d(%rip),%xmm0
call   1070 <randomNumber@plt>
movsd  0xd78(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0xd58(%rip),%xmm0
call   1070 <randomNumber@plt>
movsd  0xd53(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm1
xorpd  %xmm2,%xmm2
movsd  0x20(%rsp),%xmm0
call   1050 <glVertex3f@plt>
movsd  0x18(%rsp),%xmm1
movsd  0xcec(%rip),%xmm0
addsd  %xmm0,%xmm1
add    $0xffffffff,%ebp
je     1357 <drawCorona+0x1b7>
movsd  %xmm1,0x18(%rsp)
xor    %eax,%eax
call   10c0 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
cmp    $0x1,%eax
je     1220 <drawCorona+0x80>
movsd  0xcb9(%rip),%xmm0
movsd  0x18(%rsp),%xmm1
jmp    131c <drawCorona+0x17c>
xor    %eax,%eax
call   1060 <glEnd@plt>
movsd  0xca2(%rip),%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <glLineWidth@plt>

LLVM IR (-O0):
@GL_LINES = global i32 0
define void @drawCorona() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double 0x3FEE666666666666, double* %3
store i32 0, i32* %4
%5 = call i32 @glLineWidth(double 2.500000e+00)
%6 = load i32, i32* @GL_LINES
%7 = call i32 @glBegin(i32 %6)
%8 = call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%9 = load double, double* %3
%10 = call double @cos(i32 6)
%11 = fmul double %9, %10
store double %11, double* %1
%12 = load double, double* %3
%13 = call double @sin(i32 6)
%14 = fmul double %12, %13
store double %14, double* %2
store i32 0, i32* %4
br label %15
15: ; preds = %54, %0
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 360
br i1 %17, label %18, label %57
18: ; preds = %15
%19 = call i32 (...) @rand()
%20 = srem i32 %19, 2
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %53
22: ; preds = %18
%23 = call i32 @glColor4f(i32 1, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00)
%24 = load double, double* %1
%25 = load double, double* %2
%26 = call i32 @glVertex3f(double %24, double %25, double 0.000000e+00)
%27 = load double, double* %3
%28 = load i32, i32* %4
%29 = sitofp i32 %28 to double
%30 = fmul double %29, 3.141590e+00
%31 = fdiv double %30, 1.800000e+02
%32 = fptosi double %31 to i32
%33 = call double @cos(i32 %32)
%34 = fmul double %27, %33
store double %34, double* %1
%35 = load double, double* %3
%36 = load i32, i32* %4
%37 = sitofp i32 %36 to double
%38 = fmul double %37, 3.141590e+00
%39 = fdiv double %38, 1.800000e+02
%40 = fptosi double %39 to i32
%41 = call double @sin(i32 %40)
%42 = fmul double %35, %41
store double %42, double* %2
%43 = call i32 @glColor4f(i32 1, double 6.000000e-01, double 2.000000e-01, double 1.000000e-01)
%44 = load double, double* %1
%45 = call double @randomNumber(double 1.500000e-01)
%46 = fsub double 1.900000e+00, %45
%47 = fmul double %44, %46
%48 = load double, double* %2
%49 = call double @randomNumber(double 1.500000e-01)
%50 = fsub double 1.900000e+00, %49
%51 = fmul double %48, %50
%52 = call i32 @glVertex3f(double %47, double %51, double 0.000000e+00)
br label %53
53: ; preds = %22, %18
br label %54
54: ; preds = %53
%55 = load i32, i32* %4
%56 = add nsw i32 %55, 1
store i32 %56, i32* %4
br label %15
57: ; preds = %15
%58 = call i32 (...) @glEnd()
%59 = call i32 @glLineWidth(double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_LINES = global i32 0
define void @drawCorona() {
%1 = tail call i32 @glLineWidth(double 2.500000e+00)
%2 = load i32, i32* @GL_LINES
%3 = tail call i32 @glBegin(i32 %2)
%4 = tail call i32 @glColor3f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%5 = tail call double @cos(i32 6)
%6 = fmul double %5, 0x3FEE666666666666
%7 = tail call double @sin(i32 6)
%8 = fmul double %7, 0x3FEE666666666666
br label %9
9: ; preds = %0, %35
%10 = phi i32 [ 0, %0 ], [ %38, %35 ]
%11 = phi double [ %6, %0 ], [ %37, %35 ]
%12 = phi double [ %8, %0 ], [ %36, %35 ]
%13 = tail call i32 (...) @rand()
%14 = srem i32 %13, 2
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %35
16: ; preds = %9
%17 = tail call i32 @glColor4f(i32 1, double 1.000000e+00, double 0.000000e+00, double 1.000000e+00)
%18 = tail call i32 @glVertex3f(double %11, double %12, double 0.000000e+00)
%19 = sitofp i32 %10 to double
%20 = fmul double %19, 3.141590e+00
%21 = fdiv double %20, 1.800000e+02
%22 = fptosi double %21 to i32
%23 = tail call double @cos(i32 %22)
%24 = fmul double %23, 0x3FEE666666666666
%25 = tail call double @sin(i32 %22)
%26 = fmul double %25, 0x3FEE666666666666
%27 = tail call i32 @glColor4f(i32 1, double 6.000000e-01, double 2.000000e-01, double 1.000000e-01)
%28 = tail call double @randomNumber(double 1.500000e-01)
%29 = fsub double 1.900000e+00, %28
%30 = fmul double %24, %29
%31 = tail call double @randomNumber(double 1.500000e-01)
%32 = fsub double 1.900000e+00, %31
%33 = fmul double %26, %32
%34 = tail call i32 @glVertex3f(double %30, double %33, double 0.000000e+00)
br label %35
35: ; preds = %9, %16
%36 = phi double [ %26, %16 ], [ %12, %9 ]
%37 = phi double [ %24, %16 ], [ %11, %9 ]
%38 = add nuw nsw i32 %10, 1
%39 = icmp eq i32 %38, 360
br i1 %39, label %40, label %9
40: ; preds = %35
%41 = tail call i32 (...) @glEnd()
%42 = tail call i32 @glLineWidth(double 1.000000e+00)
ret void
}