	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_dmablit_active
_via_dmablit_active:                    ## @via_dmablit_active
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %ebx
	movq	%rdi, %r12
	leaq	12(%rdi), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	(%r12), %eax
	movl	%eax, %ecx
	subl	%ebx, %ecx
	cmpl	$8388609, %ecx                  ## imm = 0x800001
	jl	LBB0_1
## %bb.2:
	movl	4(%r12), %edx
	subl	%ebx, %edx
	cmpl	$8388609, %edx                  ## imm = 0x800001
	setl	%cl
	testq	%r14, %r14
	je	LBB0_5
## %bb.3:
	cmpl	$8388608, %edx                  ## imm = 0x800000
	jg	LBB0_5
## %bb.4:
	subl	%eax, %ebx
	addl	8(%r12), %ebx
	movq	_VIA_NUM_BLIT_SLOTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	notl	%eax
	movl	$-1, %ecx
	cmovgl	%eax, %ecx
	addl	%ebx, %ecx
	movslq	%ecx, %rax
	shlq	$2, %rax
	addq	16(%r12), %rax
	movq	%rax, (%r14)
	movb	$1, %cl
	jmp	LBB0_5
LBB0_1:
	xorl	%ecx, %ecx
LBB0_5:
	movzbl	%cl, %ebx
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIA_NUM_BLIT_SLOTS,4,2         ## @VIA_NUM_BLIT_SLOTS
	.no_dead_strip	_via_dmablit_active
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_dmablit_active
_via_dmablit_active:                    ; @via_dmablit_active
	.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	x20, x3
	mov	x22, x2
	mov	x21, x0
	add	x19, x0, #12
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	w8, [x21]
	sub	w9, w8, w22
	cmp	w9, #2048, lsl #12              ; =8388608
	b.le	LBB0_4
; %bb.1:
	ldr	w9, [x21, #4]
	sub	w9, w9, w22
	cmp	w9, #2048, lsl #12              ; =8388608
	cset	w23, le
	cbz	x20, LBB0_5
; %bb.2:
	b.gt	LBB0_5
; %bb.3:
	ldr	w9, [x21, #8]
	sub	w8, w22, w8
	add	w8, w9, w8
Lloh0:
	adrp	x9, _VIA_NUM_BLIT_SLOTS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VIA_NUM_BLIT_SLOTS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	mov	w10, #-1
	csinv	w9, w10, w9, le
	add	w8, w9, w8
	ldr	x9, [x21, #16]
	add	x8, x9, w8, sxtw #2
	str	x8, [x20]
	mov	w23, #1
	b	LBB0_5
LBB0_4:
	mov	w23, #0
LBB0_5:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	x0, x23
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_VIA_NUM_BLIT_SLOTS,4,2         ; @VIA_NUM_BLIT_SLOTS
	.no_dead_strip	_via_dmablit_active
.subsections_via_symbols
