#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_STRIP;
float cos(float);
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(float, float, float);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex3f(float, float, float);
float sin(float);
void drawArc(float cx, float cy, float r) {
  float i, j, theta, fi;
  for (j = 0; j < 2.1; j++) {
    fi = 2.0f * 3.14f / 100.0f;
    glColor3f(0.0f, 0.0f, 0.0f);
    glBegin(GL_LINE_STRIP);
    for (i = 21; i < 105; i++) {
      theta = i * 2.0f * 3.14f / 100.0f;
      glVertex3f(cx + r * cos(theta), cy + r * sin(theta), -5.0f);
      glVertex3f(cx + r * cos(theta + fi), cy + r * sin(theta + fi), -5.0f);
    }
    glEnd();
  }
}


x86 assembly (clang, -O0):
<drawArc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe70(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1345 <drawArc+0x1e5>
movss  0xe6a(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1060 <glColor3f@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
call   1080 <glBegin@plt>
movss  0xe3d(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe38(%rip),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1327 <drawArc+0x1c7>
movss  0xe3a(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  0xe29(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe19(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x18(%rbp),%xmm0
call   1070 <cos@plt>
movss  -0x44(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x40(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
movss  -0x3c(%rbp),%xmm1
movss  -0x38(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x34(%rbp),%xmm0
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
movss  0xd94(%rip),%xmm2
call   1030 <glVertex3f@plt>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
call   1070 <cos@plt>
movss  -0x30(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x2c(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
call   1050 <sin@plt>
movss  -0x28(%rbp),%xmm1
movss  -0x24(%rbp),%xmm2
movaps %xmm0,%xmm3
movss  -0x20(%rbp),%xmm0
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
movss  0xd0d(%rip),%xmm2
call   1030 <glVertex3f@plt>
movss  0xcfc(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    11d0 <drawArc+0x70>
mov    $0x0,%al
call   1040 <glEnd@plt>
movss  0xcde(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    117f <drawArc+0x1f>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawArc>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movss  %xmm2,0x8(%rsp)
movss  %xmm1,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1060 <glColor3f@plt>
mov    0x2e5b(%rip),%rbx
mov    (%rbx),%edi
call   1080 <glBegin@plt>
mov    $0x15,%ebp
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
addss  %xmm0,%xmm0
mulss  0xe4d(%rip),%xmm0
divss  0xe49(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
call   1070 <cos@plt>
mulss  0x8(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x4(%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
mulss  0x8(%rsp),%xmm1
addss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
movss  0xe08(%rip),%xmm2
call   1030 <glVertex3f@plt>
movss  0x4(%rsp),%xmm0
addss  0xdf9(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
call   1070 <cos@plt>
mulss  0x8(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x4(%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
mulss  0x8(%rsp),%xmm1
addss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
movss  0xdb0(%rip),%xmm2
call   1030 <glVertex3f@plt>
add    $0x1,%ebp
cmp    $0x69,%ebp
jne    11a0 <drawArc+0x40>
xor    %eax,%eax
call   1040 <glEnd@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1060 <glColor3f@plt>
mov    (%rbx),%edi
call   1080 <glBegin@plt>
mov    $0x15,%ebp
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
addss  %xmm0,%xmm0
mulss  0xd5d(%rip),%xmm0
divss  0xd59(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
call   1070 <cos@plt>
mulss  0x8(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x4(%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
mulss  0x8(%rsp),%xmm1
addss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
movss  0xd18(%rip),%xmm2
call   1030 <glVertex3f@plt>
movss  0x4(%rsp),%xmm0
addss  0xd09(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
call   1070 <cos@plt>
mulss  0x8(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x4(%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
mulss  0x8(%rsp),%xmm1
addss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
movss  0xcc0(%rip),%xmm2
call   1030 <glVertex3f@plt>
add    $0x1,%ebp
cmp    $0x69,%ebp
jne    1290 <drawArc+0x130>
xor    %eax,%eax
call   1040 <glEnd@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1060 <glColor3f@plt>
mov    (%rbx),%edi
call   1080 <glBegin@plt>
mov    $0x15,%ebx
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
addss  %xmm0,%xmm0
mulss  0xc6d(%rip),%xmm0
divss  0xc69(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
call   1070 <cos@plt>
mulss  0x8(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x4(%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
mulss  0x8(%rsp),%xmm1
addss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
movss  0xc28(%rip),%xmm2
call   1030 <glVertex3f@plt>
movss  0x4(%rsp),%xmm0
addss  0xc19(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
call   1070 <cos@plt>
mulss  0x8(%rsp),%xmm0
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x4(%rsp),%xmm0
call   1050 <sin@plt>
movaps %xmm0,%xmm1
mulss  0x8(%rsp),%xmm1
addss  0x14(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
movss  0xbd0(%rip),%xmm2
call   1030 <glVertex3f@plt>
add    $0x1,%ebx
cmp    $0x69,%ebx
jne    1380 <drawArc+0x220>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_LINE_STRIP = global i32 0
define void @drawArc(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
store float 0.000000e+00, float* %8
br label %11
11: ; preds = %58, %3
%12 = load float, float* %8
%13 = fpext float %12 to double
%14 = fcmp olt double %13, 2.100000e+00
br i1 %14, label %15, label %61
15: ; preds = %11
store float 0x3FB013A940000000, float* %10
%16 = call i32 @glColor3f(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%17 = load i32, i32* @GL_LINE_STRIP
%18 = call i32 @glBegin(i32 %17)
store float 2.100000e+01, float* %7
br label %19
19: ; preds = %53, %15
%20 = load float, float* %7
%21 = fcmp olt float %20, 1.050000e+02
br i1 %21, label %22, label %56
22: ; preds = %19
%23 = load float, float* %7
%24 = fmul float %23, 2.000000e+00
%25 = fmul float %24, 0x40091EB860000000
%26 = fdiv float %25, 1.000000e+02
store float %26, float* %9
%27 = load float, float* %4
%28 = load float, float* %6
%29 = load float, float* %9
%30 = call float @cos(float %29)
%31 = call float @llvm.fmuladd.f32(float %28, float %30, float %27)
%32 = load float, float* %5
%33 = load float, float* %6
%34 = load float, float* %9
%35 = call float @sin(float %34)
%36 = call float @llvm.fmuladd.f32(float %33, float %35, float %32)
%37 = call i32 @glVertex3f(float %31, float %36, float -5.000000e+00)
%38 = load float, float* %4
%39 = load float, float* %6
%40 = load float, float* %9
%41 = load float, float* %10
%42 = fadd float %40, %41
%43 = call float @cos(float %42)
%44 = call float @llvm.fmuladd.f32(float %39, float %43, float %38)
%45 = load float, float* %5
%46 = load float, float* %6
%47 = load float, float* %9
%48 = load float, float* %10
%49 = fadd float %47, %48
%50 = call float @sin(float %49)
%51 = call float @llvm.fmuladd.f32(float %46, float %50, float %45)
%52 = call i32 @glVertex3f(float %44, float %51, float -5.000000e+00)
br label %53
53: ; preds = %22
%54 = load float, float* %7
%55 = fadd float %54, 1.000000e+00
store float %55, float* %7
br label %19
56: ; preds = %19
%57 = call i32 (...) @glEnd()
br label %58
58: ; preds = %56
%59 = load float, float* %8
%60 = fadd float %59, 1.000000e+00
store float %60, float* %8
br label %11
61: ; preds = %11
ret void
}

LLVM IR (-O2):
@GL_LINE_STRIP = global i32 0
define void @drawArc(float %0, float %1, float %2) {
%4 = tail call i32 @glColor3f(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%5 = load i32, i32* @GL_LINE_STRIP
%6 = tail call i32 @glBegin(i32 %5)
br label %7
7: ; preds = %3, %7
%8 = phi i32 [ 21, %3 ], [ %24, %7 ]
%9 = sitofp i32 %8 to float
%10 = fmul float %9, 2.000000e+00
%11 = fmul float %10, 0x40091EB860000000
%12 = fdiv float %11, 1.000000e+02
%13 = tail call float @cos(float %12)
%14 = tail call float @llvm.fmuladd.f32(float %2, float %13, float %0)
%15 = tail call float @sin(float %12)
%16 = tail call float @llvm.fmuladd.f32(float %2, float %15, float %1)
%17 = tail call i32 @glVertex3f(float %14, float %16, float -5.000000e+00)
%18 = fadd float %12, 0x3FB013A940000000
%19 = tail call float @cos(float %18)
%20 = tail call float @llvm.fmuladd.f32(float %2, float %19, float %0)
%21 = tail call float @sin(float %18)
%22 = tail call float @llvm.fmuladd.f32(float %2, float %21, float %1)
%23 = tail call i32 @glVertex3f(float %20, float %22, float -5.000000e+00)
%24 = add nuw nsw i32 %8, 1
%25 = icmp eq i32 %24, 105
br i1 %25, label %26, label %7
26: ; preds = %7
%27 = tail call i32 (...) @glEnd()
%28 = tail call i32 @glColor3f(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%29 = load i32, i32* @GL_LINE_STRIP
%30 = tail call i32 @glBegin(i32 %29)
br label %31
31: ; preds = %31, %26
%32 = phi i32 [ 21, %26 ], [ %48, %31 ]
%33 = sitofp i32 %32 to float
%34 = fmul float %33, 2.000000e+00
%35 = fmul float %34, 0x40091EB860000000
%36 = fdiv float %35, 1.000000e+02
%37 = tail call float @cos(float %36)
%38 = tail call float @llvm.fmuladd.f32(float %2, float %37, float %0)
%39 = tail call float @sin(float %36)
%40 = tail call float @llvm.fmuladd.f32(float %2, float %39, float %1)
%41 = tail call i32 @glVertex3f(float %38, float %40, float -5.000000e+00)
%42 = fadd float %36, 0x3FB013A940000000
%43 = tail call float @cos(float %42)
%44 = tail call float @llvm.fmuladd.f32(float %2, float %43, float %0)
%45 = tail call float @sin(float %42)
%46 = tail call float @llvm.fmuladd.f32(float %2, float %45, float %1)
%47 = tail call i32 @glVertex3f(float %44, float %46, float -5.000000e+00)
%48 = add nuw nsw i32 %32, 1
%49 = icmp eq i32 %48, 105
br i1 %49, label %50, label %31
50: ; preds = %31
%51 = tail call i32 (...) @glEnd()
%52 = tail call i32 @glColor3f(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%53 = load i32, i32* @GL_LINE_STRIP
%54 = tail call i32 @glBegin(i32 %53)
br label %55
55: ; preds = %55, %50
%56 = phi i32 [ 21, %50 ], [ %72, %55 ]
%57 = sitofp i32 %56 to float
%58 = fmul float %57, 2.000000e+00
%59 = fmul float %58, 0x40091EB860000000
%60 = fdiv float %59, 1.000000e+02
%61 = tail call float @cos(float %60)
%62 = tail call float @llvm.fmuladd.f32(float %2, float %61, float %0)
%63 = tail call float @sin(float %60)
%64 = tail call float @llvm.fmuladd.f32(float %2, float %63, float %1)
%65 = tail call i32 @glVertex3f(float %62, float %64, float -5.000000e+00)
%66 = fadd float %60, 0x3FB013A940000000
%67 = tail call float @cos(float %66)
%68 = tail call float @llvm.fmuladd.f32(float %2, float %67, float %0)
%69 = tail call float @sin(float %66)
%70 = tail call float @llvm.fmuladd.f32(float %2, float %69, float %1)
%71 = tail call i32 @glVertex3f(float %68, float %70, float -5.000000e+00)
%72 = add nuw nsw i32 %56, 1
%73 = icmp eq i32 %72, 105
br i1 %73, label %74, label %55
74: ; preds = %55
%75 = tail call i32 (...) @glEnd()
ret void
}