#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_hand(int minute, int hlength, char c, int sXcen, int sYcen) {
  int x, y, n;
  for (n = 1; n < hlength; n++) {
    x = icos(minute - 15, n) * 2 + sXcen;
    y = isin(minute - 15, n) + sYcen;
    draw_point(x, y, c);
  }
}


x86 assembly (clang, -O0):
<draw_hand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11a5 <draw_hand+0x75>
mov    -0x4(%rbp),%edi
sub    $0xf,%edi
mov    -0x20(%rbp),%esi
call   1040 <icos@plt>
shl    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
sub    $0xf,%edi
mov    -0x20(%rbp),%esi
call   1050 <isin@plt>
add    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
movsbl -0x9(%rbp),%edx
call   1030 <draw_point@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1151 <draw_hand+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_hand>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,(%rsp)
cmp    $0x2,%esi
jl     1190 <draw_hand+0x60>
mov    %ecx,%r15d
mov    %esi,%r12d
mov    %edi,%ebx
add    $0xfffffff1,%ebx
mov    $0x1,%ebp
movsbl %dl,%r13d
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %ebp,%esi
call   1040 <icos@plt>
lea    (%r15,%rax,2),%r14d
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <isin@plt>
mov    (%rsp),%rcx
lea    (%rax,%rcx,1),%esi
mov    %r14d,%edi
mov    %r13d,%edx
call   1030 <draw_point@plt>
add    $0x1,%ebp
cmp    %ebp,%r12d
jne    1160 <draw_hand+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @draw_hand(i32 %0, i32 %1, i8 signext %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %1, 1
br i1 %6, label %7, label %19
7: ; preds = %5
%8 = add nsw i32 %0, -15
br label %9
9: ; preds = %7, %9
%10 = phi i32 [ 1, %7 ], [ %17, %9 ]
%11 = tail call i32 @icos(i32 %8, i32 %10)
%12 = shl nsw i32 %11, 1
%13 = add nsw i32 %12, %3
%14 = tail call i32 @isin(i32 %8, i32 %10)
%15 = add nsw i32 %14, %4
%16 = tail call i32 @draw_point(i32 %13, i32 %15, i8 signext %2)
%17 = add nuw nsw i32 %10, 1
%18 = icmp eq i32 %17, %1
br i1 %18, label %19, label %9
19: ; preds = %9, %5
ret void
}