// File: /workspace/github_c_makefile_star2_O0/mati75[P]evilwm/func.c
// Function: func_resize
void func_resize(void *sptr, XEvent *e, unsigned flags) {
	struct client *c = sptr;
	if (!(flags & FL_CLIENT) || !c)
		return;

	int width_inc = (c->width_inc > 1) ? c->width_inc : 16;
	int height_inc = (c->height_inc > 1) ? c->height_inc : 16;

	if (e->type == ButtonPress) {
		XButtonEvent *xbutton = (XButtonEvent *)e;
		client_resize_sweep(c, xbutton->button);
		return;
	}

	if (flags & FL_RELATIVE) {
		if (flags & FL_RIGHT) {
			c->width += width_inc;
		}
		if (flags & FL_LEFT) {
			c->width -= width_inc;
		}
		if (flags & FL_DOWN) {
			c->height += height_inc;
		}
		if (flags & FL_UP) {
			c->height -= height_inc;
		}
	} else if (flags & FL_TOGGLE) {
		int hv = 0;
		if ((flags & FL_HORZ) == FL_HORZ) {
			hv |= MAXIMISE_HORZ;
		}
		if ((flags & FL_VERT) == FL_VERT) {
			hv |= MAXIMISE_VERT;
		}
		client_maximise(c, NET_WM_STATE_TOGGLE, hv);
		return;
	}

	do_client_move(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
je 0xab0f
cmpq $0x0, -0x20(%rbp)
jne 0xab14
jmp 0xac69
movq -0x20(%rbp), %rax
cmpl $0x1, 0x7c(%rax)
jle 0xab2a
movq -0x20(%rbp), %rax
movl 0x7c(%rax), %eax
movl %eax, -0x38(%rbp)
jmp 0xab34
movl $0x10, %eax
movl %eax, -0x38(%rbp)
jmp 0xab34
movl -0x38(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x80(%rax)
jle 0xab56
movq -0x20(%rbp), %rax
movl 0x80(%rax), %eax
movl %eax, -0x3c(%rbp)
jmp 0xab60
movl $0x10, %eax
movl %eax, -0x3c(%rbp)
jmp 0xab60
movl -0x3c(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jne 0xab8c
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movl 0x54(%rax), %esi
callq 0x6990
jmp 0xac69
movl -0x14(%rbp), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0xac07
movl -0x14(%rbp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xabb3
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
addl 0x30(%rax), %ecx
movl %ecx, 0x30(%rax)
movl -0x14(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xabcf
movl -0x24(%rbp), %edx
movq -0x20(%rbp), %rax
movl 0x30(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x30(%rax)
movl -0x14(%rbp), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0xabe9
movl -0x28(%rbp), %ecx
movq -0x20(%rbp), %rax
addl 0x34(%rax), %ecx
movl %ecx, 0x34(%rax)
movl -0x14(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0xac05
movl -0x28(%rbp), %edx
movq -0x20(%rbp), %rax
movl 0x34(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x34(%rax)
jmp 0xac60
movl -0x14(%rbp), %eax
andl $0x40000, %eax          # imm = 0x40000
cmpl $0x0, %eax
je 0xac5e
movl $0x0, -0x34(%rbp)
movl -0x14(%rbp), %eax
andl $0xc00, %eax            # imm = 0xC00
cmpl $0xc00, %eax            # imm = 0xC00
jne 0xac33
movl -0x34(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x14(%rbp), %eax
andl $0x3000, %eax           # imm = 0x3000
cmpl $0x3000, %eax           # imm = 0x3000
jne 0xac4b
movl -0x34(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rdi
movl -0x34(%rbp), %edx
movl $0x2, %esi
callq 0x7950
jmp 0xac69
jmp 0xac60
movq -0x20(%rbp), %rdi
callq 0xa880
addq $0x40, %rsp
popq %rbp
retq
nop