	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adts_write_frame_header
_adts_write_frame_header:               ## @adts_write_frame_header
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	_ADTS_HEADER_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	addl	%ecx, %ebx
	addl	%edx, %ebx
	movq	_ADTS_MAX_FRAME_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	cmpl	%r8d, %ebx
	jbe	LBB0_2
## %bb.1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%edi, %edi
	movl	%ebx, %ecx
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_3
LBB0_2:
	movq	%rdi, %r12
	leaq	-36(%rbp), %r14
	movq	%r14, %rdi
	callq	_init_put_bits
	movq	%r14, %rdi
	movl	$12, %esi
	movl	$4095, %edx                     ## imm = 0xFFF
	callq	_put_bits
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movq	%r14, %rdi
	movl	$2, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$1, %edx
	callq	_put_bits
	movl	(%r12), %edx
	movq	%r14, %rdi
	movl	$2, %esi
	callq	_put_bits
	movl	4(%r12), %edx
	movq	%r14, %rdi
	movl	$4, %esi
	callq	_put_bits
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movl	8(%r12), %edx
	movq	%r14, %rdi
	movl	$3, %esi
	callq	_put_bits
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movq	%r14, %rdi
	movl	$13, %esi
	movl	%ebx, %edx
	callq	_put_bits
	movq	%r14, %rdi
	movl	$11, %esi
	movl	$2047, %edx                     ## imm = 0x7FF
	callq	_put_bits
	movq	%r14, %rdi
	movl	$2, %esi
	xorl	%edx, %edx
	callq	_put_bits
	movq	%r14, %rdi
	callq	_flush_put_bits
LBB0_3:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADTS_HEADER_SIZE,8,3           ## @ADTS_HEADER_SIZE
	.comm	_ADTS_MAX_FRAME_BYTES,4,2       ## @ADTS_MAX_FRAME_BYTES
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ADTS frame size too large: %u (max %d)\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.no_dead_strip	_adts_write_frame_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adts_write_frame_header
_adts_write_frame_header:               ; @adts_write_frame_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x8, x2
Lloh0:
	adrp	x9, _ADTS_HEADER_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ADTS_HEADER_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x2, [x9]
	add	w8, w3, w8
	add	w19, w8, w2
Lloh3:
	adrp	x8, _ADTS_MAX_FRAME_BYTES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ADTS_MAX_FRAME_BYTES@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
	cmp	w19, w4
	b.ls	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, #0
	mov	x3, x19
	bl	_av_log
Lloh11:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	b	LBB0_3
LBB0_2:
	mov	x20, x0
	add	x0, sp, #12
	bl	_init_put_bits
	add	x0, sp, #12
	mov	w1, #12
	mov	w2, #4095
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #0
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #2
	mov	w2, #0
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #1
	bl	_put_bits
	ldr	w2, [x20]
	add	x0, sp, #12
	mov	w1, #2
	bl	_put_bits
	ldr	w2, [x20, #4]
	add	x0, sp, #12
	mov	w1, #4
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #0
	bl	_put_bits
	ldr	w2, [x20, #8]
	add	x0, sp, #12
	mov	w1, #3
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #0
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #0
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #0
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #1
	mov	w2, #0
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #13
	mov	x2, x19
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #11
	mov	w2, #2047
	bl	_put_bits
	add	x0, sp, #12
	mov	w1, #2
	mov	w2, #0
	bl	_put_bits
	add	x0, sp, #12
	bl	_flush_put_bits
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ADTS_HEADER_SIZE,8,3           ; @ADTS_HEADER_SIZE
	.comm	_ADTS_MAX_FRAME_BYTES,4,2       ; @ADTS_MAX_FRAME_BYTES
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ADTS frame size too large: %u (max %d)\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.no_dead_strip	_adts_write_frame_header
.subsections_via_symbols
