	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mga_do_dma_bootstrap
_mga_do_dma_bootstrap:                  ## @mga_do_dma_bootstrap
	.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
	movq	%rsi, %r14
	movq	%rdi, %r15
	cmpq	$0, (%rsi)
	je	LBB0_1
## %bb.2:
	cmpq	$0, 8(%r15)
	setne	%al
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
LBB0_1:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_3:
	movq	(%r15), %rbx
	movl	$1, (%rbx)
	movl	12(%rbx), %edx
	movl	16(%rbx), %esi
	movq	__DRM_REGISTERS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	__DRM_READ_ONLY@GOTPCREL(%rip), %r13
	movl	(%r13), %r8d
	leaq	8(%rbx), %r9
	movq	%r15, %rdi
	callq	_drm_legacy_addmap
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %r12d
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_5
LBB0_6:
	movq	_SAREA_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	__DRM_SHM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	__DRM_LOCKED@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	orl	(%r13), %r8d
	movq	__DRM_KERNEL@GOTPCREL(%rip), %rax
	orl	(%rax), %r8d
	addq	$4, %rbx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movq	%rbx, %r9
	callq	_drm_legacy_addmap
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
LBB0_5:
	movl	%r12d, %esi
	callq	_DRM_ERROR
LBB0_11:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	cmpb	$0, -44(%rbp)                   ## 1-byte Folded Reload
	je	LBB0_13
## %bb.9:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mga_do_agp_dma_bootstrap
	testl	%eax, %eax
	je	LBB0_10
## %bb.12:
	movq	_MINIMAL_CLEANUP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_mga_do_cleanup_dma
LBB0_13:
	movq	%r15, %rdi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mga_do_pci_dma_bootstrap       ## TAILCALL
LBB0_10:
	xorl	%r12d, %r12d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	__DRM_REGISTERS,4,2             ## @_DRM_REGISTERS
	.comm	__DRM_READ_ONLY,4,2             ## @_DRM_READ_ONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to map MMIO region: %d\n"

	.comm	_SAREA_MAX,4,2                  ## @SAREA_MAX
	.comm	__DRM_SHM,4,2                   ## @_DRM_SHM
	.comm	__DRM_LOCKED,4,2                ## @_DRM_LOCKED
	.comm	__DRM_KERNEL,4,2                ## @_DRM_KERNEL
L_.str.1:                               ## @.str.1
	.asciz	"Unable to map status region: %d\n"

	.comm	_MINIMAL_CLEANUP,4,2            ## @MINIMAL_CLEANUP
	.no_dead_strip	_mga_do_dma_bootstrap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mga_do_dma_bootstrap
_mga_do_dma_bootstrap:                  ; @mga_do_dma_bootstrap
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x1]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x20, #8]
	cmp	x8, #0
	cset	w22, ne
	b	LBB0_3
LBB0_2:
	mov	w22, #0
LBB0_3:
	ldr	x23, [x20]
	mov	w8, #1
	str	w8, [x23]
Lloh0:
	adrp	x8, __DRM_REGISTERS@GOTPAGE
Lloh1:
	ldr	x8, [x8, __DRM_REGISTERS@GOTPAGEOFF]
	ldp	w2, w1, [x23, #12]
Lloh2:
	ldr	w3, [x8]
Lloh3:
	adrp	x24, __DRM_READ_ONLY@GOTPAGE
Lloh4:
	ldr	x24, [x24, __DRM_READ_ONLY@GOTPAGEOFF]
	ldr	w4, [x24]
	add	x5, x23, #8
	mov	x0, x20
	bl	_drm_legacy_addmap
	cbz	w0, LBB0_5
; %bb.4:
	mov	x21, x0
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh7:
	adrp	x8, _SAREA_MAX@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SAREA_MAX@GOTPAGEOFF]
Lloh9:
	adrp	x9, __DRM_SHM@GOTPAGE
Lloh10:
	ldr	x9, [x9, __DRM_SHM@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	ldr	w3, [x9]
	ldr	w8, [x24]
Lloh13:
	adrp	x9, __DRM_LOCKED@GOTPAGE
Lloh14:
	ldr	x9, [x9, __DRM_LOCKED@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh16:
	adrp	x9, __DRM_KERNEL@GOTPAGE
Lloh17:
	ldr	x9, [x9, __DRM_KERNEL@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w4, w8, w9
	add	x5, x23, #4
	mov	x0, x20
	mov	w1, #0
	bl	_drm_legacy_addmap
	cbz	w0, LBB0_9
; %bb.6:
	mov	x21, x0
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_7:
	mov	x1, x21
	bl	_DRM_ERROR
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
	cbz	w22, LBB0_12
; %bb.10:
	mov	x0, x20
	mov	x1, x19
	bl	_mga_do_agp_dma_bootstrap
	cbz	w0, LBB0_13
; %bb.11:
Lloh21:
	adrp	x8, _MINIMAL_CLEANUP@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MINIMAL_CLEANUP@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_mga_do_cleanup_dma
LBB0_12:
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_mga_do_pci_dma_bootstrap
LBB0_13:
	mov	w21, #0
	b	LBB0_8
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh11
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	__DRM_REGISTERS,4,2             ; @_DRM_REGISTERS
	.comm	__DRM_READ_ONLY,4,2             ; @_DRM_READ_ONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to map MMIO region: %d\n"

	.comm	_SAREA_MAX,4,2                  ; @SAREA_MAX
	.comm	__DRM_SHM,4,2                   ; @_DRM_SHM
	.comm	__DRM_LOCKED,4,2                ; @_DRM_LOCKED
	.comm	__DRM_KERNEL,4,2                ; @_DRM_KERNEL
l_.str.1:                               ; @.str.1
	.asciz	"Unable to map status region: %d\n"

	.comm	_MINIMAL_CLEANUP,4,2            ; @MINIMAL_CLEANUP
	.no_dead_strip	_mga_do_dma_bootstrap
.subsections_via_symbols
