#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*/ fb_write_point(int, int, unsigned char *, int);
void fb_write_dollop(int startx, int starty, int endx, int endy,
                     unsigned char *fb, int column_max) {
  int i, j;
  for (i = starty; i <= endy; i++)
    for (j = startx; j <= endx; j++) {
      fb_write_point(i, j, fb, column_max);
    }
}


x86 assembly (clang, -O0):
<fb_write_dollop>:
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    %r8,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1183 <fb_write_dollop+0x73>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1170 <fb_write_dollop+0x60>
mov    -0x20(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <fb_write_point@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1144 <fb_write_dollop+0x34>
jmp    1175 <fb_write_dollop+0x65>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1132 <fb_write_dollop+0x22>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_write_dollop>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,0x10(%rsp)
mov    %ecx,0xc(%rsp)
cmp    %ecx,%esi
jle    113a <fb_write_dollop+0x2a>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r9d,%r13d
mov    %r8,%rbx
mov    %esi,%ebp
mov    %edi,%r15d
mov    0x10(%rsp),%rax
lea    0x1(%rax),%r14d
jmp    115b <fb_write_dollop+0x4b>
lea    0x1(%rbp),%eax
cmp    0xc(%rsp),%ebp
mov    %eax,%ebp
je     112b <fb_write_dollop+0x1b>
cmp    0x10(%rsp),%r15d
jg     1150 <fb_write_dollop+0x40>
mov    %r15d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
mov    %r12d,%esi
mov    %rbx,%rdx
mov    %r13d,%ecx
call   1030 <fb_write_point@plt>
add    $0x1,%r12d
cmp    %r12d,%r14d
jne    1170 <fb_write_dollop+0x60>
jmp    1150 <fb_write_dollop+0x40>

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

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