// File: /workspace/github_c_makefile_star2_O0/9wm[P]9wm/manage.c
// Function: gravitate
void
gravitate(Client * c, int invert)
{
	int gravity, dx, dy, delta;

	gravity = NorthWestGravity;
	if (c->size.flags & PWinGravity)
		gravity = c->size.win_gravity;

	delta = c->border - BORDER;
	switch (gravity) {
	case NorthWestGravity:
		dx = 0;
		dy = 0;
		break;
	case NorthGravity:
		dx = delta;
		dy = 0;
		break;
	case NorthEastGravity:
		dx = 2 * delta;
		dy = 0;
		break;
	case WestGravity:
		dx = 0;
		dy = delta;
		break;
	case CenterGravity:
	case StaticGravity:
		dx = delta;
		dy = delta;
		break;
	case EastGravity:
		dx = 2 * delta;
		dy = delta;
		break;
	case SouthWestGravity:
		dx = 0;
		dy = 2 * delta;
		break;
	case SouthGravity:
		dx = delta;
		dy = 2 * delta;
		break;
	case SouthEastGravity:
		dx = 2 * delta;
		dy = 2 * delta;
		break;
	default:
		fprintf(stderr, "9wm: bad window gravity %d for 0x%x\n", gravity, (int) c->window);
		return;
	}
	dx += BORDER;
	dy += BORDER;
	if (invert) {
		dx = -dx;
		dy = -dy;
	}
	c->x += dx;
	c->y += dy;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x1, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
andq $0x200, %rax            # imm = 0x200
cmpq $0x0, %rax
je 0x5557
movq -0x8(%rbp), %rax
movl 0x88(%rax), %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
leaq 0x6dbb(%rip), %rcx      # 0xc320
movl (%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x10(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x9, %eax
ja 0x562d
movq -0x28(%rbp), %rax
leaq 0x4045(%rip), %rcx      # 0x95d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
jmp 0x5653
movl -0x1c(%rbp), %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
jmp 0x5653
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
jmp 0x5653
movl $0x0, -0x14(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x5653
movl -0x1c(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x5653
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x14(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x5653
movl $0x0, -0x14(%rbp)
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x18(%rbp)
jmp 0x5653
movl -0x1c(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x18(%rbp)
jmp 0x5653
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x14(%rbp)
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x18(%rbp)
jmp 0x5653
movq 0x69c4(%rip), %rax      # 0xbff8
movq (%rax), %rdi
movl -0x10(%rbp), %edx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
leaq 0x3fae(%rip), %rsi      # 0x95f8
movb $0x0, %al
callq 0x22b0
jmp 0x56a1
leaq 0x6cc6(%rip), %rax      # 0xc320
movl (%rax), %eax
addl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
leaq 0x6cb7(%rip), %rax      # 0xc320
movl (%rax), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x5687
xorl %eax, %eax
subl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
subl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x28(%rax), %ecx
movl %ecx, 0x28(%rax)
movl -0x18(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x2c(%rax), %ecx
movl %ecx, 0x2c(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)