#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*/ Window;
typedef scalar_t__ Pixmap;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
scalar_t__ None;
int /*<<< orphan*/ XGetGeometry(int /*<<< orphan*/ *, scalar_t__,
                                int /*<<< orphan*/ *, int *, int *,
                                unsigned int *, unsigned int *, unsigned int *,
                                unsigned int *);
scalar_t__ XtUnspecifiedPixmap;
void get_pixmap_dimensions(Display *d, Pixmap pixmap, unsigned *width_return,
                           unsigned *height_return) {
  if (pixmap != None && pixmap != XtUnspecifiedPixmap) {
    Window root;
    int x, y;
    unsigned int bw, depth;
    XGetGeometry(d, pixmap, &root, &x, &y, width_return, height_return, &bw,
                 &depth);
  } else {
    *width_return = *height_return = 0;
  }
}


x86 assembly (clang, -O0):
<get_pixmap_dimensions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eb5(%rip),%rcx
cmp    (%rcx),%rax
je     118c <get_pixmap_dimensions+0x7c>
mov    -0x10(%rbp),%rax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%rax
je     118c <get_pixmap_dimensions+0x7c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r11
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%r8
lea    -0x30(%rbp),%r10
lea    -0x34(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <XGetGeometry@plt>
jmp    11a0 <get_pixmap_dimensions+0x90>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pixmap_dimensions>:
sub    $0x18,%rsp
mov    %rcx,%rax
mov    %rdx,%r9
mov    0x2ec7(%rip),%rcx
cmp    %rsi,(%rcx)
je     1162 <get_pixmap_dimensions+0x52>
mov    0x2eab(%rip),%rcx
cmp    %rsi,(%rcx)
je     1162 <get_pixmap_dimensions+0x52>
sub    $0x8,%rsp
lea    0xc(%rsp),%r10
lea    0x10(%rsp),%r11
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x14(%rsp),%r8
push   %r10
push   %r11
push   %rax
call   1030 <XGetGeometry@plt>
add    $0x20,%rsp
add    $0x18,%rsp
ret
movl   $0x0,(%rax)
movl   $0x0,(%r9)
add    $0x18,%rsp
ret

LLVM IR (-O0):
@None = global i64 0
@XtUnspecifiedPixmap = global i64 0
define void @get_pixmap_dimensions(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%14 = load i64, i64* %6
%15 = load i64, i64* @None
%16 = icmp ne i64 %14, %15
br i1 %16, label %17, label %27
17: ; preds = %4
%18 = load i64, i64* %6
%19 = load i64, i64* @XtUnspecifiedPixmap
%20 = icmp ne i64 %18, %19
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i32*, i32** %5
%23 = load i64, i64* %6
%24 = load i32*, i32** %7
%25 = load i32*, i32** %8
%26 = call i32 @XGetGeometry(i32* %22, i64 %23, i32* %9, i32* %10, i32* %11, i32* %24, i32* %25, i32* %12, i32* %13)
br label %30
27: ; preds = %17, %4
%28 = load i32*, i32** %8
store i32 0, i32* %28
%29 = load i32*, i32** %7
store i32 0, i32* %29
br label %30
30: ; preds = %27, %21
ret void
}

LLVM IR (-O2):
@None = global i64 0
@XtUnspecifiedPixmap = global i64 0
define void @get_pixmap_dimensions(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = load i64, i64* @None
%11 = icmp eq i64 %10, %1
%12 = load i64, i64* @XtUnspecifiedPixmap
%13 = icmp eq i64 %12, %1
%14 = select i1 %11, i1 true, i1 %13
br i1 %14, label %22, label %15
15: ; preds = %4
%16 = bitcast i32* %5 to i8*
%17 = bitcast i32* %6 to i8*
%18 = bitcast i32* %7 to i8*
%19 = bitcast i32* %8 to i8*
%20 = bitcast i32* %9 to i8*
%21 = call i32 @XGetGeometry(i32* %0, i64 %1, i32* %5, i32* %6, i32* %7, i32* %2, i32* %3, i32* %8, i32* %9)
br label %23
22: ; preds = %4
store i32 0, i32* %3
store i32 0, i32* %2
br label %23
23: ; preds = %22, %15
ret void
}