#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*/ putpixel(int, int, int);
void plotbrush(int x, int y, int color) {
  int i, j;
  for (i = -5; i <= 5; i++)
    for (j = -5; j <= 5; j++)
      putpixel(x + i, y + j, color);
}


x86 assembly (clang, -O0):
<plotbrush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0xfffffffb,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jg     1178 <plotbrush+0x68>
movl   $0xfffffffb,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jg     1165 <plotbrush+0x55>
mov    -0x4(%rbp),%edi
add    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <putpixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <plotbrush+0x29>
jmp    116a <plotbrush+0x5a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <plotbrush+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plotbrush>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,0x20(%rsp)
lea    -0x5(%r14),%eax
mov    %eax,0x1c(%rsp)
lea    -0x4(%r14),%eax
mov    %eax,0x18(%rsp)
lea    -0x3(%r14),%eax
mov    %eax,0x14(%rsp)
lea    -0x2(%r14),%eax
mov    %eax,0x10(%rsp)
lea    -0x1(%r14),%eax
mov    %eax,0xc(%rsp)
lea    0x1(%r14),%eax
mov    %eax,0x8(%rsp)
lea    0x2(%r14),%eax
mov    %eax,0x4(%rsp)
lea    0x3(%r14),%eax
mov    %eax,(%rsp)
lea    0x4(%r14),%r12d
lea    0x5(%r14),%r13d
mov    $0xfffffffb,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x20(%rsp),%rax
lea    (%rax,%r15,1),%ebp
mov    %ebp,%edi
mov    0x1c(%rsp),%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
mov    %ebp,%edi
mov    0x18(%rsp),%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
mov    %ebp,%edi
mov    0x14(%rsp),%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
mov    %ebp,%edi
mov    0x10(%rsp),%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
mov    %ebp,%edi
mov    0xc(%rsp),%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
mov    %ebp,%edi
mov    0x8(%rsp),%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
mov    %ebp,%edi
mov    0x4(%rsp),%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
mov    %ebp,%edi
mov    (%rsp),%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
mov    %ebp,%edi
mov    %r12d,%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
mov    %ebp,%edi
mov    %r13d,%esi
mov    %ebx,%edx
call   1030 <putpixel@plt>
add    $0x1,%r15d
cmp    $0x6,%r15d
jne    1180 <plotbrush+0x70>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @plotbrush(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 -5, i32* %7
br label %9
9: ; preds = %29, %3
%10 = load i32, i32* %7
%11 = icmp sle i32 %10, 5
br i1 %11, label %12, label %32
12: ; preds = %9
store i32 -5, i32* %8
br label %13
13: ; preds = %25, %12
%14 = load i32, i32* %8
%15 = icmp sle i32 %14, 5
br i1 %15, label %16, label %28
16: ; preds = %13
%17 = load i32, i32* %4
%18 = load i32, i32* %7
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %5
%21 = load i32, i32* %8
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %6
%24 = call i32 @putpixel(i32 %19, i32 %22, i32 %23)
br label %25
25: ; preds = %16
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %13
28: ; preds = %13
br label %29
29: ; preds = %28
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
br label %9
32: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @plotbrush(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -5
%5 = add nsw i32 %1, -4
%6 = add nsw i32 %1, -3
%7 = add nsw i32 %1, -2
%8 = add nsw i32 %1, -1
%9 = add nsw i32 %1, 1
%10 = add nsw i32 %1, 2
%11 = add nsw i32 %1, 3
%12 = add nsw i32 %1, 4
%13 = add nsw i32 %1, 5
br label %14
14: ; preds = %3, %14
%15 = phi i32 [ -5, %3 ], [ %28, %14 ]
%16 = add nsw i32 %15, %0
%17 = tail call i32 @putpixel(i32 %16, i32 %4, i32 %2)
%18 = tail call i32 @putpixel(i32 %16, i32 %5, i32 %2)
%19 = tail call i32 @putpixel(i32 %16, i32 %6, i32 %2)
%20 = tail call i32 @putpixel(i32 %16, i32 %7, i32 %2)
%21 = tail call i32 @putpixel(i32 %16, i32 %8, i32 %2)
%22 = tail call i32 @putpixel(i32 %16, i32 %1, i32 %2)
%23 = tail call i32 @putpixel(i32 %16, i32 %9, i32 %2)
%24 = tail call i32 @putpixel(i32 %16, i32 %10, i32 %2)
%25 = tail call i32 @putpixel(i32 %16, i32 %11, i32 %2)
%26 = tail call i32 @putpixel(i32 %16, i32 %12, i32 %2)
%27 = tail call i32 @putpixel(i32 %16, i32 %13, i32 %2)
%28 = add nsw i32 %15, 1
%29 = icmp eq i32 %28, 6
br i1 %29, label %30, label %14
30: ; preds = %14
ret void
}