	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_ts_to_decoder
_write_ts_to_decoder:                   ## @write_ts_to_decoder
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movslq	%esi, %rbx
	shlq	$2, %rbx
	addq	(%rdi), %rbx
	movl	4(%rdx), %ecx
	movq	_TRANS_ERROR@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_av7110_ipack_reset
LBB0_10:
	movl	$-1, %eax
	jmp	LBB0_11
LBB0_2:
	movq	%rdx, %r15
	movl	12(%rdx), %eax
	movq	_PAYLOAD@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_10
## %bb.3:
	movq	_PAY_START@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_av7110_ipack_flush
	movl	12(%r15), %eax
LBB0_5:
	movq	_ADAPT_FIELD@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.6:
	movslq	16(%r15), %rax
	leaq	1(%rax), %rcx
	subq	%rcx, %r14
	je	LBB0_9
## %bb.7:
	leaq	(%r15,%rax,4), %r15
	addq	$4, %r15
LBB0_8:
	addq	$16, %r15
	addq	$-4, %r14
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_av7110_ipack_instant_repack
LBB0_9:
	xorl	%eax, %eax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TRANS_ERROR,4,2                ## @TRANS_ERROR
	.comm	_PAYLOAD,4,2                    ## @PAYLOAD
	.comm	_PAY_START,4,2                  ## @PAY_START
	.comm	_ADAPT_FIELD,4,2                ## @ADAPT_FIELD
	.no_dead_strip	_write_ts_to_decoder
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_ts_to_decoder
_write_ts_to_decoder:                   ; @write_ts_to_decoder
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0]
	add	x19, x8, w1, sxtw #2
	ldr	w9, [x2, #4]
Lloh0:
	adrp	x8, _TRANS_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TRANS_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_av7110_ipack_reset
LBB0_2:
	mov	w0, #-1
	b	LBB0_11
LBB0_3:
	mov	x21, x2
	ldr	w8, [x2, #12]
Lloh3:
	adrp	x10, _PAYLOAD@GOTPAGE
Lloh4:
	ldr	x10, [x10, _PAYLOAD@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_2
; %bb.4:
	mov	x20, x3
Lloh6:
	adrp	x10, _PAY_START@GOTPAGE
Lloh7:
	ldr	x10, [x10, _PAY_START@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_av7110_ipack_flush
	ldr	w8, [x21, #12]
LBB0_6:
Lloh9:
	adrp	x9, _ADAPT_FIELD@GOTPAGE
Lloh10:
	ldr	x9, [x9, _ADAPT_FIELD@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.7:
	ldrsw	x8, [x21, #16]
	add	x8, x8, #1
	subs	x20, x20, x8
	b.eq	LBB0_10
; %bb.8:
	add	x21, x21, x8, lsl #2
LBB0_9:
	add	x0, x21, #16
	sub	x1, x20, #4
	mov	x2, x19
	bl	_av7110_ipack_instant_repack
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 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	_TRANS_ERROR,4,2                ; @TRANS_ERROR
	.comm	_PAYLOAD,4,2                    ; @PAYLOAD
	.comm	_PAY_START,4,2                  ; @PAY_START
	.comm	_ADAPT_FIELD,4,2                ; @ADAPT_FIELD
	.no_dead_strip	_write_ts_to_decoder
.subsections_via_symbols
