	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function win32_display_server_set_resolution
_win32_display_server_set_resolution:   ## @win32_display_server_set_resolution
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, %r14d
	movl	%esi, %r12d
	leaq	-88(%rbp), %rdi
	movl	$-1, %esi
	movl	$20, %edx
	callq	_win32_get_video_output
	movq	_win32_orig_width@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	jne	LBB0_4
## %bb.3:
	movq	_SM_CXSCREEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GetSystemMetrics
	movq	%rax, (%rbx)
LBB0_4:
	movl	-88(%rbp), %ebx
	movq	_win32_orig_refresh@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	_win32_orig_height@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	jne	LBB0_6
## %bb.5:
	movq	_SM_CYSCREEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_GetSystemMetrics
	movq	%rax, (%r13)
	movl	-88(%rbp), %ebx
LBB0_6:
	movq	-84(%rbp), %xmm0                ## xmm0 = mem[0],zero
	movdqa	%xmm0, -64(%rbp)                ## 16-byte Spill
	movl	-76(%rbp), %r13d
	leaq	-112(%rbp), %rdi
	xorl	%esi, %esi
	movl	$20, %edx
	callq	_win32_get_video_output
	testl	%eax, %eax
	je	LBB0_11
## %bb.7:
	testl	%r15d, %r15d
	cmovnel	%r15d, %ebx
	movdqa	-64(%rbp), %xmm2                ## 16-byte Reload
	movd	%xmm2, %eax
	cmpl	%r12d, %eax
	movl	$0, %eax
	cmovel	%eax, %r12d
	movd	%r12d, %xmm1
	pinsrd	$1, %r14d, %xmm1
	pxor	%xmm0, %xmm0
	pcmpeqd	%xmm1, %xmm0
	blendvps	%xmm0, %xmm2, %xmm1
	movd	%ebx, %xmm0
	pshufd	$80, %xmm1, %xmm1               ## xmm1 = xmm1[0,0,1,1]
	pblendw	$3, %xmm0, %xmm1                ## xmm1 = xmm0[0,1],xmm1[2,3,4,5,6,7]
	pinsrd	$3, %r13d, %xmm1
	movdqa	%xmm1, -64(%rbp)                ## 16-byte Spill
	movl	$1, %ebx
	movq	_DM_BITSPERPEL@GOTPCREL(%rip), %r13
	movq	_DM_DISPLAYFREQUENCY@GOTPCREL(%rip), %r15
	movq	_CDS_TEST@GOTPCREL(%rip), %r12
	leaq	-112(%rbp), %r14
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$20, %edx
	callq	_win32_get_video_output
	incl	%ebx
	testl	%eax, %eax
	je	LBB0_11
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movdqa	-112(%rbp), %xmm0
	pcmpeqd	-64(%rbp), %xmm0                ## 16-byte Folded Reload
	pslld	$31, %xmm0
	movmskps	%xmm0, %eax
	cmpb	$15, %al
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	_DM_PELSHEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_DM_PELSWIDTH@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	(%r13), %eax
	orl	(%r15), %eax
	orl	%eax, -96(%rbp)
	movl	(%r12), %edx
	xorl	%edi, %edi
	movq	%r14, %rsi
	callq	_win32_change_display_settings
	cmpl	$128, %eax
	jne	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	xorl	%edi, %edi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_win32_change_display_settings
	addl	$-128, %eax
	testl	$-3, %eax
	jne	LBB0_13
LBB0_11:
	movl	$1, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	xorl	%eax, %eax
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_win32_orig_width,8,3           ## @win32_orig_width
	.comm	_SM_CXSCREEN,4,2                ## @SM_CXSCREEN
	.comm	_win32_orig_refresh,4,2         ## @win32_orig_refresh
	.comm	_win32_orig_height,8,3          ## @win32_orig_height
	.comm	_SM_CYSCREEN,4,2                ## @SM_CYSCREEN
	.comm	_DM_PELSWIDTH,4,2               ## @DM_PELSWIDTH
	.comm	_DM_PELSHEIGHT,4,2              ## @DM_PELSHEIGHT
	.comm	_DM_BITSPERPEL,4,2              ## @DM_BITSPERPEL
	.comm	_DM_DISPLAYFREQUENCY,4,2        ## @DM_DISPLAYFREQUENCY
	.comm	_CDS_TEST,4,2                   ## @CDS_TEST
	.no_dead_strip	_win32_display_server_set_resolution
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function win32_display_server_set_resolution
_win32_display_server_set_resolution:   ; @win32_display_server_set_resolution
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_12
; %bb.1:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	add	x0, sp, #24
	mov	w1, #-1
	mov	w2, #20
	bl	_win32_get_video_output
Lloh0:
	adrp	x22, _win32_orig_width@GOTPAGE
Lloh1:
	ldr	x22, [x22, _win32_orig_width@GOTPAGEOFF]
	ldr	x8, [x22]
	cbnz	x8, LBB0_3
; %bb.2:
Lloh2:
	adrp	x8, _SM_CXSCREEN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SM_CXSCREEN@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_GetSystemMetrics
	str	x0, [x22]
LBB0_3:
	ldr	w8, [sp, #24]
Lloh5:
	adrp	x9, _win32_orig_refresh@GOTPAGE
Lloh6:
	ldr	x9, [x9, _win32_orig_refresh@GOTPAGEOFF]
Lloh7:
	str	w8, [x9]
Lloh8:
	adrp	x22, _win32_orig_height@GOTPAGE
Lloh9:
	ldr	x22, [x22, _win32_orig_height@GOTPAGEOFF]
	ldr	x9, [x22]
	cbnz	x9, LBB0_5
; %bb.4:
Lloh10:
	adrp	x8, _SM_CYSCREEN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SM_CYSCREEN@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_GetSystemMetrics
	str	x0, [x22]
	ldr	w8, [sp, #24]
LBB0_5:
	ldp	w9, w10, [sp, #28]
	cmp	w9, w21
	csel	w11, wzr, w21, eq
	cmp	w11, #0
	csel	w21, w9, w11, eq
	cmp	w20, #0
	csel	w20, w10, w20, eq
	ldr	w22, [sp, #36]
	cmp	w19, #0
	csel	w23, w8, w19, eq
	mov	x0, sp
	mov	w1, #0
	mov	w2, #20
	bl	_win32_get_video_output
	cbz	w0, LBB0_11
; %bb.6:
	mov	w19, #1
Lloh13:
	adrp	x24, _DM_PELSWIDTH@GOTPAGE
Lloh14:
	ldr	x24, [x24, _DM_PELSWIDTH@GOTPAGEOFF]
Lloh15:
	adrp	x25, _DM_PELSHEIGHT@GOTPAGE
Lloh16:
	ldr	x25, [x25, _DM_PELSHEIGHT@GOTPAGEOFF]
Lloh17:
	adrp	x26, _DM_BITSPERPEL@GOTPAGE
Lloh18:
	ldr	x26, [x26, _DM_BITSPERPEL@GOTPAGEOFF]
Lloh19:
	adrp	x27, _DM_DISPLAYFREQUENCY@GOTPAGE
Lloh20:
	ldr	x27, [x27, _DM_DISPLAYFREQUENCY@GOTPAGEOFF]
Lloh21:
	adrp	x28, _CDS_TEST@GOTPAGE
Lloh22:
	ldr	x28, [x28, _CDS_TEST@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, sp
	mov	x1, x19
	mov	w2, #20
	bl	_win32_get_video_output
	add	w19, w19, #1
	cbz	w0, LBB0_11
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w8, w9, [sp, #8]
	ldp	w11, w10, [sp]
	cmp	w10, w21
	ccmp	w8, w20, #0, eq
	ccmp	w9, w22, #0, eq
	ccmp	w11, w23, #0, eq
	b.ne	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w8, w9, w8
	ldr	w9, [x26]
	orr	w8, w8, w9
	ldr	w9, [x27]
	orr	w8, w8, w9
	ldr	w9, [sp, #16]
	orr	w8, w8, w9
	str	w8, [sp, #16]
	ldr	w2, [x28]
	mov	x1, sp
	mov	x0, #0
	bl	_win32_change_display_settings
	cmp	w0, #128
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x1, sp
	mov	x0, #0
	mov	w2, #0
	bl	_win32_change_display_settings
	sub	w8, w0, #128
	tst	w8, #0xfffffffd
	b.ne	LBB0_7
LBB0_11:
	mov	w0, #1
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
LBB0_12:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
	.cfi_same_value w23
	.cfi_same_value w24
	.cfi_same_value w25
	.cfi_same_value w26
	.cfi_same_value w27
	.cfi_same_value w28
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_win32_orig_width,8,3           ; @win32_orig_width
	.comm	_SM_CXSCREEN,4,2                ; @SM_CXSCREEN
	.comm	_win32_orig_refresh,4,2         ; @win32_orig_refresh
	.comm	_win32_orig_height,8,3          ; @win32_orig_height
	.comm	_SM_CYSCREEN,4,2                ; @SM_CYSCREEN
	.comm	_DM_PELSWIDTH,4,2               ; @DM_PELSWIDTH
	.comm	_DM_PELSHEIGHT,4,2              ; @DM_PELSHEIGHT
	.comm	_DM_BITSPERPEL,4,2              ; @DM_BITSPERPEL
	.comm	_DM_DISPLAYFREQUENCY,4,2        ; @DM_DISPLAYFREQUENCY
	.comm	_CDS_TEST,4,2                   ; @CDS_TEST
	.no_dead_strip	_win32_display_server_set_resolution
.subsections_via_symbols
