#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_COLOR_BUFFER_BIT;
int /*<<< orphan*/ GL_TRIANGLES;
int const cos(int);
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glVertex2f(int const, int const);
int const sin(int);
void circle_display(void) {
  const int n = 20;
  const GLfloat R = 0.5f;
  const GLfloat Pi = 3.1415926536f;
  int i;
  glClear(GL_COLOR_BUFFER_BIT);
  glBegin(GL_TRIANGLES);
  for (i = 0; i < n; i++) {
    GLfloat x = 2 * Pi / n * i;
    glVertex2f(R * cos(x), R * sin(x));
  }
  glEnd();
  glFlush();
}


x86 assembly (clang, -O0):
<circle_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x14,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
call   1090 <glBegin@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x14,-0x10(%rbp)
jge    11f0 <circle_display+0x80>
imul   $0x0,-0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1080 <cos@plt>
imul   $0x0,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <sin@plt>
mov    -0x18(%rbp),%edi
imul   $0x0,%eax,%esi
call   1070 <glVertex2f@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b0 <circle_display+0x40>
mov    $0x0,%al
call   1040 <glEnd@plt>
mov    $0x0,%al
call   1060 <glFlush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle_display>:
push   %rax
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1090 <glBegin@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %edi,%edi
call   1080 <cos@plt>
xor    %edi,%edi
call   1050 <sin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <glVertex2f@plt>
xor    %eax,%eax
call   1040 <glEnd@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_TRIANGLES = global i32 0
define void @circle_display() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 20, i32* %1
store i32 0, i32* %2
store i32 3, i32* %3
%6 = load i32, i32* @GL_COLOR_BUFFER_BIT
%7 = call i32 @glClear(i32 %6)
%8 = load i32, i32* @GL_TRIANGLES
%9 = call i32 @glBegin(i32 %8)
store i32 0, i32* %4
br label %10
10: ; preds = %23, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 20
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = load i32, i32* %4
%15 = mul nsw i32 0, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = call i32 @cos(i32 %16)
%18 = mul nsw i32 0, %17
%19 = load i32, i32* %5
%20 = call i32 @sin(i32 %19)
%21 = mul nsw i32 0, %20
%22 = call i32 @glVertex2f(i32 %18, i32 %21)
br label %23
23: ; preds = %13
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %10
26: ; preds = %10
%27 = call i32 (...) @glEnd()
%28 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_TRIANGLES = global i32 0
define void @circle_display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = load i32, i32* @GL_TRIANGLES
%4 = tail call i32 @glBegin(i32 %3)
%5 = tail call i32 @cos(i32 0)
%6 = tail call i32 @sin(i32 0)
%7 = tail call i32 @glVertex2f(i32 0, i32 0)
%8 = tail call i32 @cos(i32 0)
%9 = tail call i32 @sin(i32 0)
%10 = tail call i32 @glVertex2f(i32 0, i32 0)
%11 = tail call i32 @cos(i32 0)
%12 = tail call i32 @sin(i32 0)
%13 = tail call i32 @glVertex2f(i32 0, i32 0)
%14 = tail call i32 @cos(i32 0)
%15 = tail call i32 @sin(i32 0)
%16 = tail call i32 @glVertex2f(i32 0, i32 0)
%17 = tail call i32 @cos(i32 0)
%18 = tail call i32 @sin(i32 0)
%19 = tail call i32 @glVertex2f(i32 0, i32 0)
%20 = tail call i32 @cos(i32 0)
%21 = tail call i32 @sin(i32 0)
%22 = tail call i32 @glVertex2f(i32 0, i32 0)
%23 = tail call i32 @cos(i32 0)
%24 = tail call i32 @sin(i32 0)
%25 = tail call i32 @glVertex2f(i32 0, i32 0)
%26 = tail call i32 @cos(i32 0)
%27 = tail call i32 @sin(i32 0)
%28 = tail call i32 @glVertex2f(i32 0, i32 0)
%29 = tail call i32 @cos(i32 0)
%30 = tail call i32 @sin(i32 0)
%31 = tail call i32 @glVertex2f(i32 0, i32 0)
%32 = tail call i32 @cos(i32 0)
%33 = tail call i32 @sin(i32 0)
%34 = tail call i32 @glVertex2f(i32 0, i32 0)
%35 = tail call i32 @cos(i32 0)
%36 = tail call i32 @sin(i32 0)
%37 = tail call i32 @glVertex2f(i32 0, i32 0)
%38 = tail call i32 @cos(i32 0)
%39 = tail call i32 @sin(i32 0)
%40 = tail call i32 @glVertex2f(i32 0, i32 0)
%41 = tail call i32 @cos(i32 0)
%42 = tail call i32 @sin(i32 0)
%43 = tail call i32 @glVertex2f(i32 0, i32 0)
%44 = tail call i32 @cos(i32 0)
%45 = tail call i32 @sin(i32 0)
%46 = tail call i32 @glVertex2f(i32 0, i32 0)
%47 = tail call i32 @cos(i32 0)
%48 = tail call i32 @sin(i32 0)
%49 = tail call i32 @glVertex2f(i32 0, i32 0)
%50 = tail call i32 @cos(i32 0)
%51 = tail call i32 @sin(i32 0)
%52 = tail call i32 @glVertex2f(i32 0, i32 0)
%53 = tail call i32 @cos(i32 0)
%54 = tail call i32 @sin(i32 0)
%55 = tail call i32 @glVertex2f(i32 0, i32 0)
%56 = tail call i32 @cos(i32 0)
%57 = tail call i32 @sin(i32 0)
%58 = tail call i32 @glVertex2f(i32 0, i32 0)
%59 = tail call i32 @cos(i32 0)
%60 = tail call i32 @sin(i32 0)
%61 = tail call i32 @glVertex2f(i32 0, i32 0)
%62 = tail call i32 @cos(i32 0)
%63 = tail call i32 @sin(i32 0)
%64 = tail call i32 @glVertex2f(i32 0, i32 0)
%65 = tail call i32 (...) @glEnd()
%66 = tail call i32 (...) @glFlush()
ret void
}