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

/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
struct TYPE_4__ {
  scalar_t__ type;
  int format;
  int /*<<< orphan*/ length;
};
typedef TYPE_1__ xcb_get_property_reply_t;
typedef int uint8_t;

/* Variables and functions */
scalar_t__ XCB_ATOM_WINDOW;
scalar_t__ xcb_get_property_value(TYPE_1__ *);
uint8_t
xcb_icccm_get_wm_transient_for_from_reply(xcb_window_t *prop,
                                          xcb_get_property_reply_t *reply) {
  if (!reply || reply->type != XCB_ATOM_WINDOW || reply->format != 32 ||
      !reply->length)
    return 0;
  *prop = *((xcb_window_t *)xcb_get_property_value(reply));
  return 1;
}


x86 assembly (clang, -O0):
<xcb_icccm_get_wm_transient_for_from_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115e <xcb_icccm_get_wm_transient_for_from_reply+0x4e>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x2ebf(%rip),%rcx
cmp    (%rcx),%rax
jne    115e <xcb_icccm_get_wm_transient_for_from_reply+0x4e>
mov    -0x18(%rbp),%rax
cmpl   $0x20,0x8(%rax)
jne    115e <xcb_icccm_get_wm_transient_for_from_reply+0x4e>
mov    -0x18(%rbp),%rax
cmpl   $0x0,0xc(%rax)
jne    116a <xcb_icccm_get_wm_transient_for_from_reply+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1182 <xcb_icccm_get_wm_transient_for_from_reply+0x72>
mov    -0x18(%rbp),%rdi
call   1030 <xcb_get_property_value@plt>
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_wm_transient_for_from_reply>:
push   %rbx
xor    %eax,%eax
test   %rsi,%rsi
je     1147 <xcb_icccm_get_wm_transient_for_from_reply+0x37>
mov    (%rsi),%rcx
mov    0x2ed6(%rip),%rdx
cmp    (%rdx),%rcx
jne    1147 <xcb_icccm_get_wm_transient_for_from_reply+0x37>
cmpl   $0x20,0x8(%rsi)
jne    1147 <xcb_icccm_get_wm_transient_for_from_reply+0x37>
cmpl   $0x0,0xc(%rsi)
je     1147 <xcb_icccm_get_wm_transient_for_from_reply+0x37>
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <xcb_get_property_value@plt>
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i64, i32, i32 }
@XCB_ATOM_WINDOW = global i64 0
define i32 @xcb_icccm_get_wm_transient_for_from_reply(i32* %0, %struct.TYPE_4__* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.TYPE_4__*
store i32* %0, i32** %4
store %struct.TYPE_4__* %1, %struct.TYPE_4__** %5
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%7 = icmp ne %struct.TYPE_4__* %6, null
br i1 %7, label %8, label %24
8: ; preds = %2
%9 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = load i64, i64* @XCB_ATOM_WINDOW
%13 = icmp ne i64 %11, %12
br i1 %13, label %24, label %14
14: ; preds = %8
%15 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %15, i32 0, i32 1
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 32
br i1 %18, label %24, label %19
19: ; preds = %14
%20 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%21 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %20, i32 0, i32 2
%22 = load i32, i32* %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %19, %14, %8, %2
store i32 0, i32* %3
br label %31
25: ; preds = %19
%26 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%27 = call i64 @xcb_get_property_value(%struct.TYPE_4__* %26)
%28 = inttoptr i64 %27 to i32*
%29 = load i32, i32* %28
%30 = load i32*, i32** %4
store i32 %29, i32* %30
store i32 1, i32* %3
br label %31
31: ; preds = %25, %24
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i64, i32, i32 }
@XCB_ATOM_WINDOW = global i64 0
define i32 @xcb_icccm_get_wm_transient_for_from_reply(i32* nocapture writeonly %0, %struct.TYPE_4__* %1) {
%3 = icmp eq %struct.TYPE_4__* %1, null
br i1 %3, label %21, label %4
4: ; preds = %2
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @XCB_ATOM_WINDOW
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %21
9: ; preds = %4
%10 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 1
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 32
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 2
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = tail call i64 @xcb_get_property_value(%struct.TYPE_4__* %1)
%19 = inttoptr i64 %18 to i32*
%20 = load i32, i32* %19
store i32 %20, i32* %0
br label %21
21: ; preds = %2, %4, %9, %13, %17
%22 = phi i32 [ 1, %17 ], [ 0, %13 ], [ 0, %9 ], [ 0, %4 ], [ 0, %2 ]
ret i32 %22
}