	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pd_buf_prepare
_pd_buf_prepare:                        ## @pd_buf_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	(%rdi), %rax
	movl	(%rax), %ecx
	cmpl	$129, %ecx
	je	LBB0_4
## %bb.1:
	cmpl	$128, %ecx
	jne	LBB0_9
## %bb.2:
	movq	_VIDEOBUF_NEEDS_INIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	4(%rbx), %ecx
	jne	LBB0_7
## %bb.3:
	movq	8(%rax), %rax
	movl	12(%rax), %ecx
	movl	%ecx, 8(%rbx)
	movl	8(%rax), %ecx
	movl	%ecx, 16(%rbx)
	movl	4(%rax), %eax
	movl	%eax, 12(%rbx)
	jmp	LBB0_6
LBB0_4:
	movq	_VIDEOBUF_NEEDS_INIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	4(%rbx), %ecx
	jne	LBB0_7
## %bb.5:
	movq	8(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
LBB0_6:
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	_videobuf_iolock
	testl	%eax, %eax
	js	LBB0_8
LBB0_7:
	movl	%r14d, (%rbx)
	movq	_VIDEOBUF_PREPARED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDEOBUF_NEEDS_INIT,4,2        ## @VIDEOBUF_NEEDS_INIT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VIDEOBUF_PREPARED,4,2          ## @VIDEOBUF_PREPARED
	.no_dead_strip	_pd_buf_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pd_buf_prepare
_pd_buf_prepare:                        ; @pd_buf_prepare
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x2
	mov	x19, x1
	ldr	x8, [x0]
	ldr	w9, [x8]
	cmp	w9, #129
	b.eq	LBB0_4
; %bb.1:
	cmp	w9, #128
	b.ne	LBB0_8
; %bb.2:
Lloh0:
	adrp	x9, _VIDEOBUF_NEEDS_INIT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VIDEOBUF_NEEDS_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	ldr	w10, [x19, #4]
	cmp	w9, w10
	b.ne	LBB0_7
; %bb.3:
	ldr	x8, [x8, #8]
	ldr	w9, [x8, #12]
	str	w9, [x19, #8]
	ldur	d0, [x8, #4]
	stur	d0, [x19, #12]
	b	LBB0_6
LBB0_4:
Lloh3:
	adrp	x9, _VIDEOBUF_NEEDS_INIT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VIDEOBUF_NEEDS_INIT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	ldr	w10, [x19, #4]
	cmp	w9, w10
	b.ne	LBB0_7
; %bb.5:
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
	str	w8, [x19, #8]
LBB0_6:
	mov	x1, x19
	mov	x2, #0
	bl	_videobuf_iolock
	tbnz	w0, #31, LBB0_9
LBB0_7:
	mov	w0, #0
	str	w20, [x19]
Lloh6:
	adrp	x8, _VIDEOBUF_PREPARED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VIDEOBUF_PREPARED@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	b	LBB0_9
LBB0_8:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDEOBUF_NEEDS_INIT,4,2        ; @VIDEOBUF_NEEDS_INIT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VIDEOBUF_PREPARED,4,2          ; @VIDEOBUF_PREPARED
	.no_dead_strip	_pd_buf_prepare
.subsections_via_symbols
