#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 char chtype;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
scalar_t__ abs(int);
int /*<<< orphan*/ move(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, char);
int nearbyint(double);
int pow(double, double);
double sqrt(int);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void draw_O(WINDOW *board, int y_position, int x_position) {
  chtype ch = 'O';
  signed int delta_y, delta_x;
  double ddel_y;
  for (delta_x = 1 - (16 / 2); delta_x < (16 / 2); ++delta_x) {
    ddel_y = (sqrt(pow(((8 / 2) - 1), 2) *
                   (1 - (pow(((double)abs(delta_x)) / ((16 / 2) - 1), 1.5)))));
    delta_y = nearbyint(ddel_y);
    mvwaddch(board, y_position + delta_y, x_position + delta_x, ch);
    ddel_y = -(sqrt(pow(((8 / 2) - 1), 2) *
                    (1 - (pow(((double)abs(delta_x)) / ((16 / 2) - 1), 1.5)))));
    delta_y = nearbyint(ddel_y);
    mvwaddch(board, y_position + delta_y, x_position + delta_x, ch);
  }
  move(0, 0);
  wrefresh(board);
}


x86 assembly (clang, -O0):
<draw_O>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movb   $0x4f,-0x11(%rbp)
movl   $0xfffffff9,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    12b6 <draw_O+0x146>
movsd  0xe71(%rip),%xmm0
movsd  0xe71(%rip),%xmm1
call   1060 <pow@plt>
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <abs@plt>
cvtsi2sd %rax,%xmm0
movsd  0xe44(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe30(%rip),%xmm1
call   1060 <pow@plt>
mov    -0x30(%rbp),%edi
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
imul   %eax,%edi
call   1070 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <nearbyint@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
add    -0x1c(%rbp),%edx
movsbl -0x11(%rbp),%ecx
call   1080 <mvwaddch@plt>
movsd  0xdf4(%rip),%xmm0
movsd  0xdf4(%rip),%xmm1
call   1060 <pow@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <abs@plt>
cvtsi2sd %rax,%xmm0
movsd  0xdc7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xdb3(%rip),%xmm1
call   1060 <pow@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
imul   %eax,%edi
call   1070 <sqrt@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1050 <nearbyint@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
add    -0x1c(%rbp),%edx
movsbl -0x11(%rbp),%ecx
call   1080 <mvwaddch@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    118d <draw_O+0x1d>
xor    %esi,%esi
mov    %esi,%edi
call   1090 <move@plt>
mov    -0x8(%rbp),%rdi
call   1040 <wrefresh@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_O>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
mov    $0xfffffff9,%ebx
nopl   0x0(%rax)
movsd  0xe68(%rip),%xmm0
movsd  0xe68(%rip),%xmm1
call   1060 <pow@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <abs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xe52(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe4e(%rip),%xmm1
call   1060 <pow@plt>
mov    $0x1,%edi
sub    %eax,%edi
imul   %ebp,%edi
call   1070 <sqrt@plt>
call   1050 <nearbyint@plt>
lea    (%rax,%r12,1),%esi
lea    (%r14,%rbx,1),%r13d
mov    %r15,%rdi
mov    %r13d,%edx
mov    $0x4f,%ecx
call   1080 <mvwaddch@plt>
movsd  0xdfd(%rip),%xmm0
movsd  0xdfd(%rip),%xmm1
call   1060 <pow@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <abs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
divsd  0xde7(%rip),%xmm0
movsd  0xde7(%rip),%xmm1
call   1060 <pow@plt>
mov    $0x1,%edi
sub    %eax,%edi
imul   %ebp,%edi
call   1070 <sqrt@plt>
xorpd  0xdd3(%rip),%xmm0
call   1050 <nearbyint@plt>
lea    (%rax,%r12,1),%esi
mov    %r15,%rdi
mov    %r13d,%edx
mov    $0x4f,%ecx
call   1080 <mvwaddch@plt>
add    $0x1,%ebx
cmp    $0x8,%ebx
jne    1190 <draw_O+0x20>
xor    %edi,%edi
xor    %esi,%esi
call   1090 <move@plt>
mov    %r15,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <wrefresh@plt>

LLVM IR (-O0):
define void @draw_O(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i8 79, i8* %7
store i32 -7, i32* %9
br label %11
11: ; preds = %56, %3
%12 = load i32, i32* %9
%13 = icmp slt i32 %12, 8
br i1 %13, label %14, label %59
14: ; preds = %11
%15 = call i32 @pow(double 3.000000e+00, double 2.000000e+00)
%16 = load i32, i32* %9
%17 = call i64 @abs(i32 %16)
%18 = sitofp i64 %17 to double
%19 = fdiv double %18, 7.000000e+00
%20 = call i32 @pow(double %19, double 1.500000e+00)
%21 = sub nsw i32 1, %20
%22 = mul nsw i32 %15, %21
%23 = call double @sqrt(i32 %22)
store double %23, double* %10
%24 = load double, double* %10
%25 = call i32 @nearbyint(double %24)
store i32 %25, i32* %8
%26 = load i32*, i32** %4
%27 = load i32, i32* %5
%28 = load i32, i32* %8
%29 = add nsw i32 %27, %28
%30 = load i32, i32* %6
%31 = load i32, i32* %9
%32 = add nsw i32 %30, %31
%33 = load i8, i8* %7
%34 = call i32 @mvwaddch(i32* %26, i32 %29, i32 %32, i8 signext %33)
%35 = call i32 @pow(double 3.000000e+00, double 2.000000e+00)
%36 = load i32, i32* %9
%37 = call i64 @abs(i32 %36)
%38 = sitofp i64 %37 to double
%39 = fdiv double %38, 7.000000e+00
%40 = call i32 @pow(double %39, double 1.500000e+00)
%41 = sub nsw i32 1, %40
%42 = mul nsw i32 %35, %41
%43 = call double @sqrt(i32 %42)
%44 = fneg double %43
store double %44, double* %10
%45 = load double, double* %10
%46 = call i32 @nearbyint(double %45)
store i32 %46, i32* %8
%47 = load i32*, i32** %4
%48 = load i32, i32* %5
%49 = load i32, i32* %8
%50 = add nsw i32 %48, %49
%51 = load i32, i32* %6
%52 = load i32, i32* %9
%53 = add nsw i32 %51, %52
%54 = load i8, i8* %7
%55 = call i32 @mvwaddch(i32* %47, i32 %50, i32 %53, i8 signext %54)
br label %56
56: ; preds = %14
%57 = load i32, i32* %9
%58 = add nsw i32 %57, 1
store i32 %58, i32* %9
br label %11
59: ; preds = %11
%60 = call i32 @move(i32 0, i32 0)
%61 = load i32*, i32** %4
%62 = call i32 @wrefresh(i32* %61)
ret void
}

LLVM IR (-O2):
define void @draw_O(i32* %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %3, %4
%5 = phi i32 [ -7, %3 ], [ %30, %4 ]
%6 = tail call i32 @pow(double 3.000000e+00, double 2.000000e+00)
%7 = tail call i64 @abs(i32 %5)
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 7.000000e+00
%10 = tail call i32 @pow(double %9, double 1.500000e+00)
%11 = sub nsw i32 1, %10
%12 = mul nsw i32 %11, %6
%13 = tail call double @sqrt(i32 %12)
%14 = tail call i32 @nearbyint(double %13)
%15 = add nsw i32 %14, %1
%16 = add nsw i32 %5, %2
%17 = tail call i32 @mvwaddch(i32* %0, i32 %15, i32 %16, i8 signext 79)
%18 = tail call i32 @pow(double 3.000000e+00, double 2.000000e+00)
%19 = tail call i64 @abs(i32 %5)
%20 = sitofp i64 %19 to double
%21 = fdiv double %20, 7.000000e+00
%22 = tail call i32 @pow(double %21, double 1.500000e+00)
%23 = sub nsw i32 1, %22
%24 = mul nsw i32 %23, %18
%25 = tail call double @sqrt(i32 %24)
%26 = fneg double %25
%27 = tail call i32 @nearbyint(double %26)
%28 = add nsw i32 %27, %1
%29 = tail call i32 @mvwaddch(i32* %0, i32 %28, i32 %16, i8 signext 79)
%30 = add nsw i32 %5, 1
%31 = icmp eq i32 %30, 8
br i1 %31, label %32, label %4
32: ; preds = %4
%33 = tail call i32 @move(i32 0, i32 0)
%34 = tail call i32 @wrefresh(i32* %0)
ret void
}