	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function uvc_video_encode_bulk
_uvc_video_encode_bulk:                 ## @uvc_video_encode_bulk
	.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	8(%rdi), %r13
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	movq	(%rdi), %rbx
	movq	8(%r13), %r12
	movl	(%rbx), %r15d
	cmpl	$0, 8(%rbx)
	jne	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	movl	%r15d, %ecx
	callq	_uvc_video_encode_header
	movl	%eax, 8(%rbx)
	cltq
	addq	%rax, 16(%rbx)
	leaq	(%r12,%rax,4), %r12
	subl	%eax, %r15d
LBB0_4:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	movl	%r15d, %ecx
	callq	_uvc_video_encode_data
	movslq	%eax, %r12
	movq	16(%rbx), %rax
	addq	%r12, %rax
	movq	%rax, 16(%rbx)
	subl	%r15d, %r12d
	movq	(%r14), %rcx
	cmpq	40(%rbx), %rcx
	jne	LBB0_5
## %bb.6:
	leaq	40(%rbx), %rdi
	movq	$0, 40(%rbx)
	movq	_UVC_BUF_STATE_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movq	48(%rbx), %rax
	incq	%rax
	movq	%rax, 48(%rbx)
	movq	%rax, 8(%r14)
	movq	%r14, %rsi
	callq	_uvc_queue_next_buffer
	movq	_UVC_STREAM_FID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%eax, 32(%rbx)
	jmp	LBB0_7
LBB0_1:
	xorl	%r12d, %r12d
	jmp	LBB0_9
LBB0_5:
	cmpq	24(%rbx), %rax
	jne	LBB0_8
LBB0_7:
	movl	$0, 8(%rbx)
	movq	$0, 16(%rbx)
LBB0_8:
	addl	(%rbx), %r12d
LBB0_9:
	movl	%r12d, (%r13)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UVC_BUF_STATE_READY,4,2        ## @UVC_BUF_STATE_READY
	.comm	_UVC_STREAM_FID,4,2             ## @UVC_STREAM_FID
	.no_dead_strip	_uvc_video_encode_bulk
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function uvc_video_encode_bulk
_uvc_video_encode_bulk:                 ; @uvc_video_encode_bulk
	.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
	ldr	x23, [x0, #8]
	cbz	x1, LBB0_5
; %bb.1:
	mov	x20, x1
	ldr	x19, [x0]
	ldr	x22, [x23, #8]
	ldr	w21, [x19]
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_3
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	x3, x21
	bl	_uvc_video_encode_header
	str	w0, [x19, #8]
	ldr	x8, [x19, #16]
	add	x8, x8, w0, sxtw
	str	x8, [x19, #16]
	add	x22, x22, w0, sxtw #2
	sub	w21, w21, w0
LBB0_3:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	x3, x21
	bl	_uvc_video_encode_data
	mov	x8, x0
	mov	x0, x19
	ldr	x10, [x0, #40]!
	ldur	x9, [x0, #-24]
	add	x9, x9, w8, sxtw
	stur	x9, [x0, #-24]
	sub	w21, w8, w21
	ldr	x8, [x20]
	cmp	x8, x10
	b.ne	LBB0_6
; %bb.4:
Lloh0:
	adrp	x8, _UVC_BUF_STATE_READY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UVC_BUF_STATE_READY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x20, #16]
	ldr	x8, [x19, #48]
	add	x8, x8, #1
	stp	xzr, x8, [x19, #40]
	str	x8, [x20, #8]
	mov	x1, x20
	bl	_uvc_queue_next_buffer
Lloh3:
	adrp	x8, _UVC_STREAM_FID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UVC_STREAM_FID@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19, #32]
	eor	w8, w9, w8
	str	w8, [x19, #32]
	b	LBB0_7
LBB0_5:
	mov	w8, #0
	b	LBB0_9
LBB0_6:
	ldr	x8, [x19, #24]
	cmp	x9, x8
	b.ne	LBB0_8
LBB0_7:
	str	wzr, [x19, #8]
	str	xzr, [x19, #16]
LBB0_8:
	ldr	w8, [x19]
	add	w8, w21, w8
LBB0_9:
	str	w8, [x23]
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_UVC_BUF_STATE_READY,4,2        ; @UVC_BUF_STATE_READY
	.comm	_UVC_STREAM_FID,4,2             ; @UVC_STREAM_FID
	.no_dead_strip	_uvc_video_encode_bulk
.subsections_via_symbols
