#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*/ GPIOPinWrite(int, int, int);
int /*<<< orphan*/ LCD_draw_point(int, int);
void LCD_draw_dollop(int startx, int starty, int endx, int endy) {
  int i, j;
  for (i = starty; i <= endy; i++)
    for (j = startx; j <= endx; j++) {
      GPIOPinWrite(0x40004000, 0x00000001, 0x00);
      GPIOPinWrite(0x40004000, 0x00000010, 0xff);
      LCD_draw_point(i, j);
      GPIOPinWrite(0x40004000, 0x00000001, 0xff);
    }
}


x86 assembly (clang, -O0):
<LCD_draw_dollop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11bd <LCD_draw_dollop+0x9d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11aa <LCD_draw_dollop+0x8a>
mov    $0x40004000,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40004000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <LCD_draw_point@plt>
mov    $0x40004000,%edi
mov    $0x1,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114c <LCD_draw_dollop+0x2c>
jmp    11af <LCD_draw_dollop+0x8f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <LCD_draw_dollop+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_draw_dollop>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %ecx,%esi
jle    113e <LCD_draw_dollop+0x1e>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%r12d
lea    0x1(%r14),%r13d
jmp    115a <LCD_draw_dollop+0x3a>
nop
lea    0x1(%rbx),%eax
cmp    %r15d,%ebx
mov    %eax,%ebx
je     112f <LCD_draw_dollop+0xf>
cmp    %r14d,%r12d
jg     1150 <LCD_draw_dollop+0x30>
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x40004000,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <GPIOPinWrite@plt>
mov    $0x40004000,%edi
mov    $0x10,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <LCD_draw_point@plt>
mov    $0x40004000,%edi
mov    $0x1,%esi
mov    $0xff,%edx
call   1040 <GPIOPinWrite@plt>
add    $0x1,%ebp
cmp    %ebp,%r13d
jne    1170 <LCD_draw_dollop+0x50>
jmp    1150 <LCD_draw_dollop+0x30>

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

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