#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*/ draw_point(int, int, char);
int icos(int, int);
int isin(int, int);
void draw_circle(int hand_max, int sYcen, int sXcen) {
  int x, y, r;
  char c;
  for (r = 0; r < 60; r++) {
    x = icos(r, hand_max) * 2 + sXcen;
    y = isin(r, hand_max) + sYcen;
    switch (r) {
    case 0:
    case 5:
    case 10:
    case 15:
    case 20:
    case 25:
    case 30:
    case 35:
    case 40:
    case 45:
    case 50:
    case 55:
      c = 'o';
      break;
    default:
      c = '.';
      break;
    }
    draw_point(x, y, c);
  }
}


x86 assembly (clang, -O0):
<draw_circle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3c,-0x18(%rbp)
jge    1275 <draw_circle+0x145>
mov    -0x18(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <icos@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
mov    %edx,%eax
lea    (%rax,%rcx,2),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <isin@plt>
mov    -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
test   %eax,%eax
je     124b <draw_circle+0x11b>
jmp    1190 <draw_circle+0x60>
mov    -0x20(%rbp),%eax
sub    $0x5,%eax
je     124b <draw_circle+0x11b>
jmp    11a1 <draw_circle+0x71>
mov    -0x20(%rbp),%eax
sub    $0xa,%eax
je     124b <draw_circle+0x11b>
jmp    11b2 <draw_circle+0x82>
mov    -0x20(%rbp),%eax
sub    $0xf,%eax
je     124b <draw_circle+0x11b>
jmp    11c3 <draw_circle+0x93>
mov    -0x20(%rbp),%eax
sub    $0x14,%eax
je     124b <draw_circle+0x11b>
jmp    11d4 <draw_circle+0xa4>
mov    -0x20(%rbp),%eax
sub    $0x19,%eax
je     124b <draw_circle+0x11b>
jmp    11e5 <draw_circle+0xb5>
mov    -0x20(%rbp),%eax
sub    $0x1e,%eax
je     124b <draw_circle+0x11b>
jmp    11f6 <draw_circle+0xc6>
mov    -0x20(%rbp),%eax
sub    $0x23,%eax
je     124b <draw_circle+0x11b>
jmp    1207 <draw_circle+0xd7>
mov    -0x20(%rbp),%eax
sub    $0x28,%eax
je     124b <draw_circle+0x11b>
jmp    1218 <draw_circle+0xe8>
mov    -0x20(%rbp),%eax
sub    $0x2d,%eax
je     124b <draw_circle+0x11b>
jmp    1229 <draw_circle+0xf9>
mov    -0x20(%rbp),%eax
sub    $0x32,%eax
je     124b <draw_circle+0x11b>
jmp    123a <draw_circle+0x10a>
mov    -0x20(%rbp),%eax
sub    $0x37,%eax
jne    1254 <draw_circle+0x124>
jmp    124b <draw_circle+0x11b>
movb   $0x6f,-0x19(%rbp)
jmp    1258 <draw_circle+0x128>
movb   $0x2e,-0x19(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
movsbl -0x19(%rbp),%edx
call   1030 <draw_point@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1148 <draw_circle+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_circle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%r12d
xor    %ebp,%ebp
movabs $0x84210842108421,%r13
jmp    1176 <draw_circle+0x46>
mov    $0x2e,%cl
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%r14,%rbx,2),%edi
movzbl %cl,%edx
mov    %eax,%esi
call   1030 <draw_point@plt>
add    $0x1,%ebp
cmp    $0x3c,%ebp
je     11a0 <draw_circle+0x70>
mov    %ebp,%edi
mov    %r12d,%esi
call   1040 <icos@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r12d,%esi
call   1050 <isin@plt>
add    %r15d,%eax
cmp    $0x37,%ebp
ja     1152 <draw_circle+0x22>
mov    $0x6f,%cl
mov    %ebp,%edx
bt     %rdx,%r13
jb     1160 <draw_circle+0x30>
jmp    1152 <draw_circle+0x22>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @draw_circle(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %9
br label %11
11: ; preds = %34, %3
%12 = load i32, i32* %9
%13 = icmp slt i32 %12, 60
br i1 %13, label %14, label %37
14: ; preds = %11
%15 = load i32, i32* %9
%16 = load i32, i32* %4
%17 = call i32 @icos(i32 %15, i32 %16)
%18 = mul nsw i32 %17, 2
%19 = load i32, i32* %6
%20 = add nsw i32 %18, %19
store i32 %20, i32* %7
%21 = load i32, i32* %9
%22 = load i32, i32* %4
%23 = call i32 @isin(i32 %21, i32 %22)
%24 = load i32, i32* %5
%25 = add nsw i32 %23, %24
store i32 %25, i32* %8
%26 = load i32, i32* %9
switch i32 %26, label %28 [
i32 0, label %27
i32 5, label %27
i32 10, label %27
i32 15, label %27
i32 20, label %27
i32 25, label %27
i32 30, label %27
i32 35, label %27
i32 40, label %27
i32 45, label %27
i32 50, label %27
i32 55, label %27
]
27: ; preds = %14, %14, %14, %14, %14, %14, %14, %14, %14, %14, %14, %14
store i8 111, i8* %10
br label %29
28: ; preds = %14
store i8 46, i8* %10
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %7
%31 = load i32, i32* %8
%32 = load i8, i8* %10
%33 = call i32 @draw_point(i32 %30, i32 %31, i8 signext %32)
br label %34
34: ; preds = %29
%35 = load i32, i32* %9
%36 = add nsw i32 %35, 1
store i32 %36, i32* %9
br label %11
37: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @draw_circle(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %3, %12
%5 = phi i32 [ 0, %3 ], [ %15, %12 ]
%6 = tail call i32 @icos(i32 %5, i32 %0)
%7 = shl nsw i32 %6, 1
%8 = add nsw i32 %7, %2
%9 = tail call i32 @isin(i32 %5, i32 %0)
%10 = add nsw i32 %9, %1
switch i32 %5, label %11 [
i32 0, label %12
i32 5, label %12
i32 10, label %12
i32 15, label %12
i32 20, label %12
i32 25, label %12
i32 30, label %12
i32 35, label %12
i32 40, label %12
i32 45, label %12
i32 50, label %12
i32 55, label %12
]
11: ; preds = %4
br label %12
12: ; preds = %4, %4, %4, %4, %4, %4, %4, %4, %4, %4, %4, %4, %11
%13 = phi i8 [ 46, %11 ], [ 111, %4 ], [ 111, %4 ], [ 111, %4 ], [ 111, %4 ], [ 111, %4 ], [ 111, %4 ], [ 111, %4 ], [ 111, %4 ], [ 111, %4 ], [ 111, %4 ], [ 111, %4 ], [ 111, %4 ]
%14 = tail call i32 @draw_point(i32 %8, i32 %10, i8 signext %13)
%15 = add nuw nsw i32 %5, 1
%16 = icmp eq i32 %15, 60
br i1 %16, label %17, label %4
17: ; preds = %12
ret void
}