// File: /workspace/github_c_makefile_star2_O0/kek[P]evilwm/new.c
// Function: init_geometry
static void init_geometry(Client *c) {
	long size_flags;
	XWindowAttributes attr;
	unsigned long *eprop;
	unsigned long nitems;
	PropMwmHints *mprop;
#ifdef VWM
	unsigned long *lprop;
#endif

	if ( (mprop = get_property(c->window, mwm_hints, mwm_hints, &nitems)) ) {
		if (nitems >= PROP_MWM_HINTS_ELEMENTS
				&& (mprop->flags & MWM_HINTS_DECORATIONS)
				&& !(mprop->decorations & MWM_DECOR_ALL)
				&& !(mprop->decorations & MWM_DECOR_BORDER)) {
			c->border = 0;
		}
		XFree(mprop);
	}

#ifdef VWM
	c->vdesk = c->screen->vdesk;
	if ( (lprop = get_property(c->window, xa_net_wm_desktop, XA_CARDINAL, &nitems)) ) {
		/* NB, Xlib not only returns a 32bit value in a long (which may
		 * not be 32bits), it also sign extends the 32bit value */
		if (nitems && valid_vdesk(lprop[0] & UINT32_MAX)) {
			c->vdesk = lprop[0] & UINT32_MAX;
		}
		XFree(lprop);
	}
#endif

	get_window_type(c);

	/* Get current window attributes */
	LOG_XENTER("XGetWindowAttributes(window=%lx)", c->window);
	XGetWindowAttributes(dpy, c->window, &attr);
	LOG_XDEBUG("(%s) %dx%d+%d+%d, bw = %d\n", map_state_string(attr.map_state), attr.width, attr.height, attr.x, attr.y, attr.border_width);
	LOG_XLEAVE();
	c->old_border = attr.border_width;
	c->oldw = c->oldh = 0;
	c->cmap = attr.colormap;

	if ( (eprop = get_property(c->window, xa_evilwm_unmaximised_horz, XA_CARDINAL, &nitems)) ) {
		if (nitems == 2) {
			c->oldx = eprop[0];
			c->oldw = eprop[1];
		}
		XFree(eprop);
	}
	if ( (eprop = get_property(c->window, xa_evilwm_unmaximised_vert, XA_CARDINAL, &nitems)) ) {
		if (nitems == 2) {
			c->oldy = eprop[0];
			c->oldh = eprop[1];
		}
		XFree(eprop);
	}

	size_flags = get_wm_normal_hints(c);

	if ((attr.width >= c->min_width) && (attr.height >= c->min_height)) {
	/* if (attr.map_state == IsViewable || (size_flags & (PSize | USSize))) { */
		c->width = attr.width;
		c->height = attr.height;
	} else {
		c->width = c->min_width;
		c->height = c->min_height;
		send_config(c);
	}
	if ((attr.map_state == IsViewable)
			|| (size_flags & (/*PPosition |*/ USPosition))) {
		c->x = attr.x;
		c->y = attr.y;
	} else {
#ifdef MOUSE
		int xmax = DisplayWidth(dpy, c->screen->screen);
		int ymax = DisplayHeight(dpy, c->screen->screen);
		int x, y;
		get_mouse_position(&x, &y, c->screen->root);
		c->x = (x * (xmax - c->border - c->width)) / xmax;
		c->y = (y * (ymax - c->border - c->height)) / ymax;
#else
		c->x = c->y = 0;
#endif
		send_config(c);
	}

	LOG_DEBUG("window started as %dx%d +%d+%d\n", c->width, c->height, c->x, c->y);
	if (attr.map_state == IsViewable) {
		/* The reparent that is to come would trigger an unmap event */
		c->ignore_unmap++;
	}
	c->x += c->old_border;
	c->y += c->old_border;
	gravitate_border(c, -c->old_border);
	gravitate_border(c, c->border);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x72c3(%rip), %rax      # 0xf7f0
movq (%rax), %rsi
leaq 0x72b9(%rip), %rax      # 0xf7f0
movq (%rax), %rdx
leaq -0xa8(%rbp), %rcx
callq 0x42a0
movq %rax, -0xb0(%rbp)
cmpq $0x0, %rax
je 0x85b2
cmpq $0x3, -0xa8(%rbp)
jb 0x85a6
movq -0xb0(%rbp), %rax
movq (%rax), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0x85a6
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x85a6
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
andq $0x2, %rax
cmpq $0x0, %rax
jne 0x85a6
movq -0x8(%rbp), %rax
movl $0x0, 0x34(%rax)
movq -0xb0(%rbp), %rdi
callq 0x3220
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x40(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x74(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x72ae(%rip), %rax      # 0xf880
movq (%rax), %rsi
movl $0x6, %edx
leaq -0xa8(%rbp), %rcx
callq 0x42a0
movq %rax, -0xb8(%rbp)
cmpq $0x0, %rax
je 0x865e
cmpq $0x0, -0xa8(%rbp)
je 0x8652
movq -0xb8(%rbp), %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x8635
movq -0xb8(%rbp), %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx), %rax
cmpq $0x7, %rax
ja 0x8652
movq -0xb8(%rbp), %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x74(%rax)
movq -0xb8(%rbp), %rdi
callq 0x3220
movq -0x8(%rbp), %rdi
callq 0x9000
leaq 0x7312(%rip), %rax      # 0xf980
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq -0x98(%rbp), %rdx
callq 0x35d0
movl -0x88(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x70(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x44(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x48(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x7137(%rip), %rax      # 0xf7f8
movq (%rax), %rsi
movl $0x6, %edx
leaq -0xa8(%rbp), %rcx
callq 0x42a0
movq %rax, -0xa0(%rbp)
cmpq $0x0, %rax
je 0x871f
cmpq $0x2, -0xa8(%rbp)
jne 0x8713
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0xa0(%rbp), %rdi
callq 0x3220
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x70d3(%rip), %rax      # 0xf800
movq (%rax), %rsi
movl $0x6, %edx
leaq -0xa8(%rbp), %rcx
callq 0x42a0
movq %rax, -0xa0(%rbp)
cmpq $0x0, %rax
je 0x878b
cmpq $0x2, -0xa8(%rbp)
jne 0x877f
movq -0xa0(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0xa0(%rbp), %rdi
callq 0x3220
movq -0x8(%rbp), %rdi
callq 0x8df0
movq %rax, -0x10(%rbp)
movl -0x90(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x48(%rcx), %eax
jl 0x87d2
movl -0x8c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4c(%rcx), %eax
jl 0x87d2
movl -0x90(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x8c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x87f7
movq -0x8(%rbp), %rax
movl 0x48(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x8(%rbp), %rdi
callq 0x3b60
cmpl $0x2, -0x3c(%rbp)
je 0x880b
movq -0x10(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x882a
movl -0x98(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x94(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x8934
leaq 0x714f(%rip), %rax      # 0xf980
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, -0xbc(%rbp)
leaq 0x7123(%rip), %rax      # 0xf980
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movl %eax, -0xc0(%rbp)
leaq 0x70f7(%rip), %rax      # 0xf980
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
leaq -0xd0(%rbp), %rcx
leaq -0xc4(%rbp), %r8
leaq -0xc8(%rbp), %r9
leaq -0xd4(%rbp), %r10
leaq -0xd8(%rbp), %rax
movq %rcx, %rdx
movq %r10, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x33b0
movl -0xc4(%rbp), %eax
movl -0xbc(%rbp), %ecx
movq -0x8(%rbp), %rdx
subl 0x34(%rdx), %ecx
movq -0x8(%rbp), %rdx
subl 0x2c(%rdx), %ecx
imull %ecx, %eax
cltd
idivl -0xbc(%rbp)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0xc8(%rbp), %eax
movl -0xc0(%rbp), %ecx
movq -0x8(%rbp), %rdx
subl 0x34(%rdx), %ecx
movq -0x8(%rbp), %rdx
subl 0x30(%rdx), %ecx
imull %ecx, %eax
cltd
idivl -0xc0(%rbp)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x8(%rbp), %rdi
callq 0x3b60
cmpl $0x2, -0x3c(%rbp)
jne 0x8947
movq -0x8(%rbp), %rax
movl 0x20(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movl 0x70(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x24(%rax), %ecx
movl %ecx, 0x24(%rax)
movq -0x8(%rbp), %rax
movl 0x70(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x28(%rax), %ecx
movl %ecx, 0x28(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
xorl %esi, %esi
subl 0x70(%rax), %esi
callq 0x3bf0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x34(%rax), %esi
callq 0x3bf0
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)