	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function coda_bitstream_try_queue
_coda_bitstream_try_queue:              ## @coda_bitstream_try_queue
	.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	%rsi, %r15
	movq	%rdi, %r14
	leaq	16(%rsi), %rbx
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_vb2_get_plane_payload
	movq	%rax, %r13
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_vb2_plane_vaddr
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_coda_get_bitstream_payload
	addq	%r13, %rax
	addq	$512, %rax                      ## imm = 0x200
	cmpq	32(%r14), %rax
	jae	LBB0_24
## %bb.1:
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.3:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%r14)
	jne	LBB0_12
## %bb.4:
	cmpq	$511, %r13                      ## imm = 0x1FF
	ja	LBB0_12
## %bb.5:
	movq	%r14, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r13, %rdx
	callq	_coda_buffer_parse_headers
	testq	%rax, %rax
	je	LBB0_11
## %bb.6:
	movq	%rax, %r15
	leaq	L_.str.1(%rip), %rdx
	movl	$1, %edi
	movq	%r14, %rsi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_coda_dbg
	movq	%r13, %r12
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_coda_bitstream_queue
	movq	16(%r14), %rdi
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	8(%rdi), %rax
	movq	(%rax), %rax
	movq	_CODA_960@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movslq	%r12d, %r12
	addq	%r15, %r12
	cmpl	$512, %r12d                     ## imm = 0x200
	jl	LBB0_7
	jmp	LBB0_12
LBB0_2:
	movq	16(%r14), %rdi
	addq	$4, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_v4l2_err
	jmp	LBB0_23
LBB0_11:
	leaq	L_.str.3(%rip), %rdx
	movl	$1, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_coda_dbg
LBB0_12:
	cmpq	$0, (%r14)
	jne	LBB0_16
## %bb.13:
	cmpq	$511, %r13                      ## imm = 0x1FF
	ja	LBB0_16
## %bb.14:
	movq	24(%r14), %rax
	movq	(%rax), %rax
	movq	_V4L2_PIX_FMT_H264@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.15:
	movl	$512, %esi                      ## imm = 0x200
	subl	%r13d, %esi
	movq	%r14, %rdi
	callq	_coda_h264_bitstream_pad
LBB0_16:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_coda_bitstream_queue
	testl	%eax, %eax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	$0, %r12d
	js	LBB0_17
## %bb.18:
	movq	(%r14), %rax
	leaq	1(%rax), %rcx
	movq	%rcx, (%r14)
	movq	%rax, 8(%rbx)
	movq	16(%r14), %rax
	movl	(%rax), %edi
	callq	_v4l2_m2m_get_curr_priv
	cmpq	%r14, %rax
	jne	LBB0_20
## %bb.19:
	movq	%r14, %rdi
	callq	_coda_kfifo_sync_to_device_write
LBB0_20:
	movq	_V4L2_BUF_FLAG_LAST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_22
## %bb.21:
	movq	%r14, %rdi
	callq	_coda_bit_stream_end_flag
LBB0_22:
	movl	$0, 8(%r14)
LBB0_23:
	movl	$1, %r12d
	jmp	LBB0_24
LBB0_17:
	movq	16(%r14), %rdi
	addq	$4, %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_v4l2_err
	jmp	LBB0_24
LBB0_8:
	addq	$4, %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_v4l2_err
	xorl	%r12d, %r12d
LBB0_24:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"trying to queue empty buffer\n"

L_.str.1:                               ## @.str.1
	.asciz	"pad with %u-byte header\n"

L_.str.2:                               ## @.str.2
	.asciz	"bitstream buffer overflow\n"

	.comm	_CODA_960,8,3                   ## @CODA_960
L_.str.3:                               ## @.str.3
	.asciz	"could not parse header, sequence initialization might fail\n"

	.comm	_V4L2_PIX_FMT_H264,8,3          ## @V4L2_PIX_FMT_H264
	.comm	_V4L2_BUF_FLAG_LAST,4,2         ## @V4L2_BUF_FLAG_LAST
	.no_dead_strip	_coda_bitstream_try_queue
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function coda_bitstream_try_queue
_coda_bitstream_try_queue:              ; @coda_bitstream_try_queue
	.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	x20, x1
	mov	x19, x0
	add	x22, x1, #16
	mov	x0, x22
	mov	w1, #0
	bl	_vb2_get_plane_payload
	mov	x21, x0
	mov	x0, x22
	mov	w1, #0
	bl	_vb2_plane_vaddr
	mov	x22, x0
	mov	x0, x19
	bl	_coda_get_bitstream_payload
	mov	x8, x0
	mov	w0, #0
	add	x8, x21, x8
	add	x8, x8, #512
	ldr	x9, [x19, #32]
	cmp	x8, x9
	b.hs	LBB0_24
; %bb.1:
	cbz	x22, LBB0_9
; %bb.2:
	ldr	x8, [x19]
	cbnz	x8, LBB0_11
; %bb.3:
	cmp	x21, #511
	b.hi	LBB0_11
; %bb.4:
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	bl	_coda_buffer_parse_headers
	cbz	x0, LBB0_10
; %bb.5:
	mov	x23, x0
	str	x0, [sp]
Lloh0:
	adrp	x2, l_.str.1@PAGE
Lloh1:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x1, x19
	bl	_coda_dbg
Lloh2:
	adrp	x24, _CODA_960@GOTPAGE
Lloh3:
	ldr	x24, [x24, _CODA_960@GOTPAGEOFF]
	mov	x25, x21
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_coda_bitstream_queue
	ldr	x8, [x19, #16]
	tbnz	w0, #31, LBB0_23
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	ldr	x9, [x24]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x25, x23, w25, sxtw
	cmp	w25, #512
	b.lt	LBB0_6
	b	LBB0_11
LBB0_9:
	ldr	x8, [x19, #16]
	add	x0, x8, #4
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	bl	_v4l2_err
	b	LBB0_21
LBB0_10:
Lloh6:
	adrp	x2, l_.str.3@PAGE
Lloh7:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	w0, #1
	mov	x1, x19
	bl	_coda_dbg
LBB0_11:
	ldr	x8, [x19]
	cbnz	x8, LBB0_15
; %bb.12:
	cmp	x21, #511
	b.hi	LBB0_15
; %bb.13:
	ldr	x8, [x19, #24]
	ldr	x8, [x8]
Lloh8:
	adrp	x9, _V4L2_PIX_FMT_H264@GOTPAGE
Lloh9:
	ldr	x9, [x9, _V4L2_PIX_FMT_H264@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.14:
	mov	w8, #512
	sub	w1, w8, w21
	mov	x0, x19
	bl	_coda_h264_bitstream_pad
LBB0_15:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_coda_bitstream_queue
	tbnz	w0, #31, LBB0_22
; %bb.16:
	ldr	x8, [x19]
	add	x9, x8, #1
	str	x9, [x19]
	str	x8, [x20, #8]
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	bl	_v4l2_m2m_get_curr_priv
	cmp	x0, x19
	b.ne	LBB0_18
; %bb.17:
	mov	x0, x19
	bl	_coda_kfifo_sync_to_device_write
LBB0_18:
	ldr	w8, [x20]
Lloh11:
	adrp	x9, _V4L2_BUF_FLAG_LAST@GOTPAGE
Lloh12:
	ldr	x9, [x9, _V4L2_BUF_FLAG_LAST@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_coda_bit_stream_end_flag
LBB0_20:
	str	wzr, [x19, #8]
LBB0_21:
	mov	w0, #1
	b	LBB0_24
LBB0_22:
	ldr	x8, [x19, #16]
LBB0_23:
	add	x0, x8, #4
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_v4l2_err
	mov	w0, #0
LBB0_24:
	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 AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"trying to queue empty buffer\n"

l_.str.1:                               ; @.str.1
	.asciz	"pad with %u-byte header\n"

l_.str.2:                               ; @.str.2
	.asciz	"bitstream buffer overflow\n"

	.comm	_CODA_960,8,3                   ; @CODA_960
l_.str.3:                               ; @.str.3
	.asciz	"could not parse header, sequence initialization might fail\n"

	.comm	_V4L2_PIX_FMT_H264,8,3          ; @V4L2_PIX_FMT_H264
	.comm	_V4L2_BUF_FLAG_LAST,4,2         ; @V4L2_BUF_FLAG_LAST
	.no_dead_strip	_coda_bitstream_try_queue
.subsections_via_symbols
