#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_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x;
  int y;
  unsigned int width;
  unsigned int height;
};
typedef TYPE_1__ XRectangle;
typedef int /*<<< orphan*/ Region;

/* Variables and functions */
int /*<<< orphan*/ XCreateRegion();
int /*<<< orphan*/ XUnionRectWithRegion(TYPE_1__ *, int /*<<< orphan*/,
                                        int /*<<< orphan*/);
Region MakeRegionFromRect(int x, int y, unsigned int w, unsigned int h) {
  XRectangle r;
  Region reg;
  r.x = x;
  r.y = y;
  r.width = w;
  r.height = h;
  reg = XCreateRegion();
  XUnionRectWithRegion(&r, reg, reg);
  return reg;
}


x86 assembly (clang, -O0):
<MakeRegionFromRect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <XCreateRegion@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    -0x20(%rbp),%rdi
call   1030 <XUnionRectWithRegion@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeRegionFromRect>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %edx,0x8(%rsp)
mov    %ecx,0xc(%rsp)
xor    %eax,%eax
call   1040 <XCreateRegion@plt>
mov    %eax,%ebx
mov    %rsp,%rdi
mov    %eax,%esi
mov    %eax,%edx
call   1030 <XUnionRectWithRegion@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i32 }
define i32 @MakeRegionFromRect(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.TYPE_3__
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i32 %11, i32* %12
%13 = load i32, i32* %6
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 1
store i32 %13, i32* %14
%15 = load i32, i32* %7
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 2
store i32 %15, i32* %16
%17 = load i32, i32* %8
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 3
store i32 %17, i32* %18
%19 = call i32 (...) @XCreateRegion()
store i32 %19, i32* %10
%20 = load i32, i32* %10
%21 = load i32, i32* %10
%22 = call i32 @XUnionRectWithRegion(%struct.TYPE_3__* %9, i32 %20, i32 %21)
%23 = load i32, i32* %10
ret i32 %23
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i32 }
define i32 @MakeRegionFromRect(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.TYPE_3__
%6 = bitcast %struct.TYPE_3__* %5 to i8*
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i64 0, i32 0
store i32 %0, i32* %7
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i64 0, i32 1
store i32 %1, i32* %8
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i64 0, i32 2
store i32 %2, i32* %9
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i64 0, i32 3
store i32 %3, i32* %10
%11 = tail call i32 (...) @XCreateRegion()
%12 = call i32 @XUnionRectWithRegion(%struct.TYPE_3__* %5, i32 %11, i32 %11)
ret i32 %11
}