#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 */
typedef struct TYPE_6__ TYPE_2__;
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  int x;
  int y;
};
typedef TYPE_1__ XPoint;
struct TYPE_6__ {
  unsigned long foreground;
};
typedef TYPE_2__ XGCValues;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ GC;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ Convex;
int /*<<< orphan*/ CoordModeOrigin;
int /*<<< orphan*/ GCForeground;
int /*<<< orphan*/ XCreateGC(int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/, TYPE_2__ *);
int /*<<< orphan*/ XFillPolygon(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/, TYPE_1__ *, int,
                                int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ XFreeGC(int /*<<< orphan*/ *, int /*<<< orphan*/);
void draw_shaded_rectangle(Display *dpy, Window window, int x, int y, int width,
                           int height, int thickness, unsigned long top_color,
                           unsigned long bottom_color) {
  XPoint points[4];
  XGCValues gcv;
  GC gc1, gc2;
  if (thickness == 0)
    return;
  gcv.foreground = top_color;
  gc1 = XCreateGC(dpy, window, GCForeground, &gcv);
  gcv.foreground = bottom_color;
  gc2 = XCreateGC(dpy, window, GCForeground, &gcv);
  points[0].x = x;
  points[0].y = y;
  points[1].x = x + width;
  points[1].y = y;
  points[2].x = x + width - thickness;
  points[2].y = y + thickness;
  points[3].x = x;
  points[3].y = y + thickness;
  XFillPolygon(dpy, window, gc1, points, 4, Convex, CoordModeOrigin);
  points[0].x = x;
  points[0].y = y + thickness;
  points[1].x = x;
  points[1].y = y + height;
  points[2].x = x + thickness;
  points[2].y = y + height - thickness;
  points[3].x = x + thickness;
  points[3].y = y + thickness;
  XFillPolygon(dpy, window, gc1, points, 4, Convex, CoordModeOrigin);
  points[0].x = x + width;
  points[0].y = y;
  points[1].x = x + width - thickness;
  points[1].y = y + thickness;
  points[2].x = x + width - thickness;
  points[2].y = y + height - thickness;
  points[3].x = x + width;
  points[3].y = y + height - thickness;
  XFillPolygon(dpy, window, gc2, points, 4, Convex, CoordModeOrigin);
  points[0].x = x;
  points[0].y = y + height;
  points[1].x = x + width;
  points[1].y = y + height;
  points[2].x = x + width;
  points[2].y = y + height - thickness;
  points[3].x = x + thickness;
  points[3].y = y + height - thickness;
  XFillPolygon(dpy, window, gc2, points, 4, Convex, CoordModeOrigin);
  XFreeGC(dpy, gc1);
  XFreeGC(dpy, gc2);
}


x86 assembly (clang, -O0):
<draw_shaded_rectangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x0,0x10(%rbp)
jne    1167 <draw_shaded_rectangle+0x37>
jmp    13a3 <draw_shaded_rectangle+0x273>
mov    0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e6b(%rip),%rax
mov    (%rax),%edx
lea    -0x48(%rbp),%rcx
call   1040 <XCreateGC@plt>
mov    %eax,-0x4c(%rbp)
mov    0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e47(%rip),%rax
mov    (%rax),%edx
lea    -0x48(%rbp),%rcx
call   1040 <XCreateGC@plt>
mov    %eax,-0x50(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x4c(%rbp),%edx
lea    -0x40(%rbp),%rcx
mov    0x2dcd(%rip),%rax
mov    (%rax),%r9d
mov    0x2dd3(%rip),%rax
mov    (%rax),%eax
mov    $0x4,%r8d
mov    %eax,(%rsp)
call   1030 <XFillPolygon@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x14(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x4c(%rbp),%edx
lea    -0x40(%rbp),%rcx
mov    0x2d59(%rip),%rax
mov    (%rax),%r9d
mov    0x2d5f(%rip),%rax
mov    (%rax),%eax
mov    $0x4,%r8d
mov    %eax,(%rsp)
call   1030 <XFillPolygon@plt>
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x50(%rbp),%edx
lea    -0x40(%rbp),%rcx
mov    0x2cd9(%rip),%rax
mov    (%rax),%r9d
mov    0x2cdf(%rip),%rax
mov    (%rax),%eax
mov    $0x4,%r8d
mov    %eax,(%rsp)
call   1030 <XFillPolygon@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
sub    0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x50(%rbp),%edx
lea    -0x40(%rbp),%rcx
mov    0x2c5f(%rip),%rax
mov    (%rax),%r9d
mov    0x2c65(%rip),%rax
mov    (%rax),%eax
mov    $0x4,%r8d
mov    %eax,(%rsp)
call   1030 <XFillPolygon@plt>
mov    -0x8(%rbp),%rdi
mov    -0x4c(%rbp),%esi
call   1050 <XFreeGC@plt>
mov    -0x8(%rbp),%rdi
mov    -0x50(%rbp),%esi
call   1050 <XFreeGC@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_shaded_rectangle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdx,0x70(%rsp)
mov    0xb0(%rsp),%eax
test   %eax,%eax
je     137e <draw_shaded_rectangle+0x24e>
mov    %r9d,%r12d
mov    %r8d,%ebp
mov    %ecx,%r14d
mov    0xb8(%rsp),%rax
mov    %rax,0x40(%rsp)
mov    0x2e79(%rip),%r13
mov    0x0(%r13),%edx
lea    0x40(%rsp),%rcx
mov    %rdi,%r15
mov    %rdi,0x68(%rsp)
mov    %esi,%ebx
mov    %esi,0x38(%rsp)
call   1040 <XCreateGC@plt>
mov    %eax,0x3c(%rsp)
mov    0xc0(%rsp),%rax
mov    %rax,0x40(%rsp)
mov    0x0(%r13),%edx
mov    %r15,%rdi
mov    %ebx,%esi
lea    0x40(%rsp),%rcx
call   1040 <XCreateGC@plt>
mov    %eax,0x5c(%rsp)
mov    0x70(%rsp),%r15
mov    %r15d,0x10(%rsp)
mov    %r14,%r13
mov    %r13d,0x14(%rsp)
add    %r15d,%ebp
mov    %ebp,0x54(%rsp)
mov    %ebp,0x18(%rsp)
mov    %r13d,0x1c(%rsp)
mov    0xb0(%rsp),%ecx
sub    %ecx,%ebp
mov    %ebp,0x58(%rsp)
mov    %ebp,0x20(%rsp)
add    %ecx,%r14d
mov    %r13,0x60(%rsp)
mov    %r14d,0x24(%rsp)
mov    %r15d,0x28(%rsp)
mov    %r14d,0x2c(%rsp)
mov    0x2dcc(%rip),%rax
mov    (%rax),%r9d
mov    0x2dd2(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
lea    0x10(%rsp),%rcx
mov    0x68(%rsp),%rbx
mov    %rbx,%rdi
mov    0x38(%rsp),%esi
mov    0x3c(%rsp),%ebp
mov    %ebp,%edx
mov    $0x4,%r8d
call   1030 <XFillPolygon@plt>
mov    %r15d,0x10(%rsp)
mov    %r14d,0x14(%rsp)
mov    %r15d,0x18(%rsp)
add    %r13d,%r12d
mov    %r12d,0x1c(%rsp)
mov    0xb0(%rsp),%ecx
lea    (%rcx,%r15,1),%eax
mov    %eax,0x50(%rsp)
mov    %eax,0x20(%rsp)
mov    %r12d,0x4c(%rsp)
sub    %ecx,%r12d
mov    %r12d,0x24(%rsp)
mov    %eax,0x28(%rsp)
mov    %r14d,0x2c(%rsp)
mov    0x2d54(%rip),%rax
mov    (%rax),%r9d
mov    0x2d5a(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    0x38(%rsp),%r13d
mov    %r13d,%esi
mov    %ebp,%edx
lea    0x10(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <XFillPolygon@plt>
mov    0x54(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    0x60(%rsp),%rcx
mov    %ecx,0x14(%rsp)
mov    0x58(%rsp),%ecx
mov    %ecx,0x18(%rsp)
mov    %r14d,0x1c(%rsp)
mov    %ecx,0x20(%rsp)
mov    %r12d,0x24(%rsp)
mov    %eax,0x28(%rsp)
mov    %eax,%r14d
mov    %r12d,0x2c(%rsp)
mov    0x2cee(%rip),%rax
mov    (%rax),%r9d
mov    0x2cf4(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    %r13d,%esi
mov    0x5c(%rsp),%ebp
mov    %ebp,%edx
lea    0x10(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <XFillPolygon@plt>
mov    %r15d,0x10(%rsp)
mov    0x4c(%rsp),%eax
mov    %eax,0x14(%rsp)
mov    %r14d,0x18(%rsp)
mov    %eax,0x1c(%rsp)
mov    %r14d,0x20(%rsp)
mov    %r12d,0x24(%rsp)
mov    0x50(%rsp),%eax
mov    %eax,0x28(%rsp)
mov    %r12d,0x2c(%rsp)
mov    0x2c8f(%rip),%rax
mov    (%rax),%r9d
mov    0x2c95(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %ebp,%edx
lea    0x10(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <XFillPolygon@plt>
mov    %rbx,%rdi
mov    0x3c(%rsp),%esi
call   1050 <XFreeGC@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <XFreeGC@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32, i32 }
%struct.TYPE_6__ = type { i64 }
@GCForeground = global i32 0
@Convex = global i32 0
@CoordModeOrigin = global i32 0
define void @draw_shaded_rectangle(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i64 %7, i64 %8) {
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i64
%18 = alloca i64
%19 = alloca [4 x %struct.TYPE_5__]
%20 = alloca %struct.TYPE_6__
%21 = alloca i32
%22 = alloca i32
store i32* %0, i32** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i64 %7, i64* %17
store i64 %8, i64* %18
%23 = load i32, i32* %16
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %9
br label %233
26: ; preds = %9
%27 = load i64, i64* %17
%28 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %20, i32 0, i32 0
store i64 %27, i64* %28
%29 = load i32*, i32** %10
%30 = load i32, i32* %11
%31 = load i32, i32* @GCForeground
%32 = call i32 @XCreateGC(i32* %29, i32 %30, i32 %31, %struct.TYPE_6__* %20)
store i32 %32, i32* %21
%33 = load i64, i64* %18
%34 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %20, i32 0, i32 0
store i64 %33, i64* %34
%35 = load i32*, i32** %10
%36 = load i32, i32* %11
%37 = load i32, i32* @GCForeground
%38 = call i32 @XCreateGC(i32* %35, i32 %36, i32 %37, %struct.TYPE_6__* %20)
store i32 %38, i32* %22
%39 = load i32, i32* %12
%40 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%41 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %40, i32 0, i32 0
store i32 %39, i32* %41
%42 = load i32, i32* %13
%43 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%44 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %43, i32 0, i32 1
store i32 %42, i32* %44
%45 = load i32, i32* %12
%46 = load i32, i32* %14
%47 = add nsw i32 %45, %46
%48 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 1
%49 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %48, i32 0, i32 0
store i32 %47, i32* %49
%50 = load i32, i32* %13
%51 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 1
%52 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %51, i32 0, i32 1
store i32 %50, i32* %52
%53 = load i32, i32* %12
%54 = load i32, i32* %14
%55 = add nsw i32 %53, %54
%56 = load i32, i32* %16
%57 = sub nsw i32 %55, %56
%58 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 2
%59 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %58, i32 0, i32 0
store i32 %57, i32* %59
%60 = load i32, i32* %13
%61 = load i32, i32* %16
%62 = add nsw i32 %60, %61
%63 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 2
%64 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %63, i32 0, i32 1
store i32 %62, i32* %64
%65 = load i32, i32* %12
%66 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 3
%67 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %66, i32 0, i32 0
store i32 %65, i32* %67
%68 = load i32, i32* %13
%69 = load i32, i32* %16
%70 = add nsw i32 %68, %69
%71 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 3
%72 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %71, i32 0, i32 1
store i32 %70, i32* %72
%73 = load i32*, i32** %10
%74 = load i32, i32* %11
%75 = load i32, i32* %21
%76 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%77 = load i32, i32* @Convex
%78 = load i32, i32* @CoordModeOrigin
%79 = call i32 @XFillPolygon(i32* %73, i32 %74, i32 %75, %struct.TYPE_5__* %76, i32 4, i32 %77, i32 %78)
%80 = load i32, i32* %12
%81 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%82 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %81, i32 0, i32 0
store i32 %80, i32* %82
%83 = load i32, i32* %13
%84 = load i32, i32* %16
%85 = add nsw i32 %83, %84
%86 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%87 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %86, i32 0, i32 1
store i32 %85, i32* %87
%88 = load i32, i32* %12
%89 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 1
%90 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %89, i32 0, i32 0
store i32 %88, i32* %90
%91 = load i32, i32* %13
%92 = load i32, i32* %15
%93 = add nsw i32 %91, %92
%94 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 1
%95 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %94, i32 0, i32 1
store i32 %93, i32* %95
%96 = load i32, i32* %12
%97 = load i32, i32* %16
%98 = add nsw i32 %96, %97
%99 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 2
%100 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %99, i32 0, i32 0
store i32 %98, i32* %100
%101 = load i32, i32* %13
%102 = load i32, i32* %15
%103 = add nsw i32 %101, %102
%104 = load i32, i32* %16
%105 = sub nsw i32 %103, %104
%106 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 2
%107 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %106, i32 0, i32 1
store i32 %105, i32* %107
%108 = load i32, i32* %12
%109 = load i32, i32* %16
%110 = add nsw i32 %108, %109
%111 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 3
%112 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %111, i32 0, i32 0
store i32 %110, i32* %112
%113 = load i32, i32* %13
%114 = load i32, i32* %16
%115 = add nsw i32 %113, %114
%116 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 3
%117 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %116, i32 0, i32 1
store i32 %115, i32* %117
%118 = load i32*, i32** %10
%119 = load i32, i32* %11
%120 = load i32, i32* %21
%121 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%122 = load i32, i32* @Convex
%123 = load i32, i32* @CoordModeOrigin
%124 = call i32 @XFillPolygon(i32* %118, i32 %119, i32 %120, %struct.TYPE_5__* %121, i32 4, i32 %122, i32 %123)
%125 = load i32, i32* %12
%126 = load i32, i32* %14
%127 = add nsw i32 %125, %126
%128 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%129 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %128, i32 0, i32 0
store i32 %127, i32* %129
%130 = load i32, i32* %13
%131 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%132 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %131, i32 0, i32 1
store i32 %130, i32* %132
%133 = load i32, i32* %12
%134 = load i32, i32* %14
%135 = add nsw i32 %133, %134
%136 = load i32, i32* %16
%137 = sub nsw i32 %135, %136
%138 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 1
%139 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %138, i32 0, i32 0
store i32 %137, i32* %139
%140 = load i32, i32* %13
%141 = load i32, i32* %16
%142 = add nsw i32 %140, %141
%143 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 1
%144 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %143, i32 0, i32 1
store i32 %142, i32* %144
%145 = load i32, i32* %12
%146 = load i32, i32* %14
%147 = add nsw i32 %145, %146
%148 = load i32, i32* %16
%149 = sub nsw i32 %147, %148
%150 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 2
%151 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %150, i32 0, i32 0
store i32 %149, i32* %151
%152 = load i32, i32* %13
%153 = load i32, i32* %15
%154 = add nsw i32 %152, %153
%155 = load i32, i32* %16
%156 = sub nsw i32 %154, %155
%157 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 2
%158 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %157, i32 0, i32 1
store i32 %156, i32* %158
%159 = load i32, i32* %12
%160 = load i32, i32* %14
%161 = add nsw i32 %159, %160
%162 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 3
%163 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %162, i32 0, i32 0
store i32 %161, i32* %163
%164 = load i32, i32* %13
%165 = load i32, i32* %15
%166 = add nsw i32 %164, %165
%167 = load i32, i32* %16
%168 = sub nsw i32 %166, %167
%169 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 3
%170 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %169, i32 0, i32 1
store i32 %168, i32* %170
%171 = load i32*, i32** %10
%172 = load i32, i32* %11
%173 = load i32, i32* %22
%174 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%175 = load i32, i32* @Convex
%176 = load i32, i32* @CoordModeOrigin
%177 = call i32 @XFillPolygon(i32* %171, i32 %172, i32 %173, %struct.TYPE_5__* %174, i32 4, i32 %175, i32 %176)
%178 = load i32, i32* %12
%179 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%180 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %179, i32 0, i32 0
store i32 %178, i32* %180
%181 = load i32, i32* %13
%182 = load i32, i32* %15
%183 = add nsw i32 %181, %182
%184 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%185 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %184, i32 0, i32 1
store i32 %183, i32* %185
%186 = load i32, i32* %12
%187 = load i32, i32* %14
%188 = add nsw i32 %186, %187
%189 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 1
%190 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %189, i32 0, i32 0
store i32 %188, i32* %190
%191 = load i32, i32* %13
%192 = load i32, i32* %15
%193 = add nsw i32 %191, %192
%194 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 1
%195 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %194, i32 0, i32 1
store i32 %193, i32* %195
%196 = load i32, i32* %12
%197 = load i32, i32* %14
%198 = add nsw i32 %196, %197
%199 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 2
%200 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %199, i32 0, i32 0
store i32 %198, i32* %200
%201 = load i32, i32* %13
%202 = load i32, i32* %15
%203 = add nsw i32 %201, %202
%204 = load i32, i32* %16
%205 = sub nsw i32 %203, %204
%206 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 2
%207 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %206, i32 0, i32 1
store i32 %205, i32* %207
%208 = load i32, i32* %12
%209 = load i32, i32* %16
%210 = add nsw i32 %208, %209
%211 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 3
%212 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %211, i32 0, i32 0
store i32 %210, i32* %212
%213 = load i32, i32* %13
%214 = load i32, i32* %15
%215 = add nsw i32 %213, %214
%216 = load i32, i32* %16
%217 = sub nsw i32 %215, %216
%218 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 3
%219 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %218, i32 0, i32 1
store i32 %217, i32* %219
%220 = load i32*, i32** %10
%221 = load i32, i32* %11
%222 = load i32, i32* %22
%223 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %19, i64 0, i64 0
%224 = load i32, i32* @Convex
%225 = load i32, i32* @CoordModeOrigin
%226 = call i32 @XFillPolygon(i32* %220, i32 %221, i32 %222, %struct.TYPE_5__* %223, i32 4, i32 %224, i32 %225)
%227 = load i32*, i32** %10
%228 = load i32, i32* %21
%229 = call i32 @XFreeGC(i32* %227, i32 %228)
%230 = load i32*, i32** %10
%231 = load i32, i32* %22
%232 = call i32 @XFreeGC(i32* %230, i32 %231)
br label %233
233: ; preds = %26, %25
ret void
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32, i32 }
%struct.TYPE_6__ = type { i64 }
@GCForeground = global i32 0
@Convex = global i32 0
@CoordModeOrigin = global i32 0
define void @draw_shaded_rectangle(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i64 %7, i64 %8) {
%10 = alloca [4 x %struct.TYPE_5__]
%11 = alloca %struct.TYPE_6__
%12 = bitcast [4 x %struct.TYPE_5__]* %10 to i8*
%13 = bitcast %struct.TYPE_6__* %11 to i8*
%14 = icmp eq i32 %6, 0
br i1 %14, label %50, label %15
15: ; preds = %9
%16 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %11, i64 0, i32 0
store i64 %7, i64* %16
%17 = load i32, i32* @GCForeground
%18 = call i32 @XCreateGC(i32* %0, i32 %1, i32 %17, %struct.TYPE_6__* %11)
store i64 %8, i64* %16
%19 = load i32, i32* @GCForeground
%20 = call i32 @XCreateGC(i32* %0, i32 %1, i32 %19, %struct.TYPE_6__* %11)
%21 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %10, i64 0, i64 0
%22 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %10, i64 0, i64 0, i32 0
store i32 %2, i32* %22
%23 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %10, i64 0, i64 0, i32 1
store i32 %3, i32* %23
%24 = add nsw i32 %4, %2
%25 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %10, i64 0, i64 1, i32 0
store i32 %24, i32* %25
%26 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %10, i64 0, i64 1, i32 1
store i32 %3, i32* %26
%27 = sub nsw i32 %24, %6
%28 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %10, i64 0, i64 2, i32 0
store i32 %27, i32* %28
%29 = add nsw i32 %6, %3
%30 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %10, i64 0, i64 2, i32 1
store i32 %29, i32* %30
%31 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %10, i64 0, i64 3, i32 0
store i32 %2, i32* %31
%32 = getelementptr inbounds [4 x %struct.TYPE_5__], [4 x %struct.TYPE_5__]* %10, i64 0, i64 3, i32 1
store i32 %29, i32* %32
%33 = load i32, i32* @Convex
%34 = load i32, i32* @CoordModeOrigin
%35 = call i32 @XFillPolygon(i32* %0, i32 %1, i32 %18, %struct.TYPE_5__* %21, i32 4, i32 %33, i32 %34)
store i32 %2, i32* %22
store i32 %29, i32* %23
store i32 %2, i32* %25
%36 = add nsw i32 %5, %3
store i32 %36, i32* %26
%37 = add nsw i32 %6, %2
store i32 %37, i32* %28
%38 = sub nsw i32 %36, %6
store i32 %38, i32* %30
store i32 %37, i32* %31
store i32 %29, i32* %32
%39 = load i32, i32* @Convex
%40 = load i32, i32* @CoordModeOrigin
%41 = call i32 @XFillPolygon(i32* %0, i32 %1, i32 %18, %struct.TYPE_5__* %21, i32 4, i32 %39, i32 %40)
store i32 %24, i32* %22
store i32 %3, i32* %23
store i32 %27, i32* %25
store i32 %29, i32* %26
store i32 %27, i32* %28
store i32 %38, i32* %30
store i32 %24, i32* %31
store i32 %38, i32* %32
%42 = load i32, i32* @Convex
%43 = load i32, i32* @CoordModeOrigin
%44 = call i32 @XFillPolygon(i32* %0, i32 %1, i32 %20, %struct.TYPE_5__* %21, i32 4, i32 %42, i32 %43)
store i32 %2, i32* %22
store i32 %36, i32* %23
store i32 %24, i32* %25
store i32 %36, i32* %26
store i32 %24, i32* %28
store i32 %38, i32* %30
store i32 %37, i32* %31
store i32 %38, i32* %32
%45 = load i32, i32* @Convex
%46 = load i32, i32* @CoordModeOrigin
%47 = call i32 @XFillPolygon(i32* %0, i32 %1, i32 %20, %struct.TYPE_5__* %21, i32 4, i32 %45, i32 %46)
%48 = call i32 @XFreeGC(i32* %0, i32 %18)
%49 = call i32 @XFreeGC(i32* %0, i32 %20)
br label %50
50: ; preds = %9, %15
ret void
}