#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) {
  int i = 0;
  if (x2 > x1)
    for (i = x1; i <= x2; i++)
      drawLine(i, y1, i, y2);
  else
    for (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)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    116d <drawSolidRectangle+0x5d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1168 <drawSolidRectangle+0x58>
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    113d <drawSolidRectangle+0x2d>
jmp    11a3 <drawSolidRectangle+0x93>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     119e <drawSolidRectangle+0x8e>
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    1173 <drawSolidRectangle+0x63>
jmp    11a3 <drawSolidRectangle+0x93>
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
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %29
13: ; preds = %4
%14 = load i32, i32* %5
store i32 %14, i32* %9
br label %15
15: ; preds = %25, %13
%16 = load i32, i32* %9
%17 = load i32, i32* %7
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i32, i32* %9
%21 = load i32, i32* %6
%22 = load i32, i32* %9
%23 = load i32, i32* %8
%24 = call i32 @drawLine(i32 %20, i32 %21, i32 %22, i32 %23)
br label %25
25: ; preds = %19
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
store i32 %27, i32* %9
br label %15
28: ; preds = %15
br label %45
29: ; preds = %4
%30 = load i32, i32* %7
store i32 %30, i32* %9
br label %31
31: ; preds = %41, %29
%32 = load i32, i32* %9
%33 = load i32, i32* %5
%34 = icmp sle i32 %32, %33
br i1 %34, label %35, label %44
35: ; preds = %31
%36 = load i32, i32* %9
%37 = load i32, i32* %6
%38 = load i32, i32* %9
%39 = load i32, i32* %8
%40 = call i32 @drawLine(i32 %36, i32 %37, i32 %38, i32 %39)
br label %41
41: ; preds = %35
%42 = load i32, i32* %9
%43 = add nsw i32 %42, 1
store i32 %43, i32* %9
br label %31
44: ; preds = %31
br label %45
45: ; preds = %44, %28
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
}