// File: /workspace/github_c_makefile_star2_O0/tkln[P]mcwm/mcwm.c
// Function: deletewin
int deletewin(struct client *client, const union cb_arg arg)
{
    xcb_get_property_cookie_t cookie;
    xcb_icccm_get_wm_protocols_reply_t protocols;
    bool use_delete = false;
    uint32_t i;
    (void) client;
    (void) arg;

    if (NULL == focuswin)
    {
        return 0;
    }

    /* Check if WM_DELETE is supported.  */
    cookie = xcb_icccm_get_wm_protocols_unchecked(conn, focuswin->id,
                                                  wm_protocols);
    if (xcb_icccm_get_wm_protocols_reply(conn, cookie, &protocols, NULL) == 1)
    {
        for (i = 0; i < protocols.atoms_len; i++)
        {
            if (protocols.atoms[i] == wm_delete_window)
            {
                 use_delete = true;
            }
        }
    }

    xcb_icccm_get_wm_protocols_reply_wipe(&protocols);

    if (use_delete)
    {
        xcb_client_message_event_t ev = {
          .response_type = XCB_CLIENT_MESSAGE,
          .format = 32,
          .sequence = 0,
          .window = focuswin->id,
          .type = wm_protocols,
          .data.data32 = { wm_delete_window, XCB_CURRENT_TIME }
        };

        xcb_send_event(conn, false, focuswin->id,
                       XCB_EVENT_MASK_NO_EVENT, (char *) &ev);
    }
    else
    {
        xcb_kill_client(conn, focuswin->id);
    }

    xcb_flush(conn);    
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rsi, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movb $0x0, -0x39(%rbp)
xorl %eax, %eax
cmpq 0x92b3(%rip), %rax      # 0xd940
jne 0x469b
movl $0x0, -0x4(%rbp)
jmp 0x47ae
movq 0x92d6(%rip), %rdi      # 0xd978
movq 0x9297(%rip), %rax      # 0xd940
movl (%rax), %esi
movl 0x92df(%rip), %edx      # 0xd990
callq 0x3460
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq 0x92b2(%rip), %rdi      # 0xd978
movl -0x1c(%rbp), %esi
leaq -0x38(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x3100
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x4712
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x38(%rbp), %eax
jae 0x4710
movq -0x30(%rbp), %rax
movl -0x40(%rbp), %ecx
movl (%rax,%rcx,4), %eax
cmpl 0x9287(%rip), %eax      # 0xd984
jne 0x4703
movb $0x1, -0x39(%rbp)
jmp 0x4705
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x46e5
jmp 0x4712
leaq -0x38(%rbp), %rdi
callq 0x30a0
testb $0x1, -0x39(%rbp)
je 0x4783
movb $0x21, -0x64(%rbp)
movb $0x20, -0x63(%rbp)
movw $0x0, -0x62(%rbp)
movq 0x920a(%rip), %rax      # 0xd940
movl (%rax), %eax
movl %eax, -0x60(%rbp)
movl 0x924f(%rip), %eax      # 0xd990
movl %eax, -0x5c(%rbp)
leaq -0x64(%rbp), %rdi
addq $0xc, %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x31c0
movl 0x9226(%rip), %eax      # 0xd984
movl %eax, -0x58(%rbp)
movq 0x9210(%rip), %rdi      # 0xd978
movq 0x91d1(%rip), %rax      # 0xd940
movl (%rax), %edx
xorl %ecx, %ecx
leaq -0x64(%rbp), %r8
movl %ecx, %esi
callq 0x3450
movl %eax, -0x68(%rbp)
jmp 0x479b
movq 0x91ee(%rip), %rdi      # 0xd978
movq 0x91af(%rip), %rax      # 0xd940
movl (%rax), %esi
callq 0x3520
movl %eax, -0x6c(%rbp)
movq 0x91d6(%rip), %rdi      # 0xd978
callq 0x3140
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)