	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jpu_buf_finish
_jpu_buf_finish:                        ## @jpu_buf_finish
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_to_vb2_v4l2_buffer
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_vb2_to_jpu_buffer
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rdi
	callq	_vb2_get_drv_priv
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	8(%rbx), %rcx
	movl	(%rcx), %r13d
	movq	_VB2_BUF_STATE_DONE@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_jpu_get_q_data
	movslq	(%rax), %rcx
	leal	1(%rcx), %edx
	movl	%edx, (%rax)
	movq	%rcx, (%r12)
LBB0_2:
	cmpl	$0, (%r14)
	je	LBB0_6
## %bb.3:
	movq	(%rbx), %rax
	cmpq	(%r15), %rax
	jne	LBB0_6
## %bb.4:
	movl	%r13d, %edi
	callq	_V4L2_TYPE_IS_OUTPUT
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_vaddr
	movq	%rax, %rbx
	movq	_jpeg_hdrs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %esi
	movq	_JPU_JPEG_HDR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_memcpy
	movl	20(%r14), %edi
	callq	_cpu_to_be16
	movq	_JPU_JPEG_HEIGHT_OFFSET@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movl	%eax, (%rbx,%rcx,4)
	movl	16(%r14), %edi
	callq	_cpu_to_be16
	movq	_JPU_JPEG_WIDTH_OFFSET@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movl	%eax, (%rbx,%rcx,4)
	movq	8(%r14), %rax
	movl	(%rax), %eax
	movq	_JPU_JPEG_SUBS_OFFSET@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movl	%eax, (%rbx,%rcx,4)
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VB2_BUF_STATE_DONE,8,3         ## @VB2_BUF_STATE_DONE
	.comm	_jpeg_hdrs,8,3                  ## @jpeg_hdrs
	.comm	_JPU_JPEG_HDR_SIZE,4,2          ## @JPU_JPEG_HDR_SIZE
	.comm	_JPU_JPEG_HEIGHT_OFFSET,4,2     ## @JPU_JPEG_HEIGHT_OFFSET
	.comm	_JPU_JPEG_WIDTH_OFFSET,4,2      ## @JPU_JPEG_WIDTH_OFFSET
	.comm	_JPU_JPEG_SUBS_OFFSET,4,2       ## @JPU_JPEG_SUBS_OFFSET
	.no_dead_strip	_jpu_buf_finish
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jpu_buf_finish
_jpu_buf_finish:                        ; @jpu_buf_finish
	.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, x0
	bl	_to_vb2_v4l2_buffer
	mov	x22, x0
	bl	_vb2_to_jpu_buffer
	mov	x21, x0
	ldr	x0, [x20, #8]
	bl	_vb2_get_drv_priv
	mov	x19, x0
	ldp	x9, x8, [x20]
	ldr	w23, [x8]
Lloh0:
	adrp	x24, _VB2_BUF_STATE_DONE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _VB2_BUF_STATE_DONE@GOTPAGEOFF]
	ldr	x8, [x24]
	cmp	x9, x8
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, x23
	bl	_jpu_get_q_data
	ldrsw	x8, [x0]
	add	w9, w8, #1
	str	w9, [x0]
	str	x8, [x22]
LBB0_2:
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.3:
	ldr	x8, [x20]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	mov	x0, x23
	bl	_V4L2_TYPE_IS_OUTPUT
	cbnz	x0, LBB0_6
; %bb.5:
	mov	x0, x20
	mov	w1, #0
	bl	_vb2_plane_vaddr
	mov	x20, x0
Lloh2:
	adrp	x8, _jpeg_hdrs@GOTPAGE
Lloh3:
	ldr	x8, [x8, _jpeg_hdrs@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	x9, [x21]
	ldr	w1, [x8, x9, lsl #2]
Lloh5:
	adrp	x8, _JPU_JPEG_HDR_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _JPU_JPEG_HDR_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	bl	_memcpy
	ldr	w0, [x19, #20]
	bl	_cpu_to_be16
Lloh8:
	adrp	x8, _JPU_JPEG_HEIGHT_OFFSET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _JPU_JPEG_HEIGHT_OFFSET@GOTPAGEOFF]
Lloh10:
	ldrsw	x8, [x8]
	str	w0, [x20, x8, lsl #2]
	ldr	w0, [x19, #16]
	bl	_cpu_to_be16
Lloh11:
	adrp	x8, _JPU_JPEG_WIDTH_OFFSET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _JPU_JPEG_WIDTH_OFFSET@GOTPAGEOFF]
Lloh13:
	ldrsw	x8, [x8]
	str	w0, [x20, x8, lsl #2]
	ldr	x8, [x19, #8]
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _JPU_JPEG_SUBS_OFFSET@GOTPAGE
Lloh15:
	ldr	x9, [x9, _JPU_JPEG_SUBS_OFFSET@GOTPAGEOFF]
Lloh16:
	ldrsw	x9, [x9]
	str	w8, [x20, x9, lsl #2]
LBB0_6:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_VB2_BUF_STATE_DONE,8,3         ; @VB2_BUF_STATE_DONE
	.comm	_jpeg_hdrs,8,3                  ; @jpeg_hdrs
	.comm	_JPU_JPEG_HDR_SIZE,4,2          ; @JPU_JPEG_HDR_SIZE
	.comm	_JPU_JPEG_HEIGHT_OFFSET,4,2     ; @JPU_JPEG_HEIGHT_OFFSET
	.comm	_JPU_JPEG_WIDTH_OFFSET,4,2      ; @JPU_JPEG_WIDTH_OFFSET
	.comm	_JPU_JPEG_SUBS_OFFSET,4,2       ; @JPU_JPEG_SUBS_OFFSET
	.no_dead_strip	_jpu_buf_finish
.subsections_via_symbols
