#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 /*<<< orphan*/ depth;
  scalar_t__ height;
  scalar_t__ width;
};
typedef TYPE_1__ XWindowAttributes;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Pixmap;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XCreatePixmap(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 scalar_t__, scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ XGetWindowAttributes(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/, TYPE_1__ *);
Pixmap create_backing_store(Display *dpy, Window under, Window over) {
  Pixmap pmap;
  XWindowAttributes over_attrs, under_attrs;
  XGetWindowAttributes(dpy, under, &under_attrs);
  XGetWindowAttributes(dpy, over, &over_attrs);
  pmap = XCreatePixmap(dpy, under, over_attrs.width + 2 * 1,
                       over_attrs.height + 2 * 1, under_attrs.depth);
  return pmap;
}


x86 assembly (clang, -O0):
<create_backing_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x48(%rbp),%rdx
call   1030 <XGetWindowAttributes@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
lea    -0x30(%rbp),%rdx
call   1030 <XGetWindowAttributes@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
add    $0x2,%rdx
mov    -0x28(%rbp),%rcx
add    $0x2,%rcx
mov    -0x48(%rbp),%r8d
call   1040 <XCreatePixmap@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_backing_store>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0x18(%rsp),%rdx
call   1030 <XGetWindowAttributes@plt>
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <XGetWindowAttributes@plt>
mov    0x8(%rsp),%rcx
mov    0x10(%rsp),%rdx
add    $0x2,%rdx
add    $0x2,%rcx
mov    0x18(%rsp),%r8d
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <XCreatePixmap@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i64, i64 }
define i32 @create_backing_store(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.TYPE_3__
%9 = alloca %struct.TYPE_3__
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = call i32 @XGetWindowAttributes(i32* %10, i32 %11, %struct.TYPE_3__* %9)
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = call i32 @XGetWindowAttributes(i32* %13, i32 %14, %struct.TYPE_3__* %8)
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 2
%19 = load i64, i64* %18
%20 = add nsw i64 %19, 2
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 1
%22 = load i64, i64* %21
%23 = add nsw i64 %22, 2
%24 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
%25 = load i32, i32* %24
%26 = call i32 @XCreatePixmap(i32* %16, i32 %17, i64 %20, i64 %23, i32 %25)
store i32 %26, i32* %7
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i64, i64 }
define i32 @create_backing_store(i32* %0, i32 %1, i32 %2) {
%4 = alloca %struct.TYPE_3__
%5 = alloca %struct.TYPE_3__
%6 = bitcast %struct.TYPE_3__* %4 to i8*
%7 = bitcast %struct.TYPE_3__* %5 to i8*
%8 = call i32 @XGetWindowAttributes(i32* %0, i32 %1, %struct.TYPE_3__* %5)
%9 = call i32 @XGetWindowAttributes(i32* %0, i32 %2, %struct.TYPE_3__* %4)
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 2
%11 = load i64, i64* %10
%12 = add nsw i64 %11, 2
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %4, i64 0, i32 1
%14 = load i64, i64* %13
%15 = add nsw i64 %14, 2
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i64 0, i32 0
%17 = load i32, i32* %16
%18 = call i32 @XCreatePixmap(i32* %0, i32 %1, i64 %12, i64 %15, i32 %17)
ret i32 %18
}