// File: /workspace/github_c_makefile_star2_O0/kaugm[P]mmwm/mmwm.c
// Function: clientmessage
void clientmessage(xcb_generic_event_t *e)
{
    xcb_client_message_event_t *ev = (xcb_client_message_event_t *)e;
    client *c = wintoclient(ev->window);

    DEBUG("xcb: client message");

    if (c && ev->type == ewmh->_NET_WM_STATE) {
        if (((unsigned)ev->data.data32[1] == ewmh->_NET_WM_STATE_FULLSCREEN
          || (unsigned)ev->data.data32[2] == ewmh->_NET_WM_STATE_FULLSCREEN)) {
            uint32_t mode = ev->data.data32[0];

            if (mode == _NET_WM_STATE_TOGGLE)
                mode = (c->isfullscreen) ? _NET_WM_STATE_REMOVE : _NET_WM_STATE_ADD;
            setfullscreen(c, mode == _NET_WM_STATE_ADD);
        }
    }
    else {
        if (ev->type == ewmh->_NET_CURRENT_DESKTOP
            && ev->data.data32[0] < DESKTOPS)
            change_desktop(&(Arg){.i = ev->data.data32[0]});
        else {
            if (c && ev->type == ewmh->_NET_CLOSE_WINDOW)
                killclient(c);
            else {
                if (ev->type == ewmh->_NET_ACTIVE_WINDOW) {
                    if (c) {
                        client *t = NULL;
                        for (t = M_HEAD; t && t != c; t = M_GETNEXT(t))
                            ;
                        if (t)
                            update_current(c);
                    }
                }
                else {
                    if (c && ev->type == ewmh->_NET_WM_DESKTOP
                          && ev->data.data32[0] < DESKTOPS) {
                        client_to_desktop(&(Arg){.i = ev->data.data32[0]});
                    }
                }
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x88d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x69b3
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq 0x6e7b(%rip), %rcx      # 0xd7b8
cmpl 0x84(%rcx), %eax
jne 0x69b3
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movq 0x6e65(%rip), %rcx      # 0xd7b8
cmpl 0x128(%rcx), %eax
je 0x6971
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movq 0x6e4f(%rip), %rcx      # 0xd7b8
cmpl 0x128(%rcx), %eax
jne 0x69ae
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x2, -0x1c(%rbp)
jne 0x6998
movq -0x18(%rbp), %rax
movb 0x1b(%rax), %dl
movl $0x1, %eax
xorl %ecx, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdi
cmpl $0x1, -0x1c(%rbp)
sete %al
movzbl %al, %esi
andl $0x1, %esi
callq 0x3b50
jmp 0x6aca
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq 0x6df7(%rip), %rcx      # 0xd7b8
cmpl 0x38(%rcx), %eax
jne 0x69e8
movq -0x10(%rbp), %rax
cmpl $0xa, 0xc(%rax)
jae 0x69e8
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x28(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x79a0
jmp 0x6ac8
cmpq $0x0, -0x18(%rbp)
je 0x6a12
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq 0x6dbb(%rip), %rcx      # 0xd7b8
cmpl 0x58(%rcx), %eax
jne 0x6a12
movq -0x18(%rbp), %rdi
movb $0x0, %al
callq 0x8600
jmp 0x6ac6
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq 0x6d98(%rip), %rcx      # 0xd7b8
cmpl 0x40(%rcx), %eax
jne 0x6a8b
cmpq $0x0, -0x18(%rbp)
je 0x6a89
movq $0x0, -0x30(%rbp)
movq 0x6d95(%rip), %rax      # 0xd7d0
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x30(%rbp)
movb %al, -0x39(%rbp)
je 0x6a5d
movq -0x30(%rbp), %rax
cmpq -0x18(%rbp), %rax
setne %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x6a66
jmp 0x6a77
jmp 0x6a68
movq -0x30(%rbp), %rdi
callq 0x5490
movq %rax, -0x30(%rbp)
jmp 0x6a43
cmpq $0x0, -0x30(%rbp)
je 0x6a87
movq -0x18(%rbp), %rdi
callq 0x4010
jmp 0x6a89
jmp 0x6ac4
cmpq $0x0, -0x18(%rbp)
je 0x6ac2
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq 0x6d18(%rip), %rcx      # 0xd7b8
cmpl 0x7c(%rcx), %eax
jne 0x6ac2
movq -0x10(%rbp), %rax
cmpl $0xa, 0xc(%rax)
jae 0x6ac2
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x38(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x7db0
jmp 0x6ac4
jmp 0x6ac6
jmp 0x6ac8
jmp 0x6aca
addq $0x40, %rsp
popq %rbp
retq