#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 */
struct TYPE_4__ {
  unsigned int min_width;
  unsigned int max_width;
  unsigned int min_height;
  unsigned int max_height;
  int /*<<< orphan*/ flags;
};
typedef TYPE_1__ XSizeHints;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int PMaxSize;
int PMinSize;
int /*<<< orphan*/ USSize;
int /*<<< orphan*/ XGetGeometry(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/ *, int *, int *,
                                unsigned int *, unsigned int *, unsigned int *,
                                unsigned int *);
int /*<<< orphan*/ XSetNormalHints(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   TYPE_1__ *);
int /*<<< orphan*/ XSetWMSizeHints(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                   TYPE_1__ *, int);
int /*<<< orphan*/ printf(char *);
void lockwindowsize(Display *d, Window w) {
  Window _0;
  int _1, _2;
  unsigned int width, height;
  unsigned int _3, _4;
  XGetGeometry(d, w, &_0, &_1, &_2, &width, &height, &_3, &_4);
  XSizeHints xsh;
  xsh.flags = USSize;
  xsh.min_width = xsh.max_width = width;
  xsh.min_height = xsh.max_height = height;
  XSetNormalHints(d, w, &xsh);
  XSetWMSizeHints(d, w, &xsh, PMinSize | PMaxSize);
  printf("Booyeah!\n");
}


x86 assembly (clang, -O0):
<lockwindowsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
lea    -0x1c(%rbp),%r9
lea    -0x20(%rbp),%r11
lea    -0x24(%rbp),%r10
lea    -0x28(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1050 <XGetGeometry@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    %eax,-0x40(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1040 <XSetNormalHints@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e17(%rip),%rax
mov    (%rax),%ecx
mov    0x2e2e(%rip),%rax
or     (%rax),%ecx
lea    -0x40(%rbp),%rdx
call   1060 <XSetWMSizeHints@plt>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lockwindowsize>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
sub    $0x8,%rsp
lea    0x24(%rsp),%rax
lea    0x28(%rsp),%r10
lea    0x8(%rsp),%r11
lea    0x34(%rsp),%rdx
lea    0x30(%rsp),%rcx
lea    0x2c(%rsp),%r8
lea    0xc(%rsp),%r9
push   %rax
push   %r10
push   %r11
call   1050 <XGetGeometry@plt>
add    $0x20,%rsp
mov    0x2e47(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x18(%rsp)
mov    0x4(%rsp),%eax
mov    %eax,0xc(%rsp)
mov    %eax,0x8(%rsp)
mov    (%rsp),%eax
mov    %eax,0x14(%rsp)
mov    %eax,0x10(%rsp)
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <XSetNormalHints@plt>
mov    0x2e19(%rip),%rax
mov    0x2e32(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1060 <XSetWMSizeHints@plt>
lea    0xe22(%rip),%rdi
call   1030 <puts@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32, i32, i32, i32, i32 }
@USSize = global i32 0
@PMinSize = global i32 0
@PMaxSize = global i32 0
@.str = [10 x i8] c"Booyeah!\0A\00"
define void @lockwindowsize(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.TYPE_4__
store i32* %0, i32** %3
store i32 %1, i32* %4
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = call i32 @XGetGeometry(i32* %13, i32 %14, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11)
%16 = load i32, i32* @USSize
%17 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %12, i32 0, i32 4
store i32 %16, i32* %17
%18 = load i32, i32* %8
%19 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %12, i32 0, i32 1
store i32 %18, i32* %19
%20 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %12, i32 0, i32 0
store i32 %18, i32* %20
%21 = load i32, i32* %9
%22 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %12, i32 0, i32 3
store i32 %21, i32* %22
%23 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %12, i32 0, i32 2
store i32 %21, i32* %23
%24 = load i32*, i32** %3
%25 = load i32, i32* %4
%26 = call i32 @XSetNormalHints(i32* %24, i32 %25, %struct.TYPE_4__* %12)
%27 = load i32*, i32** %3
%28 = load i32, i32* %4
%29 = load i32, i32* @PMinSize
%30 = load i32, i32* @PMaxSize
%31 = or i32 %29, %30
%32 = call i32 @XSetWMSizeHints(i32* %27, i32 %28, %struct.TYPE_4__* %12, i32 %31)
%33 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32, i32, i32, i32, i32 }
@USSize = global i32 0
@PMinSize = global i32 0
@PMaxSize = global i32 0
@str = [9 x i8] c"Booyeah!\00"
define void @lockwindowsize(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.TYPE_4__
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = bitcast i32* %6 to i8*
%15 = bitcast i32* %7 to i8*
%16 = bitcast i32* %8 to i8*
%17 = bitcast i32* %9 to i8*
%18 = call i32 @XGetGeometry(i32* %0, i32 %1, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9)
%19 = bitcast %struct.TYPE_4__* %10 to i8*
%20 = load i32, i32* @USSize
%21 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i64 0, i32 4
store i32 %20, i32* %21
%22 = load i32, i32* %6
%23 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i64 0, i32 1
store i32 %22, i32* %23
%24 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i64 0, i32 0
store i32 %22, i32* %24
%25 = load i32, i32* %7
%26 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i64 0, i32 3
store i32 %25, i32* %26
%27 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i64 0, i32 2
store i32 %25, i32* %27
%28 = call i32 @XSetNormalHints(i32* %0, i32 %1, %struct.TYPE_4__* %10)
%29 = load i32, i32* @PMinSize
%30 = load i32, i32* @PMaxSize
%31 = or i32 %30, %29
%32 = call i32 @XSetWMSizeHints(i32* %0, i32 %1, %struct.TYPE_4__* %10, i32 %31)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}