// File: /workspace/github_cpp_makefile_star2_O3/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 $0x38, %rsp
leaq -0x30(%rbp), %r12
movl $0x0, (%r12)
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
movq %r12, %rdx
callq 0x33c0
movq %rax, %r15
cmpl $0x0, (%r12)
jle 0x43f2
xorl %ebx, %ebx
leaq -0x60(%rbp), %r12
movq (%r15,%rbx,8), %rsi
movq -0x38(%rbp), %rdi
callq 0x35b0
movq %rax, %r13
movq %r12, %rdi
movq %rax, %rsi
leaq -0x29(%rbp), %rdx
callq 0x519a
movq %r12, %rdi
leaq 0x1eea(%rip), %rsi      # 0x618e
callq 0x30b0
testl %eax, %eax
je 0x4336
movq %r12, %rdi
leaq 0x1ee2(%rip), %rsi      # 0x619d
callq 0x30b0
testl %eax, %eax
je 0x4336
movq %r12, %rdi
leaq 0x1edd(%rip), %rsi      # 0x61ab
callq 0x30b0
testl %eax, %eax
je 0x4336
movq %r12, %rdi
leaq 0x1edd(%rip), %rsi      # 0x61be
callq 0x30b0
testl %eax, %eax
je 0x4336
movq %r12, %rdi
leaq 0x1eda(%rip), %rsi      # 0x61ce
callq 0x30b0
testl %eax, %eax
je 0x4336
movl $0x11, %edx
movq 0x3cc7(%rip), %rdi      # 0x7fd0
leaq 0x1ec6(%rip), %rsi      # 0x61d6
callq 0x3350
testq %r13, %r13
je 0x4382
movq %r13, %rdi
callq 0x3140
movq 0x3ca7(%rip), %rdi      # 0x7fd0
movq %r13, %rsi
movq %rax, %rdx
callq 0x3350
jmp 0x43a0
xorl %r14d, %r14d
movq %r13, %rdi
callq 0x33a0
testb %r14b, %r14b
je 0x4357
movq (%r15,%rbx,8), %rdx
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x3520
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x4370
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x3300
incq %rbx
movslq -0x30(%rbp), %rax
cmpq %rax, %rbx
jl 0x427b
jmp 0x43f2
movq 0x3c47(%rip), %rcx      # 0x7fd0
movq (%rcx), %rax
movq -0x18(%rax), %rax
leaq (%rcx,%rax), %rdi
movl 0x20(%rcx,%rax), %esi
orl $0x1, %esi
callq 0x3540
movl $0x1, %edx
movq 0x3c24(%rip), %rdi      # 0x7fd0
leaq 0x1e33(%rip), %rsi      # 0x61e6
callq 0x3350
movq 0x3c11(%rip), %rcx      # 0x7fd0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x32c0
movsbl %al, %esi
movq 0x3bf3(%rip), %rdi      # 0x7fd0
callq 0x3040
movb $0x1, %r14b
movq %rax, %rdi
callq 0x31d0
jmp 0x4339
movq %r15, %rdi
callq 0x33a0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x4425
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x3300
movq %rbx, %rdi
callq 0x3550