#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*/ vfdlib_drawLineHorizClipped(char *, int, int, int, char);
int /*<<< orphan*/ vfdlib_drawLineVertClipped(char *, int, int, int, char);
void vfdlib_drawOutlineRectangleClipped(char *buffer, int xLeft, int yTop,
                                        int xRight, int yBottom, char shade) {
  vfdlib_drawLineHorizClipped(buffer, yTop, xLeft, xRight, shade);
  vfdlib_drawLineVertClipped(buffer, xLeft, yTop, yBottom, shade);
  vfdlib_drawLineHorizClipped(buffer, yBottom - 1, xLeft, xRight, shade);
  vfdlib_drawLineVertClipped(buffer, xRight - 1, yTop, yBottom, shade);
}


x86 assembly (clang, -O0):
<vfdlib_drawOutlineRectangleClipped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r9b,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
movsbl -0x19(%rbp),%r8d
call   1030 <vfdlib_drawLineHorizClipped@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
movsbl -0x19(%rbp),%r8d
call   1040 <vfdlib_drawLineVertClipped@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
movsbl -0x19(%rbp),%r8d
call   1030 <vfdlib_drawLineHorizClipped@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%ecx
movsbl -0x19(%rbp),%r8d
call   1040 <vfdlib_drawLineVertClipped@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfdlib_drawOutlineRectangleClipped>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r12d
mov    %r8d,%r14d
mov    %ecx,%ebp
mov    %edx,%r15d
mov    %esi,%r13d
mov    %rdi,%rbx
mov    %edx,%esi
mov    %r13d,%edx
mov    %r9d,%r8d
call   1030 <vfdlib_drawLineHorizClipped@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    %r12d,%r8d
call   1040 <vfdlib_drawLineVertClipped@plt>
lea    -0x1(%r14),%esi
mov    %rbx,%rdi
mov    %r13d,%edx
mov    %ebp,%ecx
mov    %r12d,%r8d
call   1030 <vfdlib_drawLineHorizClipped@plt>
add    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    %r12d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <vfdlib_drawLineVertClipped@plt>

LLVM IR (-O0):
define void @vfdlib_drawOutlineRectangleClipped(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8 signext %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8 %5, i8* %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %9
%15 = load i32, i32* %8
%16 = load i32, i32* %10
%17 = load i8, i8* %12
%18 = call i32 @vfdlib_drawLineHorizClipped(i8* %13, i32 %14, i32 %15, i32 %16, i8 signext %17)
%19 = load i8*, i8** %7
%20 = load i32, i32* %8
%21 = load i32, i32* %9
%22 = load i32, i32* %11
%23 = load i8, i8* %12
%24 = call i32 @vfdlib_drawLineVertClipped(i8* %19, i32 %20, i32 %21, i32 %22, i8 signext %23)
%25 = load i8*, i8** %7
%26 = load i32, i32* %11
%27 = sub nsw i32 %26, 1
%28 = load i32, i32* %8
%29 = load i32, i32* %10
%30 = load i8, i8* %12
%31 = call i32 @vfdlib_drawLineHorizClipped(i8* %25, i32 %27, i32 %28, i32 %29, i8 signext %30)
%32 = load i8*, i8** %7
%33 = load i32, i32* %10
%34 = sub nsw i32 %33, 1
%35 = load i32, i32* %9
%36 = load i32, i32* %11
%37 = load i8, i8* %12
%38 = call i32 @vfdlib_drawLineVertClipped(i8* %32, i32 %34, i32 %35, i32 %36, i8 signext %37)
ret void
}

LLVM IR (-O2):
define void @vfdlib_drawOutlineRectangleClipped(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8 signext %5) {
%7 = tail call i32 @vfdlib_drawLineHorizClipped(i8* %0, i32 %2, i32 %1, i32 %3, i8 signext %5)
%8 = tail call i32 @vfdlib_drawLineVertClipped(i8* %0, i32 %1, i32 %2, i32 %4, i8 signext %5)
%9 = add nsw i32 %4, -1
%10 = tail call i32 @vfdlib_drawLineHorizClipped(i8* %0, i32 %9, i32 %1, i32 %3, i8 signext %5)
%11 = add nsw i32 %3, -1
%12 = tail call i32 @vfdlib_drawLineVertClipped(i8* %0, i32 %11, i32 %2, i32 %4, i8 signext %5)
ret void
}