	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vpif_qbuf
_vpif_qbuf:                             ## @vpif_qbuf
	.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	%rdx, %rbx
	movq	%rsi, %r14
	movq	8(%rsi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %r15
	movq	_VPIF_VIDEO_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movq	(%rdx), %r13
	movq	8(%rdx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	16(%rdx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	20(%rdx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	$2, %edi
	callq	_vpif_dbg
	imulq	$112, %r12, %r12
	cmpq	%r13, 104(%r15,%r12)
	jne	LBB0_1
## %bb.2:
	movq	(%r14), %rax
	movq	_VPIF_VIDEO_INDEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$0, (%rax,%rcx,4)
	je	LBB0_3
## %bb.4:
	leaq	(%r15,%r12), %rdi
	addq	$96, %rdi
	callq	_list_empty
	testl	%eax, %eax
	je	LBB0_29
## %bb.5:
	movq	88(%r15,%r12), %rax
	cmpq	72(%r15,%r12), %rax
	je	LBB0_6
LBB0_29:
	leaq	(%r15,%r12), %rdi
	addq	$8, %rdi
	movq	%rbx, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_videobuf_qbuf                  ## TAILCALL
LBB0_1:
	leaq	L_.str.1(%rip), %rdi
	callq	_vpif_err
LBB0_15:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_16
LBB0_3:
	leaq	L_.str.2(%rip), %rdi
	callq	_vpif_err
	movq	_EACCES@GOTPCREL(%rip), %rcx
LBB0_16:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_28:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	cmpq	$0, 80(%r15,%r12)
	je	LBB0_29
## %bb.7:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_29
## %bb.8:
	leaq	(%r15,%r12), %r14
	addq	$8, %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	24(%r15,%r12), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rbx
	movq	(%rbx), %rax
	movq	_VIDEOBUF_QUEUED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.9:
	movq	_VIDEOBUF_ACTIVE@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	je	LBB0_10
## %bb.11:
	movl	8(%rbx), %ecx
	cmpl	$128, %ecx
	je	LBB0_17
## %bb.12:
	cmpl	$129, %ecx
	jne	LBB0_14
## %bb.13:
	cmpl	$0, 28(%rbx)
	jne	LBB0_22
	jmp	LBB0_14
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	callq	_vpif_err
LBB0_14:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_15
LBB0_17:
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpl	32(%rbx), %ecx
	jl	LBB0_14
## %bb.18:
	movq	_VIDEOBUF_NEEDS_INIT@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	je	LBB0_21
## %bb.19:
	cmpl	%r13d, 28(%rbx)
	je	LBB0_21
## %bb.20:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_vpif_buffer_release
LBB0_21:
	movl	%r13d, 28(%rbx)
	movq	_VIDEOBUF_ACTIVE@GOTPCREL(%rip), %r13
LBB0_22:
	callq	_local_irq_save
	movl	16(%r15,%r12), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_vpif_buffer_prepare
	testl	%eax, %eax
	js	LBB0_23
## %bb.24:
	movq	%r15, %rcx
	addq	%r12, %r15
	addq	$72, %r15
	movq	(%r13), %rax
	movq	%rax, (%rbx)
	movq	%rcx, %r13
	cmpl	$128, (%rcx,%r12)
	jne	LBB0_26
## %bb.25:
	movq	16(%rbx), %rcx
	jmp	LBB0_27
LBB0_23:
	callq	_local_irq_restore
	jmp	LBB0_14
LBB0_26:
	movq	%rbx, %rdi
	callq	_videobuf_to_dma_contig
	movq	%rax, %rcx
LBB0_27:
	movq	%rbx, (%r15)
	movq	56(%r13,%r12), %rdi
	addq	%rcx, %rdi
	movq	48(%r13,%r12), %rsi
	addq	%rcx, %rsi
	movq	40(%r13,%r12), %rdx
	addq	%rcx, %rdx
	addq	32(%r13,%r12), %rcx
	callq	*64(%r13,%r12)
	callq	_local_irq_restore
	addq	$24, %rbx
	leaq	(%r12,%r13), %rsi
	addq	$12, %rsi
	movq	%rbx, %rdi
	callq	_list_add_tail
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_VPIF_VIDEO_INDEX,8,3           ## @VPIF_VIDEO_INDEX
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vpif_qbuf\n"

L_.str.1:                               ## @.str.1
	.asciz	"invalid buffer type\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"fh io not allowed \n"

	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_VIDEOBUF_QUEUED,8,3            ## @VIDEOBUF_QUEUED
	.comm	_VIDEOBUF_ACTIVE,8,3            ## @VIDEOBUF_ACTIVE
L_.str.3:                               ## @.str.3
	.asciz	"invalid state\n"

	.comm	_VIDEOBUF_NEEDS_INIT,8,3        ## @VIDEOBUF_NEEDS_INIT
	.no_dead_strip	_vpif_qbuf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vpif_qbuf
_vpif_qbuf:                             ; @vpif_qbuf
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x2
	mov	x20, x1
	ldr	x27, [x1, #8]
	ldr	x21, [x27, #8]
Lloh0:
	adrp	x23, _VPIF_VIDEO_INDEX@GOTPAGE
Lloh1:
	ldr	x23, [x23, _VPIF_VIDEO_INDEX@GOTPAGEOFF]
	ldr	x22, [x23]
	ldp	x28, x26, [x2]
	ldp	w24, w25, [x2, #16]
Lloh2:
	adrp	x8, _debug@GOTPAGE
Lloh3:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #2
	bl	_vpif_dbg
	mov	w8, #112
	madd	x8, x22, x8, x21
	ldr	x8, [x8, #104]
	cmp	x8, x28
	b.ne	LBB0_5
; %bb.1:
	ldr	x8, [x20]
	ldr	x9, [x23]
	ldr	w8, [x8, x9, lsl #2]
	cbz	w8, LBB0_7
; %bb.2:
	mov	w8, #112
	madd	x8, x22, x8, x21
	add	x0, x8, #96
	bl	_list_empty
	cbz	w0, LBB0_4
; %bb.3:
	mov	w8, #112
	madd	x23, x22, x8, x21
	ldr	x8, [x23, #72]!
	ldr	x9, [x23, #16]
	cmp	x9, x8
	b.eq	LBB0_10
LBB0_4:
	mov	w8, #112
	madd	x8, x22, x8, x21
	add	x0, x8, #8
	mov	x1, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_videobuf_qbuf
LBB0_5:
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_vpif_err
LBB0_6:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_vpif_err
Lloh13:
	adrp	x8, _EACCES@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	w8, #112
	madd	x8, x22, x8, x21
	ldr	x8, [x8, #80]
	cbz	x8, LBB0_4
; %bb.11:
	ldr	x8, [x27]
	cbz	x8, LBB0_4
; %bb.12:
	mov	w8, #112
	madd	x20, x22, x8, x21
	add	x19, x20, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20, #24]
	ldr	x20, [x8, x26, lsl #3]
	ldr	x8, [x20]
Lloh15:
	adrp	x9, _VIDEOBUF_QUEUED@GOTPAGE
Lloh16:
	ldr	x9, [x9, _VIDEOBUF_QUEUED@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
Lloh18:
	adrp	x26, _VIDEOBUF_ACTIVE@GOTPAGE
Lloh19:
	ldr	x26, [x26, _VIDEOBUF_ACTIVE@GOTPAGEOFF]
	ldr	x10, [x26]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_14
; %bb.13:
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_vpif_err
	b	LBB0_26
LBB0_14:
	ldr	w9, [x20, #8]
	cmp	w9, #128
	b.eq	LBB0_17
; %bb.15:
	cmp	w9, #129
	b.ne	LBB0_26
; %bb.16:
	ldr	w8, [x20, #28]
	cbnz	w8, LBB0_22
	b	LBB0_26
LBB0_17:
	ldr	w9, [x20, #32]
	cmp	w25, w9
	b.lt	LBB0_26
; %bb.18:
Lloh22:
	adrp	x9, _VIDEOBUF_NEEDS_INIT@GOTPAGE
Lloh23:
	ldr	x9, [x9, _VIDEOBUF_NEEDS_INIT@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.eq	LBB0_21
; %bb.19:
	ldr	w8, [x20, #28]
	cmp	w8, w24
	b.eq	LBB0_21
; %bb.20:
	mov	x0, x19
	mov	x1, x20
	bl	_vpif_buffer_release
LBB0_21:
	str	w24, [x20, #28]
LBB0_22:
	bl	_local_irq_save
	mov	w8, #112
	madd	x8, x22, x8, x21
	ldr	w2, [x8, #16]
	mov	x0, x19
	mov	x1, x20
	bl	_vpif_buffer_prepare
	tbnz	w0, #31, LBB0_25
; %bb.23:
	ldr	x8, [x26]
	str	x8, [x20]
	mov	w8, #112
	mul	x8, x22, x8
	ldr	w8, [x21, x8]
	cmp	w8, #128
	b.ne	LBB0_27
; %bb.24:
	ldr	x0, [x20, #16]
	b	LBB0_28
LBB0_25:
	bl	_local_irq_restore
LBB0_26:
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_6
LBB0_27:
	mov	x0, x20
	bl	_videobuf_to_dma_contig
LBB0_28:
	str	x20, [x23]
	mov	w8, #112
	madd	x21, x22, x8, x21
	ldp	x8, x9, [x21, #56]
	ldr	x10, [x21, #48]
	add	x8, x8, x0
	add	x1, x10, x0
	ldp	x11, x10, [x21, #32]
	add	x2, x10, x0
	add	x3, x11, x0
	mov	x0, x8
	blr	x9
	bl	_local_irq_restore
	add	x0, x20, #24
	add	x1, x21, #12
	bl	_list_add_tail
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_VPIF_VIDEO_INDEX,8,3           ; @VPIF_VIDEO_INDEX
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vpif_qbuf\n"

l_.str.1:                               ; @.str.1
	.asciz	"invalid buffer type\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"fh io not allowed \n"

	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_VIDEOBUF_QUEUED,8,3            ; @VIDEOBUF_QUEUED
	.comm	_VIDEOBUF_ACTIVE,8,3            ; @VIDEOBUF_ACTIVE
l_.str.3:                               ; @.str.3
	.asciz	"invalid state\n"

	.comm	_VIDEOBUF_NEEDS_INIT,8,3        ; @VIDEOBUF_NEEDS_INIT
	.no_dead_strip	_vpif_qbuf
.subsections_via_symbols
