// File: /workspace/github_cpp_makefile_star2_O1/kazzmir[P]xborder/src/main.cpp
// Function: delete_properties(_XDisplay*, unsigned long)
void delete_properties(Display * display, Window window){
    int count = 0;
    Atom * atoms = XListProperties(display, window, &count);
    for (int i = 0; i < count; i++){
        const Atom & atom = atoms[i];
        char * name = XGetAtomName(display, atom);
        std::string sname = name;


        bool destroy = true;
        if (sname == "XKLAVIER_STATE" ||
            sname == "_NET_WM_STATE" ||
            sname == "_NET_FRAME_EXTENTS" ||
            sname == "_NET_WM_DESKTOP" ||
            sname == "WM_NAME"){
            destroy = false;
        }

        if (destroy){
            std::cout << "Delete property '" << name << "'" << std::endl;
        }
        XFree(name);

        if (destroy){
            XDeleteProperty(display, window, atom);
        }
    }
    XFree(atoms);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq -0x3c(%rbp), %rbx
movl $0x0, (%rbx)
movq %rdi, -0x48(%rbp)
movq %rsi, -0x50(%rbp)
movq %rbx, %rdx
callq 0x33c0
movq %rax, -0x38(%rbp)
cmpl $0x0, (%rbx)
jle 0x43e7
xorl %r14d, %r14d
leaq -0x70(%rbp), %r12
movq 0x3d4b(%rip), %r13      # 0x7fd0
movq -0x38(%rbp), %rax
movq (%rax,%r14,8), %rsi
movq -0x48(%rbp), %rdi
callq 0x35b0
movq %rax, %rbx
movq %r12, %rdi
movq %rax, %rsi
leaq -0x29(%rbp), %rdx
callq 0x51d6
movq %r12, %rdi
leaq 0x1edc(%rip), %rsi      # 0x618e
callq 0x30b0
testl %eax, %eax
je 0x430a
movq %r12, %rdi
leaq 0x1ed8(%rip), %rsi      # 0x619d
callq 0x30b0
testl %eax, %eax
je 0x430a
movq %r12, %rdi
leaq 0x1ed3(%rip), %rsi      # 0x61ab
callq 0x30b0
testl %eax, %eax
je 0x430a
movq %r12, %rdi
leaq 0x1ed3(%rip), %rsi      # 0x61be
callq 0x30b0
testl %eax, %eax
je 0x430a
movq %r12, %rdi
leaq 0x1ed0(%rip), %rsi      # 0x61ce
callq 0x30b0
movb $0x1, %r15b
testl %eax, %eax
jne 0x430d
xorl %r15d, %r15d
testb %r15b, %r15b
je 0x439c
movl $0x11, %edx
movq %r13, %rdi
leaq 0x1eb1(%rip), %rsi      # 0x61d6
callq 0x3350
testq %rbx, %rbx
je 0x4347
movq %rbx, %rdi
callq 0x3140
movq %r13, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x3350
jmp 0x4360
movq (%r13), %rax
movq -0x18(%rax), %rax
leaq (%rax,%r13), %rdi
movl 0x20(%r13,%rax), %esi
orl $0x1, %esi
callq 0x3540
movl $0x1, %edx
movq %r13, %rdi
leaq 0x1e77(%rip), %rsi      # 0x61e6
callq 0x3350
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x32c0
movsbl %al, %esi
movq %r13, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31d0
movq %rbx, %rdi
callq 0x33a0
testb %r15b, %r15b
je 0x43be
movq -0x38(%rbp), %rax
movq (%rax,%r14,8), %rdx
movq -0x48(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x3520
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x43d7
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3300
incq %r14
movslq -0x3c(%rbp), %rax
cmpq %rax, %r14
jl 0x4285
movq -0x38(%rbp), %rdi
callq 0x33a0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x441b
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x3300
movq %rbx, %rdi
callq 0x3550