#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_10__ TYPE_3__;
typedef struct TYPE_9__ TYPE_2__;
typedef struct TYPE_8__ TYPE_1__;

/* Type definitions */
struct TYPE_9__ {
  int request_mode;
  scalar_t__ width;
  scalar_t__ height;
};
typedef TYPE_2__ XtWidgetGeometry;
typedef int /*<<< orphan*/ XtGeometryResult;
typedef TYPE_3__ *Widget;
struct TYPE_8__ {
  scalar_t__ width;
  scalar_t__ height;
};
struct TYPE_10__ {
  TYPE_1__ core;
};

/* Variables and functions */
int CWHeight;
int CWWidth;
int /*<<< orphan*/ RefigureLocations(TYPE_3__ *);
int XtCWQueryOnly;
int /*<<< orphan*/ XtGeometryNo;
int /*<<< orphan*/ XtGeometryYes;
XtGeometryResult GeometryManager(Widget w, XtWidgetGeometry *request,
                                 XtWidgetGeometry *reply) {
  XtWidgetGeometry allowed;
  if (request->request_mode & ~(XtCWQueryOnly | CWWidth | CWHeight))
    return XtGeometryNo;
  if (request->request_mode & CWWidth)
    allowed.width = request->width;
  else
    allowed.width = w->core.width;
  if (request->request_mode & CWHeight)
    allowed.height = request->height;
  else
    allowed.height = w->core.height;
  if (allowed.width == w->core.width && allowed.height == w->core.height)
    return XtGeometryNo;
  if (!(request->request_mode & XtCWQueryOnly))
    RefigureLocations(w);
  return XtGeometryYes;
}


x86 assembly (clang, -O0):
<GeometryManager>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    0x2ebf(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2e86(%rip),%rdx
or     (%rdx),%ecx
mov    0x2e95(%rip),%rdx
or     (%rdx),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1164 <GeometryManager+0x54>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    122e <GeometryManager+0x11e>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    0x2e4f(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     118d <GeometryManager+0x7d>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    1198 <GeometryManager+0x88>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    0x2e33(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     11c1 <GeometryManager+0xb1>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    11cd <GeometryManager+0xbd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jne    1201 <GeometryManager+0xf1>
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    0x8(%rcx),%rax
jne    1201 <GeometryManager+0xf1>
mov    0x2dd9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    122e <GeometryManager+0x11e>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    0x2de2(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
jne    1222 <GeometryManager+0x112>
mov    -0x10(%rbp),%rdi
call   1030 <RefigureLocations@plt>
mov    0x2dbf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GeometryManager>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%eax
mov    0x2ed3(%rip),%rcx
mov    (%rcx),%r8d
mov    0x2e99(%rip),%rdx
mov    (%rdx),%ecx
mov    %ecx,%ebx
or     %r8d,%ebx
mov    0x2ea3(%rip),%rdx
mov    (%rdx),%edx
or     %edx,%ebx
not    %ebx
mov    0x2e8e(%rip),%r14
test   %ebx,%eax
jne    117f <GeometryManager+0x6f>
lea    0x8(%rsi),%rbx
test   %eax,%ecx
cmove  %rdi,%rbx
mov    (%rbx),%rcx
cmp    (%rdi),%rcx
jne    116e <GeometryManager+0x5e>
lea    0x8(%rdi),%rcx
add    $0x10,%rsi
test   %eax,%edx
cmove  %rcx,%rsi
mov    (%rsi),%rdx
cmp    (%rcx),%rdx
je     117f <GeometryManager+0x6f>
mov    0x2e73(%rip),%r14
test   %eax,%r8d
jne    117f <GeometryManager+0x6f>
call   1030 <RefigureLocations@plt>
mov    (%r14),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_10__ = type { %struct.TYPE_8__ }
%struct.TYPE_8__ = type { i64, i64 }
%struct.TYPE_9__ = type { i32, i64, i64 }
@XtCWQueryOnly = global i32 0
@CWWidth = global i32 0
@CWHeight = global i32 0
@XtGeometryNo = global i32 0
@XtGeometryYes = global i32 0
define i32 @GeometryManager(%struct.TYPE_10__* %0, %struct.TYPE_9__* %1, %struct.TYPE_9__* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_10__*
%6 = alloca %struct.TYPE_9__*
%7 = alloca %struct.TYPE_9__*
%8 = alloca %struct.TYPE_9__
store %struct.TYPE_10__* %0, %struct.TYPE_10__** %5
store %struct.TYPE_9__* %1, %struct.TYPE_9__** %6
store %struct.TYPE_9__* %2, %struct.TYPE_9__** %7
%9 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%10 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @XtCWQueryOnly
%13 = load i32, i32* @CWWidth
%14 = or i32 %12, %13
%15 = load i32, i32* @CWHeight
%16 = or i32 %14, %15
%17 = xor i32 %16, -1
%18 = and i32 %11, %17
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %3
%21 = load i32, i32* @XtGeometryNo
store i32 %21, i32* %4
br label %88
22: ; preds = %3
%23 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%24 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %23, i32 0, i32 0
%25 = load i32, i32* %24
%26 = load i32, i32* @CWWidth
%27 = and i32 %25, %26
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %22
%30 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%31 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %30, i32 0, i32 1
%32 = load i64, i64* %31
%33 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %8, i32 0, i32 1
store i64 %32, i64* %33
br label %40
34: ; preds = %22
%35 = load %struct.TYPE_10__*, %struct.TYPE_10__** %5
%36 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %35, i32 0, i32 0
%37 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %36, i32 0, i32 0
%38 = load i64, i64* %37
%39 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %8, i32 0, i32 1
store i64 %38, i64* %39
br label %40
40: ; preds = %34, %29
%41 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%42 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %41, i32 0, i32 0
%43 = load i32, i32* %42
%44 = load i32, i32* @CWHeight
%45 = and i32 %43, %44
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %52
47: ; preds = %40
%48 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%49 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %48, i32 0, i32 2
%50 = load i64, i64* %49
%51 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %8, i32 0, i32 2
store i64 %50, i64* %51
br label %58
52: ; preds = %40
%53 = load %struct.TYPE_10__*, %struct.TYPE_10__** %5
%54 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %53, i32 0, i32 0
%55 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %54, i32 0, i32 1
%56 = load i64, i64* %55
%57 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %8, i32 0, i32 2
store i64 %56, i64* %57
br label %58
58: ; preds = %52, %47
%59 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %8, i32 0, i32 1
%60 = load i64, i64* %59
%61 = load %struct.TYPE_10__*, %struct.TYPE_10__** %5
%62 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %61, i32 0, i32 0
%63 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %62, i32 0, i32 0
%64 = load i64, i64* %63
%65 = icmp eq i64 %60, %64
br i1 %65, label %66, label %76
66: ; preds = %58
%67 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %8, i32 0, i32 2
%68 = load i64, i64* %67
%69 = load %struct.TYPE_10__*, %struct.TYPE_10__** %5
%70 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %69, i32 0, i32 0
%71 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %70, i32 0, i32 1
%72 = load i64, i64* %71
%73 = icmp eq i64 %68, %72
br i1 %73, label %74, label %76
74: ; preds = %66
%75 = load i32, i32* @XtGeometryNo
store i32 %75, i32* %4
br label %88
76: ; preds = %66, %58
%77 = load %struct.TYPE_9__*, %struct.TYPE_9__** %6
%78 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %77, i32 0, i32 0
%79 = load i32, i32* %78
%80 = load i32, i32* @XtCWQueryOnly
%81 = and i32 %79, %80
%82 = icmp ne i32 %81, 0
br i1 %82, label %86, label %83
83: ; preds = %76
%84 = load %struct.TYPE_10__*, %struct.TYPE_10__** %5
%85 = call i32 @RefigureLocations(%struct.TYPE_10__* %84)
br label %86
86: ; preds = %83, %76
%87 = load i32, i32* @XtGeometryYes
store i32 %87, i32* %4
br label %88
88: ; preds = %86, %74, %20
%89 = load i32, i32* %4
ret i32 %89
}

LLVM IR (-O2):
%struct.TYPE_10__ = type { %struct.TYPE_8__ }
%struct.TYPE_8__ = type { i64, i64 }
%struct.TYPE_9__ = type { i32, i64, i64 }
@XtCWQueryOnly = global i32 0
@CWWidth = global i32 0
@CWHeight = global i32 0
@XtGeometryNo = global i32 0
@XtGeometryYes = global i32 0
define i32 @GeometryManager(%struct.TYPE_10__* %0, %struct.TYPE_9__* nocapture %1, %struct.TYPE_9__* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @XtCWQueryOnly
%7 = load i32, i32* @CWWidth
%8 = or i32 %7, %6
%9 = load i32, i32* @CWHeight
%10 = or i32 %8, %9
%11 = xor i32 %10, -1
%12 = and i32 %5, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %37
14: ; preds = %3
%15 = and i32 %7, %5
%16 = icmp eq i32 %15, 0
%17 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %1, i64 0, i32 1
%18 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %0, i64 0, i32 0, i32 0
%19 = select i1 %16, i64* %18, i64* %17
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.TYPE_10__, %struct.TYPE_10__* %0, i64 0, i32 0, i32 1
%22 = load i64, i64* %18
%23 = icmp eq i64 %20, %22
br i1 %23, label %24, label %32
24: ; preds = %14
%25 = and i32 %9, %5
%26 = icmp eq i32 %25, 0
%27 = getelementptr inbounds %struct.TYPE_9__, %struct.TYPE_9__* %1, i64 0, i32 2
%28 = select i1 %26, i64* %21, i64* %27
%29 = load i64, i64* %28
%30 = load i64, i64* %21
%31 = icmp eq i64 %29, %30
br i1 %31, label %37, label %32
32: ; preds = %24, %14
%33 = and i32 %6, %5
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = tail call i32 @RefigureLocations(%struct.TYPE_10__* %0)
br label %37
37: ; preds = %32, %35, %24, %3
%38 = phi i32* [ @XtGeometryNo, %3 ], [ @XtGeometryNo, %24 ], [ @XtGeometryYes, %35 ], [ @XtGeometryYes, %32 ]
%39 = load i32, i32* %38
ret i32 %39
}