	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_drm
_init_drm:                              ## @init_drm
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_open
	movq	_drm@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	testq	%rax, %rax
	js	LBB0_3
## %bb.1:
	movq	_DRM_CLIENT_CAP_UNIVERSAL_PLANES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	movl	$1, %edx
	callq	_drmSetClientCap
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	callq	_RARCH_LOG
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_4:
	leaq	L_.str.3(%rip), %rdi
	callq	_RARCH_LOG
LBB0_5:
	movq	(%r14), %rdi
	movq	_DRM_CLIENT_CAP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edx
	callq	_drmSetClientCap
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_RARCH_ERR
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str.5(%rip), %rdi
	callq	_RARCH_LOG
LBB0_8:
	movq	(%r14), %rdi
	callq	_drmModeGetResources
	movq	%rax, 40(%r14)
	testq	%rax, %rax
	je	LBB0_14
## %bb.9:
	cmpq	$0, 24(%rax)
	je	LBB0_13
## %bb.10:
	xorl	%ebx, %ebx
	movq	_DRM_MODE_CONNECTED@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movq	16(%rax), %rax
	movl	(%rax,%rbx,4), %esi
	callq	_drmModeGetConnector
	movq	%rax, %r15
	movq	(%rax), %rax
	cmpq	(%r12), %rax
	je	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r15, %rdi
	callq	_drmModeFreeConnector
	incq	%rbx
	movq	40(%r14), %rax
	cmpq	24(%rax), %rbx
	jb	LBB0_11
LBB0_13:
	leaq	L_.str.7(%rip), %rdi
	jmp	LBB0_15
LBB0_14:
	leaq	L_.str.6(%rip), %rdi
LBB0_15:
	xorl	%ebx, %ebx
LBB0_16:
	xorl	%eax, %eax
	callq	_RARCH_ERR
LBB0_17:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	40(%r14), %rax
	cmpq	$0, 8(%rax)
	je	LBB0_22
## %bb.19:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	movq	(%rax), %rax
	movl	(%rax,%rbx,4), %esi
	callq	_drmModeGetEncoder
	movq	%rax, 32(%r14)
	movq	(%rax), %rcx
	cmpq	8(%r15), %rcx
	je	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	movq	%rax, %rdi
	callq	_drmModeFreeEncoder
	movq	$0, 32(%r14)
	incq	%rbx
	movq	40(%r14), %rax
	cmpq	8(%rax), %rbx
	jb	LBB0_20
	jmp	LBB0_27
LBB0_22:
	movq	32(%r14), %rax
	testq	%rax, %rax
	je	LBB0_27
LBB0_23:
	movl	8(%rax), %esi
	movl	%esi, 20(%r14)
	movl	16(%r15), %eax
	movl	%eax, 16(%r14)
	movq	(%r14), %rdi
	callq	_drmModeGetCrtc
	movq	%rax, 24(%r14)
	movq	%rax, 8(%r14)
	movq	_g_drm_mode@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movl	4(%rax), %ecx
	movl	%ecx, -40(%rbp)
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	(%r14), %rdi
	movq	_DRM_FORMAT_XRGB8888@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %rsi
	movl	$4, %edx
	callq	_modeset_create_dumbfb
	testl	%eax, %eax
	je	LBB0_25
## %bb.24:
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_ERR
LBB0_25:
	movl	20(%r14), %esi
	movl	-48(%rbp), %edx
	movq	(%r14), %rdi
	leaq	16(%r14), %r9
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	pushq	8(%r14)
	pushq	$1
	callq	_drmModeSetCrtc
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_28
## %bb.26:
	leaq	L_.str.10(%rip), %rdi
	jmp	LBB0_16
LBB0_27:
	leaq	L_.str.8(%rip), %rdi
	jmp	LBB0_15
LBB0_28:
	movl	$1, %ebx
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/dri/card0"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_drm,48,3                       ## @drm
L_.str.1:                               ## @.str.1
	.asciz	"DRM: could not open drm device\n"

	.comm	_DRM_CLIENT_CAP_UNIVERSAL_PLANES,4,2 ## @DRM_CLIENT_CAP_UNIVERSAL_PLANES
L_.str.2:                               ## @.str.2
	.asciz	"DRM: can't set UNIVERSAL PLANES cap.\n"

L_.str.3:                               ## @.str.3
	.asciz	"DRM: UNIVERSAL PLANES cap set\n"

	.comm	_DRM_CLIENT_CAP_ATOMIC,4,2      ## @DRM_CLIENT_CAP_ATOMIC
L_.str.4:                               ## @.str.4
	.asciz	"DRM: can't set ATOMIC caps: %s\n"

	.comm	_errno,4,2                      ## @errno
L_.str.5:                               ## @.str.5
	.asciz	"DRM: ATOMIC caps set\n"

L_.str.6:                               ## @.str.6
	.asciz	"DRM: drmModeGetResources failed\n"

	.comm	_DRM_MODE_CONNECTED,8,3         ## @DRM_MODE_CONNECTED
L_.str.7:                               ## @.str.7
	.asciz	"DRM: no connected connector found\n"

L_.str.8:                               ## @.str.8
	.asciz	"DRM: no encoder found.\n"

	.comm	_g_drm_mode,8,3                 ## @g_drm_mode
	.comm	_DRM_FORMAT_XRGB8888,4,2        ## @DRM_FORMAT_XRGB8888
L_.str.9:                               ## @.str.9
	.asciz	"DRM: can't create dumb fb\n"

L_.str.10:                              ## @.str.10
	.asciz	"DRM: failed to set mode\n"

	.no_dead_strip	_init_drm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_drm
_init_drm:                              ; @init_drm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_open
Lloh5:
	adrp	x20, _drm@GOTPAGE
Lloh6:
	ldr	x20, [x20, _drm@GOTPAGEOFF]
	str	x0, [x20]
	tbnz	x0, #63, LBB0_3
; %bb.1:
Lloh7:
	adrp	x8, _DRM_CLIENT_CAP_UNIVERSAL_PLANES@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DRM_CLIENT_CAP_UNIVERSAL_PLANES@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_drmSetClientCap
	cbz	w0, LBB0_4
; %bb.2:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_RARCH_ERR
	b	LBB0_5
LBB0_3:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_RARCH_LOG
	b	LBB0_16
LBB0_4:
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_RARCH_LOG
LBB0_5:
	ldr	x0, [x20]
Lloh16:
	adrp	x8, _DRM_CLIENT_CAP_ATOMIC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DRM_CLIENT_CAP_ATOMIC@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	w2, #1
	bl	_drmSetClientCap
	cbz	w0, LBB0_7
; %bb.6:
Lloh19:
	adrp	x8, _errno@GOTPAGE
Lloh20:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_RARCH_ERR
	b	LBB0_8
LBB0_7:
Lloh24:
	adrp	x0, l_.str.5@PAGE
Lloh25:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_RARCH_LOG
LBB0_8:
	ldr	x0, [x20]
	bl	_drmModeGetResources
	str	x0, [x20, #40]
	cbz	x0, LBB0_14
; %bb.9:
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_13
; %bb.10:
	mov	x21, #0
Lloh26:
	adrp	x22, _DRM_MODE_CONNECTED@GOTPAGE
Lloh27:
	ldr	x22, [x22, _DRM_MODE_CONNECTED@GOTPAGEOFF]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x9, [x0, #16]
	ldr	w1, [x9, x21, lsl #2]
	mov	x0, x8
	bl	_drmModeGetConnector
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_18
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x0, x19
	bl	_drmModeFreeConnector
	add	x21, x21, #1
	ldr	x0, [x20, #40]
	ldr	x8, [x0, #24]
	cmp	x21, x8
	b.lo	LBB0_11
LBB0_13:
Lloh28:
	adrp	x0, l_.str.7@PAGE
Lloh29:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_15
LBB0_14:
Lloh30:
	adrp	x0, l_.str.6@PAGE
Lloh31:
	add	x0, x0, l_.str.6@PAGEOFF
LBB0_15:
	bl	_RARCH_ERR
LBB0_16:
	mov	w19, #0
LBB0_17:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_18:
	ldr	x8, [x20, #40]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_22
; %bb.19:
	mov	x21, #0
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	ldr	x8, [x8]
	ldr	w1, [x8, x21, lsl #2]
	bl	_drmModeGetEncoder
	str	x0, [x20, #32]
	ldr	x8, [x0]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.eq	LBB0_23
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	bl	_drmModeFreeEncoder
	str	xzr, [x20, #32]
	add	x21, x21, #1
	ldr	x8, [x20, #40]
	ldr	x9, [x8, #8]
	cmp	x21, x9
	b.lo	LBB0_20
	b	LBB0_27
LBB0_22:
	ldr	x0, [x20, #32]
	cbz	x0, LBB0_27
LBB0_23:
	ldr	w1, [x0, #8]
	ldr	w8, [x19, #16]
	stp	w8, w1, [x20, #16]
	ldr	x0, [x20]
	bl	_drmModeGetCrtc
	str	x0, [x20, #24]
	str	x0, [x20, #8]
Lloh32:
	adrp	x8, _g_drm_mode@GOTPAGE
Lloh33:
	ldr	x8, [x8, _g_drm_mode@GOTPAGEOFF]
Lloh34:
	str	x0, [x8]
	ldr	d0, [x0]
	stur	d0, [sp, #20]
	ldr	x0, [x20]
Lloh35:
	adrp	x8, _DRM_FORMAT_XRGB8888@GOTPAGE
Lloh36:
	ldr	x8, [x8, _DRM_FORMAT_XRGB8888@GOTPAGEOFF]
Lloh37:
	ldr	w3, [x8]
	add	x1, sp, #16
	mov	w2, #4
	bl	_modeset_create_dumbfb
	cbz	w0, LBB0_25
; %bb.24:
Lloh38:
	adrp	x0, l_.str.9@PAGE
Lloh39:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_RARCH_ERR
LBB0_25:
	ldr	w1, [x20, #20]
	ldr	w2, [sp, #16]
	ldp	x0, x7, [x20]
	add	x5, x20, #16
	mov	w19, #1
	mov	w3, #0
	mov	w4, #0
	mov	w6, #1
	bl	_drmModeSetCrtc
	cbz	x0, LBB0_17
; %bb.26:
Lloh40:
	adrp	x0, l_.str.10@PAGE
Lloh41:
	add	x0, x0, l_.str.10@PAGEOFF
	b	LBB0_15
LBB0_27:
Lloh42:
	adrp	x0, l_.str.8@PAGE
Lloh43:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_15
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotStr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/dri/card0"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_drm,48,3                       ; @drm
l_.str.1:                               ; @.str.1
	.asciz	"DRM: could not open drm device\n"

	.comm	_DRM_CLIENT_CAP_UNIVERSAL_PLANES,4,2 ; @DRM_CLIENT_CAP_UNIVERSAL_PLANES
l_.str.2:                               ; @.str.2
	.asciz	"DRM: can't set UNIVERSAL PLANES cap.\n"

l_.str.3:                               ; @.str.3
	.asciz	"DRM: UNIVERSAL PLANES cap set\n"

	.comm	_DRM_CLIENT_CAP_ATOMIC,4,2      ; @DRM_CLIENT_CAP_ATOMIC
l_.str.4:                               ; @.str.4
	.asciz	"DRM: can't set ATOMIC caps: %s\n"

	.comm	_errno,4,2                      ; @errno
l_.str.5:                               ; @.str.5
	.asciz	"DRM: ATOMIC caps set\n"

l_.str.6:                               ; @.str.6
	.asciz	"DRM: drmModeGetResources failed\n"

	.comm	_DRM_MODE_CONNECTED,8,3         ; @DRM_MODE_CONNECTED
l_.str.7:                               ; @.str.7
	.asciz	"DRM: no connected connector found\n"

l_.str.8:                               ; @.str.8
	.asciz	"DRM: no encoder found.\n"

	.comm	_g_drm_mode,8,3                 ; @g_drm_mode
	.comm	_DRM_FORMAT_XRGB8888,4,2        ; @DRM_FORMAT_XRGB8888
l_.str.9:                               ; @.str.9
	.asciz	"DRM: can't create dumb fb\n"

l_.str.10:                              ; @.str.10
	.asciz	"DRM: failed to set mode\n"

	.no_dead_strip	_init_drm
.subsections_via_symbols
