	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function savage_dispatch_dma_prim
_savage_dispatch_dma_prim:              ## @savage_dispatch_dma_prim
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.3:
	movq	%rdx, %r15
	movl	8(%rsi), %edx
	testl	%edx, %edx
	je	LBB0_4
## %bb.5:
	movl	(%rsi), %eax
	xorl	%ebx, %ebx
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	addl	$-128, %eax
	cmpl	$3, %eax
	ja	LBB0_19
## %bb.6:
	movq	%rdi, %r13
	movl	4(%rsi), %r14d
	movl	12(%rsi), %r12d
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_16:
	xorl	%ebx, %ebx
	cmpl	$2, %edx
	ja	LBB0_10
## %bb.17:
	leaq	L_.str.2(%rip), %rdi
	movl	%edx, %esi
	jmp	LBB0_18
LBB0_1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_15
LBB0_4:
	xorl	%r14d, %r14d
	jmp	LBB0_57
LBB0_7:
	movb	$1, %bl
LBB0_8:
	imull	$-1431655765, %edx, %eax        ## imm = 0xAAAAAAAB
	cmpl	$1431655766, %eax               ## imm = 0x55555556
	jb	LBB0_9
## %bb.13:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%edx, %esi
	jmp	LBB0_14
LBB0_19:
	leaq	L_.str.3(%rip), %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
LBB0_18:
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %r14d
	jmp	LBB0_57
LBB0_9:
	movl	$130, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
LBB0_10:
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movl	4(%r13), %edi
	callq	_S3_SAVAGE3D_SERIES
	testq	%rax, %rax
	je	LBB0_20
## %bb.11:
	testl	%r14d, %r14d
	je	LBB0_24
LBB0_12:
	leaq	L_.str.4(%rip), %rdi
	movl	%r14d, %esi
	xorl	%r14d, %r14d
LBB0_14:
	xorl	%eax, %eax
	callq	_DRM_ERROR
LBB0_15:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_57:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_59
## %bb.58:
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	_SAVAGE_SKIP_ALL_S4@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	ja	LBB0_12
## %bb.21:
	movl	%r14d, %eax
	andl	$1, %eax
	movl	%r14d, %ecx
	shll	$30, %ecx
	sarl	$31, %ecx
	subl	%eax, %ecx
	movl	%r14d, %eax
	shll	$29, %eax
	sarl	$31, %eax
	addl	%ecx, %eax
	movl	%r14d, %ecx
	shll	$28, %ecx
	sarl	$31, %ecx
	addl	%eax, %ecx
	movl	%r14d, %eax
	shll	$27, %eax
	sarl	$31, %eax
	addl	%ecx, %eax
	movl	%r14d, %ecx
	shll	$26, %ecx
	sarl	$31, %ecx
	addl	%eax, %ecx
	movl	%r14d, %eax
	shll	$25, %eax
	sarl	$31, %eax
	addl	%ecx, %eax
	movsbl	%r14b, %ecx
	sarl	$7, %ecx
	addl	%ecx, %eax
	addl	$10, %eax
	cmpl	$8, %eax
	jne	LBB0_12
## %bb.22:
	testb	%bl, %bl
	je	LBB0_24
## %bb.23:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_2
LBB0_24:
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	leal	(%r12,%rax), %edx
	movl	(%r15), %eax
	leal	31(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$5, %ecx
	cmpl	%ecx, %edx
	jbe	LBB0_26
## %bb.25:
	decl	%edx
	leaq	L_.str.6(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	jmp	LBB0_15
LBB0_26:
	xorl	%eax, %eax
	callq	_DMA_FLUSH
	movl	4(%r15), %eax
	cmpl	16(%r13), %eax
	je	LBB0_28
## %bb.27:
	movl	$2, %edi
	callq	_BEGIN_BCI
	movq	_SAVAGE_VERTBUFADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_BCI_SET_REGISTERS
	movl	(%r13), %edi
	orl	4(%r15), %edi
	callq	_BCI_WRITE
	movl	4(%r15), %eax
	movl	%eax, 16(%r13)
LBB0_28:
	movl	%r14d, -92(%rbp)                ## 4-byte Spill
	movl	4(%r13), %edi
	callq	_S3_SAVAGE3D_SERIES
	testq	%rax, %rax
	movl	%ebx, -76(%rbp)                 ## 4-byte Spill
	je	LBB0_33
## %bb.29:
	cmpq	$0, 8(%r13)
	je	LBB0_33
## %bb.30:
	movl	$63, %ebx
	movl	$63, %edi
	callq	_BEGIN_BCI
	movq	_BCI_CMD_WAIT@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	callq	_BCI_WRITE
	decl	%ebx
	jne	LBB0_31
## %bb.32:
	movq	$0, 8(%r13)
	movl	-76(%rbp), %ebx                 ## 4-byte Reload
LBB0_33:
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	shll	$25, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	$2863311531, %r13d              ## imm = 0xAAAAAAAB
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_34
	.p2align	4, 0x90
LBB0_40:                                ##   in Loop: Header=BB0_34 Depth=1
	movl	-76(%rbp), %ebx                 ## 4-byte Reload
LBB0_56:                                ##   in Loop: Header=BB0_34 Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	_BCI_CMD_DRAW_CONT@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	subl	%r15d, %eax
	je	LBB0_57
LBB0_34:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_37 Depth 2
                                        ##     Child Loop BB0_45 Depth 2
                                        ##     Child Loop BB0_52 Depth 2
	cmpl	$255, %eax
	movl	$255, %r15d
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	cmovbl	%eax, %r15d
	testb	%bl, %bl
	je	LBB0_41
## %bb.35:                              ##   in Loop: Header=BB0_34 Depth=1
	movl	$-1, -56(%rbp)
	movq	$-1, -64(%rbp)
	movl	%r12d, %eax
	imulq	%r13, %rax
	shrq	$33, %rax
	leal	(%rax,%rax,2), %eax
	movl	%r12d, %ecx
	subl	%eax, %ecx
	movl	$2, -64(%rbp,%rcx,4)
	leal	2(%r15), %edi
	shrl	%edi
	callq	_BEGIN_BCI
	leal	2(%r12), %r14d
	movl	%r15d, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r14d, %edx
	callq	_BCI_DRAW_INDICES_S3D
	leal	1(%r12), %ebx
	addl	%r15d, %r12d
	cmpl	%r12d, %r14d
	jae	LBB0_36
	.p2align	4, 0x90
LBB0_37:                                ##   Parent Loop BB0_34 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r14d, %eax
	imulq	%r13, %rax
	shrq	$33, %rax
	leal	(%rax,%rax,2), %eax
	movl	%r14d, %ecx
	subl	%eax, %ecx
	movl	%ebx, %eax
	imulq	%r13, %rax
	shrq	$33, %rax
	leal	(%rax,%rax,2), %eax
	movl	%ebx, %edx
	subl	%eax, %edx
	movl	-64(%rbp,%rdx,4), %eax
	addl	%ebx, %eax
	movl	-64(%rbp,%rcx,4), %edi
	addl	%ebx, %edi
	shll	$16, %edi
	addl	$65536, %edi                    ## imm = 0x10000
	orl	%eax, %edi
	callq	_BCI_WRITE
	leal	2(%rbx), %edi
	addl	$2, %r14d
	addl	$3, %ebx
	cmpl	%r12d, %ebx
	movl	%edi, %ebx
	jb	LBB0_37
## %bb.38:                              ##   in Loop: Header=BB0_34 Depth=1
	cmpl	%r12d, %edi
	jae	LBB0_40
	jmp	LBB0_39
	.p2align	4, 0x90
LBB0_41:                                ##   in Loop: Header=BB0_34 Depth=1
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movl	4(%rax), %edi
	callq	_S3_SAVAGE3D_SERIES
	testq	%rax, %rax
	je	LBB0_49
## %bb.42:                              ##   in Loop: Header=BB0_34 Depth=1
	leal	2(%r15), %edi
	shrl	%edi
	callq	_BEGIN_BCI
	movl	%r15d, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r12d, %edx
	callq	_BCI_DRAW_INDICES_S3D
	leal	(%r12,%r15), %r14d
	leal	2(%r12), %ebx
	cmpl	%r14d, %ebx
	jae	LBB0_43
## %bb.44:                              ##   in Loop: Header=BB0_34 Depth=1
	shll	$16, %r12d
	addl	$131072, %r12d                  ## imm = 0x20000
	.p2align	4, 0x90
LBB0_45:                                ##   Parent Loop BB0_34 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	-1(%rbx), %edi
	orl	%r12d, %edi
	callq	_BCI_WRITE
	addl	$131072, %r12d                  ## imm = 0x20000
	addl	$2, %ebx
	cmpl	%r14d, %ebx
	jb	LBB0_45
## %bb.46:                              ##   in Loop: Header=BB0_34 Depth=1
	decl	%ebx
	movl	%ebx, %r12d
	jmp	LBB0_47
	.p2align	4, 0x90
LBB0_36:                                ##   in Loop: Header=BB0_34 Depth=1
	movl	%ebx, %edi
	cmpl	%r12d, %edi
	jae	LBB0_40
LBB0_39:                                ##   in Loop: Header=BB0_34 Depth=1
	movl	%edi, %eax
	imulq	%r13, %rax
	shrq	$33, %rax
	leal	(%rax,%rax,2), %eax
	movl	%edi, %ecx
	subl	%eax, %ecx
	addl	-64(%rbp,%rcx,4), %edi
	callq	_BCI_WRITE
	jmp	LBB0_40
LBB0_49:                                ##   in Loop: Header=BB0_34 Depth=1
	leal	3(%r15), %edi
	shrl	%edi
	callq	_BEGIN_BCI
	movl	%r15d, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	-92(%rbp), %edx                 ## 4-byte Reload
	callq	_BCI_DRAW_INDICES_S4
	leal	(%r12,%r15), %r14d
	leal	1(%r12), %eax
	cmpl	%r14d, %eax
	jae	LBB0_50
## %bb.51:                              ##   in Loop: Header=BB0_34 Depth=1
	movl	%r12d, %ebx
	shll	$16, %ebx
	addl	$65536, %ebx                    ## imm = 0x10000
	.p2align	4, 0x90
LBB0_52:                                ##   Parent Loop BB0_34 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ebx, %edi
	orl	%r12d, %edi
	callq	_BCI_WRITE
	leal	2(%r12), %edi
	addl	$131072, %ebx                   ## imm = 0x20000
	addl	$3, %r12d
	cmpl	%r14d, %r12d
	movl	%edi, %r12d
	jb	LBB0_52
	jmp	LBB0_53
LBB0_43:                                ##   in Loop: Header=BB0_34 Depth=1
	incl	%r12d
LBB0_47:                                ##   in Loop: Header=BB0_34 Depth=1
	cmpl	%r14d, %r12d
	movl	-76(%rbp), %ebx                 ## 4-byte Reload
	jae	LBB0_55
## %bb.48:                              ##   in Loop: Header=BB0_34 Depth=1
	movl	%r12d, %edi
	jmp	LBB0_54
LBB0_50:                                ##   in Loop: Header=BB0_34 Depth=1
	movl	%r12d, %edi
LBB0_53:                                ##   in Loop: Header=BB0_34 Depth=1
	cmpl	%r14d, %edi
	movl	-76(%rbp), %ebx                 ## 4-byte Reload
	jae	LBB0_55
LBB0_54:                                ##   in Loop: Header=BB0_34 Depth=1
	callq	_BCI_WRITE
LBB0_55:                                ##   in Loop: Header=BB0_34 Depth=1
	movl	%r14d, %r12d
	jmp	LBB0_56
LBB0_59:
	callq	___stack_chk_fail
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
LJTI0_0:
	.long	L0_0_set_16
	.long	L0_0_set_7
	.long	L0_0_set_8
	.long	L0_0_set_16
	.end_data_region
                                        ## -- End function
	.comm	_BCI_LOCALS,4,2                 ## @BCI_LOCALS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"called without dma buffers!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"wrong number of vertices %u in TRILIST\n"

L_.str.2:                               ## @.str.2
	.asciz	"wrong number of vertices %u in TRIFAN/STRIP\n"

L_.str.3:                               ## @.str.3
	.asciz	"invalid primitive type %u\n"

L_.str.4:                               ## @.str.4
	.asciz	"invalid skip flags 0x%04x for DMA\n"

	.comm	_SAVAGE_SKIP_ALL_S4,4,2         ## @SAVAGE_SKIP_ALL_S4
L_.str.5:                               ## @.str.5
	.asciz	"TRILIST_201 used on Savage4 hardware\n"

L_.str.6:                               ## @.str.6
	.asciz	"vertex indices (%u-%u) out of range (0-%u)\n"

	.comm	_SAVAGE_VERTBUFADDR,4,2         ## @SAVAGE_VERTBUFADDR
	.comm	_BCI_CMD_WAIT,4,2               ## @BCI_CMD_WAIT
	.comm	_BCI_CMD_DRAW_CONT,4,2          ## @BCI_CMD_DRAW_CONT
	.no_dead_strip	_savage_dispatch_dma_prim
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function savage_dispatch_dma_prim
_savage_dispatch_dma_prim:              ; @savage_dispatch_dma_prim
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	cbz	x2, LBB0_6
; %bb.1:
	ldr	w25, [x1, #8]
	cbz	w25, LBB0_7
; %bb.2:
	ldr	w20, [x1]
	sub	w8, w20, #128
	cmp	w8, #3
	b.hi	LBB0_12
; %bb.3:
	mov	x22, x2
	mov	x19, x0
	mov	w26, #0
	ldr	w23, [x1, #4]
	ldr	w21, [x1, #12]
Lloh3:
	adrp	x9, lJTI0_0@PAGE
Lloh4:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_4
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_4:
	cmp	w25, #2
	b.hi	LBB0_11
; %bb.5:
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	str	x25, [sp]
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_25
LBB0_6:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_25
LBB0_7:
	mov	w0, #0
	b	LBB0_26
LBB0_8:
	mov	w26, #1
LBB0_9:
	mov	w8, #43691
	movk	w8, #43690, lsl #16
	mul	w8, w25, w8
	mov	w9, #21846
	movk	w9, #21845, lsl #16
	cmp	w8, w9
	b.lo	LBB0_13
; %bb.10:
	str	x25, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_25
LBB0_11:
	mov	w26, #0
	b	LBB0_14
LBB0_12:
	str	x20, [sp]
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_25
LBB0_13:
	mov	w20, #130
LBB0_14:
	ldr	w0, [x19, #4]
	bl	_S3_SAVAGE3D_SERIES
	cbz	x0, LBB0_17
; %bb.15:
	cbz	w23, LBB0_21
; %bb.16:
	mov	x8, x23
	str	x8, [sp]
	b	LBB0_24
LBB0_17:
Lloh13:
	adrp	x8, _SAVAGE_SKIP_ALL_S4@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SAVAGE_SKIP_ALL_S4@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w23, w8
	b.hi	LBB0_23
; %bb.18:
	and	w8, w23, #0x1
	sbfx	w9, w23, #1, #1
	sub	w8, w9, w8
	lsl	w9, w23, #29
	add	w8, w8, w9, asr #31
	lsl	w9, w23, #28
	add	w8, w8, w9, asr #31
	lsl	w9, w23, #27
	add	w8, w8, w9, asr #31
	lsl	w9, w23, #26
	add	w8, w8, w9, asr #31
	lsl	w9, w23, #25
	add	w8, w8, w9, asr #31
	lsl	w9, w23, #24
	add	w8, w8, w9, asr #31
	add	w8, w8, #10
	cmp	w8, #8
	b.ne	LBB0_23
; %bb.19:
	cbz	w26, LBB0_21
; %bb.20:
Lloh16:
	adrp	x0, l_.str.5@PAGE
Lloh17:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_25
LBB0_21:
	ldr	w8, [x22]
	add	w9, w8, #31
	cmp	w8, #0
	csel	w8, w9, w8, lt
	asr	w8, w8, #5
	add	w9, w21, w25
	cmp	w9, w8
	b.ls	LBB0_28
; %bb.22:
	sub	w9, w9, #1
	stp	x9, x8, [sp, #8]
	str	x21, [sp]
Lloh18:
	adrp	x0, l_.str.6@PAGE
Lloh19:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_25
LBB0_23:
	str	x23, [sp]
LBB0_24:
Lloh20:
	adrp	x0, l_.str.4@PAGE
Lloh21:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_25:
	bl	_DRM_ERROR
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_26:
	ldr	x8, [sp, #56]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_56
; %bb.27:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_28:
	str	x23, [sp, #24]                  ; 8-byte Folded Spill
	bl	_DMA_FLUSH
	ldr	w8, [x22, #4]
	ldr	w9, [x19, #16]
	cmp	w8, w9
	b.eq	LBB0_30
; %bb.29:
	mov	w0, #2
	bl	_BEGIN_BCI
Lloh28:
	adrp	x8, _SAVAGE_VERTBUFADDR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SAVAGE_VERTBUFADDR@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	mov	w1, #1
	bl	_BCI_SET_REGISTERS
	ldr	w8, [x22, #4]
	ldr	w9, [x19]
	orr	w0, w9, w8
	bl	_BCI_WRITE
	ldr	w8, [x22, #4]
	str	w8, [x19, #16]
LBB0_30:
	ldr	w0, [x19, #4]
	bl	_S3_SAVAGE3D_SERIES
	cbz	x0, LBB0_35
; %bb.31:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_35
; %bb.32:
	mov	w22, #63
	mov	w0, #63
	bl	_BEGIN_BCI
Lloh31:
	adrp	x23, _BCI_CMD_WAIT@GOTPAGE
Lloh32:
	ldr	x23, [x23, _BCI_CMD_WAIT@GOTPAGEOFF]
LBB0_33:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	bl	_BCI_WRITE
	subs	w22, w22, #1
	b.ne	LBB0_33
; %bb.34:
	str	xzr, [x19, #8]
LBB0_35:
	str	x19, [sp, #32]                  ; 8-byte Folded Spill
	lsl	w22, w20, #25
	mov	w28, #43691
	movk	w28, #43690, lsl #16
	add	x27, sp, #40
	b	LBB0_38
LBB0_36:                                ;   in Loop: Header=BB0_38 Depth=1
	mov	x26, x19
LBB0_37:                                ;   in Loop: Header=BB0_38 Depth=1
	mov	w0, #0
Lloh33:
	adrp	x8, _BCI_CMD_DRAW_CONT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _BCI_CMD_DRAW_CONT@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	orr	w22, w8, w22
	mov	x21, x20
	subs	w25, w25, w23
	b.eq	LBB0_26
LBB0_38:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_40 Depth 2
                                        ;     Child Loop BB0_45 Depth 2
                                        ;     Child Loop BB0_51 Depth 2
	cmp	w25, #255
	mov	w8, #255
	csel	w23, w25, w8, lo
	cbz	w26, LBB0_42
; %bb.39:                               ;   in Loop: Header=BB0_38 Depth=1
	mov	x19, x26
	mov	x8, #-1
	str	x8, [sp, #40]
	str	w8, [sp, #48]
	umull	x8, w21, w28
	lsr	x8, x8, #33
	add	w8, w8, w8, lsl #1
	sub	w8, w21, w8
	mov	w9, #2
	str	w9, [x27, w8, uxtw #2]
	add	w8, w23, #2
	lsr	w0, w8, #1
	bl	_BEGIN_BCI
	add	w24, w21, #2
	mov	x0, x23
	mov	x1, x22
	mov	x2, x24
	bl	_BCI_DRAW_INDICES_S3D
	add	w26, w21, #1
	add	w20, w21, w23
	cmp	w24, w20
	b.hs	LBB0_47
LBB0_40:                                ;   Parent Loop BB0_38 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	umull	x8, w24, w28
	lsr	x8, x8, #33
	add	w8, w8, w8, lsl #1
	sub	w8, w24, w8
	umull	x9, w26, w28
	lsr	x9, x9, #33
	add	w9, w9, w9, lsl #1
	sub	w9, w26, w9
	ldr	w9, [x27, w9, uxtw #2]
	ldr	w8, [x27, w8, uxtw #2]
	add	w8, w26, w8
	lsl	w8, w8, #16
	add	w8, w8, #16, lsl #12            ; =65536
	add	w9, w26, w9
	orr	w0, w8, w9
	bl	_BCI_WRITE
	add	w8, w26, #2
	add	w24, w24, #2
	add	w9, w26, #3
	mov	x26, x8
	cmp	w9, w20
	b.lo	LBB0_40
; %bb.41:                               ;   in Loop: Header=BB0_38 Depth=1
	cmp	w8, w20
	b.hs	LBB0_36
	b	LBB0_48
LBB0_42:                                ;   in Loop: Header=BB0_38 Depth=1
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	ldr	w0, [x8, #4]
	bl	_S3_SAVAGE3D_SERIES
	cbz	x0, LBB0_49
; %bb.43:                               ;   in Loop: Header=BB0_38 Depth=1
	add	w8, w23, #2
	lsr	w0, w8, #1
	bl	_BEGIN_BCI
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	bl	_BCI_DRAW_INDICES_S3D
	add	w24, w21, #2
	add	w20, w21, w23
	cmp	w24, w20
	b.hs	LBB0_52
; %bb.44:                               ;   in Loop: Header=BB0_38 Depth=1
	lsl	w8, w21, #16
	add	w21, w8, #32, lsl #12           ; =131072
LBB0_45:                                ;   Parent Loop BB0_38 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	w8, w24, #1
	orr	w0, w21, w8
	bl	_BCI_WRITE
	add	w21, w21, #32, lsl #12          ; =131072
	add	w24, w24, #2
	cmp	w24, w20
	b.lo	LBB0_45
; %bb.46:                               ;   in Loop: Header=BB0_38 Depth=1
	sub	w0, w24, #1
	cmp	w0, w20
	b.hs	LBB0_37
	b	LBB0_54
LBB0_47:                                ;   in Loop: Header=BB0_38 Depth=1
	mov	x8, x26
	cmp	w8, w20
	b.hs	LBB0_36
LBB0_48:                                ;   in Loop: Header=BB0_38 Depth=1
	umull	x9, w8, w28
	lsr	x9, x9, #33
	add	w9, w9, w9, lsl #1
	sub	w9, w8, w9
	ldr	w9, [x27, w9, uxtw #2]
	add	w0, w9, w8
	bl	_BCI_WRITE
	b	LBB0_36
LBB0_49:                                ;   in Loop: Header=BB0_38 Depth=1
	add	w8, w23, #3
	lsr	w0, w8, #1
	bl	_BEGIN_BCI
	mov	x0, x23
	mov	x1, x22
	ldr	x2, [sp, #24]                   ; 8-byte Folded Reload
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_BCI_DRAW_INDICES_S4
	add	w8, w21, #1
	add	w20, w21, w23
	cmp	w8, w20
	b.hs	LBB0_55
; %bb.50:                               ;   in Loop: Header=BB0_38 Depth=1
	lsl	w8, w21, #16
	add	w24, w8, #16, lsl #12           ; =65536
LBB0_51:                                ;   Parent Loop BB0_38 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	orr	w0, w24, w21
	bl	_BCI_WRITE
	add	w0, w21, #2
	add	w24, w24, #32, lsl #12          ; =131072
	add	w8, w21, #3
	mov	x21, x0
	cmp	w8, w20
	b.lo	LBB0_51
	b	LBB0_53
LBB0_52:                                ;   in Loop: Header=BB0_38 Depth=1
	add	w0, w21, #1
LBB0_53:                                ;   in Loop: Header=BB0_38 Depth=1
	cmp	w0, w20
	b.hs	LBB0_37
LBB0_54:                                ;   in Loop: Header=BB0_38 Depth=1
	bl	_BCI_WRITE
	b	LBB0_37
LBB0_55:                                ;   in Loop: Header=BB0_38 Depth=1
	mov	x0, x21
	cmp	w0, w20
	b.hs	LBB0_37
	b	LBB0_54
LBB0_56:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_4-LBB0_4)>>2
	.byte	(LBB0_8-LBB0_4)>>2
	.byte	(LBB0_9-LBB0_4)>>2
	.byte	(LBB0_4-LBB0_4)>>2
                                        ; -- End function
	.comm	_BCI_LOCALS,4,2                 ; @BCI_LOCALS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"called without dma buffers!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"wrong number of vertices %u in TRILIST\n"

l_.str.2:                               ; @.str.2
	.asciz	"wrong number of vertices %u in TRIFAN/STRIP\n"

l_.str.3:                               ; @.str.3
	.asciz	"invalid primitive type %u\n"

l_.str.4:                               ; @.str.4
	.asciz	"invalid skip flags 0x%04x for DMA\n"

	.comm	_SAVAGE_SKIP_ALL_S4,4,2         ; @SAVAGE_SKIP_ALL_S4
l_.str.5:                               ; @.str.5
	.asciz	"TRILIST_201 used on Savage4 hardware\n"

l_.str.6:                               ; @.str.6
	.asciz	"vertex indices (%u-%u) out of range (0-%u)\n"

	.comm	_SAVAGE_VERTBUFADDR,4,2         ; @SAVAGE_VERTBUFADDR
	.comm	_BCI_CMD_WAIT,4,2               ; @BCI_CMD_WAIT
	.comm	_BCI_CMD_DRAW_CONT,4,2          ; @BCI_CMD_DRAW_CONT
	.no_dead_strip	_savage_dispatch_dma_prim
.subsections_via_symbols
