// File: /workspace/github_c_makefile_star2_O3/kaugm[P]mmwm/mmwm.c
// Function: check_if_window_is_alien
static bool check_if_window_is_alien(xcb_window_t win, bool *isFloating, xcb_atom_t *wtype)
{
    xcb_get_window_attributes_reply_t *attr[1];
    xcb_window_t windows[] = {win};
    bool isAlien = False;

    if (isFloating) *isFloating = False;
    if (wtype) *wtype = ewmh->_NET_WM_WINDOW_TYPE_NORMAL;

    xcb_get_attributes(windows, attr, 1);
    if (!attr[0])   /* dead on arrival */
        return True;

    if (attr[0]->override_redirect) {
        free(attr[0]);
        return True;
    }
    else
        free(attr[0]);

    /*
     * check if window type is not _NET_WM_WINDOW_TYPE_NORMAL.
     * if yes, then we add it to alien list and map it.
     */
    xcb_ewmh_get_atoms_reply_t type;
    xcb_atom_t atype = 0;
    if (xcb_ewmh_get_wm_window_type_reply(ewmh,
                                xcb_ewmh_get_wm_window_type(ewmh,
                                win), &type, NULL) == 1) {
        if (wtype) *wtype = type.atoms[0];
        for (unsigned int i = 0; i < type.atoms_len; i++) {
print_window_type(win, type.atoms[i]);
            if (type.atoms[i] == ewmh->_NET_WM_WINDOW_TYPE_NORMAL) {
                isAlien = False;
                break;
            }
            if (type.atoms[i] == ewmh->_NET_WM_WINDOW_TYPE_DIALOG) {
                if (wtype)      *wtype = type.atoms[i];
                if (isFloating) *isFloating = True;
                isAlien = False;
                break;
            }
            else {
                if (atype == 0)
                    atype = type.atoms[i];
                isAlien = True;
            }
        }
        xcb_ewmh_get_atoms_reply_wipe(&type);
    }
    if (isAlien)
        create_alien(win, atype);

    return isAlien;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movl %edi, %ebp
testq %rsi, %rsi
je 0x5ecb
movb $0x0, (%rbx)
testq %r14, %r14
je 0x5ee0
movq 0x4891(%rip), %rax      # 0xa768
movl 0x104(%rax), %eax
movl %eax, (%r14)
movq 0x4869(%rip), %rdi      # 0xa750
movl %ebp, %esi
callq 0x33e0
movq 0x485b(%rip), %rdi      # 0xa750
movl %eax, %esi
xorl %edx, %edx
callq 0x3230
movb $0x1, %r15b
testq %rax, %rax
je 0x5fd5
movb 0x1b(%rax), %r12b
movq %rax, %rdi
callq 0x3050
testb %r12b, %r12b
jne 0x5fd5
movq 0x4842(%rip), %r12      # 0xa768
movq %r12, %rdi
movl %ebp, %esi
callq 0x3570
xorl %r15d, %r15d
leaq 0x8(%rsp), %rdx
movq %r12, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x35e0
cmpb $0x1, %al
jne 0x5fd5
testq %r14, %r14
je 0x5f5b
movq 0x10(%rsp), %rax
movl (%rax), %eax
movl %eax, (%r14)
movl 0x8(%rsp), %r12d
testq %r12, %r12
je 0x5fc8
movq 0x10(%rsp), %rax
movq 0x47f7(%rip), %rcx      # 0xa768
movl 0x104(%rcx), %edx
xorl %esi, %esi
xorl %r15d, %r15d
movl (%rax,%rsi,4), %edi
cmpl %edx, %edi
je 0x5fc8
cmpl 0xe8(%rcx), %edi
je 0x5fb8
testl %r15d, %r15d
cmovel %edi, %r15d
incq %rsi
cmpq %rsi, %r12
jne 0x5f7c
leaq 0x8(%rsp), %rdi
callq 0x3040
testq %r12, %r12
je 0x5fd2
movl %ebp, %edi
movl %r15d, %esi
callq 0x6e93
movb $0x1, %r15b
jmp 0x5fd5
testq %r14, %r14
je 0x5fc0
movl %edi, (%r14)
testq %rbx, %rbx
je 0x5fc8
movb $0x1, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0x3040
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq