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

/* Variables and functions */
int /*<<< orphan*/ DisplayOfScreen(int /*<<< orphan*/ *);
int /*<<< orphan*/ False;
int /*<<< orphan*/ True;
scalar_t__ VirtualRootWindowOfScreen(int /*<<< orphan*/ *);
scalar_t__ xscreensaver_window_p(int /*<<< orphan*/, scalar_t__);
Bool use_subwindow_mode_p(Screen *screen, Window window) {
  if (window != VirtualRootWindowOfScreen(screen))
    return False;
  else if (xscreensaver_window_p(DisplayOfScreen(screen), window))
    return False;
  else
    return True;
}


x86 assembly (clang, -O0):
<use_subwindow_mode_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <VirtualRootWindowOfScreen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
je     1172 <use_subwindow_mode_p+0x42>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ad <use_subwindow_mode_p+0x7d>
mov    -0x10(%rbp),%rdi
call   1030 <DisplayOfScreen@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1040 <xscreensaver_window_p@plt>
cmp    $0x0,%rax
je     11a1 <use_subwindow_mode_p+0x71>
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ad <use_subwindow_mode_p+0x7d>
mov    0x2e38(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_subwindow_mode_p>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <VirtualRootWindowOfScreen@plt>
cmp    %r14,%rax
jne    1164 <use_subwindow_mode_p+0x34>
mov    %rbx,%rdi
call   1030 <DisplayOfScreen@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <xscreensaver_window_p@plt>
test   %rax,%rax
jne    1164 <use_subwindow_mode_p+0x34>
mov    0x2e7e(%rip),%rax
jmp    116b <use_subwindow_mode_p+0x3b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@False = global i32 0
@True = global i32 0
define i32 @use_subwindow_mode_p(i32* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = load i32*, i32** %4
%8 = call i64 @VirtualRootWindowOfScreen(i32* %7)
%9 = icmp ne i64 %6, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @False
store i32 %11, i32* %3
br label %22
12: ; preds = %2
%13 = load i32*, i32** %4
%14 = call i32 @DisplayOfScreen(i32* %13)
%15 = load i64, i64* %5
%16 = call i64 @xscreensaver_window_p(i32 %14, i64 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = load i32, i32* @False
store i32 %19, i32* %3
br label %22
20: ; preds = %12
%21 = load i32, i32* @True
store i32 %21, i32* %3
br label %22
22: ; preds = %20, %18, %10
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@False = global i32 0
@True = global i32 0
define i32 @use_subwindow_mode_p(i32* %0, i64 %1) {
%3 = tail call i64 @VirtualRootWindowOfScreen(i32* %0)
%4 = icmp eq i64 %3, %1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @DisplayOfScreen(i32* %0)
%7 = tail call i64 @xscreensaver_window_p(i32 %6, i64 %1)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i32* @True, i32* @False
br label %10
10: ; preds = %5, %2
%11 = phi i32* [ @False, %2 ], [ %9, %5 ]
%12 = load i32, i32* %11
ret i32 %12
}