#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 /*<<< orphan*/ GL_LINE_LOOP;
int /*<<< orphan*/ GL_POLYGON;
int M_PI;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
void graphic_draw_circle(float xc, float yc, float r, int filled) {
  int i;
  const int SIDES = 50;
  if (filled == 1)
    glBegin(GL_POLYGON);
  else
    glBegin(GL_LINE_LOOP);
  for (i = 0; i < SIDES; i++) {
    float alpha = i * 2. * M_PI / SIDES;
    ;
  }
  glEnd();
}


x86 assembly (clang, -O0):
<graphic_draw_circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
movl   $0x32,-0x18(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    115e <graphic_draw_circle+0x3e>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <glBegin@plt>
jmp    116c <graphic_draw_circle+0x4c>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1040 <glBegin@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x32,-0x14(%rbp)
jge    11c0 <graphic_draw_circle+0xa0>
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xe7e(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    0x2e4b(%rip),%rax
cvtsi2sdl (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe5b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1173 <graphic_draw_circle+0x53>
mov    $0x0,%al
call   1030 <glEnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<graphic_draw_circle>:
push   %rax
cmp    $0x1,%edi
jne    112f <graphic_draw_circle+0xf>
mov    0x2ecb(%rip),%rax
jmp    1136 <graphic_draw_circle+0x16>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1040 <glBegin@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glEnd@plt>

LLVM IR (-O0):
@GL_POLYGON = global i32 0
@GL_LINE_LOOP = global i32 0
@M_PI = global i32 0
define void @graphic_draw_circle(float %0, float %1, float %2, i32 %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store i32 %3, i32* %8
store i32 50, i32* %10
%12 = load i32, i32* %8
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %4
%15 = load i32, i32* @GL_POLYGON
%16 = call i32 @glBegin(i32 %15)
br label %20
17: ; preds = %4
%18 = load i32, i32* @GL_LINE_LOOP
%19 = call i32 @glBegin(i32 %18)
br label %20
20: ; preds = %17, %14
store i32 0, i32* %9
br label %21
21: ; preds = %33, %20
%22 = load i32, i32* %9
%23 = icmp slt i32 %22, 50
br i1 %23, label %24, label %36
24: ; preds = %21
%25 = load i32, i32* %9
%26 = sitofp i32 %25 to double
%27 = fmul double %26, 2.000000e+00
%28 = load i32, i32* @M_PI
%29 = sitofp i32 %28 to double
%30 = fmul double %27, %29
%31 = fdiv double %30, 5.000000e+01
%32 = fptrunc double %31 to float
store float %32, float* %11
br label %33
33: ; preds = %24
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %21
36: ; preds = %21
%37 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_POLYGON = global i32 0
@GL_LINE_LOOP = global i32 0
@M_PI = global i32 0
define void @graphic_draw_circle(float %0, float %1, float %2, i32 %3) {
%5 = icmp eq i32 %3, 1
%6 = load i32, i32* @GL_POLYGON
%7 = load i32, i32* @GL_LINE_LOOP
%8 = select i1 %5, i32 %6, i32 %7
%9 = tail call i32 @glBegin(i32 %8)
%10 = tail call i32 (...) @glEnd()
ret void
}