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

	struct monitor *monitor = client_monitor(c, NULL);
	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_move_drag(c, xbutton->button);
		return;
	}

	if (flags & FL_RELATIVE) {
		if (flags & FL_RIGHT) {
			c->x += width_inc;
		}
		if (flags & FL_LEFT) {
			c->x -= width_inc;
		}
		if (flags & FL_DOWN) {
			c->y += height_inc;
		}
		if (flags & FL_UP) {
			c->y -= height_inc;
		}
	} else {
		if (flags & FL_RIGHT) {
			c->x = monitor->x + monitor->width - c->width-c->border;
		}
		if (flags & FL_LEFT) {
			c->x = monitor->x + c->border;
		}
		if (flags & FL_BOTTOM) {
			c->y = monitor->y + monitor->height - c->height-c->border;
		}
		if (flags & FL_TOP) {
			c->y = monitor->y + c->border;
		}
	}

	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 0xa6bf
cmpq $0x0, -0x20(%rbp)
jne 0xa6c4
jmp 0xa878
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5890
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x7c(%rax)
jle 0xa6eb
movq -0x20(%rbp), %rax
movl 0x7c(%rax), %eax
movl %eax, -0x3c(%rbp)
jmp 0xa6f5
movl $0x10, %eax
movl %eax, -0x3c(%rbp)
jmp 0xa6f5
movl -0x3c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x1, 0x80(%rax)
jle 0xa717
movq -0x20(%rbp), %rax
movl 0x80(%rax), %eax
movl %eax, -0x40(%rbp)
jmp 0xa721
movl $0x10, %eax
movl %eax, -0x40(%rbp)
jmp 0xa721
movl -0x40(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jne 0xa74d
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0x54(%rax), %esi
callq 0x6f70
jmp 0xa878
movl -0x14(%rbp), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0xa7cb
movl -0x14(%rbp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xa774
movl -0x2c(%rbp), %ecx
movq -0x20(%rbp), %rax
addl 0x28(%rax), %ecx
movl %ecx, 0x28(%rax)
movl -0x14(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xa790
movl -0x2c(%rbp), %edx
movq -0x20(%rbp), %rax
movl 0x28(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x28(%rax)
movl -0x14(%rbp), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0xa7aa
movl -0x30(%rbp), %ecx
movq -0x20(%rbp), %rax
addl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
movl -0x14(%rbp), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0xa7c6
movl -0x30(%rbp), %edx
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
subl %edx, %ecx
movl %ecx, 0x2c(%rax)
jmp 0xa86f
movl -0x14(%rbp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0xa7fa
movq -0x28(%rbp), %rax
movl (%rax), %ecx
movq -0x28(%rbp), %rax
addl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
subl 0x30(%rax), %ecx
movq -0x20(%rbp), %rax
subl 0x3c(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x14(%rbp), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xa81b
movq -0x28(%rbp), %rax
movl (%rax), %ecx
movq -0x20(%rbp), %rax
addl 0x3c(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x28(%rax)
movl -0x14(%rbp), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0xa84b
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
addl 0xc(%rax), %ecx
movq -0x20(%rbp), %rax
subl 0x34(%rax), %ecx
movq -0x20(%rbp), %rax
subl 0x3c(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2c(%rax)
movl -0x14(%rbp), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0xa86d
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x20(%rbp), %rax
addl 0x3c(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x2c(%rax)
jmp 0xa86f
movq -0x20(%rbp), %rdi
callq 0xa880
addq $0x40, %rsp
popq %rbp
retq
nop