	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function buffer_prepare
_buffer_prepare:                        ## @buffer_prepare
	.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
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %r15
	movq	_vbi_pixel_to_capture@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%r13d, %r12d
	shll	$5, %r12d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DEB_VBI
	cmpq	$0, 8(%rbx)
	je	LBB0_3
## %bb.1:
	cmpl	%r12d, 16(%rbx)
	jge	LBB0_3
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_DEB_VBI
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_10
LBB0_3:
	cmpl	%r12d, 20(%rbx)
	je	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_saa7146_dma_free
LBB0_5:
	movq	_VIDEOBUF_NEEDS_INIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	24(%rbx), %rax
	jne	LBB0_8
## %bb.6:
	leaq	8(%rbx), %rdi
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	callq	_videobuf_to_dma
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r13d, 32(%rbx)
	movl	$32, 36(%rbx)
	movl	%r12d, 20(%rbx)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 40(%rbx)
	movl	(%r15), %edi
	movq	48(%rbx), %rsi
	addq	$8, %rsi
	callq	_saa7146_pgtable_free
	movl	(%r15), %edi
	movq	48(%rbx), %rsi
	addq	$8, %rsi
	callq	_saa7146_pgtable_alloc
	movq	%r14, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	callq	_videobuf_iolock
	testl	%eax, %eax
	je	LBB0_7
## %bb.9:
	movl	%eax, %r12d
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DEB_VBI
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_saa7146_dma_free
	jmp	LBB0_10
LBB0_7:
	movl	(%r15), %edi
	movq	48(%rbx), %rsi
	addq	$8, %rsi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	callq	_saa7146_pgtable_build_single
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_10
LBB0_8:
	movq	_VIDEOBUF_PREPARED@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%rbx)
	movq	_buffer_activate@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	xorl	%r12d, %r12d
LBB0_10:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_vbi_pixel_to_capture,4,2       ## @vbi_pixel_to_capture
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vb:%p\n"

L_.str.1:                               ## @.str.1
	.asciz	"size mismatch\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VIDEOBUF_NEEDS_INIT,8,3        ## @VIDEOBUF_NEEDS_INIT
	.comm	_VIDEOBUF_PREPARED,8,3          ## @VIDEOBUF_PREPARED
	.comm	_buffer_activate,4,2            ## @buffer_activate
L_.str.2:                               ## @.str.2
	.asciz	"error out\n"

	.no_dead_strip	_buffer_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function buffer_prepare
_buffer_prepare:                        ; @buffer_prepare
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x23, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	x21, [x8]
Lloh0:
	adrp	x8, _vbi_pixel_to_capture@GOTPAGE
Lloh1:
	ldr	x8, [x8, _vbi_pixel_to_capture@GOTPAGEOFF]
Lloh2:
	ldr	w26, [x8]
	lsl	w25, w26, #5
	str	x1, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DEB_VBI
	mov	x22, x19
	ldr	x8, [x22, #8]!
	cbz	x8, LBB0_3
; %bb.1:
	ldr	w8, [x19, #16]
	cmp	w8, w25
	b.ge	LBB0_3
; %bb.2:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DEB_VBI
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_3:
	ldr	w8, [x19, #20]
	cmp	w8, w25
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_saa7146_dma_free
LBB0_5:
Lloh10:
	adrp	x8, _VIDEOBUF_NEEDS_INIT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VIDEOBUF_NEEDS_INIT@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	ldr	x9, [x19, #24]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.6:
	mov	x0, x22
	bl	_videobuf_to_dma
	mov	x24, x0
	mov	w8, #32
	stp	w26, w8, [x19, #32]
	str	w25, [x19, #20]
	str	w23, [x19, #40]
	ldr	w0, [x21]
	ldr	x8, [x19, #48]
	add	x1, x8, #8
	bl	_saa7146_pgtable_free
	ldr	w0, [x21]
	ldr	x8, [x19, #48]
	add	x1, x8, #8
	bl	_saa7146_pgtable_alloc
	mov	x0, x20
	mov	x1, x22
	mov	x2, #0
	bl	_videobuf_iolock
	cbz	w0, LBB0_8
; %bb.7:
	mov	x22, x0
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DEB_VBI
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_saa7146_dma_free
	b	LBB0_10
LBB0_8:
	ldr	w0, [x21]
	ldr	x8, [x19, #48]
	add	x1, x8, #8
	ldp	w3, w2, [x24]
	bl	_saa7146_pgtable_build_single
	mov	x22, x0
	cbnz	w0, LBB0_10
LBB0_9:
	mov	w22, #0
Lloh15:
	adrp	x8, _VIDEOBUF_PREPARED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VIDEOBUF_PREPARED@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	str	x8, [x19, #24]
Lloh18:
	adrp	x8, _buffer_activate@GOTPAGE
Lloh19:
	ldr	x8, [x8, _buffer_activate@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_10:
	mov	x0, x22
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_vbi_pixel_to_capture,4,2       ; @vbi_pixel_to_capture
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vb:%p\n"

l_.str.1:                               ; @.str.1
	.asciz	"size mismatch\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VIDEOBUF_NEEDS_INIT,8,3        ; @VIDEOBUF_NEEDS_INIT
	.comm	_VIDEOBUF_PREPARED,8,3          ; @VIDEOBUF_PREPARED
	.comm	_buffer_activate,4,2            ; @buffer_activate
l_.str.2:                               ; @.str.2
	.asciz	"error out\n"

	.no_dead_strip	_buffer_prepare
.subsections_via_symbols
