// File: /workspace/github_c_makefile_star2_O0/mati75[P]evilwm/client.c
// Function: get_wm_normal_hints
long get_wm_normal_hints(struct client *c) {
	long flags;
	long dummy;
	XSizeHints *size = XAllocSizeHints();

	LOG_XENTER("XGetWMNormalHints(window=%lx)", (unsigned long)c->window);
	XGetWMNormalHints(display.dpy, c->window, size, &dummy);
	debug_wm_normal_hints(size);
	LOG_XLEAVE();

	flags = size->flags;

	if (flags & PMinSize) {
		c->min_width = size->min_width;
		c->min_height = size->min_height;
	} else {
		c->min_width = c->min_height = 0;
	}

	if (flags & PMaxSize) {
		c->max_width = size->max_width;
		c->max_height = size->max_height;
	} else {
		c->max_width = c->max_height = 0;
	}

	if (flags & PBaseSize) {
		c->base_width = size->base_width;
		c->base_height = size->base_height;
	} else {
		c->base_width = c->min_width;
		c->base_height = c->min_height;
	}

	c->width_inc = c->height_inc = 1;
	if (flags & PResizeInc) {
		c->width_inc = size->width_inc ? size->width_inc : 1;
		c->height_inc = size->height_inc ? size->height_inc : 1;
	}

	if (!(flags & PMinSize)) {
		c->min_width = c->base_width + c->width_inc;
		c->min_height = c->base_height + c->height_inc;
	}

	if (flags & PWinGravity) {
		c->win_gravity_hint = size->win_gravity;
	} else {
		c->win_gravity_hint = NorthWestGravity;
	}
	c->win_gravity = c->win_gravity_hint;

	XFree(size);
	return flags;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
callq 0x4660
movq %rax, -0x20(%rbp)
leaq 0xd7d4(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rdx
leaq -0x18(%rbp), %rcx
callq 0x4130
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
andq $0x10, %rax
cmpq $0x0, %rax
je 0x55fa
movq -0x20(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x6c(%rax)
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x70(%rax)
jmp 0x5610
movq -0x8(%rbp), %rax
movl $0x0, 0x70(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x6c(%rax)
movq -0x10(%rbp), %rax
andq $0x20, %rax
cmpq $0x0, %rax
je 0x563c
movq -0x20(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x74(%rax)
movq -0x20(%rbp), %rax
movl 0x24(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x78(%rax)
jmp 0x5652
movq -0x8(%rbp), %rax
movl $0x0, 0x78(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x74(%rax)
movq -0x10(%rbp), %rax
andq $0x100, %rax            # imm = 0x100
cmpq $0x0, %rax
je 0x5686
movq -0x20(%rbp), %rax
movl 0x40(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x84(%rax)
movq -0x20(%rbp), %rax
movl 0x44(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x88(%rax)
jmp 0x56a8
movq -0x8(%rbp), %rax
movl 0x6c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x84(%rax)
movq -0x8(%rbp), %rax
movl 0x70(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x88(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x80(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x7c(%rax)
movq -0x10(%rbp), %rax
andq $0x40, %rax
cmpq $0x0, %rax
je 0x5726
movq -0x20(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x56e5
movq -0x20(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x24(%rbp)
jmp 0x56ef
movl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x56ef
movl -0x24(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x7c(%rax)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x2c(%rax)
je 0x570f
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %eax
movl %eax, -0x28(%rbp)
jmp 0x5719
movl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x5719
movl -0x28(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x80(%rax)
movq -0x10(%rbp), %rax
andq $0x10, %rax
cmpq $0x0, %rax
jne 0x5767
movq -0x8(%rbp), %rax
movl 0x84(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x7c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x6c(%rax)
movq -0x8(%rbp), %rax
movl 0x88(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x80(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x70(%rax)
movq -0x10(%rbp), %rax
andq $0x200, %rax            # imm = 0x200
cmpq $0x0, %rax
je 0x578a
movq -0x20(%rbp), %rax
movl 0x48(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8c(%rax)
jmp 0x5798
movq -0x8(%rbp), %rax
movl $0x1, 0x8c(%rax)
movq -0x8(%rbp), %rax
movl 0x8c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x90(%rax)
movq -0x20(%rbp), %rdi
callq 0x4050
movq -0x10(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop