	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vpdma_firmware_cb
_vpdma_firmware_cb:                     ## @vpdma_firmware_cb
	.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
	movq	%rdi, %r13
	movq	%rsi, %r14
	movq	(%rsi), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	testq	%r13, %r13
	je	LBB0_12
## %bb.1:
	cmpl	$0, 4(%r13)
	je	LBB0_12
## %bb.2:
	movq	_VPDMA_LIST_ATTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VPDMA_LIST_RDY_MASK@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	_VPDMA_LIST_RDY_SHFT@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movq	%r14, %rdi
	movq	%r14, %rbx
	callq	_read_field_reg
	testq	%rax, %rax
	je	LBB0_3
## %bb.13:
	movq	%rbx, %rax
	movq	(%rbx), %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*8(%rax)                        ## TAILCALL
LBB0_12:
	movq	(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_3:
	movl	(%r13), %esi
	leaq	-56(%rbp), %rdi
	callq	_vpdma_alloc_desc_buf
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_11
LBB0_5:
	movl	-48(%rbp), %edi
	movl	(%r13), %edx
	movl	4(%r13), %esi
	callq	_memcpy
	leaq	-56(%rbp), %rsi
	movq	%r14, %rbx
	movq	%r14, %rdi
	callq	_vpdma_map_desc_buf
	movq	_VPDMA_LIST_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-56(%rbp), %edx
	movq	%r14, %rdi
	callq	_write_reg
	movl	$100, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	$10, %edi
	callq	_msleep_interruptible
	movq	_VPDMA_LIST_ATTR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movl	(%r12), %ecx
	movq	%r14, %rdi
	callq	_read_field_reg
	testq	%rax, %rax
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	decl	%ebx
	jne	LBB0_6
## %bb.8:
	movq	%r14, %rbx
	movq	(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_10
LBB0_9:
	movq	%r14, %rbx
	movq	(%r14), %rdi
	callq	*8(%r14)
LBB0_10:
	leaq	-56(%rbp), %r14
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_vpdma_unmap_desc_buf
	movq	%r14, %rdi
	callq	_vpdma_free_desc_buf
LBB0_11:
	movq	%r13, %rdi
	callq	_release_firmware
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"firmware callback\n"

L_.str.1:                               ## @.str.1
	.asciz	"couldn't get firmware\n"

	.comm	_VPDMA_LIST_ATTR,4,2            ## @VPDMA_LIST_ATTR
	.comm	_VPDMA_LIST_RDY_MASK,4,2        ## @VPDMA_LIST_RDY_MASK
	.comm	_VPDMA_LIST_RDY_SHFT,4,2        ## @VPDMA_LIST_RDY_SHFT
L_.str.2:                               ## @.str.2
	.asciz	"failed to allocate dma buffer for firmware\n"

	.comm	_VPDMA_LIST_ADDR,4,2            ## @VPDMA_LIST_ADDR
L_.str.3:                               ## @.str.3
	.asciz	"firmware upload failed\n"

	.no_dead_strip	_vpdma_firmware_cb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vpdma_firmware_cb
_vpdma_firmware_cb:                     ; @vpdma_firmware_cb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x0, [x1]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
	cbz	x19, LBB0_4
; %bb.1:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_4
; %bb.2:
Lloh2:
	adrp	x21, _VPDMA_LIST_ATTR@GOTPAGE
Lloh3:
	ldr	x21, [x21, _VPDMA_LIST_ATTR@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh4:
	adrp	x22, _VPDMA_LIST_RDY_MASK@GOTPAGE
Lloh5:
	ldr	x22, [x22, _VPDMA_LIST_RDY_MASK@GOTPAGEOFF]
	ldr	w2, [x22]
Lloh6:
	adrp	x23, _VPDMA_LIST_RDY_SHFT@GOTPAGE
Lloh7:
	ldr	x23, [x23, _VPDMA_LIST_RDY_SHFT@GOTPAGEOFF]
	ldr	w3, [x23]
	mov	x0, x20
	bl	_read_field_reg
	cbz	x0, LBB0_5
; %bb.3:
	ldp	x0, x1, [x20]
	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
	add	sp, sp, #80
	br	x1
LBB0_4:
	ldr	x0, [x20]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	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
	add	sp, sp, #80
	b	_dev_err
LBB0_5:
	ldr	w1, [x19]
	mov	x0, sp
	bl	_vpdma_alloc_desc_buf
	cbz	w0, LBB0_7
; %bb.6:
	ldr	x0, [x20]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_13
LBB0_7:
	ldr	w0, [sp, #8]
	ldp	w2, w1, [x19]
	bl	_memcpy
	mov	x1, sp
	mov	x0, x20
	bl	_vpdma_map_desc_buf
Lloh12:
	adrp	x8, _VPDMA_LIST_ADDR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VPDMA_LIST_ADDR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	ldr	w2, [sp]
	mov	x0, x20
	bl	_write_reg
	mov	w24, #100
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	w0, #10
	bl	_msleep_interruptible
	ldr	w1, [x21]
	ldr	w2, [x22]
	ldr	w3, [x23]
	mov	x0, x20
	bl	_read_field_reg
	cbnz	x0, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	subs	w24, w24, #1
	b.ne	LBB0_8
; %bb.10:
	ldr	x0, [x20]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	b	LBB0_12
LBB0_11:
	ldp	x0, x8, [x20]
	blr	x8
LBB0_12:
	mov	x1, sp
	mov	x0, x20
	bl	_vpdma_unmap_desc_buf
	mov	x0, sp
	bl	_vpdma_free_desc_buf
LBB0_13:
	mov	x0, x19
	bl	_release_firmware
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"firmware callback\n"

l_.str.1:                               ; @.str.1
	.asciz	"couldn't get firmware\n"

	.comm	_VPDMA_LIST_ATTR,4,2            ; @VPDMA_LIST_ATTR
	.comm	_VPDMA_LIST_RDY_MASK,4,2        ; @VPDMA_LIST_RDY_MASK
	.comm	_VPDMA_LIST_RDY_SHFT,4,2        ; @VPDMA_LIST_RDY_SHFT
l_.str.2:                               ; @.str.2
	.asciz	"failed to allocate dma buffer for firmware\n"

	.comm	_VPDMA_LIST_ADDR,4,2            ; @VPDMA_LIST_ADDR
l_.str.3:                               ; @.str.3
	.asciz	"firmware upload failed\n"

	.no_dead_strip	_vpdma_firmware_cb
.subsections_via_symbols
