#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_circle(unsigned char *, int, int, float, int, int, int,
                               int, unsigned char);
void tarca(unsigned char *sl, int w, int h, int size1, int size2, float ar) {
  unsigned char black, white;
  int i;
  black = 0;
  white = 255;
  for (i = 0; i < (w * h); i++)
    sl[i] = black;
  if (size1 < 20)
    size1 = 20;
  draw_circle(sl, w, h, ar, w / 2, h / 2, 0, size2 / 2, white);
  for (i = size1; i < (h / 2); i = i + size1)
    draw_circle(sl, w, h, ar, w / 2, h / 2, i - size2 / 2, i + size2 / 2,
                white);
}


x86 assembly (clang, -O0):
<tarca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movb   $0x0,-0x1d(%rbp)
movb   $0xff,-0x1e(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    116b <tarca+0x5b>
mov    -0x1d(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    113d <tarca+0x2d>
cmpl   $0x14,-0x14(%rbp)
jge    117c <tarca+0x6c>
movl   $0x14,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
mov    $0x2,%r8d
cltd
idiv   %r8d
mov    %eax,%r8d
mov    -0x18(%rbp),%eax
mov    $0x2,%r9d
cltd
idiv   %r9d
mov    -0x28(%rbp),%edx
xor    %r9d,%r9d
mov    %eax,(%rsp)
movzbl -0x1e(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <draw_circle@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    1272 <tarca+0x162>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
mov    %eax,-0x34(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
mov    $0x2,%r8d
cltd
idiv   %r8d
mov    %eax,%r8d
mov    -0x24(%rbp),%r9d
mov    -0x18(%rbp),%eax
mov    $0x2,%r10d
cltd
idiv   %r10d
sub    %eax,%r9d
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x2,%r10d
cltd
idiv   %r10d
mov    -0x34(%rbp),%edx
mov    %eax,%r10d
mov    -0x30(%rbp),%eax
add    %r10d,%eax
mov    %eax,(%rsp)
movzbl -0x1e(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <draw_circle@plt>
mov    -0x24(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11d4 <tarca+0xc4>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tarca>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%ebp
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
mov    %edx,%eax
imul   %esi,%eax
test   %eax,%eax
movss  %xmm0,0x8(%rsp)
jle    115d <tarca+0x3d>
mov    %eax,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
movss  0x8(%rsp),%xmm0
cmp    $0x15,%ebx
mov    $0x14,%r13d
cmovge %ebx,%r13d
mov    %r12d,%ecx
shr    $0x1f,%ecx
add    %r12d,%ecx
sar    %ecx
mov    %r14d,%ebx
shr    $0x1f,%ebx
add    %r14d,%ebx
sar    %ebx
mov    %ebp,%eax
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
mov    %r15,%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    %ecx,0xc(%rsp)
mov    %ebx,%r8d
xor    %r9d,%r9d
push   $0xff
mov    %rbp,0x18(%rsp)
push   %rbp
call   1030 <draw_circle@plt>
add    $0x10,%rsp
mov    %r13d,0x4(%rsp)
cmp    %ebx,%r13d
jge    121a <tarca+0xfa>
mov    %r15,%r13
mov    %r14d,%ebp
mov    %r12d,%r15d
mov    0x10(%rsp),%r14
neg    %r14d
mov    0x4(%rsp),%eax
mov    %eax,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r14,%r12,1),%r9d
mov    0x10(%rsp),%rax
add    %r12d,%eax
mov    %r13,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
movss  0x8(%rsp),%xmm0
mov    0xc(%rsp),%ecx
mov    %ebx,%r8d
push   $0xff
push   %rax
call   1030 <draw_circle@plt>
add    $0x10,%rsp
add    0x4(%rsp),%r12d
cmp    %ebx,%r12d
jl     11e0 <tarca+0xc0>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @tarca(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, float %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
%13 = alloca i8
%14 = alloca i8
%15 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store float %5, float* %12
store i8 0, i8* %13
store i8 -1, i8* %14
store i32 0, i32* %15
br label %16
16: ; preds = %28, %6
%17 = load i32, i32* %15
%18 = load i32, i32* %8
%19 = load i32, i32* %9
%20 = mul nsw i32 %18, %19
%21 = icmp slt i32 %17, %20
br i1 %21, label %22, label %31
22: ; preds = %16
%23 = load i8, i8* %13
%24 = load i8*, i8** %7
%25 = load i32, i32* %15
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
store i8 %23, i8* %27
br label %28
28: ; preds = %22
%29 = load i32, i32* %15
%30 = add nsw i32 %29, 1
store i32 %30, i32* %15
br label %16
31: ; preds = %16
%32 = load i32, i32* %10
%33 = icmp slt i32 %32, 20
br i1 %33, label %34, label %35
34: ; preds = %31
store i32 20, i32* %10
br label %35
35: ; preds = %34, %31
%36 = load i8*, i8** %7
%37 = load i32, i32* %8
%38 = load i32, i32* %9
%39 = load float, float* %12
%40 = load i32, i32* %8
%41 = sdiv i32 %40, 2
%42 = load i32, i32* %9
%43 = sdiv i32 %42, 2
%44 = load i32, i32* %11
%45 = sdiv i32 %44, 2
%46 = load i8, i8* %14
%47 = call i32 @draw_circle(i8* %36, i32 %37, i32 %38, float %39, i32 %41, i32 %43, i32 0, i32 %45, i8 zeroext %46)
%48 = load i32, i32* %10
store i32 %48, i32* %15
br label %49
49: ; preds = %73, %35
%50 = load i32, i32* %15
%51 = load i32, i32* %9
%52 = sdiv i32 %51, 2
%53 = icmp slt i32 %50, %52
br i1 %53, label %54, label %77
54: ; preds = %49
%55 = load i8*, i8** %7
%56 = load i32, i32* %8
%57 = load i32, i32* %9
%58 = load float, float* %12
%59 = load i32, i32* %8
%60 = sdiv i32 %59, 2
%61 = load i32, i32* %9
%62 = sdiv i32 %61, 2
%63 = load i32, i32* %15
%64 = load i32, i32* %11
%65 = sdiv i32 %64, 2
%66 = sub nsw i32 %63, %65
%67 = load i32, i32* %15
%68 = load i32, i32* %11
%69 = sdiv i32 %68, 2
%70 = add nsw i32 %67, %69
%71 = load i8, i8* %14
%72 = call i32 @draw_circle(i8* %55, i32 %56, i32 %57, float %58, i32 %60, i32 %62, i32 %66, i32 %70, i8 zeroext %71)
br label %73
73: ; preds = %54
%74 = load i32, i32* %15
%75 = load i32, i32* %10
%76 = add nsw i32 %74, %75
store i32 %76, i32* %15
br label %49
77: ; preds = %49
ret void
}

LLVM IR (-O2):
define void @tarca(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, float %5) {
%7 = mul i32 %2, %1
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = zext i32 %7 to i64
br label %11
11: ; preds = %9, %6
%12 = icmp sgt i32 %3, 20
%13 = select i1 %12, i32 %3, i32 20
%14 = sdiv i32 %1, 2
%15 = sdiv i32 %2, 2
%16 = sdiv i32 %4, 2
%17 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, float %5, i32 %14, i32 %15, i32 0, i32 %16, i8 zeroext -1)
%18 = icmp slt i32 %13, %15
br i1 %18, label %19, label %26
19: ; preds = %11, %19
%20 = phi i32 [ %24, %19 ], [ %13, %11 ]
%21 = sub nsw i32 %20, %16
%22 = add nsw i32 %20, %16
%23 = tail call i32 @draw_circle(i8* %0, i32 %1, i32 %2, float %5, i32 %14, i32 %15, i32 %21, i32 %22, i8 zeroext -1)
%24 = add nuw nsw i32 %20, %13
%25 = icmp slt i32 %24, %15
br i1 %25, label %19, label %26
26: ; preds = %19, %11
ret void
}