#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x;
  int y;
};
typedef TYPE_1__ XPoint;

/* Variables and functions */
int /*<<< orphan*/ mycircle(int, int, int, int);
int /*<<< orphan*/ myfilledcircle(int, int, int, int);
int /*<<< orphan*/ printf(char *, int);
void DrawCircle(int mycolor, XPoint *myp, int no, double size, int fill) {
  int i, x, y, r;
  for (i = 0; i < no; i++) {
    x = myp[i].x;
    y = myp[i].y;
    r = size;
    switch (fill) {
    case 0:
      mycircle(mycolor, x, y, r);
      break;
    case 1:
      myfilledcircle(mycolor, x, y, r);
      break;
    default:
      printf("draw2dgraph:DrawCircle: fill type %i not defined\n", fill);
    }
  }
}


x86 assembly (clang, -O0):
<DrawCircle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11f4 <DrawCircle+0xc4>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    0x4(%rax,%rcx,8),%eax
mov    %eax,-0x30(%rbp)
cvttsd2si -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x38(%rbp)
test   %eax,%eax
je     11a6 <DrawCircle+0x76>
jmp    1195 <DrawCircle+0x65>
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
je     11bc <DrawCircle+0x8c>
jmp    11d2 <DrawCircle+0xa2>
mov    -0x4(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
call   1050 <mycircle@plt>
jmp    11e1 <DrawCircle+0xb1>
mov    -0x4(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
call   1040 <myfilledcircle@plt>
jmp    11e1 <DrawCircle+0xb1>
mov    -0x24(%rbp),%esi
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
jmp    11e6 <DrawCircle+0xb6>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1151 <DrawCircle+0x21>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawCircle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    11ad <DrawCircle+0x7d>
mov    %ecx,%ebp
mov    %rsi,%rbx
mov    %edi,%r14d
cvttsd2si %xmm0,%r15d
mov    %edx,%r13d
xor    %r12d,%r12d
jmp    1177 <DrawCircle+0x47>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0xe99(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%r12
cmp    %r12,%r13
je     11ad <DrawCircle+0x7d>
mov    (%rbx,%r12,8),%esi
mov    0x4(%rbx,%r12,8),%edx
cmp    $0x1,%ebp
je     11a0 <DrawCircle+0x70>
test   %ebp,%ebp
jne    1160 <DrawCircle+0x30>
mov    %r14d,%edi
mov    %r15d,%ecx
call   1050 <mycircle@plt>
jmp    116e <DrawCircle+0x3e>
cs nopw 0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    %r15d,%ecx
call   1040 <myfilledcircle@plt>
jmp    116e <DrawCircle+0x3e>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@.str = [50 x i8] c"draw2dgraph:DrawCircle: fill type %i not defined\0A\00"
define void @DrawCircle(i32 %0, %struct.TYPE_3__* %1, i32 %2, double %3, i32 %4) {
%6 = alloca i32
%7 = alloca %struct.TYPE_3__*
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %6
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %7
store i32 %2, i32* %8
store double %3, double* %9
store i32 %4, i32* %10
store i32 0, i32* %11
br label %15
15: ; preds = %51, %5
%16 = load i32, i32* %11
%17 = load i32, i32* %8
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %54
19: ; preds = %15
%20 = load %struct.TYPE_3__*, %struct.TYPE_3__** %7
%21 = load i32, i32* %11
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %20, i64 %22
%24 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %23, i32 0, i32 0
%25 = load i32, i32* %24
store i32 %25, i32* %12
%26 = load %struct.TYPE_3__*, %struct.TYPE_3__** %7
%27 = load i32, i32* %11
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %26, i64 %28
%30 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %29, i32 0, i32 1
%31 = load i32, i32* %30
store i32 %31, i32* %13
%32 = load double, double* %9
%33 = fptosi double %32 to i32
store i32 %33, i32* %14
%34 = load i32, i32* %10
switch i32 %34, label %47 [
i32 0, label %35
i32 1, label %41
]
35: ; preds = %19
%36 = load i32, i32* %6
%37 = load i32, i32* %12
%38 = load i32, i32* %13
%39 = load i32, i32* %14
%40 = call i32 @mycircle(i32 %36, i32 %37, i32 %38, i32 %39)
br label %50
41: ; preds = %19
%42 = load i32, i32* %6
%43 = load i32, i32* %12
%44 = load i32, i32* %13
%45 = load i32, i32* %14
%46 = call i32 @myfilledcircle(i32 %42, i32 %43, i32 %44, i32 %45)
br label %50
47: ; preds = %19
%48 = load i32, i32* %10
%49 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %47, %41, %35
br label %51
51: ; preds = %50
%52 = load i32, i32* %11
%53 = add nsw i32 %52, 1
store i32 %53, i32* %11
br label %15
54: ; preds = %15
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
@.str = [50 x i8] c"draw2dgraph:DrawCircle: fill type %i not defined\0A\00"
define void @DrawCircle(i32 %0, %struct.TYPE_3__* nocapture %1, i32 %2, double %3, i32 %4) {
%6 = icmp sgt i32 %2, 0
br i1 %6, label %7, label %25
7: ; preds = %5
%8 = fptosi double %3 to i32
%9 = zext i32 %2 to i64
br label %10
10: ; preds = %7, %22
%11 = phi i64 [ 0, %7 ], [ %23, %22 ]
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 %11, i32 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 %11, i32 1
%15 = load i32, i32* %14
switch i32 %4, label %20 [
i32 0, label %16
i32 1, label %18
]
16: ; preds = %10
%17 = tail call i32 @mycircle(i32 %0, i32 %13, i32 %15, i32 %8)
br label %22
18: ; preds = %10
%19 = tail call i32 @myfilledcircle(i32 %0, i32 %13, i32 %15, i32 %8)
br label %22
20: ; preds = %10
%21 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %22
22: ; preds = %16, %18, %20
%23 = add nuw nsw i64 %11, 1
%24 = icmp eq i64 %23, %9
br i1 %24, label %25, label %10
25: ; preds = %22, %5
ret void
}