LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/controller.c
// Function: controller
int controller(int argc, char** argv) {
    log_debug("Instance became controller");

    socket_mode = CONTROLLER;

    if (!initialize_socket())
        return EXIT_FAILURE;

    char* input_feed = calloc(1024, sizeof(char));

    for (int index = 2; index < argc; index++) {
        strcat(input_feed, argv[index]);
        input_feed[strlen(input_feed)] = '\31';
    }
    input_feed[strlen(input_feed) - 1] = '\0';

    write_to_socket(input_feed);
    free(input_feed);

    finalize_socket();

    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4690(%rip), %rsi      # 0x8004
leaq 0x46ae(%rip), %rdx      # 0x8029
leaq 0x4697(%rip), %r8       # 0x8019
movl $0x3, %edi
movl $0x12, %ecx
xorl %eax, %eax
callq 0x51d6
leaq 0x8f22(%rip), %rax      # 0xc8bc
movl $0x1, (%rax)
callq 0x48a8
testw %ax, %ax
je 0x3a12
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x3340
movq %rax, %r14
cmpl $0x3, %ebp
jl 0x39eb
movl %ebp, %r15d
movl $0x2, %r12d
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
callq 0x35f0
movq %r14, %rdi
callq 0x31f0
movb $0x19, (%r14,%rax)
incq %r12
cmpq %r12, %r15
jne 0x39ca
movq %r14, %rdi
callq 0x31f0
movb $0x0, -0x1(%r14,%rax)
movq %r14, %rdi
callq 0x4a9d
movq %r14, %rdi
callq 0x3060
callq 0x4a6d
xorl %eax, %eax
jmp 0x3a17
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_process_input
void ipc_process_input(char *feed) {
    unsigned short update = 0;
    vector_t *input = construct_vector();

    char *token;
    while ((token = strsep(&feed, "\31")))
        push_to_vector(input, token);

    char *qualifier = vector_iterator(input);

    if (!strcmp(qualifier, "halt")) {
        custard_is_running = 0;
    } else if (!strcmp(qualifier, "configure"))
        ipc_command_configure(input, &update);
    else if (!strcmp(qualifier, "geometry"))
        ipc_command_geometry(input, &update);
    else if (!strcmp(qualifier, "match"))
        ipc_command_match(input, &update);
    else if (!strcmp(qualifier, "window"))
        ipc_command_window(input, &update);
    else if (!strcmp(qualifier, "workspace"))
        ipc_command_workspace(input, &update);
    else if (!strcmp(qualifier, "focus"))
        ipc_command_focus(input, &update);

    if (update) {
        apply();
        update = 0;
    }

    deconstruct_vector(input);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %r14
movq %rdi, (%r14)
movw $0x0, 0x6(%rsp)
callq 0x3818
movq %rax, %rbx
leaq 0x45ed(%rip), %rsi      # 0x8034
movq %r14, %rdi
callq 0x3440
testq %rax, %rax
je 0x3a7b
leaq 0x45d9(%rip), %r14      # 0x8034
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3884
movq %r15, %rdi
movq %r14, %rsi
callq 0x3440
testq %rax, %rax
jne 0x3a60
movq %rbx, %rdi
callq 0x3849
movq %rax, %r14
leaq 0x45a9(%rip), %rsi      # 0x8036
movq %rax, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b17
leaq 0x459b(%rip), %rsi      # 0x803b
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b25
leaq 0x4f56(%rip), %rsi      # 0x8a09
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b34
leaq 0x457f(%rip), %rsi      # 0x8045
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b3e
leaq 0x4637(%rip), %rsi      # 0x8110
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b48
leaq 0x455f(%rip), %rsi      # 0x804b
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b57
leaq 0x4556(%rip), %rsi      # 0x8055
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
jne 0x3b64
leaq 0x6(%rsp), %rsi
callq 0x437f
jmp 0x3b64
leaq 0x8db2(%rip), %rax      # 0xc8d0
movw $0x0, (%rax)
jmp 0x3b64
leaq 0x6(%rsp), %rsi
movq %rbx, %rdi
callq 0x3b83
jmp 0x3b64
movq %rbx, %rdi
callq 0x3c2a
jmp 0x3b64
movq %rbx, %rdi
callq 0x3db7
jmp 0x3b64
leaq 0x6(%rsp), %rsi
movq %rbx, %rdi
callq 0x3dea
jmp 0x3b64
leaq 0x6(%rsp), %rsi
movq %rbx, %rdi
callq 0x4343
cmpw $0x0, 0x6(%rsp)
je 0x3b71
callq 0x741f
movq %rbx, %rdi
callq 0x392e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_command_configure
void ipc_command_configure(vector_t *input, unsigned short *screen_update) {
    /*
     * Usage:
     *  custard - configure ([configurable] [value])...
     */

    char *variable;
    char *value_string;
    kv_value_t *value = NULL;

    while (input->remaining) {
        variable = vector_iterator(input);
        value_string = vector_iterator(input);

        if (!(value = get_value_from_key(configuration, variable)))
            continue;

        ipc_helper_typecast_and_assign(value, variable, value_string);
    }

    if (!windows)
        return;

    window_t *window;
    while ((window = vector_iterator(windows))) {
        set_window_geometry(window, window->geometry);
        decorate(window);
    }

    *screen_update = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
cmpl $0x0, 0x10(%rdi)
je 0x3bdb
movq %rdi, %r14
leaq 0x8d21(%rip), %r13      # 0xc8c0
movq %r14, %rdi
callq 0x3849
movq %rax, %r15
movq %r14, %rdi
callq 0x3849
movq %rax, %r12
movq (%r13), %rdi
movq %r15, %rsi
callq 0x4de5
testq %rax, %rax
je 0x3bd4
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x449c
cmpl $0x0, 0x10(%r14)
jne 0x3b9f
leaq 0x8d06(%rip), %r15      # 0xc8e8
movq (%r15), %rdi
testq %rdi, %rdi
je 0x3c20
callq 0x3849
testq %rax, %rax
je 0x3c1b
movq %rax, %r14
movq 0x8(%r14), %rsi
movq %r14, %rdi
callq 0x7052
movq %r14, %rdi
callq 0x5882
movq (%r15), %rdi
callq 0x3849
movq %rax, %r14
testq %rax, %rax
jne 0x3bf7
movw $0x1, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_command_match
void ipc_command_match(vector_t *input, unsigned short *screen_update) {
    suppress_unused(screen_update);

    if (input->size < 3) return;

    char *subject = vector_iterator(input);

    if (!strcmp(subject, "monitor"))
        ipc_sub_command_match_monitor(input);
    else
        ipc_sub_command_match_window(input);
}

// Assembly:
pushq %rbx
cmpl $0x3, 0xc(%rdi)
jae 0x3dc0
popq %rbx
retq
movq %rdi, %rbx
callq 0x3849
leaq 0x43f6(%rip), %rsi      # 0x81c5
movq %rax, %rdi
callq 0x3370
movq %rbx, %rdi
testl %eax, %eax
je 0x3de4
popq %rbx
jmp 0x4644
popq %rbx
jmp 0x4565
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_command_workspace
void ipc_command_workspace(vector_t *input, unsigned short *screen_update) {
    monitor_t *monitor = monitor_with_cursor_residence();

    unsigned int workspace = string_to_integer(vector_iterator(input));
    if (workspace) {
        show_workspace_on_monitor(monitor, workspace);
    }

    *screen_update = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x69c8
movq %rax, %r14
movq %r15, %rdi
callq 0x3849
movq %rax, %rdi
callq 0x4770
testl %eax, %eax
je 0x4374
movq %r14, %rdi
movl %eax, %esi
callq 0x71e0
movw $0x1, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_command_focus
void ipc_command_focus(vector_t *input, unsigned short *screen_update) {
    suppress_unused(input);

    unsigned short passed = 0;

    monitor_t *monitor = monitor_with_cursor_residence();

    window_t *window;
    while ((window = vector_iterator(windows))) {
        if (window->workspace != monitor->workspace)
            continue;

        if (window->id == focused_window) {
            if (passed)
                return; // only one window

            if (!windows->remaining)
                reset_vector_iterator(windows);

            passed = 1;
            continue;
        }

        if (passed) {
            reset_vector_iterator(windows);
            /* Focus on this window */
            xcb_window_t previous_window = focused_window;
            focused_window = window->id;

            xcb_ungrab_button(xcb_connection,
                XCB_BUTTON_INDEX_ANY, window->id, XCB_MOD_MASK_ANY);
            raise_window(window->parent);
            decorate(window);
            focus_window(window->id);

            if (previous_window != XCB_WINDOW_NONE) {
                window = get_window_by_id(previous_window);
                xcb_grab_button(xcb_connection, 0, previous_window,
                    XCB_EVENT_MASK_BUTTON_PRESS,
                    XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC,
                    XCB_NONE, XCB_NONE,
                    XCB_BUTTON_INDEX_ANY ^ \
                        XCB_BUTTON_INDEX_4 ^ XCB_BUTTON_INDEX_5,
                    XCB_MOD_MASK_ANY);
                decorate(window);
            }

            *screen_update = 1;
            return;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movb $0x1, %bpl
callq 0x69c8
movq %rax, %r14
leaq 0x8548(%rip), %r13      # 0xc8e8
leaq 0x8549(%rip), %r12      # 0xc8f0
movq (%r13), %rdi
callq 0x3849
testq %rax, %rax
je 0x448d
movq %rax, %r15
movl 0x24(%rax), %eax
cmpl 0x20(%r14), %eax
jne 0x43a7
movl (%r15), %eax
cmpl (%r12), %eax
setne %bl
je 0x43db
testb $0x1, %bpl
movl %ebx, %ebp
jne 0x43a7
jmp 0x43fa
testb $0x1, %bpl
je 0x448d
movq (%r13), %rdi
cmpl $0x0, 0x10(%rdi)
movl %ebx, %ebp
jne 0x43a7
callq 0x387d
movl %ebx, %ebp
jmp 0x43a7
movq (%r13), %rdi
callq 0x387d
movl (%r12), %ebp
movl (%r15), %edx
movl %edx, (%r12)
leaq 0x84e3(%rip), %r13      # 0xc8f8
movq (%r13), %rdi
xorl %r12d, %r12d
xorl %esi, %esi
movl $0x8000, %ecx           # imm = 0x8000
callq 0x3500
movl 0x4(%r15), %edi
callq 0x77aa
movq %r15, %rdi
callq 0x5882
movl (%r15), %edi
callq 0x7710
testl %ebp, %ebp
je 0x4484
movl %ebp, %edi
callq 0x6d20
movq %rax, %r14
movq (%r13), %rdi
xorl %esi, %esi
movl %ebp, %edx
movl $0x4, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq $0x8000                 # imm = 0x8000
pushq $0x1
pushq %r12
pushq %r12
callq 0x3360
addq $0x20, %rsp
movq %r14, %rdi
callq 0x5882
movq (%rsp), %rax
movw $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_helper_typecast_and_assign
void ipc_helper_typecast_and_assign(kv_value_t *kv_value, char *variable,
    char *input) {

    // Assign all color values

    if (!strcmp(variable, "border.color.focused") ||
        !strcmp(variable, "border.color.unfocused") ||
        !strcmp(variable, "border.color.background")) {
        kv_value->color = string_to_color(input);
        return;
    }

    // Assign all boolean values

    if (!strcmp(variable, "border.colors.flipped")) {
        kv_value->boolean = string_to_boolean(input);
        return;
    }

    // Assign all string values

    if (!strcmp(variable, "geometry") ||
        !strcmp(variable, "monitor")) {
        kv_value->string = (char*)calloc(1, sizeof(char));
        strcpy(kv_value->string, input);
        return;
    }

    // If all else fails, it's an integer

    kv_value->number = string_to_integer(input);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x3baa(%rip), %rsi      # 0x805b
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4526
leaq 0x3bac(%rip), %rsi      # 0x8070
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4526
leaq 0x3bb0(%rip), %rsi      # 0x8087
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4526
leaq 0x3bb5(%rip), %rsi      # 0x809f
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4558
leaq 0x450c(%rip), %rsi      # 0x8a09
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4536
leaq 0x3cb5(%rip), %rsi      # 0x81c5
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4536
movq %r14, %rdi
callq 0x4770
jmp 0x452e
movq %r14, %rdi
callq 0x4775
movl %eax, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
movl $0x1, %edi
movl $0x1, %esi
callq 0x3340
movq %rax, (%rbx)
movq %rax, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x30e0
movq %r14, %rdi
callq 0x473c
movw %ax, (%rbx)
jmp 0x4530
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_sub_command_match_monitor
void ipc_sub_command_match_monitor(vector_t *input) {
    char *monitor_name = vector_iterator(input);
    monitor_t *monitor = monitor_from_name(monitor_name);

    if (!monitor)
        return;

    if (!monitor->configuration)
        monitor->configuration = construct_vector();

    char *configurables[7] = {
        "grid.rows,"
        "grid.columns",
        "grid.margins",
        "grid.margin.top",
        "grid.margin.bottom",
        "grid.margin.left",
        "grid.margin.right"
    };
    unsigned int index = 0;
    kv_pair_t *setting;

    char *variable;
    char *value_string;

    while (input->remaining) {
        variable = vector_iterator(input);
        value_string = vector_iterator(input);

        log_debug("%s = %s", variable, value_string);

        for (index = 0; index < 7;) {
            if (!strcmp(configurables[index++], variable)) {
                setting = create_or_get_kv_pair(monitor->configuration,
                    variable);
                setting->value->number = string_to_integer(value_string);
                break;
            }
        }
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3849
movq %rax, %rdi
callq 0x6987
testq %rax, %rax
je 0x4635
movq %rax, %r14
cmpq $0x0, 0x18(%rax)
jne 0x459c
callq 0x3818
movq %rax, 0x18(%r14)
cmpl $0x0, 0x10(%rbx)
je 0x4635
leaq 0x7793(%rip), %r12      # 0xbd40
movq %rbx, %rdi
callq 0x3849
movq %rax, %rbp
movq %rbx, %rdi
callq 0x3849
movq %rax, %r15
movq %rax, (%rsp)
movl $0x3, %edi
leaq 0x3b23(%rip), %rsi      # 0x80f6
leaq 0x3bd5(%rip), %rdx      # 0x81af
movl $0x1ec, %ecx            # imm = 0x1EC
leaq 0x3be7(%rip), %r8       # 0x81cd
movq %rbp, %r9
xorl %eax, %eax
callq 0x51d6
xorl %r13d, %r13d
cmpq $0x38, %r13
je 0x462b
movq (%r13,%r12), %rdi
movq %rbp, %rsi
callq 0x3370
addq $0x8, %r13
testl %eax, %eax
jne 0x45f3
movq 0x18(%r14), %rdi
movq %rbp, %rsi
callq 0x4d2b
movq %rax, %rbp
movq %r15, %rdi
callq 0x4770
movq 0x8(%rbp), %rcx
movl %eax, (%rcx)
cmpl $0x0, 0x10(%rbx)
jne 0x45ad
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_sub_command_match_window
void ipc_sub_command_match_window(vector_t *input) {
    /*
     * Usage:
     *  custard - match window.name [expression] ([configurable] [value])...
     * custard - match window.class [expression] ([configurable] [value])...
     */

    input->remaining++;
    char *subject = vector_iterator(input);
    char *expression = vector_iterator(input);

    window_attribute_t attribute;

    if (!strcmp(subject, "window.name"))
        attribute = name;
    else if (!strcmp(subject, "window.class"))
        attribute = class;
    else return;

    rule_t *rule = create_or_get_rule(attribute, expression);
    if (!rule->rules)
        rule->rules = construct_vector();

    char *configurables[10] = {
        "borders",
        "border.size.outer",
        "border.size.inner",
        "border.color.focused",
        "border.color.unfocused",
        "border.color.background",
        "border.colors.flipped",
        "geometry",
        "monitor",
        "workspace"
    };
    unsigned int index = 0;
    kv_pair_t *setting;

    char *variable;
    char *value_string;

    while (input->remaining > 0) {
        variable = vector_iterator(input);
        value_string = vector_iterator(input);

        for (index = 0; index < 10;) {
            if (!strcmp(configurables[index++], variable)) {
                setting = create_or_get_kv_pair(rule->rules, variable);
                ipc_helper_typecast_and_assign(setting->value,
                    variable, value_string);
                break;
            }
        }
    }

    add_rule(rule);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
incl 0x10(%rdi)
callq 0x3849
movq %rax, %r15
movq %rbx, %rdi
callq 0x3849
movq %rax, %r14
leaq 0x3b66(%rip), %rsi      # 0x81d5
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x469d
leaq 0x3b5f(%rip), %rsi      # 0x81e1
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x46a1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
jmp 0x46a6
movl $0x1, %edi
movq %r14, %rsi
callq 0x6a70
movq %rax, %r14
cmpq $0x0, 0x10(%rax)
jne 0x46c1
callq 0x3818
movq %rax, 0x10(%r14)
cmpl $0x0, 0x10(%rbx)
je 0x4725
leaq 0x3b4e(%rip), %r13      # 0x821c
movq %rbx, %rdi
callq 0x3849
movq %rax, %r15
movq %rbx, %rdi
callq 0x3849
movq %rax, %r12
xorl %ebp, %ebp
cmpq $0x28, %rbp
je 0x471f
movslq (%rbp,%r13), %rdi
addq %r13, %rdi
movq %r15, %rsi
callq 0x3370
addq $0x4, %rbp
testl %eax, %eax
jne 0x46e6
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0x4d2b
movq 0x8(%rax), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x449c
cmpl $0x0, 0x10(%rbx)
jne 0x46ce
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6b06
nop
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/parsing.c
// Function: string_to_color
color_t string_to_color(char *string) {
    color_t color = {
        .red   = 255,
        .green = 255,
        .blue  = 255,
        .alpha = 255
    };

    if (!string || string[0] != '#')
        return color;

    unsigned int length = strlen(string);
    if (length <= 4 || (5 < length && length < 7) || length == 8 || length > 9)
        return color;

    unsigned int offset = 0;
    if (length < 6) offset = 4;

    char group[8] = "000000ff";
    for (unsigned int index = 0; index < (length - 1); index++)
        group[index + offset] = string[index + 1];

    unsigned int rgba;
    rgba = strtol(group, NULL, 16);

    if (offset) {
        color.alpha = (rgba & 0x000F) * 0x11;
        color.red   = ((rgba & 0xF000) / 0x1000) * 0x11;
        color.green = ((rgba & 0x0F00) / 0x100) * 0x11;
        color.blue  = ((rgba & 0x00F0) / 0x10) * 0x11;
    } else {
        color.alpha = (rgba & 0x000000FF);
        color.red   = (rgba & 0xFF000000) / 0x1000000;
        color.green = (rgba & 0x00FF0000) / 0x10000;
        color.blue  = (rgba & 0x0000FF00) / 0x100;
    }

    return color;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0xff000000, %ebx       # imm = 0xFF000000
movl $0xff0000, %r12d        # imm = 0xFF0000
movl $0xff00, %r13d          # imm = 0xFF00
movl $0xff, %ebp
testq %rdi, %rdi
je 0x488e
movq %rdi, %r14
cmpb $0x23, (%rdi)
jne 0x488e
movq %r14, %rdi
callq 0x31f0
movq %rax, %r15
cmpl $0x5, %r15d
jb 0x488e
setne %al
cmpl $0x7, %r15d
setb %cl
cmpl $0x9, %r15d
ja 0x488e
cmpl $0x8, %r15d
je 0x488e
andb %cl, %al
jne 0x488e
xorl %eax, %eax
cmpl $0x5, %r15d
sete %al
movabsq $0x6666303030303030, %rcx # imm = 0x6666303030303030
movq %rsp, %rbx
movq %rcx, (%rbx)
movl %r15d, %edx
decl %edx
leaq (%rsp,%rax,4), %rdi
incq %r14
movq %r14, %rsi
callq 0x33f0
movq %rbx, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x33e0
movq %rax, %rbx
cmpl $0x5, %r15d
jne 0x4866
movl %ebx, %eax
andl $0xf, %eax
movl %eax, %edx
shll $0x4, %edx
orl %eax, %edx
movl %ebx, %ecx
shrl $0xc, %ecx
andl $0xf, %ecx
movl %ecx, %eax
shll $0x4, %eax
orl %ecx, %eax
movl %ebx, %esi
shrl $0x8, %esi
andl $0xf, %esi
movl %esi, %ecx
shll $0x4, %ecx
orl %esi, %ecx
shrb $0x4, %bl
movzbl %bl, %edi
movl %edi, %esi
shll $0x4, %esi
addl %edi, %esi
movl %edx, %ebx
jmp 0x4879
movq %rbx, %rax
shrq $0x18, %rax
movq %rbx, %rcx
shrq $0x10, %rcx
movl %ebx, %esi
shrl $0x8, %esi
shll $0x18, %ebx
movzbl %sil, %r12d
shll $0x10, %r12d
shll $0x8, %ecx
movzwl %cx, %r13d
movzbl %al, %ebp
orl %ebx, %r12d
orl %r13d, %ebp
orl %r12d, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/socket.c
// Function: finalize_socket
void finalize_socket() {
    if (socket_mode == WINDOW_MANAGER)
        unlink(socket_path);
    else
        close(socket_file_descriptor);
    free(socket_path);
}

// Assembly:
pushq %rax
cmpl $0x0, 0x7e47(%rip)      # 0xc8bc
je 0x4a84
movl 0x7e3b(%rip), %edi      # 0xc8b8
callq 0x32f0
jmp 0x4a90
movq 0x7e25(%rip), %rdi      # 0xc8b0
callq 0x3090
movq 0x7e19(%rip), %rdi      # 0xc8b0
popq %rax
jmp 0x3060
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/ipc/socket.c
// Function: read_from_socket
char *read_from_socket() {
    int command_file_descriptor = accept(socket_file_descriptor, NULL, 0);

    if (!command_file_descriptor) {
        log_fatal("Unable to accept connection to socket");
        return "";
    }

    char *output = calloc(1024, sizeof(char));
    ssize_t length = read(command_file_descriptor, output, 1023);

    output[length] = '\0';
    log_debug("Fed data(%s)", output);

    return output;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl 0x7dc2(%rip), %edi      # 0xc8b8
xorl %esi, %esi
xorl %edx, %edx
callq 0x35b0
testl %eax, %eax
je 0x4b55
movl %eax, %ebp
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x3340
movq %rax, %rbx
movl $0x3ff, %edx            # imm = 0x3FF
movl %ebp, %edi
movq %rax, %rsi
callq 0x3320
movb $0x0, (%rbx,%rax)
leaq 0x3742(%rip), %rsi      # 0x8273
leaq 0x37ec(%rip), %rdx      # 0x8324
leaq 0x381c(%rip), %r8       # 0x835b
movl $0x3, %edi
movl $0x55, %ecx
movq %rbx, %r9
xorl %eax, %eax
callq 0x51d6
jmp 0x4b82
leaq 0x3717(%rip), %rsi      # 0x8273
leaq 0x37c1(%rip), %rdx      # 0x8324
leaq 0x37cb(%rip), %r8       # 0x8335
movl $0x1, %edi
movl $0x4d, %ecx
xorl %eax, %eax
callq 0x51d6
leaq 0x3ad5(%rip), %rbx      # 0x8657
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/config.c
// Function: create_or_get_kv_pair
kv_pair_t *create_or_get_kv_pair(vector_t *configuration, char *key) {
    kv_pair_t *kv_pair;

    while ((kv_pair = vector_iterator(configuration))) {
        if (!strcmp(kv_pair->key, key)) {
            reset_vector_iterator(configuration);
            return kv_pair;
        }
    }

    kv_pair = (kv_pair_t*)calloc(1, sizeof(kv_pair_t));

    kv_pair->key = (char*)calloc(strlen(key) + 1, sizeof(char));
    strcpy(kv_pair->key, key);

    kv_pair->value = (kv_value_t*)calloc(1, sizeof(kv_value_t));
    log_debug("New key-value pair created with key(%s)", key);

    push_to_vector(configuration, kv_pair);
    return kv_pair;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rbx, %rdi
callq 0x3849
testq %rax, %rax
je 0x4d5f
movq %rax, %r14
movq (%rax), %rdi
movq %r15, %rsi
callq 0x3370
testl %eax, %eax
jne 0x4d36
movq %rbx, %rdi
callq 0x387d
jmp 0x4ddc
movl $0x1, %edi
movl $0x10, %esi
callq 0x3340
movq %rax, %r14
movq %r15, %rdi
callq 0x31f0
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x3340
movq %rax, (%r14)
movq %rax, %rdi
movq %r15, %rsi
callq 0x30e0
movl $0x1, %edi
movl $0x8, %esi
callq 0x3340
movq %rax, 0x8(%r14)
leaq 0x35ce(%rip), %rsi      # 0x837d
leaq 0x35d7(%rip), %rdx      # 0x838d
leaq 0x35e6(%rip), %r8       # 0x83a3
movl $0x3, %edi
movl $0x4b, %ecx
movq %r15, %r9
xorl %eax, %eax
callq 0x51d6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3884
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/config.c
// Function: get_value_from_key
kv_value_t *get_value_from_key(vector_t *configuration, char *key) {
    kv_pair_t *kv_pair;

    while ((kv_pair = vector_iterator(configuration))) {
        if (!strcmp(kv_pair->key, key)) {
            reset_vector_iterator(configuration);
            return kv_pair->value;
        }
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x3849
testq %rax, %rax
je 0x4e21
movq %rax, %r12
movq (%rax), %rdi
movq %r15, %rsi
callq 0x3370
testl %eax, %eax
jne 0x4df5
movq %r14, %rdi
callq 0x387d
movq 0x8(%r12), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/config.c
// Function: get_value_from_key_with_fallback
kv_value_t *get_value_from_key_with_fallback(vector_t *passed_configuration,
    char *key) {

    if (!passed_configuration)
        passed_configuration = configuration;

    kv_value_t *value;
    value = get_value_from_key(passed_configuration, key);

    if (passed_configuration != configuration)
        if (!value)
            value = get_value_from_key(configuration, key);

    return value;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
jne 0x4e46
movq 0x7a7a(%rip), %r14      # 0xc8c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4de5
movq 0x7a68(%rip), %rdi      # 0xc8c0
cmpq %rdi, %r14
sete %cl
testq %rax, %rax
setne %dl
orb %cl, %dl
je 0x4e70
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4de5
nop
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/custard.c
// Function: log
void _log(unsigned short level, const char *file, const char *function,
    const int line, char *formatting, ...) {

    /*
     * Loglevels:
     * 0 - Absolutely fucking nothing
     * 1 - Fatal
     * 2 - Message
     * 3 - Debug
     */

     if (loglevel < level)
        return;

    fprintf(stderr, "%s:%s L%d: ", file, function, line);

    va_list ap;
    va_start(ap, formatting);
    vfprintf(stderr, formatting, ap);
    va_end(ap);

    fputs("\n", stderr);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
testb %al, %al
je 0x521b
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %r9, 0x48(%rsp)
cmpw %di, 0x7169(%rip)       # 0xc390
jae 0x5234
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
movq %r8, %rbx
movl %ecx, %r8d
movq %rdx, %rcx
movq %rsi, %rdx
movq 0x6da9(%rip), %r14      # 0xbff0
movq (%r14), %rdi
leaq 0x33f9(%rip), %rsi      # 0x864a
xorl %eax, %eax
callq 0x33c0
leaq 0x20(%rsp), %rax
movq %rsp, %rdx
movq %rax, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000028, %rax     # imm = 0x3000000028
movq %rax, (%rdx)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x3590
movq (%r14), %rsi
leaq 0x33c4(%rip), %rdi      # 0x8656
callq 0x3280
jmp 0x5229
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/custard.c
// Function: initialize
unsigned short initialize() {
    if (!initialize_xcb() || !initialize_ewmh() || !initialize_socket())
        return 0;
    log_debug("XCB, EWMH, and socket setup");

    setup_monitors();
    log_debug("Monitors setup");
    setup_global_configuration();
    log_debug("Global configuration setup");

    unsigned int index = 0;
    for (; index < SIGUNUSED; index++)
        if (signals[index])
            signal(index, signals[index]);
    index = 0;
    log_debug("Signal handlers setup");

    return 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x723c
testw %ax, %ax
je 0x5388
callq 0x742c
testw %ax, %ax
je 0x5388
callq 0x48a8
testw %ax, %ax
je 0x5388
leaq 0x30fc(%rip), %r14      # 0x83cb
leaq 0x3255(%rip), %r15      # 0x852b
leaq 0x3259(%rip), %r8       # 0x8536
xorl %ebx, %ebx
movl $0x3, %edi
movq %r14, %rsi
movq %r15, %rdx
movl $0x7c, %ecx
xorl %eax, %eax
callq 0x51d6
callq 0x67d0
leaq 0x3250(%rip), %r8       # 0x8552
movl $0x3, %edi
movq %r14, %rsi
movq %r15, %rdx
movl $0x7f, %ecx
xorl %eax, %eax
callq 0x51d6
callq 0x4b8c
leaq 0x323c(%rip), %r8       # 0x8561
movl $0x3, %edi
movq %r14, %rsi
movq %r15, %rdx
movl $0x81, %ecx
xorl %eax, %eax
callq 0x51d6
leaq 0x745d(%rip), %r14      # 0xc7a0
movq (%r14,%rbx,8), %rsi
testq %rsi, %rsi
je 0x5353
movl %ebx, %edi
callq 0x3390
incq %rbx
cmpq $0x1f, %rbx
jne 0x5343
leaq 0x3068(%rip), %rsi      # 0x83cb
leaq 0x31c1(%rip), %rdx      # 0x852b
leaq 0x320b(%rip), %r8       # 0x857c
movl $0x3, %edi
movl $0x88, %ecx
xorl %eax, %eax
callq 0x51d6
movw $0x1, %ax
jmp 0x538a
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/decorations.c
// Function: apply_decoration_to_window_screen_geometry
void apply_decoration_to_window_screen_geometry(window_t *window,
    screen_geometry_t *geometry) {

    unsigned int border_type = get_setting_from_window_rules(window,
        "borders")->number;

    if (!border_type)
        return;

    if (border_type > 3)
        border_type = 3;

    unsigned int outer_size = get_setting_from_window_rules(window,
        "border.size.outer")->number;
    unsigned int inner_size = get_setting_from_window_rules(window,
        "border.size.inner")->number;

    if (!outer_size)
        outer_size = 1;

    if (!inner_size)
        inner_size = 1;

    unsigned int border_size;
    if (border_type == 1)
        border_size = outer_size;
    else
        border_size = (outer_size * (border_type - 1)) +
            inner_size;

    if (!border_size)
        return;

    geometry->height -= (border_size * 2);
    geometry->width -= (border_size * 2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x2a42(%rip), %rsi      # 0x81ee
callq 0x71be
movl (%rax), %ebp
testl %ebp, %ebp
je 0x581a
leaq 0x2a38(%rip), %rsi      # 0x81f6
movq %r14, %rdi
callq 0x71be
movl (%rax), %r15d
leaq 0x2a38(%rip), %rsi      # 0x8208
movq %r14, %rdi
callq 0x71be
cmpl $0x1, %r15d
adcl $0x0, %r15d
cmpl $0x1, %ebp
je 0x5803
cmpl $0x3, %ebp
movl $0x3, %ecx
cmovbl %ebp, %ecx
movl (%rax), %eax
cmpl $0x1, %eax
adcl $0x0, %eax
decl %ecx
imull %ecx, %r15d
addl %eax, %r15d
je 0x581a
addl %r15d, %r15d
cvtsi2ss %r15, %xmm0
movsd 0x8(%rbx), %xmm1
unpcklps %xmm0, %xmm0            # xmm0 = xmm0[0,0,1,1]
subps %xmm0, %xmm1
movlps %xmm1, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/decorations.c
// Function: get_raw_color_value
unsigned int get_raw_color_value(color_t color) {
    unsigned int value;

    value = (color.alpha) * 0x1000000 |
        ((color.red   * color.alpha) / 0xff) * 0x10000 |
        ((color.green * color.alpha) / 0xff) * 0x100   |
        ((color.blue  * color.alpha) / 0xff);

    return value;
}

// Assembly:
movl %edi, %ecx
shrl $0x8, %ecx
movl %edi, %eax
shrl $0x10, %eax
movl %edi, %edx
shrl $0x18, %edx
movl %edi, %esi
andl $0xff000000, %esi       # imm = 0xFF000000
movl $0xff, %r8d
andl %r8d, %edi
imull %edx, %edi
imull $0x8081, %edi, %edi     # imm = 0x8081
shrl $0x7, %edi
andl $0x1ff0000, %edi        # imm = 0x1FF0000
orl %esi, %edi
andl %r8d, %ecx
imull %edx, %ecx
imull $0x8081, %ecx, %ecx     # imm = 0x8081
shrl $0xf, %ecx
andl $0x1ff00, %ecx          # imm = 0x1FF00
andl %r8d, %eax
imull %edx, %eax
imull $0x8081, %eax, %eax     # imm = 0x8081
shrl $0x17, %eax
orl %edi, %eax
orl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/decorations.c
// Function: single_border
void single_border(xcb_window_t window, unsigned int border_size,
    color_t color) {
    /* Single border, configure window */
    unsigned int values[1] = { border_size };
    configure_window(window, XCB_CONFIG_WINDOW_BORDER_WIDTH, values);

    values[0] = get_raw_color_value(color);
    xcb_change_window_attributes(xcb_connection, window,
        XCB_CW_BORDER_PIXEL, values);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %r14d
movl %edi, %ebp
leaq 0xc(%rsp), %rbx
movl %esi, (%rbx)
movl $0x10, %esi
movq %rbx, %rdx
callq 0x7650
movl %r14d, %ecx
shrl $0x8, %ecx
movl %r14d, %eax
shrl $0x10, %eax
movl %r14d, %edx
shrl $0x18, %edx
movl %r14d, %esi
andl $0xff000000, %esi       # imm = 0xFF000000
movl $0xff, %edi
andl %edi, %r14d
imull %edx, %r14d
imull $0x8081, %r14d, %r8d    # imm = 0x8081
shrl $0x7, %r8d
andl $0x1ff0000, %r8d        # imm = 0x1FF0000
orl %esi, %r8d
andl %edi, %ecx
imull %edx, %ecx
imull $0x8081, %ecx, %ecx     # imm = 0x8081
shrl $0xf, %ecx
andl $0x1ff00, %ecx          # imm = 0x1FF00
andl %edi, %eax
imull %edx, %eax
imull $0x8081, %eax, %eax     # imm = 0x8081
shrl $0x17, %eax
orl %r8d, %eax
orl %ecx, %eax
movl %eax, (%rbx)
leaq 0x6ea6(%rip), %rax      # 0xc8f8
movq (%rax), %rdi
movl %ebp, %esi
movl $0x8, %edx
movq %rbx, %rcx
callq 0x3170
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/geometry.c
// Function: create_screen_geometry
screen_geometry_t *create_screen_geometry(unsigned int x, unsigned int y,
    unsigned int height, unsigned int width) {
    screen_geometry_t *geometry = (screen_geometry_t*)calloc(1,
        sizeof(screen_geometry_t));

    geometry->x = x;
    geometry->y = y;
    geometry->height = height;
    geometry->width = width;

    return geometry;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %r15d
movl $0x1, %edi
movl $0x10, %esi
callq 0x3340
movd %ebx, %xmm0
movd %ebp, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movd %r14d, %xmm0
movd %r15d, %xmm2
punpckldq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
punpcklqdq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0]
movdqa 0x26be(%rip), %xmm0     # 0x8660
pand %xmm2, %xmm0
por 0x26c2(%rip), %xmm0     # 0x8670
psrld $0x10, %xmm2
por 0x26c5(%rip), %xmm2     # 0x8680
subps 0x26ce(%rip), %xmm2     # 0x8690
addps %xmm0, %xmm2
movups %xmm2, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/geometry.c
// Function: get_equivalent_screen_geometry
screen_geometry_t *get_equivalent_screen_geometry(grid_geometry_t *geometry,
    monitor_t *monitor) {
    screen_geometry_t *screen_geometry = create_screen_geometry(
        get_x_offset(geometry->x, monitor),
        get_y_offset(geometry->y, monitor),
        span_height_over_screen(geometry->height, monitor),
        span_width_over_screen(geometry->width, monitor)
    );

    return screen_geometry;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %edi
callq 0x63b8
movaps %xmm0, 0x30(%rsp)
movl 0x4(%r14), %edi
movq %rbx, %rsi
callq 0x643c
movaps %xmm0, 0x20(%rsp)
movl 0x8(%r14), %edi
movq %rbx, %rsi
callq 0x6360
movaps %xmm0, 0x10(%rsp)
movl 0xc(%r14), %edi
movq %rbx, %rsi
callq 0x6308
movaps %xmm0, (%rsp)
movl $0x1, %edi
movl $0x10, %esi
callq 0x3340
movaps 0x30(%rsp), %xmm2
unpcklps 0x20(%rsp), %xmm2       # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
movaps 0x10(%rsp), %xmm0
unpcklps (%rsp), %xmm0           # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
movlhps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0]
cvttps2dq %xmm2, %xmm0
movdqa %xmm0, %xmm1
psrad $0x1f, %xmm1
subps 0x2649(%rip), %xmm2     # 0x86a0
cvttps2dq %xmm2, %xmm2
pand %xmm1, %xmm2
por %xmm0, %xmm2
movdqa 0x25f5(%rip), %xmm0     # 0x8660
pand %xmm2, %xmm0
por 0x25f9(%rip), %xmm0     # 0x8670
psrld $0x10, %xmm2
por 0x25fc(%rip), %xmm2     # 0x8680
subps 0x2605(%rip), %xmm2     # 0x8690
addps %xmm0, %xmm2
movups %xmm2, (%rax)
addq $0x48, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/geometry.c
// Function: get_geometry_from_monitor
grid_geometry_t *get_geometry_from_monitor(monitor_t *monitor, char *label) {
    if (!monitor->geometries)
        return NULL;

    labeled_grid_geometry_t *labeled_geometry;
    while ((labeled_geometry = vector_iterator(monitor->geometries))) {
        if (!strcmp(labeled_geometry->label, label)) {
            reset_vector_iterator(monitor->geometries);
            return labeled_geometry->geometry;
        }
    }

    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x10(%rdi)
je 0x60e0
movq %rsi, %r15
movq %rdi, %r14
xorl %ebx, %ebx
movq 0x10(%r14), %rdi
callq 0x3849
testq %rax, %rax
je 0x60e2
movq %rax, %r12
movq 0x8(%rax), %rdi
movq %r15, %rsi
callq 0x3370
testl %eax, %eax
jne 0x60b0
movq 0x10(%r14), %rdi
callq 0x387d
movq (%r12), %rbx
jmp 0x60e2
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/grid.c
// Function: calculate_default_height
unsigned int calculate_default_height(monitor_t *monitor) {
    unsigned int rows = get_value_from_key_with_fallback(
        monitor->configuration, "grid.rows")->number;

    if (rows % 2) return 1;

    return 2;
}

// Assembly:
pushq %rax
movq 0x18(%rdi), %rdi
leaq 0x2268(%rip), %rsi      # 0x8368
callq 0x4e30
movl (%rax), %ecx
andl $0x1, %ecx
movl $0x2, %eax
subl %ecx, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/grid.c
// Function: calculate_default_width
unsigned int calculate_default_width(monitor_t *monitor) {
    unsigned int columns = get_value_from_key_with_fallback(
        monitor->configuration, "grid.columns")->number;

    if (columns % 2) return 1;

    return 2;
}

// Assembly:
pushq %rax
movq 0x18(%rdi), %rdi
leaq 0x2030(%rip), %rsi      # 0x814f
callq 0x4e30
movl (%rax), %ecx
andl $0x1, %ecx
movl $0x2, %eax
subl %ecx, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/grid.c
// Function: calculate_default_x
unsigned int calculate_default_x(monitor_t *monitor) {
    unsigned int columns = get_value_from_key_with_fallback(
        monitor->configuration, "grid.columns")->number;

    unsigned int default_value = (columns / 2) - 1;

    if (columns % 2) default_value++;

    return default_value;
}

// Assembly:
pushq %rax
movq 0x18(%rdi), %rdi
leaq 0x2011(%rip), %rsi      # 0x814f
callq 0x4e30
movl (%rax), %eax
movl %eax, %ecx
shrl %ecx
andl $0x1, %eax
addl %ecx, %eax
decl %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/grid.c
// Function: calculate_default_y
unsigned int calculate_default_y(monitor_t *monitor) {
    unsigned int rows = get_value_from_key_with_fallback(
        monitor->configuration, "grid.rows")->number;

    unsigned int default_value = (rows / 2) - 1;

    if (rows % 2) default_value++;

    return default_value;
}

// Assembly:
pushq %rax
movq 0x18(%rdi), %rdi
leaq 0x220a(%rip), %rsi      # 0x8368
callq 0x4e30
movl (%rax), %eax
movl %eax, %ecx
shrl %ecx
andl $0x1, %eax
addl %ecx, %eax
decl %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/grid.c
// Function: calculate_horizontal_unit_size
float calculate_horizontal_unit_size(monitor_t *monitor) {
    unsigned int total_border_size = 0;

    unsigned int gap_size = get_value_from_key_with_fallback(
        monitor->configuration, "grid.margins")->number;
    unsigned int columns = get_value_from_key_with_fallback(
        monitor->configuration, "grid.columns")->number;
    unsigned int offset_left = get_value_from_key_with_fallback(
        monitor->configuration, "grid.margin.left")->number;
    unsigned int offset_right = get_value_from_key_with_fallback(
        monitor->configuration, "grid.margin.right")->number;

    unsigned int horizontal_border_summation = (total_border_size * 2) *
        columns;
    unsigned int horizontal_offset = offset_left + offset_right;
    unsigned int horizontal_gap_summation = gap_size * (columns + 1);

    unsigned int negative_real_estate = horizontal_offset +
        horizontal_gap_summation + horizontal_border_summation;

    float usable_real_estate = (float)(monitor->geometry->width -
        negative_real_estate);
    float unit_size = usable_real_estate / (float)columns;

    return unit_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
leaq 0x1fd5(%rip), %rsi      # 0x815c
callq 0x4e30
movl (%rax), %ebp
movq 0x18(%rbx), %rdi
leaq 0x1fb6(%rip), %rsi      # 0x814f
callq 0x4e30
movl (%rax), %r14d
movq 0x18(%rbx), %rdi
leaq 0x1fe0(%rip), %rsi      # 0x818c
callq 0x4e30
movq 0x18(%rbx), %rdi
leal 0x1(%r14), %r15d
imull %ebp, %r15d
addl (%rax), %r15d
leaq 0x1fd6(%rip), %rsi      # 0x819d
callq 0x4e30
addl (%rax), %r15d
cvtsi2ss %r15, %xmm1
movq 0x8(%rbx), %rax
cvtsi2ss %r14, %xmm2
movss 0xc(%rax), %xmm0
subss %xmm1, %xmm0
divss %xmm2, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/grid.c
// Function: calculate_vertical_unit_size
float calculate_vertical_unit_size(monitor_t *monitor) {
    unsigned int total_border_size = 0;

    unsigned int gap_size = get_value_from_key_with_fallback(
        monitor->configuration, "grid.margins")->number;
    unsigned int rows = get_value_from_key_with_fallback(
        monitor->configuration, "grid.rows")->number;
    unsigned int offset_top = get_value_from_key_with_fallback(
        monitor->configuration, "grid.margin.top")->number;
    unsigned int offset_bottom = get_value_from_key_with_fallback(
        monitor->configuration, "grid.margin.bottom")->number;

    unsigned int vertical_border_summation = (total_border_size * 2) * rows;
    unsigned int vertical_offset = offset_top + offset_bottom;
    unsigned int vertical_gap_summation = gap_size * (rows + 1);

    unsigned int negative_real_estate = vertical_offset +
        vertical_gap_summation + vertical_border_summation;

    float usable_real_estate = (float)(monitor->geometry->height -
        negative_real_estate);
    float unit_size = usable_real_estate / (float)rows;

    return unit_size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
leaq 0x1f52(%rip), %rsi      # 0x815c
callq 0x4e30
movl (%rax), %ebp
movq 0x18(%rbx), %rdi
leaq 0x214c(%rip), %rsi      # 0x8368
callq 0x4e30
movl (%rax), %r14d
movq 0x18(%rbx), %rdi
leaq 0x1f3a(%rip), %rsi      # 0x8169
callq 0x4e30
movq 0x18(%rbx), %rdi
leal 0x1(%r14), %r15d
imull %ebp, %r15d
addl (%rax), %r15d
leaq 0x1f2f(%rip), %rsi      # 0x8179
callq 0x4e30
addl (%rax), %r15d
cvtsi2ss %r15, %xmm1
movq 0x8(%rbx), %rax
cvtsi2ss %r14, %xmm2
movss 0x8(%rax), %xmm0
subss %xmm1, %xmm0
divss %xmm2, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/grid.c
// Function: span_units_over_screen
float span_units_over_screen(float unit_size, unsigned int span,
    monitor_t *monitor) {
    unsigned int total_border_size = 0;
    unsigned int gap_size = get_value_from_key_with_fallback(
        monitor->configuration, "grid.margins")->number;

    return (unit_size * span) + (gap_size * (span - 1)) +
        ((total_border_size * 2) * (span - 1));
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
movss %xmm0, 0xc(%rsp)
movq 0x18(%rsi), %rdi
leaq 0x1ecc(%rip), %rsi      # 0x815c
callq 0x4e30
movl %ebx, %ecx
cvtsi2ss %rcx, %xmm1
decl %ebx
imull (%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2ss %rbx, %xmm0
mulss 0xc(%rsp), %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
addss %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/grid.c
// Function: get_unit_offset
float get_unit_offset(float unit_size, unsigned int offset,
    monitor_t *monitor) {
    unsigned int total_border_size = 0;
    unsigned int gap_size = get_value_from_key_with_fallback(
        monitor->configuration, "grid.margins")->number;

    return (unit_size * offset) + (gap_size * (offset + 1)) +
        ((total_border_size * 2) * offset);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
movss %xmm0, 0xc(%rsp)
movq 0x18(%rsi), %rdi
leaq 0x1e84(%rip), %rsi      # 0x815c
callq 0x4e30
movl %ebx, %ecx
cvtsi2ss %rcx, %xmm1
incl %ebx
imull (%rax), %ebx
xorps %xmm0, %xmm0
cvtsi2ss %rbx, %xmm0
mulss 0xc(%rsp), %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
addss %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/grid.c
// Function: get_x_offset
float get_x_offset(unsigned int offset, monitor_t *monitor) {
    float unit_in_pixels = calculate_horizontal_unit_size(monitor);
    float left_offset = (float)get_value_from_key_with_fallback(
        monitor->configuration, "grid.margin.left")->number;

    return get_unit_offset(unit_in_pixels, offset, monitor) + \
        left_offset + monitor->geometry->x;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
movq %rsi, %rdi
callq 0x6172
movss %xmm0, 0x4(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x1db1(%rip), %rsi      # 0x818c
callq 0x4e30
movl (%rax), %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movss %xmm0, (%rsp)
movq 0x18(%rbx), %rdi
leaq 0x1d62(%rip), %rsi      # 0x815c
callq 0x4e30
movl %r14d, %ecx
cvtsi2ss %rcx, %xmm1
incl %r14d
imull (%rax), %r14d
xorps %xmm0, %xmm0
cvtsi2ss %r14, %xmm0
mulss 0x4(%rsp), %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
addss %xmm1, %xmm0
addss (%rsp), %xmm0
movq 0x8(%rbx), %rax
addss (%rax), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/comfies[P]custard/src/wm/grid.c
// Function: get_y_offset
float get_y_offset(unsigned int offset, monitor_t *monitor) {
    float unit_in_pixels = calculate_vertical_unit_size(monitor);
    float top_offset = (float)get_value_from_key_with_fallback(
        monitor->configuration, "grid.margin.top")->number;

    return get_unit_offset(unit_in_pixels, offset, monitor) + \
        top_offset + monitor->geometry->y;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
movq %rsi, %rdi
callq 0x61f5
movss %xmm0, 0x4(%rsp)
movq 0x18(%rbx), %rdi
leaq 0x1d0a(%rip), %rsi      # 0x8169
callq 0x4e30
movl (%rax), %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
movss %xmm0, (%rsp)
movq 0x18(%rbx), %rdi
leaq 0x1cde(%rip), %rsi      # 0x815c
callq 0x4e30
movl %r14d, %ecx
cvtsi2ss %rcx, %xmm1
incl %r14d
imull (%rax), %r14d
xorps %xmm0, %xmm0
cvtsi2ss %r14, %xmm0
mulss 0x4(%rsp), %xmm1
addss %xmm0, %xmm1
xorps %xmm0, %xmm0
addss %xmm1, %xmm0
addss (%rsp), %xmm0
movq 0x8(%rbx), %rax
addss 0x4(%rax), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)