// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x24(%rbp)
movb $0x0, -0x25(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x767b
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
cmpq $0x0, -0x18(%rbp)
je 0x7695
movq 0x612f(%rip), %rax      # 0xd7b8
movl 0x104(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
leaq -0x24(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x1, %edx
callq 0x9020
cmpq $0x0, -0x20(%rbp)
jne 0x76b7
movb $0x1, -0x1(%rbp)
jmp 0x7804
movq -0x20(%rbp), %rax
cmpb $0x0, 0x1b(%rax)
je 0x76d3
movq -0x20(%rbp), %rdi
callq 0x3050
movb $0x1, -0x1(%rbp)
jmp 0x7804
movq -0x20(%rbp), %rdi
callq 0x3050
movl $0x0, -0x44(%rbp)
movq 0x60ce(%rip), %rax      # 0xd7b8
movq %rax, -0x58(%rbp)
movq 0x60c3(%rip), %rdi      # 0xd7b8
movl -0x8(%rbp), %esi
callq 0x3570
movq -0x58(%rbp), %rdi
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %esi
leaq -0x40(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x35e0
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x77eb
cmpq $0x0, -0x18(%rbp)
je 0x7733
movq -0x38(%rbp), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jae 0x77e2
movl -0x8(%rbp), %edi
movq -0x38(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl (%rax,%rcx,4), %esi
callq 0x92f0
movq -0x38(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq 0x604f(%rip), %rcx      # 0xd7b8
cmpl 0x104(%rcx), %eax
jne 0x7777
movb $0x0, -0x25(%rbp)
jmp 0x77e2
movq -0x38(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq 0x6030(%rip), %rcx      # 0xd7b8
cmpl 0xe8(%rcx), %eax
jne 0x77bb
cmpq $0x0, -0x18(%rbp)
je 0x77a7
movq -0x38(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl (%rax,%rcx,4), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x10(%rbp)
je 0x77b5
movq -0x10(%rbp), %rax
movb $0x1, (%rax)
movb $0x0, -0x25(%rbp)
jmp 0x77e2
cmpl $0x0, -0x44(%rbp)
jne 0x77ce
movq -0x38(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
movb $0x1, -0x25(%rbp)
jmp 0x77d4
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x773a
leaq -0x40(%rbp), %rdi
callq 0x3040
testb $0x1, -0x25(%rbp)
je 0x77fc
movl -0x8(%rbp), %edi
movl -0x44(%rbp), %esi
callq 0x9100
movb -0x25(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nop