// File: /workspace/github_c_makefile_star2_O0/mati75[P]evilwm/client_new.c
// Function: init_geometry
static void init_geometry(struct client *c) {
	unsigned long nitems;
	XWindowAttributes attr;

	// Normal border size from MWM hints
	c->normal_border = window_normal_border(c->window);

	// Possible get a value for initial virtual desktop from EWMH hint
	unsigned long *lprop;
	c->vdesk = c->screen->vdesk;
	if ( (lprop = get_property(c->window, X_ATOM(_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);
	}

	// Get current window attributes
	LOG_XENTER("XGetWindowAttributes(window=%lx)", (unsigned long)c->window);
	XGetWindowAttributes(display.dpy, c->window, &attr);
	debug_window_attributes(&attr);
	LOG_XLEAVE();
	// We remove any client border, so preserve its old value to restore on
	// emulator quit.
	c->old_border = attr.border_width;
	c->cmap = attr.colormap;

	// Default to no unmaximised width/height.
	c->oldw = c->oldh = 0;

	// If the _EVILWM_UNMAXIMISED_HORZ is present, it was previously
	// managed by evilwm and this property contains the unmaximised X
	// coordinate and width.  These are unrepresented in EWMH hints, so
	// would otherwise not survive window manager restart.
	unsigned long *eprop;
	if ( (eprop = get_property(c->window, X_ATOM(_EVILWM_UNMAXIMISED_HORZ), XA_CARDINAL, &nitems)) ) {
		if (nitems == 2) {
			c->oldx = eprop[0];
			c->oldw = eprop[1];
		}
		XFree(eprop);
	}

	// Similarly _EVILWM_UNMAXIMISED_VERT will contain the unmaximised Y
	// coordinate and height.
	if ( (eprop = get_property(c->window, X_ATOM(_EVILWM_UNMAXIMISED_VERT), XA_CARDINAL, &nitems)) ) {
		if (nitems == 2) {
			c->oldy = eprop[0];
			c->oldh = eprop[1];
		}
		XFree(eprop);
	}

	c->border = (c->oldw && c->oldh) ? 0 : c->normal_border;

	// Update some client info from the WM_NORMAL_HINTS property.  The
	// flags returned will indicate whether certain values were user- or
	// program-specified.
	long size_flags = get_wm_normal_hints(c);

	_Bool need_send_config = 0;

	// If the current window dimensions conform to the minimums specified
	// in WM_NORMAL_HINTS, use them.  Otherwise, use the mimimums.
	if ((attr.width >= c->min_width) && (attr.height >= c->min_height)) {
		c->width = attr.width;
		c->height = attr.height;
	} else {
		c->width = c->min_width;
		c->height = c->min_height;
		need_send_config = 1;
	}

	// If the window was already visible (as we manage existing windows on
	// startup), or if its screen position was user-specified, use its
	// current position.  Otherwise (new window, post startup), calculate a
	// position for it based on where the pointer is.

	// XXX: if an existing window would be mapped off the screen, would it
	// be sensible to move it somewhere visible?

	if ((attr.map_state == IsViewable) || (size_flags & USPosition)) {
		c->x = attr.x;
		c->y = attr.y;
	} else {
		int xmax = DisplayWidth(display.dpy, c->screen->screen);
		int ymax = DisplayHeight(display.dpy, c->screen->screen);
		int x, y;
		get_pointer_root_xy(c->screen->root, &x, &y);
		c->x = (x * (xmax - c->border - c->width)) / xmax;
		c->y = (y * (ymax - c->border - c->height)) / ymax;
		need_send_config = 1;
	}

	if (need_send_config)
		send_config(c);

	ewmh_set_net_frame_extents(c->window, c->border);

	LOG_DEBUG("window started as %dx%d +%d+%d\n", c->width, c->height, c->x, c->y);

	// If the window was already viewable (existed while window manager
	// starts), that means the reparent to come would send an unmap request
	// to the root window.  Set a flag to ignore this.
	if (attr.map_state == IsViewable) {
		c->ignore_unmap++;
	}

	// Account for removed old_border
	c->x += c->old_border;
	c->y += c->old_border;
	client_gravitate(c, -c->old_border);
	client_gravitate(c, c->border);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xcdb0
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x60(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0xa9ac(%rip), %rax      # 0x12d80
movq 0xb8(%rax), %rsi
movl $0x6, %edx
leaq -0x10(%rbp), %rcx
callq 0xcd00
movq %rax, -0xa0(%rbp)
cmpq $0x0, %rax
je 0x8467
cmpq $0x0, -0x10(%rbp)
je 0x845b
movq -0xa0(%rbp), %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
je 0x843e
movq -0xa0(%rbp), %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx), %rax
leaq 0xab12(%rip), %rcx      # 0x12f48
movl 0x2c(%rcx), %ecx
cmpq %rcx, %rax
jae 0x845b
movq -0xa0(%rbp), %rcx
movabsq $0xffffffff, %rax       # imm = 0xFFFFFFFF
andq (%rcx), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0xa0(%rbp), %rdi
callq 0x4050
leaq 0xa912(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
leaq -0x98(%rbp), %rdx
callq 0x4640
movl -0x88(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x50(%rax)
movq -0x48(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x48(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0xa8bf(%rip), %rax      # 0x12d80
movq 0x30(%rax), %rsi
movl $0x6, %edx
leaq -0x10(%rbp), %rcx
callq 0xcd00
movq %rax, -0xa8(%rbp)
cmpq $0x0, %rax
je 0x851a
cmpq $0x2, -0x10(%rbp)
jne 0x850e
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x40(%rax)
movq -0xa8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x48(%rax)
movq -0xa8(%rbp), %rdi
callq 0x4050
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0xa858(%rip), %rax      # 0x12d80
movq 0x38(%rax), %rsi
movl $0x6, %edx
leaq -0x10(%rbp), %rcx
callq 0xcd00
movq %rax, -0xa8(%rbp)
cmpq $0x0, %rax
je 0x8581
cmpq $0x2, -0x10(%rbp)
jne 0x8575
movq -0xa8(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x44(%rax)
movq -0xa8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x4c(%rax)
movq -0xa8(%rbp), %rdi
callq 0x4050
movq -0x8(%rbp), %rax
cmpl $0x0, 0x48(%rax)
je 0x859f
movq -0x8(%rbp), %rax
cmpl $0x0, 0x4c(%rax)
je 0x859f
xorl %eax, %eax
movl %eax, -0xc8(%rbp)
jmp 0x85ac
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0xc8(%rbp)
movl -0xc8(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x3c(%rax)
movq -0x8(%rbp), %rdi
callq 0x5590
movq %rax, -0xb0(%rbp)
movb $0x0, -0xb1(%rbp)
movl -0x90(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
jl 0x860a
movl -0x8c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x70(%rcx), %eax
jl 0x860a
movl -0x90(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
movl -0x8c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x34(%rax)
jmp 0x862d
movq -0x8(%rbp), %rax
movl 0x6c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x8(%rbp), %rax
movl 0x70(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x34(%rax)
movb $0x1, -0xb1(%rbp)
cmpl $0x2, -0x3c(%rbp)
je 0x8644
movq -0xb0(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x8663
movl -0x98(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x94(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
jmp 0x873b
leaq 0xa716(%rip), %rax      # 0x12d80
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, -0xb8(%rbp)
leaq 0xa6ea(%rip), %rax      # 0x12d80
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, -0xbc(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0xc4(%rbp), %rdx
callq 0xcc80
movl -0xc0(%rbp), %eax
movl -0xb8(%rbp), %ecx
movq -0x8(%rbp), %rdx
subl 0x3c(%rdx), %ecx
movq -0x8(%rbp), %rdx
subl 0x30(%rdx), %ecx
imull %ecx, %eax
cltd
idivl -0xb8(%rbp)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0xc4(%rbp), %eax
movl -0xbc(%rbp), %ecx
movq -0x8(%rbp), %rdx
subl 0x3c(%rdx), %ecx
movq -0x8(%rbp), %rdx
subl 0x34(%rdx), %ecx
imull %ecx, %eax
cltd
idivl -0xbc(%rbp)
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
movb $0x1, -0xb1(%rbp)
testb $0x1, -0xb1(%rbp)
je 0x874d
movq -0x8(%rbp), %rdi
callq 0x5d50
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movslq 0x3c(%rax), %rsi
callq 0xa4f0
cmpl $0x2, -0x3c(%rbp)
jne 0x8774
movq -0x8(%rbp), %rax
movl 0x24(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x24(%rax)
movq -0x8(%rbp), %rax
movl 0x50(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x28(%rax), %ecx
movl %ecx, 0x28(%rax)
movq -0x8(%rbp), %rax
movl 0x50(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
xorl %esi, %esi
subl 0x50(%rax), %esi
callq 0x5e00
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %esi
callq 0x5e00
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)