// File: /workspace/github_c_makefile_star2_O0/comfies[P]custard/src/wm/monitor.c
// Function: setup_monitors
void setup_monitors() {
    monitors = construct_vector();

    monitor_t *monitor;
    if (!xrandr_is_available()) {
        monitor = (monitor_t*)calloc(1, sizeof(monitor_t));
        monitor->name = (char*)calloc(1, sizeof(char));
        monitor->geometry = (screen_geometry_t*)calloc(1,
            sizeof(screen_geometry_t));
        monitor->configuration = NULL;

        monitor->geometry->x = monitor->geometry->y = 0.0;
        monitor->geometry->height = (float)xcb_screen->height_in_pixels;
        monitor->geometry->width = (float)xcb_screen->width_in_pixels;

        monitor->geometries = NULL;
        monitor->workspace = 1;

        strcpy(monitor->name, "<xorg>");
        push_to_vector(monitors, monitor);

        return;
    }

    xcb_randr_get_monitors_reply_t *outputs = get_xrandr_outputs();

    xcb_randr_monitor_info_iterator_t iterator;
    iterator = xcb_randr_get_monitors_monitors_iterator(outputs);

    xcb_randr_monitor_info_t *monitor_information;
    char *output_name;

    while (iterator.rem) {
        monitor = (monitor_t*)calloc(1, sizeof(monitor_t));
        monitor->name = (char*)calloc(1, sizeof(char));
        monitor->geometry = (screen_geometry_t*)calloc(1,
            sizeof(screen_geometry_t));
        monitor->configuration = NULL;

        monitor_information = iterator.data;
        output_name = xcb_get_atom_name_name(
            xcb_get_atom_name_reply(xcb_connection,
                xcb_get_atom_name(xcb_connection, monitor_information->name),
            NULL));

        monitor->geometry->x = (float)monitor_information->x;
        monitor->geometry->y = (float)monitor_information->y;

        monitor->geometry->height = (float)monitor_information->height;
        monitor->geometry->width = (float)monitor_information->width;

        monitor->geometries = NULL;
        monitor->workspace = 1;

        strcpy(monitor->name, output_name);
        push_to_vector(monitors, monitor);

        xcb_randr_monitor_info_next(&iterator);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
callq 0x3860
movq %rax, 0x60a4(%rip)      # 0xd8d8
callq 0x9440
cmpw $0x0, %ax
jne 0x7928
movl $0x1, %edi
movq %rdi, -0x50(%rbp)
movl $0x28, %esi
callq 0x3350
movq -0x50(%rbp), %rsi
movq %rax, -0x8(%rbp)
movq %rsi, %rdi
callq 0x3350
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movl $0x10, %esi
callq 0x3350
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x0, 0x4(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl $0x0, (%rax)
leaq 0x6047(%rip), %rax      # 0xd900
movq (%rax), %rcx
movzwl 0x16(%rcx), %ecx
cvtsi2ss %ecx, %xmm0
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movss %xmm0, 0x8(%rcx)
movq (%rax), %rax
movzwl 0x14(%rax), %eax
cvtsi2ss %eax, %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movss %xmm0, 0xc(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0x2da6(%rip), %rsi      # 0xa6b4
callq 0x30e0
movq 0x5fbe(%rip), %rdi      # 0xd8d8
movq -0x8(%rbp), %rsi
callq 0x3990
jmp 0x7a96
callq 0x9480
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x31a0
movq %rax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x7a96
movl $0x1, %edi
movq %rdi, -0x60(%rbp)
movl $0x28, %esi
callq 0x3350
movq -0x60(%rbp), %rsi
movq %rax, -0x8(%rbp)
movq %rsi, %rdi
callq 0x3350
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movl $0x10, %esi
callq 0x3350
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x5f3b(%rip), %rax      # 0xd8f8
movq (%rax), %rdi
movq %rdi, -0x58(%rbp)
movq -0x38(%rbp), %rax
movl (%rax), %esi
callq 0x3030
movq -0x58(%rbp), %rdi
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x3240
movq %rax, %rdi
callq 0x33c0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movswl 0x8(%rax), %eax
cvtsi2ss %eax, %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movss %xmm0, (%rax)
movq -0x38(%rbp), %rax
movswl 0xa(%rax), %eax
cvtsi2ss %eax, %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movss %xmm0, 0x4(%rax)
movq -0x38(%rbp), %rax
movzwl 0xe(%rax), %eax
cvtsi2ss %eax, %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movss %xmm0, 0x8(%rax)
movq -0x38(%rbp), %rax
movzwl 0xc(%rax), %eax
cvtsi2ss %eax, %xmm0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movss %xmm0, 0xc(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x30e0
movq 0x5e59(%rip), %rdi      # 0xd8d8
movq -0x8(%rbp), %rsi
callq 0x3990
leaq -0x20(%rbp), %rdi
callq 0x3130
jmp 0x7952
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)