#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*/ drawLine(int, int, int, int);
void drawSolidRectangle(int x1, int y1, int x2, int y2) {
  if (x2 > x1)
    for (int i = x1; i <= x2; i++)
      drawLine(i, y1, i, y2);
  else
    for (int i = x2; i <= x1; i++)
      drawLine(i, y1, i, y2);
  return;
}


x86 assembly (clang, -O0):
<drawSolidRectangle>:
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    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1166 <drawSolidRectangle+0x56>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1161 <drawSolidRectangle+0x51>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <drawLine@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <drawSolidRectangle+0x26>
jmp    119c <drawSolidRectangle+0x8c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1197 <drawSolidRectangle+0x87>
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <drawLine@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    116c <drawSolidRectangle+0x5c>
jmp    119c <drawSolidRectangle+0x8c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawSolidRectangle>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
mov    %edi,%ebx
cmp    %edi,%edx
jle    1148 <drawSolidRectangle+0x38>
add    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
call   1030 <drawLine@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <drawSolidRectangle+0x20>
jmp    1166 <drawSolidRectangle+0x56>
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
call   1030 <drawLine@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1150 <drawSolidRectangle+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @drawSolidRectangle(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* %7
%12 = load i32, i32* %5
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %30
14: ; preds = %4
%15 = load i32, i32* %5
store i32 %15, i32* %9
br label %16
16: ; preds = %26, %14
%17 = load i32, i32* %9
%18 = load i32, i32* %7
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i32, i32* %9
%22 = load i32, i32* %6
%23 = load i32, i32* %9
%24 = load i32, i32* %8
%25 = call i32 @drawLine(i32 %21, i32 %22, i32 %23, i32 %24)
br label %26
26: ; preds = %20
%27 = load i32, i32* %9
%28 = add nsw i32 %27, 1
store i32 %28, i32* %9
br label %16
29: ; preds = %16
br label %46
30: ; preds = %4
%31 = load i32, i32* %7
store i32 %31, i32* %10
br label %32
32: ; preds = %42, %30
%33 = load i32, i32* %10
%34 = load i32, i32* %5
%35 = icmp sle i32 %33, %34
br i1 %35, label %36, label %45
36: ; preds = %32
%37 = load i32, i32* %10
%38 = load i32, i32* %6
%39 = load i32, i32* %10
%40 = load i32, i32* %8
%41 = call i32 @drawLine(i32 %37, i32 %38, i32 %39, i32 %40)
br label %42
42: ; preds = %36
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 1
store i32 %44, i32* %10
br label %32
45: ; preds = %32
br label %46
46: ; preds = %45, %29
ret void
}

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