#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_draw_rectangle(int, int, int, int, int /*<<< orphan*/);
void draw4rectangles(uint16_t cx, uint16_t cy, uint16_t x, uint16_t y,
                     uint32_t color) {
  fgui_draw_rectangle(cx - y, cy - x, y << 1, 1, color);
  fgui_draw_rectangle(cx - x, cy - y, x << 1, 1, color);
  fgui_draw_rectangle(cx - x, cy + y, x << 1, 1, color);
  fgui_draw_rectangle(cx - y, cy + x, y << 1, 1, color);
}


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

x86 assembly (clang, -O2):
<draw4rectangles>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%ebx
mov    %esi,%r12d
mov    %edi,%r13d
sub    %ecx,%edi
mov    %edi,(%rsp)
sub    %edx,%esi
lea    0x0(%rbp,%rbp,1),%edx
mov    %edx,0x4(%rsp)
mov    $0x1,%ecx
mov    %r8d,%r15d
call   1030 <fgui_draw_rectangle@plt>
sub    %ebx,%r13d
mov    %r12d,%esi
sub    %ebp,%esi
lea    (%rbx,%rbx,1),%r14d
mov    %r13d,%edi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    %r15d,%r8d
call   1030 <fgui_draw_rectangle@plt>
add    %r12d,%ebp
mov    %r13d,%edi
mov    %ebp,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
mov    %r15d,%r8d
call   1030 <fgui_draw_rectangle@plt>
add    %r12d,%ebx
mov    (%rsp),%edi
mov    %ebx,%esi
mov    0x4(%rsp),%edx
mov    $0x1,%ecx
mov    %r15d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fgui_draw_rectangle@plt>

LLVM IR (-O0):
define void @draw4rectangles(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* %9
%13 = sub nsw i32 %11, %12
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
%17 = load i32, i32* %9
%18 = shl i32 %17, 1
%19 = load i32, i32* %10
%20 = call i32 @fgui_draw_rectangle(i32 %13, i32 %16, i32 %18, i32 1, i32 %19)
%21 = load i32, i32* %6
%22 = load i32, i32* %8
%23 = sub nsw i32 %21, %22
%24 = load i32, i32* %7
%25 = load i32, i32* %9
%26 = sub nsw i32 %24, %25
%27 = load i32, i32* %8
%28 = shl i32 %27, 1
%29 = load i32, i32* %10
%30 = call i32 @fgui_draw_rectangle(i32 %23, i32 %26, i32 %28, i32 1, i32 %29)
%31 = load i32, i32* %6
%32 = load i32, i32* %8
%33 = sub nsw i32 %31, %32
%34 = load i32, i32* %7
%35 = load i32, i32* %9
%36 = add nsw i32 %34, %35
%37 = load i32, i32* %8
%38 = shl i32 %37, 1
%39 = load i32, i32* %10
%40 = call i32 @fgui_draw_rectangle(i32 %33, i32 %36, i32 %38, i32 1, i32 %39)
%41 = load i32, i32* %6
%42 = load i32, i32* %9
%43 = sub nsw i32 %41, %42
%44 = load i32, i32* %7
%45 = load i32, i32* %8
%46 = add nsw i32 %44, %45
%47 = load i32, i32* %9
%48 = shl i32 %47, 1
%49 = load i32, i32* %10
%50 = call i32 @fgui_draw_rectangle(i32 %43, i32 %46, i32 %48, i32 1, i32 %49)
ret void
}

LLVM IR (-O2):
define void @draw4rectangles(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sub nsw i32 %0, %3
%7 = sub nsw i32 %1, %2
%8 = shl i32 %3, 1
%9 = tail call i32 @fgui_draw_rectangle(i32 %6, i32 %7, i32 %8, i32 1, i32 %4)
%10 = sub nsw i32 %0, %2
%11 = sub nsw i32 %1, %3
%12 = shl i32 %2, 1
%13 = tail call i32 @fgui_draw_rectangle(i32 %10, i32 %11, i32 %12, i32 1, i32 %4)
%14 = add nsw i32 %3, %1
%15 = tail call i32 @fgui_draw_rectangle(i32 %10, i32 %14, i32 %12, i32 1, i32 %4)
%16 = add nsw i32 %2, %1
%17 = tail call i32 @fgui_draw_rectangle(i32 %6, i32 %16, i32 %8, i32 1, i32 %4)
ret void
}