LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTreeBranch::hit(RayTracer::Ray const&, double, double, RayTracer::HitRecord&) const
bool ObjectTreeBranch::hit(const Ray& ray, double t_min, double t_max, HitRecord& record) const {
    HitRecord record_r;
    bool hit_left = this->left->quick_hit(ray, t_min, t_max) && this->left->hit(ray, t_min, t_max, record);
    bool hit_right = this->right->quick_hit(ray, t_min, t_max) && this->right->hit(ray, t_min, t_max, record_r);
    // Note the record if it was a hit
    if (hit_left && hit_right) {
        // Set record to the smallest one
        if (record_r.t < record.t) {
            record = record_r;
        }
    } else if (hit_right) {
        // Don't forget to update record
        record = record_r;
    }
    
    // Return if we actually hit
    return hit_left || hit_right;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movsd %xmm1, 0x8(%rsp)
movsd %xmm0, (%rsp)
movq %rsi, %r14
movq %rdi, %r15
leaq 0x10(%rsp), %rdi
callq 0x82352
movq 0x50(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq *0x10(%rax)
testb %al, %al
je 0x89115
movq 0x50(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %rbx, %rdx
callq *0x18(%rax)
movl %eax, %ebp
jmp 0x89117
xorl %ebp, %ebp
movq 0x58(%r15), %rdi
movq (%rdi), %rax
movq %r14, %rsi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq *0x10(%rax)
testb %al, %al
je 0x8917e
movq 0x58(%r15), %rdi
movq (%rdi), %rax
leaq 0x10(%rsp), %rdx
movq %r14, %rsi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq *0x18(%rax)
movl %ebp, %ecx
andb %al, %cl
cmpb $0x1, %cl
jne 0x89169
movsd (%rbx), %xmm0
movb $0x1, %al
ucomisd 0x10(%rsp), %xmm0
ja 0x8916d
jmp 0x89180
testb %al, %al
je 0x8917e
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x8236c
movb $0x1, %al
jmp 0x89180
xorl %eax, %eax
orb %al, %bpl
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTreeBranch::operator=(RayTracer::ObjectTreeBranch)
ObjectTreeBranch& ObjectTreeBranch::operator=(ObjectTreeBranch other) {
    // Copy the stuff by swapping
    if (this != &other) {
        // Copy by swapping
        swap(*this, other);
    }
    return *this;
}

// Assembly:
movq %rdi, %rax
cmpq %rsi, %rdi
je 0x891b8
movq 0x50(%rax), %rcx
movq 0x50(%rsi), %rdx
movq %rdx, 0x50(%rax)
movq %rcx, 0x50(%rsi)
movq 0x58(%rax), %rcx
movq 0x58(%rsi), %rdx
movq %rdx, 0x58(%rax)
movq %rcx, 0x58(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTreeLeaf::operator=(RayTracer::ObjectTreeLeaf)
ObjectTreeLeaf& ObjectTreeLeaf::operator=(ObjectTreeLeaf other) {
    // Copy the stuff by swapping
    if (this != &other) {
        // Copy by swapping
        swap(*this, other);
    }
    return *this;
}

// Assembly:
movq %rdi, %rax
cmpq %rsi, %rdi
je 0x893d0
movq 0x50(%rax), %rcx
movq 0x50(%rsi), %rdx
movq %rdx, 0x50(%rax)
movq %rcx, 0x50(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTreeLeaf::operator=(RayTracer::ObjectTreeLeaf&&)
ObjectTreeLeaf& ObjectTreeLeaf::operator=(ObjectTreeLeaf&& other) {
    // Copy the stuff directly
    if (this != &other) {
        this->obj = other.obj;
        other.obj = nullptr;
    }
    return *this;
}

// Assembly:
movq %rdi, %rax
cmpq %rsi, %rdi
je 0x893f7
movq 0x50(%rsi), %rcx
movq %rcx, 0x50(%rax)
andq $0x0, 0x50(%rsi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::~ObjectTree()
ObjectTree::~ObjectTree() {
    if (this->root != nullptr) { delete this->root; }

    // ALso delete all objects
    for (size_t i = 0; i < this->objects.size(); i++) {
        delete this->objects.at(i);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x894a8
movq (%rdi), %rax
callq *0x8(%rax)
xorl %r14d, %r14d
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
cmpq %rax, %r14
jae 0x894d9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x82330
movq (%rax), %rdi
testq %rdi, %rdi
je 0x894d4
movq (%rdi), %rax
callq *0x10(%rax)
incq %r14
jmp 0x894ab
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x82400
movq %rax, %rdi
callq 0x56ca4
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::add(RayTracer::RenderObject*)
bool ObjectTree::add(RenderObject* obj) {
    // Crash if the object has no hitbox
    if (!obj->has_hitbox) {
        return false;
    }

    this->objects.push_back(obj);   

    // Be sure to mark the tree as non-optimised anymore
    this->is_optimised = false;

    return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movb 0x78(%rsi), %bl
cmpb $0x1, %bl
jne 0x89510
movq %rdi, %r14
movq %rsp, %rsi
callq 0x899cc
movb $0x0, 0x20(%r14)
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::remove(RayTracer::RenderObject*)
bool ObjectTree::remove(RenderObject* obj) {
    // Check if a node with this pointer is present
    for (size_t i = 0; i < this->objects.size(); i++) {
        if (this->objects.at(i) == obj) {
            // Remove it and then quit
            this->objects.erase(this->objects.begin() + i);

            this->is_optimised = false;
            
            return true;
        }
    }
    return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %r14d, %r14d
movq 0x8(%rbx), %r13
subq (%rbx), %r13
sarq $0x3, %r13
cmpq %r13, %r14
jae 0x8956a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x82330
cmpq %r12, (%rax)
je 0x89558
incq %r14
addq $0x8, %r15
jmp 0x8952f
addq (%rbx), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x899ea
movb $0x0, 0x20(%rbx)
cmpq %r13, %r14
setb %al
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::optimize()
void ObjectTree::optimize() {
    this->is_optimised = true;

    // Start by removing any existing trees
    if (this->root != nullptr) {
        delete this->root;
    }
    
    // Make sure there are things to optimize
    if (this->size() == 0) { return; }

    // Create the root node
    if (this->size() == 1) {
        // If there is only one element, make a leaf
        this->root = (ObjectTreeNode*) new ObjectTreeLeaf(this->objects.at(0));
    } else {
        // Else, make a branch which splits itself
        this->root = (ObjectTreeNode*) new ObjectTreeBranch(this->objects);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movb $0x1, 0x20(%rdi)
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x89597
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
je 0x895fd
cmpq $0x1, %rax
jne 0x895d0
pushq $0x58
popq %rdi
callq 0x52470
movq %rax, %r14
movq %rbx, %rdi
xorl %esi, %esi
callq 0x82330
movq (%rax), %rsi
movq %r14, %rdi
callq 0x89230
movq %r14, 0x18(%rbx)
jmp 0x895fd
pushq $0x60
popq %rdi
callq 0x52470
movq %rax, %r14
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x822e2
movq %rsp, %rsi
movq %r14, %rdi
callq 0x88d62
movq %r14, 0x18(%rbx)
movq %rsp, %rdi
callq 0x82400
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x82400
jmp 0x89615
movq %rax, %rbx
pushq $0x60
jmp 0x8961e
movq %rax, %rbx
pushq $0x58
popq %rsi
movq %r14, %rdi
callq 0x52480
movq %rbx, %rdi
callq 0x527a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::hit(RayTracer::Ray const&, double, double, RayTracer::HitRecord&) const
bool ObjectTree::hit(const Ray& ray, double t_min, double t_max, HitRecord& record) const {
    // Do different things depending if we're optimised or not
    if (this->is_optimised) {
        // Quit if there is nothing
        if (this->root == nullptr) { return false; }

        // Simply use the tree structure
        return this->root->quick_hit(ray, t_min, t_max) && this->root->hit(ray, t_min, t_max, record);
    }

    cerr << "WARNING: ObjectTree @ " << this << " is not optimised." << endl;

    // Otherwise, do it loop-wise
    double t_best = t_max;
    bool hit = false;
    for (size_t i = 0; i < this->objects.size(); i++) {
        // Fetch the correct item from the list
        RenderObject* obj = this->objects.at(i);
        if (obj->quick_hit(ray, t_min, t_best) && obj->hit(ray, t_min, t_best, record)) {
            t_best = record.t;
            hit = true;
        }
    }

    // Return if we hit or not
    return hit;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpb $0x1, 0x20(%rdi)
jne 0x896b0
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0x89764
movq (%rdi), %rax
movq %r14, %rsi
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x8(%rsp)
callq *0x10(%rax)
testb %al, %al
je 0x89764
movq 0x18(%r15), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
movq %r14, %rsi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %rbx, %rdx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movsd %xmm0, 0x10(%rsp)
movsd %xmm1, 0x8(%rsp)
movq 0x2891d(%rip), %rdi     # 0xb1fe0
leaq 0x9896(%rip), %rsi      # 0x92f60
callq 0x52450
movq %rax, %rdi
movq %r15, %rsi
callq 0x52380
leaq 0x9896(%rip), %rsi      # 0x92f77
movq %rax, %rdi
callq 0x52450
movq %rax, %rdi
callq 0x52210
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x8(%r15), %rax
subq (%r15), %rax
sarq $0x3, %rax
cmpq %rax, %r13
jae 0x89767
movq %r15, %rdi
movq %r13, %rsi
callq 0x823b2
movq (%rax), %rbp
movq (%rbp), %rax
movq %rbp, %rdi
movq %r14, %rsi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
callq *0x20(%rax)
testb %al, %al
je 0x8975f
movq (%rbp), %rax
movq %rbp, %rdi
movq %r14, %rsi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %rbx, %rdx
callq *0x30(%rax)
testb %al, %al
je 0x8975f
movsd (%rbx), %xmm0
movsd %xmm0, 0x8(%rsp)
movb $0x1, %r12b
incq %r13
jmp 0x896f7
xorl %r12d, %r12d
andb $0x1, %r12b
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::operator=(RayTracer::ObjectTree)
ObjectTree& ObjectTree::operator=(ObjectTree other) {
    if (this != &other) {
        // Copy by swapping
        swap(*this, other);
    }
    return *this;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x8978f
movq %rbx, %rdi
callq 0x89794
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::swap(RayTracer::ObjectTree&, RayTracer::ObjectTree&)
void RayTracer::swap(ObjectTree& first, ObjectTree& second) {
    using std::swap;

    swap(first.objects, second.objects);
    swap(first.root, second.root);
    swap(first.is_optimised, second.is_optimised);
    swap(first.uid, second.uid);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x824ca
movq 0x18(%r14), %rax
movq 0x18(%rbx), %rcx
movq %rcx, 0x18(%r14)
movq %rax, 0x18(%rbx)
movb 0x20(%r14), %al
movb 0x20(%rbx), %cl
movb %cl, 0x20(%r14)
movb %al, 0x20(%rbx)
movq 0x28(%r14), %rax
movq 0x28(%rbx), %rcx
movq %rcx, 0x28(%r14)
movq %rax, 0x28(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/ObjectTree.cpp
// Function: RayTracer::ObjectTree::operator=(RayTracer::ObjectTree&&)
ObjectTree& ObjectTree::operator=(ObjectTree&& other) {
    if (this != &other) {
        // Copy by swapping
        swap(*this, other);
    }
    return *this;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0x897eb
movq %rbx, %rdi
callq 0x89794
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: choose_window(_XDisplay*)
Window choose_window(Display * display){
    Window root = RootWindow(display, DefaultScreen(display));
    Window root_out;
    int root_x, root_y;
    int win_x, win_y;
    unsigned int mask;
    Window child = 0;
    Cursor cursor;

    cursor = XCreateFontCursor(display, XC_crosshair);

    XGrabPointer(display, root, False, ButtonPressMask | ButtonReleaseMask, GrabModeSync, GrabModeAsync, root, cursor, CurrentTime);

    // std::cout << "Grabbing window" << std::endl;
    while (1){
        XAllowEvents(display, SyncPointer, CurrentTime);
        XEvent event;
        XWindowEvent(display, root, ButtonPressMask | ButtonReleaseMask, &event);
        if (event.type == ButtonPress){
            child = event.xbutton.subwindow;
            break;
        }
    }

    // XQueryPointer(display, root, &root_out, &child, &root_x, &root_y, &win_x, &win_y, &mask);
    // std::cout << "Grabbed window " << child << std::endl;
    XUngrabPointer(display, CurrentTime);
    std::cout << "Grabbed window " << child << std::endl;
    if (child == root){
        return 0;
    }

    return child;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r14
movq 0xe8(%rdi), %rax
movslq 0xe0(%rdi), %rcx
shlq $0x7, %rcx
movq 0x10(%rax,%rcx), %rbx
pushq $0x22
popq %rsi
callq 0x3190
movq %rax, 0x8(%rsp)
movq %rbx, (%rsp)
andq $0x0, 0x10(%rsp)
pushq $0xc
popq %rcx
pushq $0x1
popq %r15
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movl %r15d, %r9d
callq 0x30f0
pushq $0xc
popq %r12
leaq -0xe8(%rbp), %r13
movq %r14, %rdi
movl %r15d, %esi
xorl %edx, %edx
callq 0x3150
movq %r14, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x3070
cmpl $0x4, -0xe8(%rbp)
jne 0x3766
movq -0xb8(%rbp), %r15
xorl %r12d, %r12d
movq %r14, %rdi
xorl %esi, %esi
callq 0x3280
movq 0x5828(%rip), %rdi      # 0x8fd0
leaq 0x28ed(%rip), %rsi      # 0x609c
callq 0x32b0
movq %rax, %rdi
movq %r15, %rsi
callq 0x31c0
movq %rax, %rdi
callq 0x3140
cmpq %rbx, %r15
cmoveq %r12, %r15
movq %r15, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: find_xborder_window(_XDisplay*)
Window find_xborder_window(Display * display){
    Window chosen = choose_window(display);
    if (chosen == 0){
        std::cout << "Error: Window could not be selected, or root window chosen" << std::endl;
        return 0;
    }
    Atom xborder = XInternAtom(display, "xborder", false);
    Window xborder_window = find_window_by_atom(display, chosen, xborder);
    if (xborder_window == 0){
        std::cout << "Error: Selected window is not an xborder: " << chosen << std::endl;
        return 0;
    }
    return xborder_window;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x36fc
testq %rax, %rax
je 0x381a
movq %rax, %r14
leaq 0x2af5(%rip), %rsi      # 0x62f6
movq %rbx, %rdi
xorl %edx, %edx
callq 0x31f0
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x383c
movq 0x57af(%rip), %rdi      # 0x8fd0
leaq 0x2884(%rip), %rsi      # 0x60ac
callq 0x32b0
movq %rax, %rdi
callq 0x3140
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: find_window_by_atom(_XDisplay*, unsigned long, unsigned long)
static Window find_window_by_atom(Display *dpy, Window win, Atom atom){
    Atom type = None;
    int format;
    unsigned long nitems, after;
    unsigned char *data = NULL;
    Window inf;

    // std::cout << "Find window with atom " << XGetAtomName(dpy, atom) << std::endl;
    XGetWindowProperty(dpy, win, atom, 0, 0, False, AnyPropertyType,
            &type, &format, &nitems, &after, &data);
    if (data)
        XFree(data);
    if (type)
        return win;
    inf = TryChildren(dpy, win, atom);
    if (!inf)
        inf = win;
    return inf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x60, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq -0x28(%rbp), %rax
andq $0x0, (%rax)
leaq -0x38(%rbp), %r12
andq $0x0, (%r12)
movq %r12, 0x28(%rsp)
leaq -0x40(%rbp), %rcx
movq %rcx, 0x20(%rsp)
leaq -0x48(%rbp), %rcx
movq %rcx, 0x18(%rsp)
leaq -0x2c(%rbp), %rcx
andq $0x0, (%rsp)
movq %rcx, 0x10(%rsp)
movq %rax, 0x8(%rsp)
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x30b0
movq (%r12), %rdi
testq %rdi, %rdi
je 0x38aa
callq 0x3380
cmpq $0x0, -0x28(%rbp)
jne 0x38c6
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4af6
testq %rax, %rax
cmovneq %rax, %rbx
movq %rbx, %rax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: find_terminal(_XDisplay*)
Window find_terminal(Display * display){
    Window child = choose_window(display);
    if (child == 0){
        return 0;
    }
    return _XmuClientWindow(display, child);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x36fc
testq %rax, %rax
je 0x3916
movq %rax, %rbx
leaq 0x28b2(%rip), %rsi      # 0x61a6
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x31f0
testq %rax, %rax
je 0x3918
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x383c
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: create_color(_XDisplay*, int, int, int)
XColor create_color(Display * display, int red, int green, int blue){
    XColor color;
    color.red = red;
    color.green = green;
    color.blue = blue;
    int screen = DefaultScreen(display);
    Colormap screen_colormap = DefaultColormap(display, screen);
    XAllocColor(display, screen_colormap, &color);
    return color;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq -0x18(%rbp), %rbx
movw %si, 0x8(%rbx)
movw %dx, 0xa(%rbx)
movw %cx, 0xc(%rbx)
movslq 0xe0(%rdi), %rax
movq 0xe8(%rdi), %rcx
shlq $0x7, %rax
movq 0x50(%rcx,%rax), %rsi
movq %rbx, %rdx
callq 0x3220
movq (%rbx), %rax
movq 0x8(%rbx), %rdx
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: hsv2rgb(hsv)
rgb hsv2rgb(hsv HSV){
    rgb RGB;
    double H = HSV.h, S = HSV.s, V = HSV.v,
           P, Q, T,
           fract;

    (H == 360.)?(H = 0.):(H /= 60.);
    fract = H - floor(H);

    P = V*(1. - S);
    Q = V*(1. - S*fract);
    T = V*(1. - S*(1. - fract));

    if      (0. <= H && H < 1.)
        RGB = (rgb){.r = V, .g = T, .b = P};
    else if (1. <= H && H < 2.)
        RGB = (rgb){.r = Q, .g = V, .b = P};
    else if (2. <= H && H < 3.)
        RGB = (rgb){.r = P, .g = V, .b = T};
    else if (3. <= H && H < 4.)
        RGB = (rgb){.r = P, .g = Q, .b = V};
    else if (4. <= H && H < 5.)
        RGB = (rgb){.r = T, .g = P, .b = V};
    else if (5. <= H && H < 6.)
        RGB = (rgb){.r = V, .g = P, .b = Q};
    else
        RGB = (rgb){.r = 0., .g = 0., .b = 0.};

    return RGB;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movsd 0x10(%rbp), %xmm0
movsd 0x18(%rbp), %xmm1
movsd %xmm1, -0x18(%rbp)
movapd %xmm0, %xmm1
divsd 0x260e(%rip), %xmm1     # 0x6010
movsd 0x20(%rbp), %xmm2
movsd %xmm2, -0x10(%rbp)
cmpeqsd 0x2603(%rip), %xmm0     # 0x6018
andnpd %xmm1, %xmm0
movapd %xmm0, -0x30(%rbp)
callq 0x3500
movsd -0x18(%rbp), %xmm6
movsd -0x10(%rbp), %xmm5
movapd -0x30(%rbp), %xmm7
movapd %xmm7, %xmm3
subsd %xmm0, %xmm3
movsd 0x25de(%rip), %xmm1     # 0x6020
movapd %xmm1, %xmm0
subsd %xmm6, %xmm0
mulsd %xmm5, %xmm0
movapd %xmm1, %xmm4
subsd %xmm3, %xmm4
mulsd %xmm6, %xmm4
movapd %xmm1, %xmm2
subsd %xmm4, %xmm2
mulsd %xmm5, %xmm2
xorpd %xmm4, %xmm4
ucomisd %xmm4, %xmm7
movapd %xmm7, %xmm4
jb 0x3a85
ucomisd %xmm4, %xmm1
jbe 0x3a85
movsd %xmm5, (%rbx)
movsd %xmm2, 0x8(%rbx)
jmp 0x3ab2
mulsd %xmm3, %xmm6
subsd %xmm6, %xmm1
mulsd %xmm5, %xmm1
ucomisd 0x2587(%rip), %xmm4     # 0x6020
jb 0x3ac1
movsd 0x2585(%rip), %xmm3     # 0x6028
ucomisd %xmm4, %xmm3
jbe 0x3ac1
movsd %xmm1, (%rbx)
movsd %xmm5, 0x8(%rbx)
movsd %xmm0, 0x10(%rbx)
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
ucomisd 0x255f(%rip), %xmm4     # 0x6028
jb 0x3ae9
movsd 0x255d(%rip), %xmm3     # 0x6030
ucomisd %xmm4, %xmm3
jbe 0x3ae9
movsd %xmm0, (%rbx)
movsd %xmm5, 0x8(%rbx)
movsd %xmm2, 0x10(%rbx)
jmp 0x3ab7
ucomisd 0x253f(%rip), %xmm4     # 0x6030
jb 0x3b0c
movsd 0x253d(%rip), %xmm3     # 0x6038
ucomisd %xmm4, %xmm3
jbe 0x3b0c
movsd %xmm0, (%rbx)
movsd %xmm1, 0x8(%rbx)
jmp 0x3b2d
ucomisd 0x2524(%rip), %xmm4     # 0x6038
jb 0x3b34
movsd 0x2522(%rip), %xmm3     # 0x6040
ucomisd %xmm4, %xmm3
jbe 0x3b34
movsd %xmm2, (%rbx)
movsd %xmm0, 0x8(%rbx)
movsd %xmm5, 0x10(%rbx)
jmp 0x3ab7
ucomisd 0x2504(%rip), %xmm4     # 0x6040
jb 0x3b5f
movsd 0x2502(%rip), %xmm2     # 0x6048
ucomisd %xmm4, %xmm2
jbe 0x3b5f
movsd %xmm5, (%rbx)
movsd %xmm0, 0x8(%rbx)
movsd %xmm1, 0x10(%rbx)
jmp 0x3ab7
xorpd %xmm0, %xmm0
movupd %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
jmp 0x3ab7
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: get_rgb(int, float, float)
rgb get_rgb(int h, float s, float v){
    hsv hsv;
    hsv.h = h;
    hsv.s = s;
    hsv.v = v;
    return hsv2rgb(hsv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
cvtsi2sd %esi, %xmm2
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
movsd %xmm2, -0x20(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x20(%rbp), %xmm0
movups %xmm0, (%rsp)
callq 0x39db
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: get_rgb(int, int)
rgb get_rgb(int x, int y){
    if (x < 0 || x > palette_x || y < 0 || y > palette_y){
        rgb out;
        out.r = 0;
        out.g = 0;
        out.b = 0;
        return out;
    }
    hsv hsv;
    hsv.h = (int) interpolate(x, 0, palette_x, 0, 360);
    hsv.s = 1.0;
    hsv.v = 1.2 - interpolate(y, 0, palette_y, 0.2, 1.0);
    return hsv2rgb(hsv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
cmpl $0x15, %esi
setb %al
cmpl $0x7, %edx
setb %cl
testb %cl, %al
jne 0x3bff
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
jmp 0x3c7e
cvtsi2ss %esi, %xmm0
mulss 0x244d(%rip), %xmm0     # 0x6058
divss 0x2449(%rip), %xmm0     # 0x605c
xorps %xmm1, %xmm1
addss %xmm0, %xmm1
cvttps2dq %xmm1, %xmm0
cvtsi2ss %edx, %xmm1
cvtdq2pd %xmm0, %xmm0
mulss 0x2432(%rip), %xmm1     # 0x6060
divss 0x242e(%rip), %xmm1     # 0x6064
addss 0x242a(%rip), %xmm1     # 0x6068
cvtss2sd %xmm1, %xmm1
movsd 0x2406(%rip), %xmm2     # 0x6050
subsd %xmm1, %xmm2
movlps %xmm0, -0x20(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x18(%rbp)
movsd %xmm2, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x20(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x39db
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: draw_palette(_XDisplay*, unsigned long, int)
void draw_palette(Display * display, Window window, int start_y){
    
    GC local = XCreateGC(display, window, 0, NULL);
    
    int x = 0;
    int y = start_y;
    int size = palette_size_block;

    for (int cy = 0; cy <= palette_y; cy++){
        for (int cx = 0; cx <= palette_x; cx++){
            rgb rgb = get_rgb(cx, cy);
            XColor color = create_color(display, rgb);
            XGCValues values;
            values.foreground = color.pixel;
            XChangeGC(display, local, GCForeground, &values);
            XFillRectangle(display, window, local, x, y, size, size);

            x += size;
        }
        x = 0;
        y += size;
    } 

    XFreeGC(display, local);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movl %edx, -0x2c(%rbp)
movq %rdi, %rbx
xorl %r12d, %r12d
movq %rsi, -0x38(%rbp)
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3160
movq %rax, %r13
cmpl $0x7, %r12d
je 0x3d85
xorl %r15d, %r15d
xorl %r14d, %r14d
cmpl $0x15, %r15d
je 0x3d79
leaq -0x50(%rbp), %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x3bd6
movq -0x40(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x50(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x39a6
movq %rax, -0xc0(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
pushq $0x4
popq %rdx
leaq -0xd0(%rbp), %rcx
callq 0x31d0
movl $0xf, (%rsp)
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq %r13, %rdx
movl %r14d, %ecx
movl -0x2c(%rbp), %r8d
pushq $0xf
popq %r9
callq 0x3170
addl $0xf, %r14d
incl %r15d
jmp 0x3d05
addl $0xf, -0x2c(%rbp)
incl %r12d
jmp 0x3cf5
movq %rbx, %rdi
movq %r13, %rsi
callq 0x31a0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: change_background_color(_XDisplay*, unsigned long, rgb)
void change_background_color(Display * display, Window window, rgb rgb){
    XSetWindowAttributes attributes;
    attributes.background_pixel = create_color(display, rgb).pixel;
    XChangeWindowAttributes(display, window, CWBackPixel, &attributes);
    XClearWindow(display, window);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x90, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x20(%rbp), %rax
movq %rax, 0x10(%rsp)
movaps 0x10(%rbp), %xmm0
movups %xmm0, (%rsp)
callq 0x39a6
leaq -0x80(%rbp), %rcx
movq %rax, 0x8(%rcx)
pushq $0x2
popq %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x34c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3290
addq $0x90, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: x_error(_XDisplay*, XErrorEvent*)
int x_error(Display * display, XErrorEvent * event){
    char buffer[256];
    snprintf(buffer, sizeof(buffer), "/tmp/xborder-error.%lu", window);
    FILE * log = fopen(buffer, "a");
    fprintf(log, "xborder pid %d window id %lu crashed\n", getpid(), window);
    fprintf(log, "xerror:\n");
    fprintf(log, "  serial: %lu\n", event->serial);
    char error_string[256];
    XGetErrorText(display, event->error_code, error_string, sizeof(error_string));
    fprintf(log, "  error code: %s\n", error_string);
    fprintf(log, "  request code: %d\n", event->request_code);
    fprintf(log, "  minor code: %d\n", event->minor_code);
    fprintf(log, "  resource id: %lu\n", event->resourceid);
    fprintf(log, "\n");
    show_backtrace(fileno(log));
    fclose(log);
    // exit(1);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x520, %rsp            # imm = 0x520
movq %rsi, %r14
movq %rdi, %r15
movq 0x5498(%rip), %rcx      # 0x9308
leaq 0x2270(%rip), %rdx      # 0x60e7
leaq -0x220(%rbp), %rbx
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdi
xorl %eax, %eax
callq 0x34b0
leaq 0x226a(%rip), %rsi      # 0x60fe
movq %rbx, %rdi
callq 0x3340
movq %rax, %rbx
callq 0x3420
movq 0x545d(%rip), %rcx      # 0x9308
leaq 0x224e(%rip), %rsi      # 0x6100
movq %rbx, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x33e0
leaq 0x2261(%rip), %rdi      # 0x6126
pushq $0x8
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x35a0
movq 0x18(%r14), %rdx
leaq 0x2251(%rip), %rsi      # 0x612f
movq %rbx, %rdi
xorl %eax, %eax
callq 0x33e0
movzbl 0x20(%r14), %esi
leaq -0x120(%rbp), %r12
movq %r15, %rdi
movq %r12, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x3400
leaq 0x2233(%rip), %rsi      # 0x613e
movq %rbx, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x33e0
movzbl 0x21(%r14), %edx
leaq 0x222c(%rip), %rsi      # 0x6150
movq %rbx, %rdi
xorl %eax, %eax
callq 0x33e0
movzbl 0x22(%r14), %edx
leaq 0x222a(%rip), %rsi      # 0x6164
movq %rbx, %rdi
xorl %eax, %eax
callq 0x33e0
movq 0x10(%r14), %rdx
leaq 0x2227(%rip), %rsi      # 0x6176
movq %rbx, %rdi
xorl %eax, %eax
callq 0x33e0
pushq $0xa
popq %rdi
movq %rbx, %rsi
callq 0x3360
movq %rbx, %rdi
callq 0x3310
movl %eax, %r14d
leaq -0x540(%rbp), %r15
pushq $0x64
popq %rsi
movq %r15, %rdi
callq 0x3440
movq %r15, %rdi
movl %eax, %esi
movl %r14d, %edx
callq 0x34a0
movq %rbx, %rdi
callq 0x32c0
xorl %eax, %eax
addq $0x520, %rsp            # imm = 0x520
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: get_window_title[abi:cxx11](_XDisplay*, unsigned long)
std::string get_window_title(Display * display, Window window){
    char* buffer = NULL;
    if (XFetchName(display, window, &buffer) != 0){
        if (buffer != NULL){
            std::string out = buffer;
            XFree(buffer);
            return out;
        }
    }

    return "XBorder";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x20(%rbp), %r14
andq $0x0, (%r14)
movq %rsi, %rdi
movq %rdx, %rsi
movq %r14, %rdx
callq 0x3460
testl %eax, %eax
setne %al
movq (%r14), %rsi
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x3ff8
leaq -0x12(%rbp), %rdx
movq %rbx, %rdi
callq 0x4bf8
movq -0x20(%rbp), %rdi
callq 0x3380
jmp 0x400b
leaq 0x218b(%rip), %rsi      # 0x618a
leaq -0x11(%rbp), %rdx
movq %rbx, %rdi
callq 0x4bf8
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x3130
movq %r14, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O2/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), %rdx
andl $0x0, (%rdx)
movq %rdi, -0x38(%rbp)
movq %rsi, -0x40(%rbp)
callq 0x33a0
movq %rax, %r15
xorl %ebx, %ebx
leaq -0x60(%rbp), %r12
movslq -0x30(%rbp), %rax
cmpq %rax, %rbx
jge 0x414e
movq (%r15,%rbx,8), %rsi
movq -0x38(%rbp), %rdi
callq 0x3570
movq %rax, %r13
movq %r12, %rdi
movq %rax, %rsi
leaq -0x29(%rbp), %rdx
callq 0x4bf8
movq %r12, %rdi
leaq 0x2104(%rip), %rsi      # 0x6192
callq 0x4c33
testb %al, %al
jne 0x40e3
movq %r12, %rdi
leaq 0x2100(%rip), %rsi      # 0x61a1
callq 0x4c33
testb %al, %al
jne 0x40e3
movq %r12, %rdi
leaq 0x20fb(%rip), %rsi      # 0x61af
callq 0x4c33
testb %al, %al
jne 0x40e3
movq %r12, %rdi
leaq 0x20fb(%rip), %rsi      # 0x61c2
callq 0x4c33
testb %al, %al
jne 0x40e3
movq %r12, %rdi
leaq 0x20f8(%rip), %rsi      # 0x61d2
callq 0x4c33
testb %al, %al
je 0x4114
xorl %r14d, %r14d
movq %r13, %rdi
callq 0x3380
testb %r14b, %r14b
je 0x4104
movq (%r15,%rbx,8), %rdx
movq -0x38(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x34f0
movq %r12, %rdi
callq 0x3130
incq %rbx
jmp 0x4058
movq 0x4eb5(%rip), %rdi      # 0x8fd0
leaq 0x20b8(%rip), %rsi      # 0x61da
callq 0x32b0
movq %rax, %rdi
movq %r13, %rsi
callq 0x32b0
movq %rax, %rdi
leaq 0x20ae(%rip), %rsi      # 0x61ea
callq 0x32b0
movb $0x1, %r14b
movq %rax, %rdi
callq 0x3140
jmp 0x40e6
movq %r15, %rdi
callq 0x3380
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: get_parent_window(_XDisplay*, unsigned long)
Window get_parent_window(Display * display, Window window){
    Window root = 0;
    Window parent = 0;
    Window* children = NULL;
    unsigned int count = 0;
    XQueryTree(display, window, &root, &parent, &children, &count);
    if (children != NULL){
        XFree(children);
    }
    return parent;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x28, %rsp
leaq -0x28(%rbp), %rdx
andq $0x0, (%rdx)
leaq -0x10(%rbp), %rcx
andq $0x0, (%rcx)
leaq -0x20(%rbp), %rbx
andq $0x0, (%rbx)
leaq -0x14(%rbp), %r9
andl $0x0, (%r9)
movq %rbx, %r8
callq 0x3100
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x41ff
callq 0x3380
movq -0x10(%rbp), %rax
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: do_configure_xborder()
void do_configure_xborder(){
    Display * display;

    display = XOpenDisplay(NULL);
    if (display == NULL){
        std::cerr << "Cannot open display" << std::endl;
        return;
    }

    Window chosen = find_xborder_window(display);
    if (chosen == 0){
        XCloseDisplay(display);
        return;
    }

    // std::cout << "Send event to window " << chosen << std::endl;

    Atom xborder_configure = XInternAtom(display, "xborder", false);

    XEvent event;
    XClientMessageEvent * client = &event.xclient;
    event.type = ClientMessage;
    client->message_type = xborder_configure;
    client->format = 8;
    client->window = chosen;
    client->data.b[0] = XBorderConfigure;

    if (XSendEvent(display, chosen, 0, 0, &event) != 0){
        std::cout << "Reconfigured xborder window " << chosen << std::endl;
    } else {
        std::cout << "Could not send an event" << std::endl;
    }
    XCloseDisplay(display);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0xc0, %rsp
xorl %edi, %edi
callq 0x33b0
testq %rax, %rax
je 0x49b5
movq %rax, %rbx
movq %rax, %rdi
callq 0x37e3
testq %rax, %rax
je 0x49db
movq %rax, %r14
leaq 0x19a1(%rip), %rsi      # 0x62f6
movq %rbx, %rdi
xorl %edx, %edx
callq 0x31f0
leaq -0xd0(%rbp), %r8
movl $0x21, (%r8)
movq %rax, 0x28(%r8)
movl $0x8, 0x30(%r8)
movq %r14, 0x20(%r8)
movb $0x0, 0x38(%r8)
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x3060
movq 0x4638(%rip), %rdi      # 0x8fd0
testl %eax, %eax
je 0x49ee
leaq 0x195b(%rip), %rsi      # 0x62fe
callq 0x32b0
movq %rax, %rdi
movq %r14, %rsi
callq 0x31c0
jmp 0x49fa
movq 0x4634(%rip), %rdi      # 0x8ff0
leaq 0x1829(%rip), %rsi      # 0x61ec
callq 0x32b0
movq %rax, %rdi
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x3140
movq %rbx, %rdi
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x3560
leaq 0x1926(%rip), %rsi      # 0x631b
callq 0x32b0
movq %rax, %rdi
callq 0x3140
movq %rbx, %rdi
callq 0x3560
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: main
int main(int argc, char ** argv){
    bool glow = false;

    for (int i = 1; i < argc; i++){
        std::string arg(argv[i]);
        if (arg == "glow" ||
            arg == "-glow" ||
            arg == "--glow"){
            glow = true;
        } else if (arg == "configure"){
            do_configure_xborder();
            return 0;
        }
    }

    run_xborder(glow);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movslq %edi, %r13
pushq $0x1
popq %r15
movl $0x0, -0x2c(%rbp)
leaq -0x50(%rbp), %r14
cmpq %r13, %r15
jge 0x4ac5
movq (%rbx,%r15,8), %rsi
movq %r14, %rdi
leaq -0x2d(%rbp), %rdx
callq 0x4bf8
movq %r14, %rdi
leaq 0x18d6(%rip), %rsi      # 0x6335
callq 0x4c33
movb $0x1, %r12b
testb %al, %al
jne 0x4a91
movq %r14, %rdi
leaq 0x18bf(%rip), %rsi      # 0x6334
callq 0x4c33
testb %al, %al
jne 0x4a91
movq %r14, %rdi
leaq 0x18ab(%rip), %rsi      # 0x6333
callq 0x4c33
testb %al, %al
je 0x4aa8
movb $0x1, %al
movl %eax, -0x2c(%rbp)
movq %r14, %rdi
callq 0x3130
incq %r15
testb %r12b, %r12b
jne 0x4a3c
jmp 0x4ad1
movq %r14, %rdi
leaq 0x1888(%rip), %rsi      # 0x633a
callq 0x4c33
testb %al, %al
je 0x4a96
callq 0x491d
xorl %r12d, %r12d
jmp 0x4a96
movzbl -0x2c(%rbp), %edi
andl $0x1, %edi
callq 0x424f
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: TryChildren(_XDisplay*, unsigned long, unsigned long)
static Window TryChildren(Display *dpy, Window win, Atom WM_STATE){
    Window root, parent;
    Window *children;
    unsigned int nchildren;
    unsigned int i;
    Atom type = None;
    int format;
    unsigned long nitems, after;
    unsigned char *data;
    Window inf = 0;

    if (!XQueryTree(dpy, win, &root, &parent, &children, &nchildren))
        return 0;
    for (i = 0; !inf && (i < nchildren); i++) {
        data = NULL;
        XGetWindowProperty(dpy, children[i], WM_STATE, 0, 0, False,
                AnyPropertyType, &type, &format, &nitems,
                &after, &data);
        if (data)
            XFree(data);
        if (type)
            inf = children[i];
    }
    for (i = 0; !inf && (i < nchildren); i++)
        inf = TryChildren(dpy, children[i], WM_STATE);
    if (children)
        XFree(children);
    return inf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %rbx
movq %rdi, %r14
andq $0x0, -0x48(%rbp)
leaq -0x70(%rbp), %rdx
leaq -0x68(%rbp), %rcx
leaq -0x38(%rbp), %r8
leaq -0x2c(%rbp), %r9
callq 0x3100
testl %eax, %eax
je 0x4be2
xorl %r12d, %r12d
leaq -0x48(%rbp), %r13
xorl %r15d, %r15d
movl -0x2c(%rbp), %eax
testq %r15, %r15
jne 0x4ba9
cmpq %rax, %r12
jae 0x4ba9
andq $0x0, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %rsi
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
leaq -0x40(%rbp), %rax
pushq %rax
leaq -0x58(%rbp), %rax
pushq %rax
leaq -0x60(%rbp), %rax
pushq %rax
leaq -0x4c(%rbp), %rax
pushq %rax
pushq %r13
pushq $0x0
callq 0x30b0
addq $0x30, %rsp
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x4b90
callq 0x3380
cmpq $0x0, -0x48(%rbp)
je 0x4ba1
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %r15
jmp 0x4ba4
xorl %r15d, %r15d
incq %r12
jmp 0x4b39
xorl %r12d, %r12d
movq -0x38(%rbp), %rdi
testq %r15, %r15
jne 0x4bd6
movl %eax, %eax
cmpq %rax, %r12
jae 0x4bd6
movq (%rdi,%r12,8), %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x4af6
movq %rax, %r15
incq %r12
movl -0x2c(%rbp), %eax
jmp 0x4bac
testq %rdi, %rdi
je 0x4be5
callq 0x3380
jmp 0x4be5
xorl %r15d, %r15d
movq %r15, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kazzmir[P]xborder/src/main.cpp
// Function: OptionWindow::create(_XDisplay*, unsigned long)
static OptionWindow* create(Display * display, Window xborder_window){
        Atom wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", false);
        int screen = DefaultScreen(display);
        int width = (palette_x + 1) * palette_size_block + 5;
        int height = palette_start_y + (palette_y + 1) * palette_size_block;
        Window window = XCreateSimpleWindow(display, RootWindow(display, screen),
                                            1, 1,
                                            width, height,
                                            1, BlackPixel(display, screen), WhitePixel(display, screen));
        XFontStruct * fontInfo = XLoadQueryFont(display, "6x10");
        XGCValues values;
        // values.font = fontInfo->fid;
        values.foreground = BlackPixel(display, screen);
        GC graphics = XCreateGC(display, window, GCForeground, &values);
        XSelectInput(display, window,
                     ExposureMask |
                     KeyPress |
                     KeyRelease |
                     ButtonPressMask |
                     ButtonReleaseMask |
                     Button1MotionMask |
                     StructureNotifyMask);
        XMapWindow(display, window);
        XStoreName(display, window, "XBorder options");
        XSetWMProtocols(display, window, &wm_delete_window, 1);

        return new OptionWindow(display, window, graphics, xborder_window);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x134a(%rip), %rsi      # 0x62c7
xorl %edx, %edx
callq 0x31f0
leaq -0x30(%rbp), %rcx
movq %rax, (%rcx)
movslq 0xe0(%r14), %r15
movq 0xe8(%r14), %rax
shlq $0x7, %r15
movq 0x10(%rax,%r15), %rsi
subq $0x8, %rsp
pushq $0x1
popq %r13
movq %r14, %rdi
movl %r13d, %edx
movl %r13d, %ecx
movl $0x140, %r8d            # imm = 0x140
movl $0x91, %r9d
pushq 0x58(%rax,%r15)
pushq 0x60(%rax,%r15)
pushq $0x1
callq 0x30c0
addq $0x20, %rsp
movq %rax, %r12
leaq 0x13a7(%rip), %rsi      # 0x6385
movq %r14, %rdi
callq 0x3530
movq 0xe8(%r14), %rax
movq 0x60(%rax,%r15), %rax
leaq -0xb0(%rbp), %rcx
movq %rax, 0x10(%rcx)
pushq $0x4
popq %rdx
movq %r14, %rdi
movq %r12, %rsi
callq 0x3160
movq %rax, %r15
movl $0x2810f, %edx          # imm = 0x2810F
movq %r14, %rdi
movq %r12, %rsi
callq 0x31b0
movq %r14, %rdi
movq %r12, %rsi
callq 0x3320
leaq 0x135a(%rip), %rdx      # 0x638a
movq %r14, %rdi
movq %r12, %rsi
callq 0x3050
movq %r14, %rdi
movq %r12, %rsi
leaq -0x30(%rbp), %rdx
movl %r13d, %ecx
callq 0x3180
pushq $0x68
popq %rdi
callq 0x32e0
movq %rax, %r13
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %rbx, %r8
callq 0x53a8
movq %r13, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x68
popq %rsi
movq %r13, %rdi
callq 0x32f0
movq %rbx, %rdi
callq 0x3510
// File: /workspace/github_cpp_makefile_star2_O2/j-faria[P]kima/examples/default_priors/kima_setup.cpp
// Function: main
int main(int argc, char** argv)
{
    datafile = "dummy_data.rv";

    load(datafile, "kms", 0);

    Sampler<RVmodel> sampler = setup<RVmodel>(argc, argv);
    sampler.run(1000);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x6c0, %rsp            # imm = 0x6C0
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x43905(%rip), %r14     # 0x646c0
leaq 0x2625b(%rip), %rsi     # 0x4701d
movq %r14, %rdi
callq 0x6770
leaq 0x8(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x1b707(%rip), %rsi     # 0x3c4e0
movq %r14, %rdi
callq 0x2100f
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x210b8
movq %r14, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x21104
leaq 0x8(%rsp), %rdi
callq 0x212ca
xorl %eax, %eax
addq $0x6c0, %rsp            # imm = 0x6C0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x212ca
movq %rbx, %rdi
callq 0x66e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/oknenavin[P]cxon/test/../src/cxon/lang/json/lib/boost/container/static_vector.hxx
// Function: bool cxon::read<cxon::JSON<cxon::json::format_traits>, boost::container::static_vector<int, 3ul, void>, void>::value<char const*, cxon::context<cxon::JSON<cxon::json::format_traits>>, cxon::JSON<cxon::json::format_traits>>(boost::container::static_vector<int, 3ul, void>&, char const*&, char const*, cxon::context<cxon::JSON<cxon::json::format_traits>>&)
static bool value(boost::container::static_vector<T, N>& t, II& i, II e, Cx& cx) {
                    II const o = i;
                        std::size_t p = 0;
                    return cio::cnt::read_list<Y>(i, e, cx, [&] {
                        if (++p <= N)
                            return read_value<Y>(cnt::emplace(t), i, e, cx);
                        return cio::rewind(i, o), cx/json::read_error::overflow;
                    });
                }

// Assembly:
subq $0x78, %rsp
leaq 0x70(%rsp), %rax
movq %rdx, (%rax)
movq (%rsi), %r8
leaq 0x60(%rsp), %r9
andq $0x0, (%r9)
leaq 0x68(%rsp), %r10
movq %r8, (%r10)
movq %r9, 0x30(%rsp)
movq %rdi, 0x38(%rsp)
movq %rsi, 0x40(%rsp)
movq %rax, 0x48(%rsp)
movq %rcx, 0x50(%rsp)
movq %r10, 0x58(%rsp)
movups 0x30(%rsp), %xmm0
movups 0x40(%rsp), %xmm1
movups 0x50(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rsi, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x21862
addq $0x78, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/oknenavin[P]cxon/test/../src/cxon/lang/common/cio/char.hxx
// Function: std::enable_if<!cxon::JSON<cxon::json::format_traits>::produce_strict_javascript, bool>::type cxon::cio::chr::imp::encode_<cxon::JSON<cxon::json::format_traits>, char32_t>::value<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, cxon::context<cxon::JSON<cxon::json::format_traits>>, cxon::JSON<cxon::json::format_traits>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, char32_t, cxon::context<cxon::JSON<cxon::json::format_traits>>&)
static auto value(O& o, char32_t c, Cx& cx) -> enable_if_t<!S::produce_strict_javascript, bool> {
                        if (c > 0x7F) {
                                char b[4]; int const n = utf32_to_utf8(b, c);
                                return poke<X>(o, b, n, cx);
                        }
                        else    return encode_<X, char>::value(o, char(c), cx);
                    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x80, %esi
jb 0x2797c
leaq 0x4(%rsp), %r14
movq %r14, %rdi
callq 0x26270
movslq %eax, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe060
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movsbl %sil, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x26b06
// File: /workspace/github_cpp_makefile_star2_O2/oknenavin[P]cxon/test/../src/cxon/lang/common/cio/string.hxx
// Function: std::enable_if<chr::is_char_16<char16_t>::value, bool>::type cxon::cio::str::imp::char_append_<boost::container::basic_string<char16_t, std::char_traits<char16_t>, boost::container::new_allocator<char16_t>>, char16_t>(boost::container::basic_string<char16_t, std::char_traits<char16_t>, boost::container::new_allocator<char16_t>>&, char32_t)
inline auto char_append_(C& c, char32_t c32) -> enable_if_t<chr::is_char_16<T>::value, bool> {
                if (c32 > 0xFFFF) {
                    c32 -= 0x10000;
                    return cxon::cnt::append(c, T(0xD800 | (c32 >> 10))) && cxon::cnt::append(c, T(0xDC00 | (c32 & 0x3FF)));
                }
                return cxon::cnt::append(c, T(c32));
            }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
cmpl $0x10000, %esi          # imm = 0x10000
jb 0x27b6d
leal 0xff0000(%r14), %eax
shrl $0xa, %eax
orl $0xd800, %eax           # imm = 0xD800
movzwl %ax, %esi
movq %rbx, %rdi
callq 0x27be6
andl $0x3ff, %r14d           # imm = 0x3FF
orl $0xdc00, %r14d          # imm = 0xDC00
movzwl %r14w, %esi
movq %rbx, %rdi
callq 0x27be6
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq