// File: /workspace/github_c_makefile_star2_O0/mati75[P]evilwm/screen.c
// Function: screen_probe_monitors
void screen_probe_monitors(struct screen *s) {
#if defined(RANDR) && (RANDR_MAJOR == 1) && (RANDR_MINOR >= 5)
        if (display.have_randr && !option.wholescreen) {
		int nmonitors;
		XRRMonitorInfo *monitors;
		// Populate list of active monitors
		LOG_XENTER("XRRGetMonitors(screen=%d)", s->screen);
		monitors = XRRGetMonitors(display.dpy, s->root, True, &nmonitors);
		if (monitors) {
			struct monitor *new_monitors = s->monitors;
			if (nmonitors != s->nmonitors) {
				// allocating in multiple of 4 should stop us
				// having to reallocate at all in the most
				// common uses
				int n = (nmonitors | 3) + 1;
				new_monitors = realloc(s->monitors, n * sizeof(struct monitor));
			}
			if (new_monitors) {
				s->monitors = new_monitors;
				for (int i = 0; i < nmonitors; i++) {
					LOG_XDEBUG("monitor %d: %dx%d+%d+%d\n", i, monitors[i].width, monitors[i].height, monitors[i].x, monitors[i].y);
					s->monitors[i].x = monitors[i].x;
					s->monitors[i].y = monitors[i].y;
					s->monitors[i].width = monitors[i].width;
					s->monitors[i].height = monitors[i].height;
					s->monitors[i].area = monitors[i].width * monitors[i].height;
				}
				s->nmonitors = nmonitors;
			}
			LOG_XLEAVE();
			XRRFreeMonitors(monitors);
			return;
		}
		LOG_XLEAVE();
	}
#endif

	s->nmonitors = 1;
	if (!s->monitors) {
		s->monitors = xmalloc(sizeof(struct monitor));
	}
	s->monitors[0].x = 0;
	s->monitors[0].y = 0;
	s->monitors[0].width = DisplayWidth(display.dpy, s->screen);
	s->monitors[0].height = DisplayHeight(display.dpy, s->screen);
	s->monitors[0].area = s->monitors[0].width * s->monitors[0].height;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x6c0d(%rip), %rax      # 0x12d80
cmpl $0x0, 0x180(%rax)
je 0xc329
leaq 0x6dc1(%rip), %rax      # 0x12f48
cmpl $0x0, 0x34(%rax)
jne 0xc329
leaq 0x6be8(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %edx
leaq -0xc(%rbp), %rcx
callq 0x41a0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xc327
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
je 0xc1fd
movl -0xc(%rbp), %eax
orl $0x3, %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rdi
movslq -0x24(%rbp), %rax
imulq $0x14, %rax, %rsi
callq 0x46c0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0xc319
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x70(%rax)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xc30f
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x14(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movslq -0x28(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movslq -0x28(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x4(%rax)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movslq -0x28(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x20(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movslq -0x28(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
movq -0x18(%rbp), %rax
movslq -0x28(%rbp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
imull 0x20(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movslq -0x28(%rbp), %rdx
imulq $0x14, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x10(%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xc21b
movl -0xc(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x6c(%rax)
movq -0x18(%rbp), %rdi
callq 0x4310
jmp 0xc3ed
jmp 0xc329
movq -0x8(%rbp), %rax
movl $0x1, 0x6c(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x70(%rax)
jne 0xc354
movl $0x14, %edi
callq 0xd890
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movl $0x0, 0x4(%rax)
leaq 0x6a08(%rip), %rax      # 0x12d80
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movl %ecx, 0x8(%rax)
leaq 0x69db(%rip), %rax      # 0x12d80
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movl 0x8(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
imull 0xc(%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movl %ecx, 0x10(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)