// File: /workspace/github_c_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, %r14
movl %edi, %ebx
testq %rsi, %rsi
je 0x603a
movb $0x0, (%r14)
testq %r15, %r15
je 0x604f
movq 0x5722(%rip), %rax      # 0xb768
movl 0x104(%rax), %eax
movl %eax, (%r15)
movq 0x56fa(%rip), %rdi      # 0xb750
movl %ebx, %esi
callq 0x33e0
movq 0x56ec(%rip), %rdi      # 0xb750
movl %eax, %esi
xorl %edx, %edx
callq 0x3230
movb $0x1, %r12b
testq %rax, %rax
je 0x613a
movb 0x1b(%rax), %bpl
movq %rax, %rdi
callq 0x3050
testb %bpl, %bpl
jne 0x613a
movq 0x56d3(%rip), %r13      # 0xb768
movq %r13, %rdi
movl %ebx, %esi
callq 0x3570
xorl %r12d, %r12d
movq %rsp, %rdx
movq %r13, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x35e0
movl $0x0, %ebp
cmpb $0x1, %al
jne 0x612c
testq %r15, %r15
je 0x60c9
movq 0x8(%rsp), %rax
movl (%rax), %eax
movl %eax, (%r15)
movl (%rsp), %eax
testq %rax, %rax
je 0x610c
movq 0x8(%rsp), %rcx
movq 0x568b(%rip), %rdx      # 0xb768
movl 0x104(%rdx), %esi
xorl %edi, %edi
xorl %ebp, %ebp
movl (%rcx,%rdi,4), %r8d
cmpl %esi, %r8d
setne %r12b
je 0x6124
cmpl 0xe8(%rdx), %r8d
je 0x6110
testl %ebp, %ebp
cmovel %r8d, %ebp
incq %rdi
cmpl %edi, %eax
jne 0x60e7
jmp 0x6124
xorl %ebp, %ebp
jmp 0x6121
testq %r15, %r15
je 0x6118
movl %r8d, (%r15)
testq %r14, %r14
je 0x6121
movb $0x1, (%r14)
xorl %r12d, %r12d
movq %rsp, %rdi
callq 0x3040
testb %r12b, %r12b
je 0x613a
movl %ebx, %edi
movl %ebp, %esi
callq 0x706d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq