	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function savage_do_init_bci
_savage_do_init_bci:                    ## @savage_do_init_bci
	.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, %rbx
	movq	%rdi, %r14
	movq	24(%rdi), %r15
	movl	(%rsi), %esi
	cmpl	$16, %esi
	je	LBB0_2
## %bb.1:
	cmpl	$32, %esi
	jne	LBB0_7
LBB0_2:
	movl	4(%rbx), %ecx
	cmpl	$16, %ecx
	je	LBB0_4
## %bb.3:
	cmpl	$32, %ecx
	jne	LBB0_8
LBB0_4:
	movl	80(%rbx), %eax
	movq	_SAVAGE_DMA_AGP@GOTPCREL(%rip), %r12
	cmpl	(%r12), %eax
	je	LBB0_14
## %bb.5:
	movq	_SAVAGE_DMA_PCI@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	je	LBB0_14
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%eax, %esi
	jmp	LBB0_10
LBB0_7:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
LBB0_9:
	xorl	%ebx, %ebx
LBB0_10:
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_12:
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	92(%rbx), %edx
	movl	%edx, 212(%r15)
	movl	88(%rbx), %edx
	movl	%edx, 208(%r15)
	movl	84(%rbx), %edx
	movl	%edx, 204(%r15)
	movl	%eax, 168(%r15)
	movl	%esi, (%r15)
	movl	76(%rbx), %eax
	movl	%eax, 200(%r15)
	movl	8(%rbx), %eax
	movl	%eax, 4(%r15)
	movl	12(%rbx), %eax
	movl	%eax, 8(%r15)
	movl	%ecx, 12(%r15)
	movl	16(%rbx), %eax
	movl	%eax, 16(%r15)
	movups	60(%rbx), %xmm0
	movups	%xmm0, 184(%r15)
	movq	%r14, %rdi
	callq	_drm_getsarea
	movq	%rax, 112(%r15)
	testq	%rax, %rax
	je	LBB0_18
## %bb.15:
	movq	24(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_19
## %bb.16:
	movq	%r14, %rdi
	callq	_drm_core_findmap
	movq	%rax, 72(%r15)
	testq	%rax, %rax
	jne	LBB0_20
## %bb.17:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_69
LBB0_18:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_69
LBB0_19:
	movq	$0, 72(%r15)
LBB0_20:
	movl	168(%r15), %eax
	cmpl	(%r12), %eax
	jne	LBB0_24
## %bb.21:
	movq	32(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_24
## %bb.22:
	movq	%rsi, (%r14)
	movq	%r14, %rdi
	callq	_drm_core_findmap
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_38
## %bb.23:
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_drm_core_ioremap
	movq	16(%r14), %rax
	cmpl	$0, 8(%rax)
	je	LBB0_51
LBB0_24:
	movq	40(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_27
## %bb.25:
	movq	%r14, %rdi
	callq	_drm_core_findmap
	movq	%rax, 176(%r15)
	testq	%rax, %rax
	jne	LBB0_28
## %bb.26:
	leaq	L_.str.7(%rip), %rdi
	jmp	LBB0_69
LBB0_27:
	movq	$0, 176(%r15)
LBB0_28:
	cmpq	$0, 48(%rbx)
	je	LBB0_31
## %bb.29:
	movq	24(%r15), %rdi
	callq	_S3_SAVAGE3D_SERIES
	testq	%rax, %rax
	je	LBB0_35
## %bb.30:
	leaq	L_.str.8(%rip), %rdi
	jmp	LBB0_69
LBB0_31:
	movq	$0, 160(%r15)
	movq	_savage_dma_flush@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 128(%r15)
	leaq	L_.str.14(%rip), %rdi
	callq	_DRM_DEBUG
	movq	$0, 152(%r15)
	movq	_SAVAGE_FAKE_DMA_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, 148(%r15)
	movq	__DRM_SHM@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 136(%r15)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	movl	%eax, 144(%r15)
	testl	%eax, %eax
	je	LBB0_44
## %bb.32:
	leaq	136(%r15), %rax
	movq	%rax, 160(%r15)
	movq	_savage_fake_dma_flush@GOTPCREL(%rip), %rax
LBB0_33:
	movl	(%rax), %eax
	movl	%eax, 128(%r15)
	movq	24(%r15), %rdi
	movq	112(%r15), %rax
	movslq	56(%rbx), %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	movq	%rcx, 120(%r15)
	movq	_S3_SAVAGE4@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jle	LBB0_45
## %bb.34:
	movq	_SAVAGE_BD_TILE_DEST@GOTPCREL(%rip), %rax
	movl	(%rax), %r11d
	movl	(%r15), %esi
	movl	12(%r15), %ebx
	movl	%r11d, %r12d
	jmp	LBB0_46
LBB0_35:
	movq	8(%r14), %rax
	testq	%rax, %rax
	je	LBB0_39
## %bb.36:
	cmpq	$0, (%rax)
	je	LBB0_39
## %bb.37:
	leaq	L_.str.9(%rip), %rdi
	jmp	LBB0_69
LBB0_38:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_69
LBB0_39:
	movq	48(%rbx), %rsi
	movq	%r14, %rdi
	callq	_drm_core_findmap
	movq	%rax, 160(%r15)
	testq	%rax, %rax
	je	LBB0_54
## %bb.40:
	movl	168(%r15), %edx
	movq	(%rax), %rcx
	cmpl	(%r12), %edx
	jne	LBB0_65
## %bb.41:
	movq	__DRM_AGP@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_67
## %bb.42:
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_drm_core_ioremap
	movq	160(%r15), %rax
	cmpl	$0, 8(%rax)
	jne	LBB0_66
## %bb.43:
	leaq	L_.str.12(%rip), %rdi
	jmp	LBB0_64
LBB0_44:
	leaq	L_.str.15(%rip), %rdi
	jmp	LBB0_64
LBB0_45:
	movl	(%r15), %esi
	cmpl	$16, %esi
	movq	_SAVAGE_BD_TILE_16BPP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_SAVAGE_BD_TILE_32BPP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r11d
	movl	%r11d, %r12d
	cmovel	%eax, %r12d
	movl	12(%r15), %ebx
	cmpl	$16, %ebx
	cmovel	%eax, %r11d
LBB0_46:
	leal	7(%rsi), %ecx
	testl	%esi, %esi
	cmovnsl	%esi, %ecx
	sarl	$3, %ecx
	movl	4(%r15), %eax
	movl	8(%r15), %r8d
	cltd
	idivl	%ecx
	movl	%eax, %r9d
	movl	%r8d, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r8d
	movl	16(%r15), %eax
	leal	7(%rbx), %ecx
	testl	%ebx, %ebx
	cmovnsl	%ebx, %ecx
	sarl	$3, %ecx
	cltd
	idivl	%ecx
	movq	_SAVAGE_BD_BPP_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %r13b
	movl	%r13d, %ecx
	shll	%cl, %esi
	movq	_SAVAGE_BD_TILE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %r10b
	movl	%r10d, %ecx
	shll	%cl, %r12d
	movq	_SAVAGE_BD_BW_DISABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	%edx, %esi
	orl	%r12d, %esi
	orl	%esi, %r9d
	movl	%r9d, 32(%r15)
	orl	%r8d, %esi
	movl	%esi, 36(%r15)
	movl	%r13d, %ecx
	shll	%cl, %ebx
	orl	%edx, %ebx
	movl	%r10d, %ecx
	shll	%cl, %r11d
	orl	%ebx, %r11d
	orl	%eax, %r11d
	movl	%r11d, 40(%r15)
	movq	$0, 64(%r15)
	movq	$0, 104(%r15)
	movq	88(%r15), %rax
	movq	_SAVAGE_BCI_OFFSET@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	movq	%rcx, 96(%r15)
	callq	_S3_SAVAGE3D_SERIES
	testq	%rax, %rax
	jne	LBB0_48
## %bb.47:
	movq	_SAVAGE_FIFO_USED_MASK_S4@GOTPCREL(%rip), %rax
	jmp	LBB0_49
LBB0_48:
	movq	_SAVAGE_FIFO_USED_MASK_S3D@GOTPCREL(%rip), %rax
LBB0_49:
	movl	(%rax), %eax
	movl	%eax, 80(%r15)
	movq	72(%r15), %rax
	testq	%rax, %rax
	je	LBB0_52
## %bb.50:
	movq	(%rax), %rax
	movq	%rax, 56(%r15)
	movq	_savage_bci_wait_fifo_shadow@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 52(%r15)
	movq	_savage_bci_wait_event_shadow@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 48(%r15)
	movq	64(%r15), %rcx
	movq	%rcx, 8184(%rax)
	jmp	LBB0_57
LBB0_51:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_64
LBB0_52:
	movq	$0, 56(%r15)
	movq	24(%r15), %rdi
	callq	_S3_SAVAGE3D_SERIES
	testq	%rax, %rax
	jne	LBB0_55
## %bb.53:
	movq	_savage_bci_wait_fifo_s4@GOTPCREL(%rip), %rax
	jmp	LBB0_56
LBB0_54:
	leaq	L_.str.10(%rip), %rdi
	jmp	LBB0_69
LBB0_55:
	movq	_savage_bci_wait_fifo_s3d@GOTPCREL(%rip), %rax
LBB0_56:
	movl	(%rax), %eax
	movl	%eax, 52(%r15)
	movq	_savage_bci_wait_event_reg@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r15)
LBB0_57:
	movq	24(%r15), %rdi
	callq	_S3_SAVAGE3D_SERIES
	testq	%rax, %rax
	jne	LBB0_59
## %bb.58:
	movq	_savage_emit_clip_rect_s4@GOTPCREL(%rip), %rax
	jmp	LBB0_60
LBB0_59:
	movq	_savage_emit_clip_rect_s3d@GOTPCREL(%rip), %rax
LBB0_60:
	movl	(%rax), %eax
	movl	%eax, 44(%r15)
	movq	%r14, %rdi
	callq	_savage_freelist_init
	testq	%rax, %rax
	js	LBB0_63
## %bb.61:
	movq	%r15, %rdi
	callq	_savage_dma_init
	xorl	%ebx, %ebx
	testq	%rax, %rax
	jns	LBB0_13
## %bb.62:
	leaq	L_.str.17(%rip), %rdi
	jmp	LBB0_64
LBB0_63:
	leaq	L_.str.16(%rip), %rdi
LBB0_64:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	%r14, %rdi
	callq	_savage_do_cleanup_bci
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_65:
	movq	__DRM_CONSISTENT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_68
LBB0_66:
	movq	_savage_dma_flush@GOTPCREL(%rip), %rax
	jmp	LBB0_33
LBB0_67:
	leaq	L_.str.11(%rip), %rdi
	jmp	LBB0_69
LBB0_68:
	leaq	L_.str.13(%rip), %rdi
LBB0_69:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	%r14, %rdi
	callq	_savage_do_cleanup_bci
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid frame buffer bpp %d!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"invalid depth buffer bpp %d!\n"

	.comm	_SAVAGE_DMA_AGP,4,2             ## @SAVAGE_DMA_AGP
	.comm	_SAVAGE_DMA_PCI,4,2             ## @SAVAGE_DMA_PCI
L_.str.2:                               ## @.str.2
	.asciz	"invalid dma memory type %d!\n"

L_.str.3:                               ## @.str.3
	.asciz	"could not find sarea!\n"

L_.str.4:                               ## @.str.4
	.asciz	"could not find shadow status region!\n"

L_.str.5:                               ## @.str.5
	.asciz	"could not find DMA buffer region!\n"

L_.str.6:                               ## @.str.6
	.asciz	"failed to ioremap DMA buffer region!\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.7:                               ## @.str.7
	.asciz	"could not find agp texture region!\n"

L_.str.8:                               ## @.str.8
	.asciz	"command DMA not supported on Savage3D/MX/IX.\n"

L_.str.9:                               ## @.str.9
	.asciz	"command and vertex DMA not supported at the same time.\n"

L_.str.10:                              ## @.str.10
	.asciz	"could not find command DMA region!\n"

	.comm	__DRM_AGP,8,3                   ## @_DRM_AGP
L_.str.11:                              ## @.str.11
	.asciz	"AGP command DMA region is not a _DRM_AGP map!\n"

L_.str.12:                              ## @.str.12
	.asciz	"failed to ioremap command DMA region!\n"

	.comm	__DRM_CONSISTENT,8,3            ## @_DRM_CONSISTENT
L_.str.13:                              ## @.str.13
	.asciz	"PCI command DMA region is not a _DRM_CONSISTENT map!\n"

	.comm	_savage_dma_flush,4,2           ## @savage_dma_flush
L_.str.14:                              ## @.str.14
	.asciz	"falling back to faked command DMA.\n"

	.comm	_SAVAGE_FAKE_DMA_SIZE,4,2       ## @SAVAGE_FAKE_DMA_SIZE
	.comm	__DRM_SHM,8,3                   ## @_DRM_SHM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.15:                              ## @.str.15
	.asciz	"could not allocate faked DMA buffer!\n"

	.comm	_savage_fake_dma_flush,4,2      ## @savage_fake_dma_flush
	.comm	_S3_SAVAGE4,8,3                 ## @S3_SAVAGE4
	.comm	_SAVAGE_BD_TILE_16BPP,4,2       ## @SAVAGE_BD_TILE_16BPP
	.comm	_SAVAGE_BD_TILE_32BPP,4,2       ## @SAVAGE_BD_TILE_32BPP
	.comm	_SAVAGE_BD_TILE_DEST,4,2        ## @SAVAGE_BD_TILE_DEST
	.comm	_SAVAGE_BD_BW_DISABLE,4,2       ## @SAVAGE_BD_BW_DISABLE
	.comm	_SAVAGE_BD_BPP_SHIFT,4,2        ## @SAVAGE_BD_BPP_SHIFT
	.comm	_SAVAGE_BD_TILE_SHIFT,4,2       ## @SAVAGE_BD_TILE_SHIFT
	.comm	_SAVAGE_BCI_OFFSET,4,2          ## @SAVAGE_BCI_OFFSET
	.comm	_SAVAGE_FIFO_USED_MASK_S3D,4,2  ## @SAVAGE_FIFO_USED_MASK_S3D
	.comm	_SAVAGE_FIFO_USED_MASK_S4,4,2   ## @SAVAGE_FIFO_USED_MASK_S4
	.comm	_savage_bci_wait_fifo_shadow,4,2 ## @savage_bci_wait_fifo_shadow
	.comm	_savage_bci_wait_event_shadow,4,2 ## @savage_bci_wait_event_shadow
	.comm	_savage_bci_wait_fifo_s3d,4,2   ## @savage_bci_wait_fifo_s3d
	.comm	_savage_bci_wait_fifo_s4,4,2    ## @savage_bci_wait_fifo_s4
	.comm	_savage_bci_wait_event_reg,4,2  ## @savage_bci_wait_event_reg
	.comm	_savage_emit_clip_rect_s3d,4,2  ## @savage_emit_clip_rect_s3d
	.comm	_savage_emit_clip_rect_s4,4,2   ## @savage_emit_clip_rect_s4
L_.str.16:                              ## @.str.16
	.asciz	"could not initialize freelist\n"

L_.str.17:                              ## @.str.17
	.asciz	"could not initialize command DMA\n"

	.no_dead_strip	_savage_do_init_bci
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function savage_do_init_bci
_savage_do_init_bci:                    ; @savage_do_init_bci
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x0, #24]
	ldr	w8, [x1]
	cmp	w8, #16
	b.eq	LBB0_2
; %bb.1:
	cmp	w8, #32
	b.ne	LBB0_9
LBB0_2:
	ldr	w9, [x21, #4]
	cmp	w9, #16
	b.eq	LBB0_4
; %bb.3:
	cmp	w9, #32
	b.ne	LBB0_10
LBB0_4:
	ldr	w10, [x21, #80]
Lloh0:
	adrp	x22, _SAVAGE_DMA_AGP@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SAVAGE_DMA_AGP@GOTPAGEOFF]
	ldr	w11, [x22]
Lloh2:
	adrp	x12, _SAVAGE_DMA_PCI@GOTPAGE
Lloh3:
	ldr	x12, [x12, _SAVAGE_DMA_PCI@GOTPAGEOFF]
Lloh4:
	ldr	w12, [x12]
	cmp	w10, w11
	ccmp	w10, w12, #4, ne
	b.ne	LBB0_11
; %bb.5:
	ldr	w11, [x21, #92]
	str	w11, [x20, #212]
	str	w10, [x20, #168]
	str	w8, [x20]
	ldur	d0, [x21, #84]
	ldr	d1, [x21, #72]
	mov.d	v1[1], v0[0]
	stur	q1, [x20, #196]
	ldr	d0, [x21, #8]
	stur	d0, [x20, #4]
	ldr	w8, [x21, #68]
	str	w8, [x20, #192]
	ldr	w8, [x21, #16]
	stp	w9, w8, [x20, #12]
	ldur	d0, [x21, #60]
	str	d0, [x20, #184]
	mov	x0, x19
	bl	_drm_getsarea
	str	x0, [x20, #112]
	cbz	x0, LBB0_16
; %bb.6:
	ldr	x1, [x21, #24]
	cbz	x1, LBB0_17
; %bb.7:
	mov	x0, x19
	bl	_drm_core_findmap
	str	x0, [x20, #72]
	cbnz	x0, LBB0_18
; %bb.8:
Lloh5:
	adrp	x0, l_.str.4@PAGE
Lloh6:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_59
LBB0_9:
	str	x8, [sp]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_12
LBB0_10:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	str	x8, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_11:
	str	x10, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_12:
	bl	_DRM_ERROR
LBB0_13:
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	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
	add	sp, sp, #64
	ret
LBB0_16:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_59
LBB0_17:
	str	xzr, [x20, #72]
LBB0_18:
	ldr	w8, [x20, #168]
	ldr	w9, [x22]
	cmp	w8, w9
	b.ne	LBB0_22
; %bb.19:
	ldr	x1, [x21, #32]
	cbz	x1, LBB0_22
; %bb.20:
	str	x1, [x19]
	mov	x0, x19
	bl	_drm_core_findmap
	str	x0, [x19, #16]
	cbz	x0, LBB0_36
; %bb.21:
	mov	x1, x19
	bl	_drm_core_ioremap
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #8]
	cbz	w8, LBB0_46
LBB0_22:
	ldr	x1, [x21, #40]
	cbz	x1, LBB0_25
; %bb.23:
	mov	x0, x19
	bl	_drm_core_findmap
	str	x0, [x20, #176]
	cbnz	x0, LBB0_26
; %bb.24:
Lloh17:
	adrp	x0, l_.str.7@PAGE
Lloh18:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_59
LBB0_25:
	str	xzr, [x20, #176]
LBB0_26:
	ldr	x8, [x21, #48]
	cbz	x8, LBB0_29
; %bb.27:
	ldr	x0, [x20, #24]
	bl	_S3_SAVAGE3D_SERIES
	cbz	x0, LBB0_33
; %bb.28:
Lloh19:
	adrp	x0, l_.str.8@PAGE
Lloh20:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_59
LBB0_29:
	str	xzr, [x20, #160]
Lloh21:
	adrp	x8, _savage_dma_flush@GOTPAGE
Lloh22:
	ldr	x8, [x8, _savage_dma_flush@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x20, #128]
Lloh24:
	adrp	x0, l_.str.14@PAGE
Lloh25:
	add	x0, x0, l_.str.14@PAGEOFF
	bl	_DRM_DEBUG
Lloh26:
	adrp	x8, __DRM_SHM@GOTPAGE
Lloh27:
	ldr	x8, [x8, __DRM_SHM@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	mov	x22, x20
	str	x8, [x22, #136]!
Lloh29:
	adrp	x8, _SAVAGE_FAKE_DMA_SIZE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SAVAGE_FAKE_DMA_SIZE@GOTPAGEOFF]
	str	xzr, [x22, #16]
Lloh31:
	ldr	w0, [x8]
	str	w0, [x22, #12]
Lloh32:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	bl	_kmalloc
	str	w0, [x22, #8]
	cbz	w0, LBB0_42
; %bb.30:
	str	x22, [x20, #160]
Lloh35:
	adrp	x8, _savage_fake_dma_flush@GOTPAGE
Lloh36:
	ldr	x8, [x8, _savage_fake_dma_flush@GOTPAGEOFF]
LBB0_31:
	ldr	w8, [x8]
	str	w8, [x20, #128]
	ldr	x8, [x20, #112]
	ldr	x8, [x8]
	ldrsw	x9, [x21, #56]
	add	x8, x8, x9, lsl #2
	str	x8, [x20, #120]
	ldr	x0, [x20, #24]
Lloh37:
	adrp	x8, _S3_SAVAGE4@GOTPAGE
Lloh38:
	ldr	x8, [x8, _S3_SAVAGE4@GOTPAGEOFF]
Lloh39:
	ldr	x8, [x8]
	cmp	x0, x8
	b.le	LBB0_43
; %bb.32:
Lloh40:
	adrp	x8, _SAVAGE_BD_TILE_DEST@GOTPAGE
Lloh41:
	ldr	x8, [x8, _SAVAGE_BD_TILE_DEST@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	ldr	w10, [x20]
	ldr	w9, [x20, #12]
	mov	x11, x8
	b	LBB0_44
LBB0_33:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_37
; %bb.34:
	ldr	x8, [x8]
	cbz	x8, LBB0_37
; %bb.35:
Lloh43:
	adrp	x0, l_.str.9@PAGE
Lloh44:
	add	x0, x0, l_.str.9@PAGEOFF
	b	LBB0_59
LBB0_36:
Lloh45:
	adrp	x0, l_.str.5@PAGE
Lloh46:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_59
LBB0_37:
	ldr	x1, [x21, #48]
	mov	x0, x19
	bl	_drm_core_findmap
	str	x0, [x20, #160]
	cbz	x0, LBB0_54
; %bb.38:
	ldr	w9, [x20, #168]
	ldr	w10, [x22]
	ldr	x8, [x0]
	cmp	w9, w10
	b.ne	LBB0_55
; %bb.39:
Lloh47:
	adrp	x9, __DRM_AGP@GOTPAGE
Lloh48:
	ldr	x9, [x9, __DRM_AGP@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_57
; %bb.40:
	mov	x1, x19
	bl	_drm_core_ioremap
	ldr	x8, [x20, #160]
	ldr	w8, [x8, #8]
	cbnz	w8, LBB0_56
; %bb.41:
Lloh50:
	adrp	x0, l_.str.12@PAGE
Lloh51:
	add	x0, x0, l_.str.12@PAGEOFF
	b	LBB0_53
LBB0_42:
Lloh52:
	adrp	x0, l_.str.15@PAGE
Lloh53:
	add	x0, x0, l_.str.15@PAGEOFF
	b	LBB0_53
LBB0_43:
	ldr	w10, [x20]
Lloh54:
	adrp	x8, _SAVAGE_BD_TILE_16BPP@GOTPAGE
Lloh55:
	ldr	x8, [x8, _SAVAGE_BD_TILE_16BPP@GOTPAGEOFF]
Lloh56:
	ldr	w8, [x8]
Lloh57:
	adrp	x9, _SAVAGE_BD_TILE_32BPP@GOTPAGE
Lloh58:
	ldr	x9, [x9, _SAVAGE_BD_TILE_32BPP@GOTPAGEOFF]
Lloh59:
	ldr	w12, [x9]
	cmp	w10, #16
	csel	w11, w8, w12, eq
	ldr	w9, [x20, #12]
	cmp	w9, #16
	csel	w8, w8, w12, eq
LBB0_44:
	add	w12, w10, #7
	cmp	w10, #0
	csel	w12, w12, w10, lt
	asr	w12, w12, #3
	ldp	w13, w14, [x20, #4]
	sdiv	w13, w13, w12
	sdiv	w12, w14, w12
	ldr	w14, [x20, #16]
	add	w15, w9, #7
	cmp	w9, #0
	csel	w15, w15, w9, lt
	asr	w15, w15, #3
Lloh60:
	adrp	x16, _SAVAGE_BD_BW_DISABLE@GOTPAGE
Lloh61:
	ldr	x16, [x16, _SAVAGE_BD_BW_DISABLE@GOTPAGEOFF]
Lloh62:
	adrp	x17, _SAVAGE_BD_BPP_SHIFT@GOTPAGE
Lloh63:
	ldr	x17, [x17, _SAVAGE_BD_BPP_SHIFT@GOTPAGEOFF]
Lloh64:
	ldr	w16, [x16]
Lloh65:
	ldr	w17, [x17]
	lsl	w10, w10, w17
	orr	w10, w10, w16
	orr	w13, w10, w13
	orr	w10, w10, w12
Lloh66:
	adrp	x12, _SAVAGE_BD_TILE_SHIFT@GOTPAGE
Lloh67:
	ldr	x12, [x12, _SAVAGE_BD_TILE_SHIFT@GOTPAGEOFF]
Lloh68:
	ldr	w12, [x12]
	lsl	w11, w11, w12
	orr	w13, w13, w11
	orr	w10, w10, w11
	stp	w13, w10, [x20, #32]
	sdiv	w10, w14, w15
	orr	w10, w16, w10
	lsl	w9, w9, w17
	orr	w9, w10, w9
	lsl	w8, w8, w12
	orr	w8, w9, w8
	str	w8, [x20, #40]
	str	xzr, [x20, #64]
	ldr	x8, [x20, #88]
	ldr	x8, [x8]
Lloh69:
	adrp	x9, _SAVAGE_BCI_OFFSET@GOTPAGE
Lloh70:
	ldr	x9, [x9, _SAVAGE_BCI_OFFSET@GOTPAGEOFF]
Lloh71:
	ldrsw	x9, [x9]
	add	x8, x8, x9, lsl #2
	stp	x8, xzr, [x20, #96]
	bl	_S3_SAVAGE3D_SERIES
Lloh72:
	adrp	x8, _SAVAGE_FIFO_USED_MASK_S4@GOTPAGE
Lloh73:
	ldr	x8, [x8, _SAVAGE_FIFO_USED_MASK_S4@GOTPAGEOFF]
Lloh74:
	adrp	x9, _SAVAGE_FIFO_USED_MASK_S3D@GOTPAGE
Lloh75:
	ldr	x9, [x9, _SAVAGE_FIFO_USED_MASK_S3D@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	str	w8, [x20, #80]
	ldr	x8, [x20, #72]
	cbz	x8, LBB0_47
; %bb.45:
	ldr	x8, [x8]
	str	x8, [x20, #56]
Lloh76:
	adrp	x9, _savage_bci_wait_fifo_shadow@GOTPAGE
Lloh77:
	ldr	x9, [x9, _savage_bci_wait_fifo_shadow@GOTPAGEOFF]
Lloh78:
	adrp	x10, _savage_bci_wait_event_shadow@GOTPAGE
Lloh79:
	ldr	x10, [x10, _savage_bci_wait_event_shadow@GOTPAGEOFF]
Lloh80:
	ldr	w9, [x9]
Lloh81:
	ldr	w10, [x10]
	stp	w10, w9, [x20, #48]
	ldr	x9, [x20, #64]
	str	x9, [x8, #8184]
	b	LBB0_48
LBB0_46:
Lloh82:
	adrp	x0, l_.str.6@PAGE
Lloh83:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_53
LBB0_47:
	str	xzr, [x20, #56]
	ldr	x0, [x20, #24]
	bl	_S3_SAVAGE3D_SERIES
Lloh84:
	adrp	x8, _savage_bci_wait_fifo_s4@GOTPAGE
Lloh85:
	ldr	x8, [x8, _savage_bci_wait_fifo_s4@GOTPAGEOFF]
Lloh86:
	adrp	x9, _savage_bci_wait_fifo_s3d@GOTPAGE
Lloh87:
	ldr	x9, [x9, _savage_bci_wait_fifo_s3d@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
Lloh88:
	adrp	x9, _savage_bci_wait_event_reg@GOTPAGE
Lloh89:
	ldr	x9, [x9, _savage_bci_wait_event_reg@GOTPAGEOFF]
Lloh90:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #48]
LBB0_48:
	ldr	x0, [x20, #24]
	bl	_S3_SAVAGE3D_SERIES
Lloh91:
	adrp	x8, _savage_emit_clip_rect_s4@GOTPAGE
Lloh92:
	ldr	x8, [x8, _savage_emit_clip_rect_s4@GOTPAGEOFF]
Lloh93:
	adrp	x9, _savage_emit_clip_rect_s3d@GOTPAGE
Lloh94:
	ldr	x9, [x9, _savage_emit_clip_rect_s3d@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	str	w8, [x20, #44]
	mov	x0, x19
	bl	_savage_freelist_init
	tbnz	x0, #63, LBB0_51
; %bb.49:
	mov	x0, x20
	bl	_savage_dma_init
	tbnz	x0, #63, LBB0_52
; %bb.50:
	mov	w0, #0
	b	LBB0_15
LBB0_51:
Lloh95:
	adrp	x0, l_.str.16@PAGE
Lloh96:
	add	x0, x0, l_.str.16@PAGEOFF
	b	LBB0_53
LBB0_52:
Lloh97:
	adrp	x0, l_.str.17@PAGE
Lloh98:
	add	x0, x0, l_.str.17@PAGEOFF
LBB0_53:
	bl	_DRM_ERROR
	mov	x0, x19
	bl	_savage_do_cleanup_bci
Lloh99:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh100:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_14
LBB0_54:
Lloh101:
	adrp	x0, l_.str.10@PAGE
Lloh102:
	add	x0, x0, l_.str.10@PAGEOFF
	b	LBB0_59
LBB0_55:
Lloh103:
	adrp	x9, __DRM_CONSISTENT@GOTPAGE
Lloh104:
	ldr	x9, [x9, __DRM_CONSISTENT@GOTPAGEOFF]
Lloh105:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_58
LBB0_56:
Lloh106:
	adrp	x8, _savage_dma_flush@GOTPAGE
Lloh107:
	ldr	x8, [x8, _savage_dma_flush@GOTPAGEOFF]
	b	LBB0_31
LBB0_57:
Lloh108:
	adrp	x0, l_.str.11@PAGE
Lloh109:
	add	x0, x0, l_.str.11@PAGEOFF
	b	LBB0_59
LBB0_58:
Lloh110:
	adrp	x0, l_.str.13@PAGE
Lloh111:
	add	x0, x0, l_.str.13@PAGEOFF
LBB0_59:
	bl	_DRM_ERROR
	mov	x0, x19
	bl	_savage_do_cleanup_bci
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGot	Lloh74, Lloh75
	.loh AdrpLdrGot	Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh64
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh81
	.loh AdrpLdrGotLdr	Lloh76, Lloh77, Lloh80
	.loh AdrpAdd	Lloh82, Lloh83
	.loh AdrpLdrGotLdr	Lloh88, Lloh89, Lloh90
	.loh AdrpLdrGot	Lloh86, Lloh87
	.loh AdrpLdrGot	Lloh84, Lloh85
	.loh AdrpLdrGot	Lloh93, Lloh94
	.loh AdrpLdrGot	Lloh91, Lloh92
	.loh AdrpAdd	Lloh95, Lloh96
	.loh AdrpAdd	Lloh97, Lloh98
	.loh AdrpLdrGot	Lloh99, Lloh100
	.loh AdrpAdd	Lloh101, Lloh102
	.loh AdrpLdrGotLdr	Lloh103, Lloh104, Lloh105
	.loh AdrpLdrGot	Lloh106, Lloh107
	.loh AdrpAdd	Lloh108, Lloh109
	.loh AdrpAdd	Lloh110, Lloh111
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid frame buffer bpp %d!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"invalid depth buffer bpp %d!\n"

	.comm	_SAVAGE_DMA_AGP,4,2             ; @SAVAGE_DMA_AGP
	.comm	_SAVAGE_DMA_PCI,4,2             ; @SAVAGE_DMA_PCI
l_.str.2:                               ; @.str.2
	.asciz	"invalid dma memory type %d!\n"

l_.str.3:                               ; @.str.3
	.asciz	"could not find sarea!\n"

l_.str.4:                               ; @.str.4
	.asciz	"could not find shadow status region!\n"

l_.str.5:                               ; @.str.5
	.asciz	"could not find DMA buffer region!\n"

l_.str.6:                               ; @.str.6
	.asciz	"failed to ioremap DMA buffer region!\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.7:                               ; @.str.7
	.asciz	"could not find agp texture region!\n"

l_.str.8:                               ; @.str.8
	.asciz	"command DMA not supported on Savage3D/MX/IX.\n"

l_.str.9:                               ; @.str.9
	.asciz	"command and vertex DMA not supported at the same time.\n"

l_.str.10:                              ; @.str.10
	.asciz	"could not find command DMA region!\n"

	.comm	__DRM_AGP,8,3                   ; @_DRM_AGP
l_.str.11:                              ; @.str.11
	.asciz	"AGP command DMA region is not a _DRM_AGP map!\n"

l_.str.12:                              ; @.str.12
	.asciz	"failed to ioremap command DMA region!\n"

	.comm	__DRM_CONSISTENT,8,3            ; @_DRM_CONSISTENT
l_.str.13:                              ; @.str.13
	.asciz	"PCI command DMA region is not a _DRM_CONSISTENT map!\n"

	.comm	_savage_dma_flush,4,2           ; @savage_dma_flush
l_.str.14:                              ; @.str.14
	.asciz	"falling back to faked command DMA.\n"

	.comm	_SAVAGE_FAKE_DMA_SIZE,4,2       ; @SAVAGE_FAKE_DMA_SIZE
	.comm	__DRM_SHM,8,3                   ; @_DRM_SHM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.15:                              ; @.str.15
	.asciz	"could not allocate faked DMA buffer!\n"

	.comm	_savage_fake_dma_flush,4,2      ; @savage_fake_dma_flush
	.comm	_S3_SAVAGE4,8,3                 ; @S3_SAVAGE4
	.comm	_SAVAGE_BD_TILE_16BPP,4,2       ; @SAVAGE_BD_TILE_16BPP
	.comm	_SAVAGE_BD_TILE_32BPP,4,2       ; @SAVAGE_BD_TILE_32BPP
	.comm	_SAVAGE_BD_TILE_DEST,4,2        ; @SAVAGE_BD_TILE_DEST
	.comm	_SAVAGE_BD_BW_DISABLE,4,2       ; @SAVAGE_BD_BW_DISABLE
	.comm	_SAVAGE_BD_BPP_SHIFT,4,2        ; @SAVAGE_BD_BPP_SHIFT
	.comm	_SAVAGE_BD_TILE_SHIFT,4,2       ; @SAVAGE_BD_TILE_SHIFT
	.comm	_SAVAGE_BCI_OFFSET,4,2          ; @SAVAGE_BCI_OFFSET
	.comm	_SAVAGE_FIFO_USED_MASK_S3D,4,2  ; @SAVAGE_FIFO_USED_MASK_S3D
	.comm	_SAVAGE_FIFO_USED_MASK_S4,4,2   ; @SAVAGE_FIFO_USED_MASK_S4
	.comm	_savage_bci_wait_fifo_shadow,4,2 ; @savage_bci_wait_fifo_shadow
	.comm	_savage_bci_wait_event_shadow,4,2 ; @savage_bci_wait_event_shadow
	.comm	_savage_bci_wait_fifo_s3d,4,2   ; @savage_bci_wait_fifo_s3d
	.comm	_savage_bci_wait_fifo_s4,4,2    ; @savage_bci_wait_fifo_s4
	.comm	_savage_bci_wait_event_reg,4,2  ; @savage_bci_wait_event_reg
	.comm	_savage_emit_clip_rect_s3d,4,2  ; @savage_emit_clip_rect_s3d
	.comm	_savage_emit_clip_rect_s4,4,2   ; @savage_emit_clip_rect_s4
l_.str.16:                              ; @.str.16
	.asciz	"could not initialize freelist\n"

l_.str.17:                              ; @.str.17
	.asciz	"could not initialize command DMA\n"

	.no_dead_strip	_savage_do_init_bci
.subsections_via_symbols
