	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ResolutionForMode
_ResolutionForMode:                     ## @ResolutionForMode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	testl	%esi, %esi
	movq	_display_modes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rdi,8), %rcx
	leaq	4(%rax,%rdi,8), %rax
	movq	%rcx, %rdx
	cmoveq	%rax, %rdx
	cmoveq	%rcx, %rax
	movl	(%rax), %ecx
	movl	(%rdx), %edx
	movq	_resolutions@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_current_resolution@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	cmpl	%edx, (%rax,%rsi,8)
	jb	LBB0_3
## %bb.1:
	cmpl	%ecx, 4(%rax,%rsi,8)
	jae	LBB0_2
LBB0_3:
	movq	_resolutions_size@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testq	%rsi, %rsi
	jne	LBB0_4
LBB0_7:
	xorl	%eax, %eax
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	$8, %rax
	decq	%rsi
	je	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	%edx, (%rax)
	jb	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%ecx, 4(%rax)
	jb	LBB0_6
LBB0_8:
	popq	%rbp
	retq
LBB0_2:
	leaq	(%rax,%rsi,8), %rax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_display_modes,8,3              ## @display_modes
	.comm	_resolutions,8,3                ## @resolutions
	.comm	_current_resolution,8,3         ## @current_resolution
	.comm	_resolutions_size,4,2           ## @resolutions_size
	.no_dead_strip	_ResolutionForMode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ResolutionForMode
_ResolutionForMode:                     ; @ResolutionForMode
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _display_modes@GOTPAGE
Lloh1:
	ldr	x8, [x8, _display_modes@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x8, x8, x0, lsl #3
	add	x9, x8, #4
	cmp	w1, #0
	csel	x10, x9, x8, eq
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	ldr	w9, [x10]
Lloh3:
	adrp	x10, _resolutions@GOTPAGE
Lloh4:
	ldr	x10, [x10, _resolutions@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x10]
Lloh6:
	adrp	x10, _current_resolution@GOTPAGE
Lloh7:
	ldr	x10, [x10, _current_resolution@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	add	x0, x11, x10, lsl #3
	ldr	w10, [x0]
	cmp	w10, w9
	b.lo	LBB0_2
; %bb.1:
	ldr	w10, [x0, #4]
	cmp	w10, w8
	b.hs	LBB0_7
LBB0_2:
Lloh9:
	adrp	x10, _resolutions_size@GOTPAGE
Lloh10:
	ldr	x10, [x10, _resolutions_size@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cbz	w10, LBB0_8
; %bb.3:
	mov	x0, x11
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x0, x0, #8
	subs	x10, x10, #1
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x0]
	cmp	w11, w9
	b.lo	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w11, [x0, #4]
	cmp	w11, w8
	b.lo	LBB0_4
LBB0_7:
	ret
LBB0_8:
	mov	x0, #0
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_display_modes,8,3              ; @display_modes
	.comm	_resolutions,8,3                ; @resolutions
	.comm	_current_resolution,8,3         ; @current_resolution
	.comm	_resolutions_size,4,2           ; @resolutions_size
	.no_dead_strip	_ResolutionForMode
.subsections_via_symbols
