	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mga_do_pci_dma_bootstrap
_mga_do_pci_dma_bootstrap:              ## @mga_do_pci_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %r15
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %rbx
	movq	_MGA_WARP_UCODE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	%edx, %eax
	cmoval	%eax, %edx
	movq	__DRM_CONSISTENT@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	__DRM_READ_ONLY@GOTPCREL(%rip), %r14
	movl	(%r14), %r8d
	leaq	24(%rbx), %r9
	xorl	%esi, %esi
	callq	_drm_legacy_addmap
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_17
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EFAULT@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_21
LBB0_4:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %ebx
	testl	%ebx, %ebx
	je	LBB0_8
## %bb.5:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leaq	16(%rax), %r12
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %ecx
	movl	(%r14), %r8d
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	movq	%r12, %r9
	callq	_drm_legacy_addmap
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%ebx, %ecx
	shrl	%ecx
	cmpl	$2, %ebx
	movl	%ecx, %ebx
	jae	LBB0_7
## %bb.22:
	leaq	L_.str.2(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_21
LBB0_8:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	16(%rbx), %rax
	movl	(%rax), %edx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %esi
	cmpl	%esi, %edx
	je	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_INFO
	movq	16(%rbx), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_10:
	movl	4(%r14), %ebx
	testl	%ebx, %ebx
	je	LBB0_11
## %bb.12:
	leaq	-64(%rbp), %r13
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	%ebx, -64(%rbp)
	movl	16(%r14), %eax
	movl	%eax, -60(%rbp)
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_drm_legacy_addbufs_pci
	testl	%eax, %eax
	je	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	decl	%ebx
	jne	LBB0_13
## %bb.15:
	movl	%eax, %r12d
	jmp	LBB0_16
LBB0_11:
	xorl	%r12d, %r12d
LBB0_16:
	leaq	L_.str.4(%rip), %rdi
LBB0_17:
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_21:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movl	4(%r14), %esi
	cmpl	%ebx, %esi
	je	LBB0_20
## %bb.19:
	leaq	L_.str.5(%rip), %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_DRM_INFO
	movl	%ebx, 4(%r14)
LBB0_20:
	xorps	%xmm0, %xmm0
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movups	%xmm0, (%rax)
	movq	$0, 8(%r14)
	leaq	L_.str.6(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_DRM_INFO
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_MGA_WARP_UCODE_SIZE,4,2        ## @MGA_WARP_UCODE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dev->dma is NULL\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	__DRM_CONSISTENT,4,2            ## @_DRM_CONSISTENT
	.comm	__DRM_READ_ONLY,4,2             ## @_DRM_READ_ONLY
L_.str.1:                               ## @.str.1
	.asciz	"Unable to create mapping for WARP microcode: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to allocate primary DMA region: %d\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"Primary DMA buffer size reduced from %u to %u.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Unable to add secondary DMA buffers: %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"Secondary PCI DMA buffer bin count reduced from %u to %u.\n"

L_.str.6:                               ## @.str.6
	.asciz	"Initialized card for PCI DMA.\n"

	.no_dead_strip	_mga_do_pci_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_pci_dma_bootstrap
_mga_do_pci_dma_bootstrap:              ; @mga_do_pci_dma_bootstrap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	ldr	x8, [x0]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	x23, [x0, #8]
Lloh0:
	adrp	x8, _MGA_WARP_UCODE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MGA_WARP_UCODE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x24, __DRM_CONSISTENT@GOTPAGE
Lloh7:
	ldr	x24, [x24, __DRM_CONSISTENT@GOTPAGEOFF]
	cmp	w8, w9
	csel	w2, w8, w9, hi
	ldr	w3, [x24]
Lloh8:
	adrp	x25, __DRM_READ_ONLY@GOTPAGE
Lloh9:
	ldr	x25, [x25, __DRM_READ_ONLY@GOTPAGEOFF]
	ldr	w4, [x25]
	add	x5, x23, #24
	mov	w1, #0
	bl	_drm_legacy_addmap
	cbz	w0, LBB0_5
; %bb.2:
	mov	x21, x0
	str	x21, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	b	LBB0_21
LBB0_3:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh14:
	adrp	x8, _EFAULT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_21
LBB0_5:
	ldr	w21, [x19]
	cbz	w21, LBB0_10
; %bb.6:
	add	x22, x23, #16
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w3, [x24]
	ldr	w4, [x25]
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	mov	x5, x22
	bl	_drm_legacy_addmap
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	lsr	w8, w21, #1
	cmp	w21, #2
	mov	x21, x8
	b.hs	LBB0_7
; %bb.9:
	str	x0, [sp]
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DRM_ERROR
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
LBB0_10:
	ldr	x8, [x23, #16]
	ldr	w9, [x8]
	ldr	w8, [x19]
	cmp	w9, w8
	b.eq	LBB0_12
; %bb.11:
	stp	x8, x9, [sp]
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_INFO
	ldr	x8, [x23, #16]
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_12:
	ldr	w22, [x19, #4]
	cbz	w22, LBB0_16
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w8, [x19, #16]
	stp	w22, w8, [sp, #24]
	add	x1, sp, #24
	mov	x0, x20
	bl	_drm_legacy_addbufs_pci
	cbz	w0, LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	subs	w22, w22, #1
	b.ne	LBB0_13
; %bb.15:
	mov	x21, x0
	b	LBB0_17
LBB0_16:
	mov	w21, #0
LBB0_17:
	str	x21, [sp]
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DRM_ERROR
	b	LBB0_21
LBB0_18:
	ldr	w8, [x19, #4]
	cmp	w8, w22
	b.eq	LBB0_20
; %bb.19:
	stp	x8, x22, [sp]
Lloh24:
	adrp	x0, l_.str.5@PAGE
Lloh25:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_INFO
	str	w22, [x19, #4]
LBB0_20:
	stp	xzr, xzr, [x23]
	str	xzr, [x19, #8]
Lloh26:
	adrp	x0, l_.str.6@PAGE
Lloh27:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DRM_INFO
	mov	w21, #0
LBB0_21:
	mov	x0, x21
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_MGA_WARP_UCODE_SIZE,4,2        ; @MGA_WARP_UCODE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dev->dma is NULL\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	__DRM_CONSISTENT,4,2            ; @_DRM_CONSISTENT
	.comm	__DRM_READ_ONLY,4,2             ; @_DRM_READ_ONLY
l_.str.1:                               ; @.str.1
	.asciz	"Unable to create mapping for WARP microcode: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to allocate primary DMA region: %d\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"Primary DMA buffer size reduced from %u to %u.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Unable to add secondary DMA buffers: %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"Secondary PCI DMA buffer bin count reduced from %u to %u.\n"

l_.str.6:                               ; @.str.6
	.asciz	"Initialized card for PCI DMA.\n"

	.no_dead_strip	_mga_do_pci_dma_bootstrap
.subsections_via_symbols
