#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*/ bresline(int, int, int, int, int);
void drawRect(int x1, int y1, int x2, int y2) {
  bresline(x1, y1, x2, y1, 1);
  bresline(x1, y1, x1, y2, 1);
  bresline(x2, y1, x2, y2, 1);
  bresline(x1, y2, x2, y2, 1);
}


x86 assembly (clang, -O0):
<drawRect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <bresline@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <bresline@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <bresline@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <bresline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawRect>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%ecx
mov    $0x1,%r8d
call   1030 <bresline@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    $0x1,%r8d
call   1030 <bresline@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    $0x1,%r8d
call   1030 <bresline@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    $0x1,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <bresline@plt>

LLVM IR (-O0):
define void @drawRect(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = call i32 @bresline(i32 %9, i32 %10, i32 %11, i32 %12, i32 1)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = load i32, i32* %8
%18 = call i32 @bresline(i32 %14, i32 %15, i32 %16, i32 %17, i32 1)
%19 = load i32, i32* %7
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = call i32 @bresline(i32 %19, i32 %20, i32 %21, i32 %22, i32 1)
%24 = load i32, i32* %5
%25 = load i32, i32* %8
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = call i32 @bresline(i32 %24, i32 %25, i32 %26, i32 %27, i32 1)
ret void
}

LLVM IR (-O2):
define void @drawRect(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @bresline(i32 %0, i32 %1, i32 %2, i32 %1, i32 1)
%6 = tail call i32 @bresline(i32 %0, i32 %1, i32 %0, i32 %3, i32 1)
%7 = tail call i32 @bresline(i32 %2, i32 %1, i32 %2, i32 %3, i32 1)
%8 = tail call i32 @bresline(i32 %0, i32 %3, i32 %2, i32 %3, i32 1)
ret void
}