#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*/ psdraw_line(int, int, int, int, int, char, char, char);
void psdraw_rect(int x1, int y1, int x2, int y2, int z, char r, char g,
                 char b) {
  psdraw_line(x1, y1, x2, y1, z, r, g, b);
  psdraw_line(x2, y1, x2, y2, z, r, g, b);
  psdraw_line(x1, y2, x2, y2, z, r, g, b);
  psdraw_line(x1, y1, x1, y2, z, r, g, b);
}


x86 assembly (clang, -O0):
<psdraw_rect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r9b,%al
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x15(%rbp),%r9b
mov    0x10(%rbp),%al
movsbl %r9b,%r9d
movsbl %al,%eax
mov    %eax,(%rsp)
movsbl 0x18(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <psdraw_line@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x15(%rbp),%r9b
mov    0x10(%rbp),%al
movsbl %r9b,%r9d
movsbl %al,%eax
mov    %eax,(%rsp)
movsbl 0x18(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <psdraw_line@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x15(%rbp),%r9b
mov    0x10(%rbp),%al
movsbl %r9b,%r9d
movsbl %al,%eax
mov    %eax,(%rsp)
movsbl 0x18(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <psdraw_line@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x15(%rbp),%r9b
mov    0x10(%rbp),%al
movsbl %r9b,%r9d
movsbl %al,%eax
mov    %eax,(%rsp)
movsbl 0x18(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <psdraw_line@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psdraw_rect>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,0x4(%rsp)
mov    %edx,%ebx
mov    %edi,0xc(%rsp)
movsbl 0x50(%rsp),%r15d
movsbl 0x58(%rsp),%ebp
mov    %esi,%ecx
mov    %esi,%r12d
mov    %esi,0x8(%rsp)
mov    %r8d,%r13d
mov    %r9d,%r14d
mov    %r9d,(%rsp)
push   %rbp
push   %r15
mov    %r15,0x20(%rsp)
call   1030 <psdraw_line@plt>
add    $0x10,%rsp
mov    %ebx,%edi
mov    %r12d,%esi
mov    %ebx,%edx
mov    0x4(%rsp),%r12d
mov    %r12d,%ecx
mov    %r13d,%r8d
mov    %r14d,%r9d
push   %rbp
push   %r15
call   1030 <psdraw_line@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%r15d
mov    %r15d,%edi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r12d,%ecx
mov    %r13d,%r8d
mov    (%rsp),%ebx
mov    %ebx,%r9d
push   %rbp
push   0x18(%rsp)
call   1030 <psdraw_line@plt>
add    $0x10,%rsp
mov    %r15d,%edi
mov    0x8(%rsp),%esi
mov    %r15d,%edx
mov    %r12d,%ecx
mov    %r13d,%r8d
mov    %ebx,%r9d
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <psdraw_line@plt>

LLVM IR (-O0):
define void @psdraw_rect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8
%15 = alloca i8
%16 = alloca i8
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i8 %5, i8* %14
store i8 %6, i8* %15
store i8 %7, i8* %16
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32, i32* %10
%21 = load i32, i32* %13
%22 = load i8, i8* %14
%23 = load i8, i8* %15
%24 = load i8, i8* %16
%25 = call i32 @psdraw_line(i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i8 signext %22, i8 signext %23, i8 signext %24)
%26 = load i32, i32* %11
%27 = load i32, i32* %10
%28 = load i32, i32* %11
%29 = load i32, i32* %12
%30 = load i32, i32* %13
%31 = load i8, i8* %14
%32 = load i8, i8* %15
%33 = load i8, i8* %16
%34 = call i32 @psdraw_line(i32 %26, i32 %27, i32 %28, i32 %29, i32 %30, i8 signext %31, i8 signext %32, i8 signext %33)
%35 = load i32, i32* %9
%36 = load i32, i32* %12
%37 = load i32, i32* %11
%38 = load i32, i32* %12
%39 = load i32, i32* %13
%40 = load i8, i8* %14
%41 = load i8, i8* %15
%42 = load i8, i8* %16
%43 = call i32 @psdraw_line(i32 %35, i32 %36, i32 %37, i32 %38, i32 %39, i8 signext %40, i8 signext %41, i8 signext %42)
%44 = load i32, i32* %9
%45 = load i32, i32* %10
%46 = load i32, i32* %9
%47 = load i32, i32* %12
%48 = load i32, i32* %13
%49 = load i8, i8* %14
%50 = load i8, i8* %15
%51 = load i8, i8* %16
%52 = call i32 @psdraw_line(i32 %44, i32 %45, i32 %46, i32 %47, i32 %48, i8 signext %49, i8 signext %50, i8 signext %51)
ret void
}

LLVM IR (-O2):
define void @psdraw_rect(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8 signext %5, i8 signext %6, i8 signext %7) {
%9 = tail call i32 @psdraw_line(i32 %0, i32 %1, i32 %2, i32 %1, i32 %4, i8 signext %5, i8 signext %6, i8 signext %7)
%10 = tail call i32 @psdraw_line(i32 %2, i32 %1, i32 %2, i32 %3, i32 %4, i8 signext %5, i8 signext %6, i8 signext %7)
%11 = tail call i32 @psdraw_line(i32 %0, i32 %3, i32 %2, i32 %3, i32 %4, i8 signext %5, i8 signext %6, i8 signext %7)
%12 = tail call i32 @psdraw_line(i32 %0, i32 %1, i32 %0, i32 %3, i32 %4, i8 signext %5, i8 signext %6, i8 signext %7)
ret void
}