// File: /workspace/github_c_makefile_star2_O3/tkln[P]mcwm/mcwm.c
// Function: fixwindow
void fixwindow(struct client *client, bool setcolour)
{
    uint32_t values[1];
    uint32_t ws;
    
    if (NULL == client)
    {
        return;
    }
    
    if (client->fixed)
    {
        client->fixed = false;
        setwmdesktop(client->id, curws);

        if (setcolour)
        {
            /* Set border color to ordinary focus colour. */
            values[0] = conf.focuscol;
            xcb_change_window_attributes(conn, client->id, XCB_CW_BORDER_PIXEL,
                                         values);
        }

        /* Delete from all workspace lists except current. */
        for (ws = 0; ws < WORKSPACES; ws ++)
        {
            if (ws != curws)
            {
                delfromworkspace(client, ws);
            }
        }
    }
    else
    {
        /*
         * First raise the window. If we're going to another desktop
         * we don't want this fixed window to be occluded behind
         * something else.
         */
        raisewindow(client->id);
        
        client->fixed = true;
        setwmdesktop(client->id, NET_WM_FIXED);

        /* Add window to all workspace lists. */
        for (ws = 0; ws < WORKSPACES; ws ++)
        {
            if (ws != curws)
            {
                addtoworkspace(client, ws);
            }
        }

        if (setcolour)
        {
            /* Set border color to fixed colour. */
            values[0] = conf.fixedcol;
            xcb_change_window_attributes(conn, client->id, XCB_CW_BORDER_PIXEL,
                                         values);
        }
    }

    xcb_flush(conn);    
}

// Assembly:
testq %rdi, %rdi
je 0x61ed
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
cmpb $0x1, 0x32(%rdi)
jne 0x614b
movb $0x0, 0x32(%rbx)
movl (%rbx), %edx
movl 0x480f(%rip), %eax      # 0xa8c0
leaq 0x10(%rsp), %r10
movl %eax, (%r10)
movq 0x48b8(%rip), %rdi      # 0xa978
movl 0x48ba(%rip), %ecx      # 0xa980
xorl %esi, %esi
movl $0x6, %r8d
movl $0x20, %r9d
pushq %r10
pushq $0x1
callq 0x3520
addq $0x10, %rsp
testb %bpl, %bpl
je 0x6106
movl 0x487c(%rip), %eax      # 0xa968
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
movq 0x487e(%rip), %rdi      # 0xa978
movl (%rbx), %esi
movl $0x8, %edx
callq 0x30f0
leaq 0x47d3(%rip), %r14      # 0xa8e0
movl 0x47ad(%rip), %eax      # 0xa8c0
xorl %r15d, %r15d
movl %eax, %ecx
cmpq %rcx, %r15
je 0x6139
movq 0x48(%rbx,%r15,8), %rsi
movq %r14, %rdi
callq 0x6dc0
movq $0x0, 0x48(%rbx,%r15,8)
movl 0x4787(%rip), %eax      # 0xa8c0
incq %r15
addq $0x8, %r14
cmpq $0xa, %r15
jne 0x6116
jmp 0x61d7
movl (%rbx), %edi
callq 0x61ee
movb $0x1, 0x32(%rbx)
movl (%rbx), %edx
leaq 0x14(%rsp), %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq 0x480e(%rip), %rdi      # 0xa978
movl 0x4810(%rip), %ecx      # 0xa980
xorl %r14d, %r14d
xorl %esi, %esi
movl $0x6, %r8d
movl $0x20, %r9d
pushq %rax
pushq $0x1
callq 0x3520
addq $0x10, %rsp
movl 0x472d(%rip), %eax      # 0xa8c0
cmpl %eax, %r14d
je 0x61a9
movq %rbx, %rdi
movl %r14d, %esi
callq 0x622c
movl 0x4717(%rip), %eax      # 0xa8c0
incl %r14d
cmpl $0xa, %r14d
jne 0x6193
testb %bpl, %bpl
je 0x61d7
movl 0x47b3(%rip), %eax      # 0xa970
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
movq 0x47ad(%rip), %rdi      # 0xa978
movl (%rbx), %esi
movl $0x8, %edx
callq 0x30f0
movq 0x479a(%rip), %rdi      # 0xa978
callq 0x3150
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq