#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*/ draw_line(int, int, int, int, int);
void draw_rectangle(int x1, int y1, int x2, int y2, int color) {
  draw_line(x1, y1, x2, y1, color);
  draw_line(x2, y1, x2, y2, color);
  draw_line(x2, y2, x1, y2, color);
  draw_line(x1, y2, x1, y1, color);
}


x86 assembly (clang, -O0):
<draw_rectangle>:
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    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <draw_line@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <draw_line@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <draw_line@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <draw_line@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_rectangle>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r12d
mov    %edx,%ebx
mov    %esi,%r15d
mov    %edi,%ebp
mov    %esi,%ecx
call   1030 <draw_line@plt>
mov    %ebx,%edi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %r12d,%ecx
mov    %r14d,%r8d
call   1030 <draw_line@plt>
mov    %ebx,%edi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r14d,%r8d
call   1030 <draw_line@plt>
mov    %ebp,%edi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <draw_line@plt>

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

LLVM IR (-O2):
define void @draw_rectangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @draw_line(i32 %0, i32 %1, i32 %2, i32 %1, i32 %4)
%7 = tail call i32 @draw_line(i32 %2, i32 %1, i32 %2, i32 %3, i32 %4)
%8 = tail call i32 @draw_line(i32 %2, i32 %3, i32 %0, i32 %3, i32 %4)
%9 = tail call i32 @draw_line(i32 %0, i32 %3, i32 %0, i32 %1, i32 %4)
ret void
}