#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 */
typedef int /*<<< orphan*/ uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ fgui_fill_rectangle(int, int, int, int, int /*<<< orphan*/);
void fgui_draw_rectangle(uint16_t x, uint16_t y, uint16_t w, uint16_t h,
                         uint32_t color) {
  fgui_fill_rectangle(x, y, w, 1, color);
  fgui_fill_rectangle(x, y, 1, h, color);
  fgui_fill_rectangle(x + w - 1, y, 1, h, color);
  fgui_fill_rectangle(x, y + h - 1, w, 1, color);
}


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

x86 assembly (clang, -O2):
<fgui_draw_rectangle>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r12d
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x1,%ecx
call   1030 <fgui_fill_rectangle@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <fgui_fill_rectangle@plt>
lea    (%rbx,%r14,1),%edi
add    $0xffffffff,%edi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1030 <fgui_fill_rectangle@plt>
lea    (%r15,%rbp,1),%esi
add    $0xffffffff,%esi
mov    %ebx,%edi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    %r12d,%r8d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fgui_fill_rectangle@plt>

LLVM IR (-O0):
define void @fgui_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* %10
%15 = call i32 @fgui_fill_rectangle(i32 %11, i32 %12, i32 %13, i32 1, i32 %14)
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = call i32 @fgui_fill_rectangle(i32 %16, i32 %17, i32 1, i32 %18, i32 %19)
%21 = load i32, i32* %6
%22 = load i32, i32* %8
%23 = add nsw i32 %21, %22
%24 = sub nsw i32 %23, 1
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = load i32, i32* %10
%28 = call i32 @fgui_fill_rectangle(i32 %24, i32 %25, i32 1, i32 %26, i32 %27)
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = load i32, i32* %9
%32 = add nsw i32 %30, %31
%33 = sub nsw i32 %32, 1
%34 = load i32, i32* %8
%35 = load i32, i32* %10
%36 = call i32 @fgui_fill_rectangle(i32 %29, i32 %33, i32 %34, i32 1, i32 %35)
ret void
}

LLVM IR (-O2):
define void @fgui_draw_rectangle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @fgui_fill_rectangle(i32 %0, i32 %1, i32 %2, i32 1, i32 %4)
%7 = tail call i32 @fgui_fill_rectangle(i32 %0, i32 %1, i32 1, i32 %3, i32 %4)
%8 = add i32 %0, -1
%9 = add i32 %8, %2
%10 = tail call i32 @fgui_fill_rectangle(i32 %9, i32 %1, i32 1, i32 %3, i32 %4)
%11 = add i32 %1, -1
%12 = add i32 %11, %3
%13 = tail call i32 @fgui_fill_rectangle(i32 %0, i32 %12, i32 %2, i32 1, i32 %4)
ret void
}