// File: /workspace/github_c_makefile_star2_O0/kaugm[P]mmwm/mmwm.c
// Function: killclient
void killclient()
{
	int n = 0;
	client *c = NULL, *t = NULL;

    if (!M_CURRENT)
        return;
    if (!deletewindow(M_CURRENT->win)) {
        xcb_kill_client(dis, M_CURRENT->win);
        DEBUG("client killed");
    }
    else {
        DEBUG("client deleted");
    }
    /* this section is for switching to previous (-1) desktop when the last window on it is killed */
    /* count stack windows and grab first non-floating, non-maximize window */
    for (t = M_HEAD; t; t = M_GETNEXT(t)) {
        if (!ISFMTM(t)) {
            if (c)
                ++n;
            else
                c = t;
        }
    }
	/* just this line below was the original piece of code */
	removeclient(M_CURRENT);
	while (n < 1) {
		if (current_desktop_number == 0)
			return;
		change_desktop(&(Arg)
			{.i = (DESKTOPS + current_desktop_number - 1) % DESKTOPS});
		n = 0;
		/* count stack windows and grab first non-floating, non-maximize window */
		for (t = M_HEAD; t; t = M_GETNEXT(t)) {
			if (!ISFMTM(t)) {
				if (c)
					++n;
				else
					c = t;
			}
		}
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq 0x51aa(%rip), %rax      # 0xd7d0
cmpq $0x0, 0x30(%rax)
jne 0x8632
jmp 0x87c0
movq 0x5197(%rip), %rax      # 0xd7d0
movq 0x30(%rax), %rax
movl 0x20(%rax), %edi
callq 0x87d0
testb $0x1, %al
jne 0x8668
movq 0x5150(%rip), %rdi      # 0xd7a0
movq 0x5179(%rip), %rax      # 0xd7d0
movq 0x30(%rax), %rax
movl 0x20(%rax), %esi
callq 0x35f0
movl %eax, -0x1c(%rbp)
jmp 0x866a
jmp 0x866a
movq 0x515f(%rip), %rax      # 0xd7d0
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x86eb
movq -0x18(%rbp), %rax
testb $0x1, 0x1b(%rax)
jne 0x86da
movq -0x18(%rbp), %rax
testb $0x1, 0x1c(%rax)
jne 0x86da
movq -0x18(%rbp), %rax
testb $0x1, 0x19(%rax)
jne 0x86da
movq -0x18(%rbp), %rax
testb $0x1, 0x1d(%rax)
jne 0x86da
movq -0x18(%rbp), %rax
movl 0x24(%rax), %eax
movq 0x5102(%rip), %rcx      # 0xd7b8
cmpl 0x104(%rcx), %eax
jne 0x86da
cmpq $0x0, -0x10(%rbp)
je 0x86d0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x86d8
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x86da
jmp 0x86dc
movq -0x18(%rbp), %rdi
callq 0x5490
movq %rax, -0x18(%rbp)
jmp 0x8679
movq 0x50de(%rip), %rax      # 0xd7d0
movq 0x30(%rax), %rdi
callq 0x8800
cmpl $0x1, -0x4(%rbp)
jge 0x87c0
cmpl $0x0, 0x50ec(%rip)      # 0xd7f8
jne 0x8713
jmp 0x87c0
movl 0x50df(%rip), %eax      # 0xd7f8
addl $0xa, %eax
subl $0x1, %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl %edx, -0x28(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x79a0
movl $0x0, -0x4(%rbp)
movq 0x508f(%rip), %rax      # 0xd7d0
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x87bb
movq -0x18(%rbp), %rax
testb $0x1, 0x1b(%rax)
jne 0x87aa
movq -0x18(%rbp), %rax
testb $0x1, 0x1c(%rax)
jne 0x87aa
movq -0x18(%rbp), %rax
testb $0x1, 0x19(%rax)
jne 0x87aa
movq -0x18(%rbp), %rax
testb $0x1, 0x1d(%rax)
jne 0x87aa
movq -0x18(%rbp), %rax
movl 0x24(%rax), %eax
movq 0x5032(%rip), %rcx      # 0xd7b8
cmpl 0x104(%rcx), %eax
jne 0x87aa
cmpq $0x0, -0x10(%rbp)
je 0x87a0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x87a8
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x87aa
jmp 0x87ac
movq -0x18(%rbp), %rdi
callq 0x5490
movq %rax, -0x18(%rbp)
jmp 0x8749
jmp 0x86fb
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)