#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*/ drawCFullCircle(int, int, int, int);
void drawGhostEyes(int x, int y, int size, int pos) {
  int vec[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
  drawCFullCircle(x + size / 3, y + size / 3, size / 8, 0xFFFFFF);
  drawCFullCircle(x + 2 * size / 3, y + size / 3, size / 8, 0xFFFFFF);
  drawCFullCircle(x + size / 3 + vec[pos % 4][0] * size / 15,
                  y + size / 3 + vec[pos % 4][1] * size / 15, size / 16, 0);
  drawCFullCircle(x + 2 * size / 3 + vec[pos % 4][0] * size / 15,
                  y + size / 3 + vec[pos % 4][1] * size / 15, size / 16, 0);
}


x86 assembly (clang, -O0):
<drawGhostEyes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    0xed5(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecf(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecc(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    %eax,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    %eax,%esi
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    $0xffffff,%ecx
call   1030 <drawCFullCircle@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    %eax,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    %eax,%esi
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    $0xffffff,%ecx
call   1030 <drawCFullCircle@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    %eax,%edi
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,8),%eax
imul   -0xc(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
add    %eax,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    %eax,%esi
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x2c(%rbp,%rax,8),%eax
imul   -0xc(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
add    %eax,%esi
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <drawCFullCircle@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    %eax,%edi
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x30(%rbp,%rax,8),%eax
imul   -0xc(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
add    %eax,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    %eax,%esi
mov    -0x10(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x2c(%rbp,%rax,8),%eax
imul   -0xc(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
add    %eax,%esi
mov    -0xc(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
xor    %ecx,%ecx
call   1030 <drawCFullCircle@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawGhostEyes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%ebp
mov    %esi,%r15d
mov    %rdi,0x10(%rsp)
movslq %edx,%rbx
imul   $0x55555556,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
add    %eax,%edi
mov    %edi,0xc(%rsp)
add    %eax,%r15d
lea    0x7(%rbx),%r13d
test   %ebx,%ebx
cmovns %ebx,%r13d
lea    0xf(%rbx),%r12d
cmovns %ebx,%r12d
sar    $0x3,%r13d
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0xffffff,%ecx
call   1030 <drawCFullCircle@plt>
lea    (%rbx,%rbx,1),%eax
cltq
imul   $0x55555556,%rax,%r14
mov    %r14,%rax
shr    $0x20,%rax
shr    $0x3f,%r14
add    %eax,%r14d
add    0x10(%rsp),%r14d
mov    %r14d,%edi
mov    %r15d,%esi
mov    %r13d,%edx
mov    $0xffffff,%ecx
call   1030 <drawCFullCircle@plt>
lea    0x3(%rbp),%eax
test   %ebp,%ebp
cmovns %ebp,%eax
and    $0xfffffffc,%eax
sub    %eax,%ebp
movslq %ebp,%rax
lea    0xe49(%rip),%rcx
mov    (%rcx,%rax,8),%edx
imul   %ebx,%edx
movslq %edx,%rbp
imul   $0xffffffff88888889,%rbp,%rdx
shr    $0x20,%rdx
add    %edx,%ebp
mov    %ebp,%edx
shr    $0x1f,%edx
sar    $0x3,%ebp
add    %edx,%ebp
mov    0xc(%rsp),%edi
add    %ebp,%edi
imul   0x4(%rcx,%rax,8),%ebx
movslq %ebx,%rbx
imul   $0xffffffff88888889,%rbx,%rax
shr    $0x20,%rax
add    %eax,%ebx
mov    %ebx,%eax
shr    $0x1f,%eax
sar    $0x3,%ebx
add    %eax,%ebx
add    %r15d,%ebx
sar    $0x4,%r12d
mov    %ebx,%esi
mov    %r12d,%edx
xor    %ecx,%ecx
call   1030 <drawCFullCircle@plt>
add    %r14d,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r12d,%edx
xor    %ecx,%ecx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <drawCFullCircle@plt>

LLVM IR (-O0):
@__const.drawGhostEyes.vec = [4 x [2 x i32]] [[2 x i32] [i32 1, i32 0], [2 x i32] [i32 0, i32 1], [2 x i32] [i32 -1, i32 0], [2 x i32] [i32 0, i32 -1]]
define void @drawGhostEyes(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x [2 x i32]]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = bitcast [4 x [2 x i32]]* %9 to i8*
%11 = load i32, i32* %5
%12 = load i32, i32* %7
%13 = sdiv i32 %12, 3
%14 = add nsw i32 %11, %13
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = sdiv i32 %16, 3
%18 = add nsw i32 %15, %17
%19 = load i32, i32* %7
%20 = sdiv i32 %19, 8
%21 = call i32 @drawCFullCircle(i32 %14, i32 %18, i32 %20, i32 16777215)
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = mul nsw i32 2, %23
%25 = sdiv i32 %24, 3
%26 = add nsw i32 %22, %25
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = sdiv i32 %28, 3
%30 = add nsw i32 %27, %29
%31 = load i32, i32* %7
%32 = sdiv i32 %31, 8
%33 = call i32 @drawCFullCircle(i32 %26, i32 %30, i32 %32, i32 16777215)
%34 = load i32, i32* %5
%35 = load i32, i32* %7
%36 = sdiv i32 %35, 3
%37 = add nsw i32 %34, %36
%38 = load i32, i32* %8
%39 = srem i32 %38, 4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %9, i64 0, i64 %40
%42 = getelementptr inbounds [2 x i32], [2 x i32]* %41, i64 0, i64 0
%43 = load i32, i32* %42
%44 = load i32, i32* %7
%45 = mul nsw i32 %43, %44
%46 = sdiv i32 %45, 15
%47 = add nsw i32 %37, %46
%48 = load i32, i32* %6
%49 = load i32, i32* %7
%50 = sdiv i32 %49, 3
%51 = add nsw i32 %48, %50
%52 = load i32, i32* %8
%53 = srem i32 %52, 4
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %9, i64 0, i64 %54
%56 = getelementptr inbounds [2 x i32], [2 x i32]* %55, i64 0, i64 1
%57 = load i32, i32* %56
%58 = load i32, i32* %7
%59 = mul nsw i32 %57, %58
%60 = sdiv i32 %59, 15
%61 = add nsw i32 %51, %60
%62 = load i32, i32* %7
%63 = sdiv i32 %62, 16
%64 = call i32 @drawCFullCircle(i32 %47, i32 %61, i32 %63, i32 0)
%65 = load i32, i32* %5
%66 = load i32, i32* %7
%67 = mul nsw i32 2, %66
%68 = sdiv i32 %67, 3
%69 = add nsw i32 %65, %68
%70 = load i32, i32* %8
%71 = srem i32 %70, 4
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %9, i64 0, i64 %72
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %73, i64 0, i64 0
%75 = load i32, i32* %74
%76 = load i32, i32* %7
%77 = mul nsw i32 %75, %76
%78 = sdiv i32 %77, 15
%79 = add nsw i32 %69, %78
%80 = load i32, i32* %6
%81 = load i32, i32* %7
%82 = sdiv i32 %81, 3
%83 = add nsw i32 %80, %82
%84 = load i32, i32* %8
%85 = srem i32 %84, 4
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* %9, i64 0, i64 %86
%88 = getelementptr inbounds [2 x i32], [2 x i32]* %87, i64 0, i64 1
%89 = load i32, i32* %88
%90 = load i32, i32* %7
%91 = mul nsw i32 %89, %90
%92 = sdiv i32 %91, 15
%93 = add nsw i32 %83, %92
%94 = load i32, i32* %7
%95 = sdiv i32 %94, 16
%96 = call i32 @drawCFullCircle(i32 %79, i32 %93, i32 %95, i32 0)
ret void
}

LLVM IR (-O2):
@__const.drawGhostEyes.vec = [4 x [2 x i32]] [[2 x i32] [i32 1, i32 0], [2 x i32] [i32 0, i32 1], [2 x i32] [i32 -1, i32 0], [2 x i32] [i32 0, i32 -1]]
define void @drawGhostEyes(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sdiv i32 %2, 3
%6 = add nsw i32 %5, %0
%7 = add nsw i32 %5, %1
%8 = sdiv i32 %2, 8
%9 = tail call i32 @drawCFullCircle(i32 %6, i32 %7, i32 %8, i32 16777215)
%10 = shl nsw i32 %2, 1
%11 = sdiv i32 %10, 3
%12 = add nsw i32 %11, %0
%13 = tail call i32 @drawCFullCircle(i32 %12, i32 %7, i32 %8, i32 16777215)
%14 = srem i32 %3, 4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* @__const.drawGhostEyes.vec, i64 0, i64 %15, i64 0
%17 = load i32, i32* %16
%18 = mul nsw i32 %17, %2
%19 = sdiv i32 %18, 15
%20 = add nsw i32 %19, %6
%21 = getelementptr inbounds [4 x [2 x i32]], [4 x [2 x i32]]* @__const.drawGhostEyes.vec, i64 0, i64 %15, i64 1
%22 = load i32, i32* %21
%23 = mul nsw i32 %22, %2
%24 = sdiv i32 %23, 15
%25 = add nsw i32 %24, %7
%26 = sdiv i32 %2, 16
%27 = tail call i32 @drawCFullCircle(i32 %20, i32 %25, i32 %26, i32 0)
%28 = add nsw i32 %19, %12
%29 = tail call i32 @drawCFullCircle(i32 %28, i32 %25, i32 %26, i32 0)
ret void
}