	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_dmablit
_via_dmablit:                           ## @via_dmablit
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	cmpq	$0, 16(%rsi)
	sete	%r13b
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rax), %r14
	leaq	(,%r13,4), %r15
	addq	%r13, %r15
	leaq	(%r14,%r15,8), %r12
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_via_dmablit_grab_slot
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r14
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_via_build_sg_info
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_via_dmablit_release_slot
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_via_dmablit_release_slot
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_8:
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	leaq	(%r15,%rbx,8), %r14
	addq	$8, %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rsi
	movq	32(%r15,%rbx,8), %r8
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	(%rdi), %rcx
	leaq	1(%rcx), %rdx
	movq	%rdx, (%rdi)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r8,%rcx,8)
	movq	_VIA_NUM_BLIT_SLOTS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jl	LBB0_10
## %bb.9:
	movq	$0, (%rdi)
LBB0_10:
	incl	24(%rsi,%rbx,8)
	movq	16(%rsi,%rbx,8), %rax
	incq	%rax
	movq	%rax, 16(%rsi,%rbx,8)
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rax, 8(%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	movl	%r13d, (%rbx)
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	callq	_via_dmablit_handler
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Called without initialization.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VIA_NUM_BLIT_SLOTS,8,3         ## @VIA_NUM_BLIT_SLOTS
	.no_dead_strip	_via_dmablit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_dmablit
_via_dmablit:                           ; @via_dmablit
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	x8, [x0]
	cbz	x8, LBB0_5
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldr	x9, [x1, #16]
	cmp	x9, #0
	cset	w21, eq
	ldr	x25, [x8]
	mov	w8, #40
	umaddl	x22, w21, w8, x25
	mov	x0, x22
	mov	x1, x21
	bl	_via_dmablit_grab_slot
	mov	x24, x0
	cbnz	w0, LBB0_7
; %bb.2:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.3:
	mov	x23, x0
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	bl	_via_build_sg_info
	cbz	w0, LBB0_9
; %bb.4:
	mov	x24, x0
	mov	x0, x22
	bl	_via_dmablit_release_slot
	mov	x0, x23
	bl	_kfree
	b	LBB0_7
LBB0_5:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_7:
	mov	x0, x24
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_8:
	mov	x0, x22
	bl	_via_dmablit_release_slot
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_9:
	mov	w8, #40
	madd	x26, x21, x8, x25
	add	x24, x26, #8
	mov	x0, x24
	bl	_spin_lock_irqsave
	ldr	x8, [x26, #32]
	ldr	x9, [x22]
	add	x10, x9, #1
	str	x10, [x22]
	str	x23, [x8, x9, lsl #3]
Lloh9:
	adrp	x8, _VIA_NUM_BLIT_SLOTS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VIA_NUM_BLIT_SLOTS@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x10, x8
	b.lt	LBB0_11
; %bb.10:
	str	xzr, [x22]
LBB0_11:
	mov	w8, #40
	madd	x8, x21, x8, x25
	ldr	w9, [x8, #24]
	add	w9, w9, #1
	str	w9, [x8, #24]
	ldr	x9, [x8, #16]
	add	x9, x9, #1
	str	x9, [x8, #16]
	str	x9, [x20, #8]
	mov	x0, x24
	bl	_spin_unlock_irqrestore
	str	w21, [x20]
	mov	x0, x19
	mov	x1, x21
	mov	w2, #0
	bl	_via_dmablit_handler
	mov	w24, #0
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Called without initialization.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VIA_NUM_BLIT_SLOTS,8,3         ; @VIA_NUM_BLIT_SLOTS
	.no_dead_strip	_via_dmablit
.subsections_via_symbols
