#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 int GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_LINE_LOOP;
int cos(int);
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glLineWidth(int);
int /*<<< orphan*/ glVertex3fv(int *);
int sin(int);
void drawstar() {
  GLfloat a = (GLfloat)(1 / (2 - 2 * cos(72 * 3.1415926535898 / 180)));
  GLfloat bx = (GLfloat)(a * cos(18 * 3.1415926535898 / 180));
  GLfloat by = (GLfloat)(a * sin(18 * 3.1415926535898 / 180));
  GLfloat cy = (GLfloat)(-a * cos(18 * 3.1415926535898 / 180));
  GLfloat pointB[3] = {bx * 10000, by * 10000, -5000},
          pointC[3] = {(GLfloat)(0.5 * 10000), cy * 10000, -5000},
          pointD[3] = {(GLfloat)(-0.5 * 10000), cy * 10000, -5000},
          pointE[3] = {-bx * 10000, by * 10000, -5000},
          pointA[3] = {0 * 10000, a * 10000, -5000};
  glLineWidth(4);
  glColor3f(1, 0, 1);
  glBegin(GL_LINE_LOOP);
  glVertex3fv(pointA);
  glVertex3fv(pointC);
  glVertex3fv(pointE);
  glVertex3fv(pointB);
  glVertex3fv(pointD);
  glVertex3fv(pointA);
  glEnd();
}


x86 assembly (clang, -O0):
<drawstar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    $0x1,%edi
call   1080 <cos@plt>
shl    $0x1,%eax
mov    $0x2,%ecx
sub    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x58(%rbp)
xor    %edi,%edi
call   1080 <cos@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x54(%rbp)
xor    %edi,%edi
call   1050 <sin@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x50(%rbp)
xor    %edi,%edi
call   1080 <cos@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
imul   $0x2710,-0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
imul   $0x2710,-0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0xffffec78,-0x14(%rbp)
movl   $0x1388,-0x28(%rbp)
imul   $0x2710,-0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
movl   $0xffffec78,-0x20(%rbp)
movl   $0xffffec78,-0x34(%rbp)
imul   $0x2710,-0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
movl   $0xffffec78,-0x2c(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
imul   $0x2710,%eax,%eax
mov    %eax,-0x40(%rbp)
imul   $0x2710,-0xc(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movl   $0xffffec78,-0x38(%rbp)
movl   $0x0,-0x4c(%rbp)
imul   $0x2710,-0x4(%rbp),%eax
mov    %eax,-0x48(%rbp)
movl   $0xffffec78,-0x44(%rbp)
mov    $0x4,%edi
call   1030 <glLineWidth@plt>
mov    $0x1,%edx
xor    %esi,%esi
mov    %edx,%edi
call   1060 <glColor3f@plt>
mov    0x2d66(%rip),%rax
mov    (%rax),%edi
call   1090 <glBegin@plt>
lea    -0x4c(%rbp),%rdi
call   1070 <glVertex3fv@plt>
lea    -0x28(%rbp),%rdi
call   1070 <glVertex3fv@plt>
lea    -0x40(%rbp),%rdi
call   1070 <glVertex3fv@plt>
lea    -0x1c(%rbp),%rdi
call   1070 <glVertex3fv@plt>
lea    -0x34(%rbp),%rdi
call   1070 <glVertex3fv@plt>
lea    -0x4c(%rbp),%rdi
call   1070 <glVertex3fv@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawstar>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    $0x1,%edi
call   1080 <cos@plt>
add    %eax,%eax
mov    $0x2,%ebx
sub    %eax,%ebx
neg    %eax
xor    %ecx,%ecx
cmp    $0xfffffffd,%eax
cmovb  %ecx,%ebx
xor    %edi,%edi
call   1080 <cos@plt>
mov    %eax,%r14d
imul   %ebx,%r14d
xor    %edi,%edi
call   1050 <sin@plt>
mov    %eax,%ebp
xor    %edi,%edi
call   1080 <cos@plt>
imul   $0x2710,%r14d,%ecx
mov    %ecx,0x34(%rsp)
imul   $0x2710,%ebx,%ecx
imul   %ecx,%ebp
mov    %ebp,0x38(%rsp)
movl   $0xffffec78,0x3c(%rsp)
ff
movl   $0x1388,0x28(%rsp)
imul   %ebx,%eax
imul   $0xffffd8f0,%eax,%eax
mov    %eax,0x2c(%rsp)
movl   $0xffffec78,0x30(%rsp)
ff
movl   $0xffffec78,0x1c(%rsp)
ff
mov    %eax,0x20(%rsp)
movl   $0xffffec78,0x24(%rsp)
ff
imul   $0xffffd8f0,%r14d,%eax
mov    %eax,0x10(%rsp)
mov    %ebp,0x14(%rsp)
movl   $0xffffec78,0x18(%rsp)
ff
movl   $0x0,0x4(%rsp)
mov    %ecx,0x8(%rsp)
movl   $0xffffec78,0xc(%rsp)
ff
mov    $0x4,%edi
call   1030 <glLineWidth@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <glColor3f@plt>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
call   1090 <glBegin@plt>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <glVertex3fv@plt>
lea    0x28(%rsp),%rdi
call   1070 <glVertex3fv@plt>
lea    0x10(%rsp),%rdi
call   1070 <glVertex3fv@plt>
lea    0x34(%rsp),%rdi
call   1070 <glVertex3fv@plt>
lea    0x1c(%rsp),%rdi
call   1070 <glVertex3fv@plt>
mov    %rbx,%rdi
call   1070 <glVertex3fv@plt>
xor    %eax,%eax
call   1040 <glEnd@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@GL_LINE_LOOP = global i32 0
define void @drawstar() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [3 x i32]
%6 = alloca [3 x i32]
%7 = alloca [3 x i32]
%8 = alloca [3 x i32]
%9 = alloca [3 x i32]
%10 = call i32 @cos(i32 1)
%11 = mul nsw i32 2, %10
%12 = sub nsw i32 2, %11
%13 = sdiv i32 1, %12
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = call i32 @cos(i32 0)
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %2
%17 = load i32, i32* %1
%18 = call i32 @sin(i32 0)
%19 = mul nsw i32 %17, %18
store i32 %19, i32* %3
%20 = load i32, i32* %1
%21 = sub nsw i32 0, %20
%22 = call i32 @cos(i32 0)
%23 = mul nsw i32 %21, %22
store i32 %23, i32* %4
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%25 = load i32, i32* %2
%26 = mul nsw i32 %25, 10000
store i32 %26, i32* %24
%27 = getelementptr inbounds i32, i32* %24, i64 1
%28 = load i32, i32* %3
%29 = mul nsw i32 %28, 10000
store i32 %29, i32* %27
%30 = getelementptr inbounds i32, i32* %27, i64 1
store i32 -5000, i32* %30
%31 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 5000, i32* %31
%32 = getelementptr inbounds i32, i32* %31, i64 1
%33 = load i32, i32* %4
%34 = mul nsw i32 %33, 10000
store i32 %34, i32* %32
%35 = getelementptr inbounds i32, i32* %32, i64 1
store i32 -5000, i32* %35
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32 -5000, i32* %36
%37 = getelementptr inbounds i32, i32* %36, i64 1
%38 = load i32, i32* %4
%39 = mul nsw i32 %38, 10000
store i32 %39, i32* %37
%40 = getelementptr inbounds i32, i32* %37, i64 1
store i32 -5000, i32* %40
%41 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%42 = load i32, i32* %2
%43 = sub nsw i32 0, %42
%44 = mul nsw i32 %43, 10000
store i32 %44, i32* %41
%45 = getelementptr inbounds i32, i32* %41, i64 1
%46 = load i32, i32* %3
%47 = mul nsw i32 %46, 10000
store i32 %47, i32* %45
%48 = getelementptr inbounds i32, i32* %45, i64 1
store i32 -5000, i32* %48
%49 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
store i32 0, i32* %49
%50 = getelementptr inbounds i32, i32* %49, i64 1
%51 = load i32, i32* %1
%52 = mul nsw i32 %51, 10000
store i32 %52, i32* %50
%53 = getelementptr inbounds i32, i32* %50, i64 1
store i32 -5000, i32* %53
%54 = call i32 @glLineWidth(i32 4)
%55 = call i32 @glColor3f(i32 1, i32 0, i32 1)
%56 = load i32, i32* @GL_LINE_LOOP
%57 = call i32 @glBegin(i32 %56)
%58 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%59 = call i32 @glVertex3fv(i32* %58)
%60 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%61 = call i32 @glVertex3fv(i32* %60)
%62 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%63 = call i32 @glVertex3fv(i32* %62)
%64 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%65 = call i32 @glVertex3fv(i32* %64)
%66 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%67 = call i32 @glVertex3fv(i32* %66)
%68 = getelementptr inbounds [3 x i32], [3 x i32]* %9, i64 0, i64 0
%69 = call i32 @glVertex3fv(i32* %68)
%70 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_LINE_LOOP = global i32 0
define void @drawstar() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = alloca [3 x i32]
%6 = tail call i32 @cos(i32 1)
%7 = mul i32 %6, -2
%8 = add i32 %7, 2
%9 = icmp ugt i32 %7, -4
%10 = select i1 %9, i32 %8, i32 0
%11 = tail call i32 @cos(i32 0)
%12 = mul nsw i32 %10, %11
%13 = tail call i32 @sin(i32 0)
%14 = tail call i32 @cos(i32 0)
%15 = bitcast [3 x i32]* %1 to i8*
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%17 = mul nsw i32 %12, 10000
store i32 %17, i32* %16
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
%19 = mul nsw i32 %10, 10000
%20 = mul i32 %19, %13
store i32 %20, i32* %18
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
store i32 -5000, i32* %21
%22 = bitcast [3 x i32]* %2 to i8*
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 5000, i32* %23
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%25 = mul i32 %14, -10000
%26 = mul i32 %25, %10
store i32 %26, i32* %24
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
store i32 -5000, i32* %27
%28 = bitcast [3 x i32]* %3 to i8*
%29 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 -5000, i32* %29
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
store i32 %26, i32* %30
%31 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
store i32 -5000, i32* %31
%32 = bitcast [3 x i32]* %4 to i8*
%33 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%34 = mul i32 %12, -10000
store i32 %34, i32* %33
%35 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
store i32 %20, i32* %35
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
store i32 -5000, i32* %36
%37 = bitcast [3 x i32]* %5 to i8*
%38 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 0, i32* %38
%39 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %19, i32* %39
%40 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 -5000, i32* %40
%41 = tail call i32 @glLineWidth(i32 4)
%42 = tail call i32 @glColor3f(i32 1, i32 0, i32 1)
%43 = load i32, i32* @GL_LINE_LOOP
%44 = tail call i32 @glBegin(i32 %43)
%45 = call i32 @glVertex3fv(i32* %38)
%46 = call i32 @glVertex3fv(i32* %23)
%47 = call i32 @glVertex3fv(i32* %33)
%48 = call i32 @glVertex3fv(i32* %16)
%49 = call i32 @glVertex3fv(i32* %29)
%50 = call i32 @glVertex3fv(i32* %38)
%51 = call i32 (...) @glEnd()
ret void
}