	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_get_connector              ## -- Begin function drm_get_connector
	.p2align	4, 0x90
_drm_get_connector:                     ## @drm_get_connector
	.cfi_startproc
## %bb.0:
	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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r13d
	movl	(%rsi), %edi
	movl	$1, %r12d
	movl	$1, %esi
	callq	_MAX
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_g_drm_resources@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movq	(%rbx), %rax
	cmpl	$0, (%rax)
	jle	LBB0_18
## %bb.1:
	xorl	%r15d, %r15d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	callq	_drmModeFreeConnector
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r15
	movq	_g_drm_resources@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%rax), %rcx
	cmpq	%rcx, %r15
	jge	LBB0_10
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rax), %rax
	movl	(%rax,%r15,4), %esi
	movl	%r13d, %edi
	callq	_drmModeGetConnector
	testq	%rax, %rax
	je	LBB0_9
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %r12
	movq	(%rax), %rbx
	movq	_DRM_MODE_CONNECTED@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	leaq	L_.str.2(%rip), %rdx
	cmpq	%r14, %rbx
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.3(%rip), %rdx
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movl	8(%r12), %edx
	leaq	L_.str.4(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	cmpq	%r14, %rbx
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, 8(%r12)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	incl	%edx
	leaq	L_.str.5(%rip), %rdi
	movl	%r15d, %esi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_RARCH_LOG
	jmp	LBB0_8
LBB0_10:
	testl	%ecx, %ecx
	movl	$1, %r12d
	jle	LBB0_18
## %bb.11:
	xorl	%ebx, %ebx
	movq	_g_drm_connector@GOTPCREL(%rip), %r14
	xorl	%r15d, %r15d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%rax, %rdi
	callq	_drmModeFreeConnector
	movq	$0, (%r14)
LBB0_17:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rbx
	movq	_g_drm_resources@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%rax), %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_19
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rax), %rax
	movl	(%rax,%rbx,4), %esi
	movl	%r13d, %edi
	callq	_drmModeGetConnector
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	(%rax), %rcx
	movq	_DRM_MODE_CONNECTED@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	cmpl	$0, 8(%rax)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	incl	%r15d
	cmpl	-48(%rbp), %r15d                ## 4-byte Folded Reload
	jne	LBB0_16
	jmp	LBB0_20
LBB0_18:
	movq	_g_drm_connector@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_20
LBB0_19:
	leaq	L_.str.6(%rip), %rdi
	callq	_RARCH_WARN
	xorl	%r12d, %r12d
LBB0_20:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[DRM]: Found %d connectors.\n"

	.comm	_g_drm_resources,8,3            ## @g_drm_resources
	.comm	_DRM_MODE_CONNECTED,8,3         ## @DRM_MODE_CONNECTED
L_.str.1:                               ## @.str.1
	.asciz	"[DRM]: Connector %d connected: %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"yes"

L_.str.3:                               ## @.str.3
	.asciz	"no"

L_.str.4:                               ## @.str.4
	.asciz	"[DRM]: Connector %d has %d modes.\n"

L_.str.5:                               ## @.str.5
	.asciz	"[DRM]: Connector %d assigned to monitor index: #%u.\n"

	.comm	_g_drm_connector,8,3            ## @g_drm_connector
L_.str.6:                               ## @.str.6
	.asciz	"[DRM]: Couldn't get device connector.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_get_connector              ; -- Begin function drm_get_connector
	.p2align	2
_drm_get_connector:                     ; @drm_get_connector
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x0
	ldr	w0, [x1]
	mov	w1, #1
	bl	_MAX
	mov	x20, x0
Lloh0:
	adrp	x26, _g_drm_resources@GOTPAGE
Lloh1:
	ldr	x26, [x26, _g_drm_resources@GOTPAGEOFF]
	ldr	x8, [x26]
	ldr	w1, [x8]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_LOG
	ldr	x8, [x26]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_16
; %bb.1:
	str	w20, [sp, #12]                  ; 4-byte Folded Spill
	mov	x21, #0
	mov	w28, #0
Lloh4:
	adrp	x24, l_.str.2@PAGE
Lloh5:
	add	x24, x24, l_.str.2@PAGEOFF
Lloh6:
	adrp	x22, l_.str.1@PAGE
Lloh7:
	add	x22, x22, l_.str.1@PAGEOFF
Lloh8:
	adrp	x23, l_.str.4@PAGE
Lloh9:
	add	x23, x23, l_.str.4@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x25
	bl	_drmModeFreeConnector
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x21, #1
	ldr	x8, [x26]
	ldrsw	x9, [x8]
	cmp	x21, x9
	b.ge	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8, #8]
	ldr	w1, [x8, x21, lsl #2]
	mov	x0, x19
	bl	_drmModeGetConnector
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x25, x0
	ldr	x27, [x0]
Lloh10:
	adrp	x8, _DRM_MODE_CONNECTED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DRM_MODE_CONNECTED@GOTPAGEOFF]
Lloh12:
	ldr	x20, [x8]
	cmp	x27, x20
Lloh13:
	adrp	x8, l_.str.3@PAGE
Lloh14:
	add	x8, x8, l_.str.3@PAGEOFF
	csel	x8, x24, x8, eq
	str	x8, [sp]
	mov	x0, x22
	mov	x1, x21
	bl	_RARCH_LOG
	ldr	w8, [x25, #8]
	str	x8, [sp]
	mov	x0, x23
	mov	x1, x21
	bl	_RARCH_LOG
	cmp	x27, x20
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x25, #8]
	cbz	w8, LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w28, w28, #1
	str	x28, [sp]
Lloh15:
	adrp	x0, l_.str.5@PAGE
Lloh16:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x21
	bl	_RARCH_LOG
	b	LBB0_2
LBB0_8:
	cmp	w9, #1
	ldr	w23, [sp, #12]                  ; 4-byte Folded Reload
	b.lt	LBB0_16
; %bb.9:
	mov	x20, #0
	mov	w21, #0
Lloh17:
	adrp	x22, _g_drm_connector@GOTPAGE
Lloh18:
	ldr	x22, [x22, _g_drm_connector@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	bl	_drmModeFreeConnector
	str	xzr, [x22]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x20, x20, #1
	ldr	x8, [x26]
	ldrsw	x9, [x8]
	cmp	x20, x9
	b.ge	LBB0_18
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8, #8]
	ldr	w1, [x8, x20, lsl #2]
	mov	x0, x19
	bl	_drmModeGetConnector
	str	x0, [x22]
	cbz	x0, LBB0_11
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x0]
Lloh19:
	adrp	x9, _DRM_MODE_CONNECTED@GOTPAGE
Lloh20:
	ldr	x9, [x9, _DRM_MODE_CONNECTED@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_10
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	add	w21, w21, #1
	cmp	w21, w23
	b.ne	LBB0_10
	b	LBB0_17
LBB0_16:
Lloh22:
	adrp	x8, _g_drm_connector@GOTPAGE
Lloh23:
	ldr	x8, [x8, _g_drm_connector@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	cbz	x8, LBB0_18
LBB0_17:
	mov	w0, #1
	b	LBB0_19
LBB0_18:
Lloh25:
	adrp	x0, l_.str.6@PAGE
Lloh26:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_RARCH_WARN
	mov	w0, #0
LBB0_19:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[DRM]: Found %d connectors.\n"

	.comm	_g_drm_resources,8,3            ; @g_drm_resources
	.comm	_DRM_MODE_CONNECTED,8,3         ; @DRM_MODE_CONNECTED
l_.str.1:                               ; @.str.1
	.asciz	"[DRM]: Connector %d connected: %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"yes"

l_.str.3:                               ; @.str.3
	.asciz	"no"

l_.str.4:                               ; @.str.4
	.asciz	"[DRM]: Connector %d has %d modes.\n"

l_.str.5:                               ; @.str.5
	.asciz	"[DRM]: Connector %d assigned to monitor index: #%u.\n"

	.comm	_g_drm_connector,8,3            ; @g_drm_connector
l_.str.6:                               ; @.str.6
	.asciz	"[DRM]: Couldn't get device connector.\n"

.subsections_via_symbols
