#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;
int M_PI;
double cos(double);
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glTranslatef(double, double, double);
int /*<<< orphan*/ glVertex2f(double, double);
double sin(double);
void drawSearch(void) {
  int i;
  double rs = 0.15;
  double phi;
  glPushMatrix();
  glTranslatef(0.34, 0.1, 0.0);
  glColor3f(0.0, 1.0, 1.0);
  glBegin(GL_LINE_STRIP);
  for (i = 0; i <= 2 * 360; i++) {
    phi = (i / 2.0) * M_PI / 180.0;
    glVertex2f(rs * cos(phi), rs * sin(phi));
  }
  glEnd();
  glPopMatrix();
  return;
}


x86 assembly (clang, -O0):
<drawSearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  0xe78(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1070 <glPushMatrix@plt>
movsd  0xe54(%rip),%xmm0
movsd  0xe54(%rip),%xmm1
xorps  %xmm2,%xmm2
call   10a0 <glTranslatef@plt>
xorps  %xmm0,%xmm0
movsd  0xe31(%rip),%xmm2
movaps %xmm2,%xmm1
call   1060 <glColor3f@plt>
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
call   10b0 <glBegin@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x2d0,-0x4(%rbp)
jg     1287 <drawSearch+0xf7>
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe22(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    0x2dd7(%rip),%rax
cvtsi2sdl (%rax),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdff(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1090 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
call   1080 <glVertex2f@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11ec <drawSearch+0x5c>
mov    $0x0,%al
call   1030 <glEnd@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawSearch>:
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1070 <glPushMatrix@plt>
movsd  0xe5a(%rip),%xmm0
movsd  0xe5a(%rip),%xmm1
xorps  %xmm2,%xmm2
movsd  %xmm2,(%rsp)
xorps  %xmm2,%xmm2
call   10a0 <glTranslatef@plt>
movsd  0xe4a(%rip),%xmm1
xorpd  %xmm0,%xmm0
movapd %xmm1,%xmm2
call   1060 <glColor3f@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
call   10b0 <glBegin@plt>
mov    $0x2d1,%ebx
mov    0x2dfb(%rip),%r14
nopl   (%rax)
movsd  (%rsp),%xmm1
mulsd  0xe1b(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl (%r14),%xmm0
mulsd  %xmm1,%xmm0
divsd  0xe0f(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
call   1090 <cos@plt>
movapd %xmm0,%xmm1
movsd  0xe00(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1050 <sin@plt>
movapd %xmm0,%xmm1
mulsd  0xddf(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
call   1080 <glVertex2f@plt>
movsd  (%rsp),%xmm0
addsd  0xdaf(%rip),%xmm0
movsd  %xmm0,(%rsp)
add    $0xffffffff,%ebx
jne    11f0 <drawSearch+0x60>
xor    %eax,%eax
call   1030 <glEnd@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
@GL_LINE_STRIP = global i32 0
@M_PI = global i32 0
define void @drawSearch() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store double 1.500000e-01, double* %2
%4 = call i32 (...) @glPushMatrix()
%5 = call i32 @glTranslatef(double 3.400000e-01, double 1.000000e-01, double 0.000000e+00)
%6 = call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 1.000000e+00)
%7 = load i32, i32* @GL_LINE_STRIP
%8 = call i32 @glBegin(i32 %7)
store i32 0, i32* %1
br label %9
9: ; preds = %29, %0
%10 = load i32, i32* %1
%11 = icmp sle i32 %10, 720
br i1 %11, label %12, label %32
12: ; preds = %9
%13 = load i32, i32* %1
%14 = sitofp i32 %13 to double
%15 = fdiv double %14, 2.000000e+00
%16 = load i32, i32* @M_PI
%17 = sitofp i32 %16 to double
%18 = fmul double %15, %17
%19 = fdiv double %18, 1.800000e+02
store double %19, double* %3
%20 = load double, double* %2
%21 = load double, double* %3
%22 = call double @cos(double %21)
%23 = fmul double %20, %22
%24 = load double, double* %2
%25 = load double, double* %3
%26 = call double @sin(double %25)
%27 = fmul double %24, %26
%28 = call i32 @glVertex2f(double %23, double %27)
br label %29
29: ; preds = %12
%30 = load i32, i32* %1
%31 = add nsw i32 %30, 1
store i32 %31, i32* %1
br label %9
32: ; preds = %9
%33 = call i32 (...) @glEnd()
%34 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
@GL_LINE_STRIP = global i32 0
@M_PI = global i32 0
define void @drawSearch() {
%1 = tail call i32 (...) @glPushMatrix()
%2 = tail call i32 @glTranslatef(double 3.400000e-01, double 1.000000e-01, double 0.000000e+00)
%3 = tail call i32 @glColor3f(double 0.000000e+00, double 1.000000e+00, double 1.000000e+00)
%4 = load i32, i32* @GL_LINE_STRIP
%5 = tail call i32 @glBegin(i32 %4)
br label %6
6: ; preds = %0, %6
%7 = phi i32 [ 0, %0 ], [ %19, %6 ]
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 5.000000e-01
%10 = load i32, i32* @M_PI
%11 = sitofp i32 %10 to double
%12 = fmul double %9, %11
%13 = fdiv double %12, 1.800000e+02
%14 = tail call double @cos(double %13)
%15 = fmul double %14, 1.500000e-01
%16 = tail call double @sin(double %13)
%17 = fmul double %16, 1.500000e-01
%18 = tail call i32 @glVertex2f(double %15, double %17)
%19 = add nuw nsw i32 %7, 1
%20 = icmp eq i32 %19, 721
br i1 %20, label %21, label %6
21: ; preds = %6
%22 = tail call i32 (...) @glEnd()
%23 = tail call i32 (...) @glPopMatrix()
ret void
}