	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_nal_bitstream_mp4_to_annexb ## -- Begin function hb_nal_bitstream_mp4_to_annexb
	.p2align	4, 0x90
_hb_nal_bitstream_mp4_to_annexb:        ## @hb_nal_bitstream_mp4_to_annexb
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movslq	%edx, %rcx
	cmpq	%rsi, %rcx
	jge	LBB0_9
## %bb.1:
	movl	%edx, %ebx
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rdi,%rsi,4), %rdx
	xorl	%r15d, %r15d
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rdx, %r14
	movq	%r13, %rdi
	movl	%ebx, %r12d
	movl	%ebx, %esi
	leaq	-48(%rbp), %rdx
	callq	_mp4_nal_unit_length
	movq	%r14, %rsi
	cltq
	leaq	(,%rax,4), %rbx
	addq	%r13, %rbx
	subq	%rbx, %rsi
	sarq	$2, %rsi
	movq	-48(%rbp), %rdx
	cmpq	%rdx, %rsi
	jb	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
	movq	%rbx, %rsi
	callq	_hb_nal_unit_write_annexb
	movq	%r14, %rdx
	addq	%rax, %r15
	movq	-48(%rbp), %rax
	leaq	(%rbx,%rax,4), %r13
	movq	%r14, %rax
	subq	%r13, %rax
	sarq	$2, %rax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, %rax
	movl	%r12d, %ebx
	jg	LBB0_2
## %bb.5:
	movq	%r15, %rdi
	callq	_hb_buffer_init
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:
	movq	%rax, %r15
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, -64(%rbp)                 ## 8-byte Folded Reload
	jge	LBB0_12
## %bb.7:
	xorl	%r13d, %r13d
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	leaq	-48(%rbp), %rdx
	callq	_mp4_nal_unit_length
	cltq
	leaq	(%r14,%rax,4), %rbx
	leaq	(,%r13,4), %rdi
	addq	(%r15), %rdi
	movq	-48(%rbp), %rdx
	movq	%rbx, %rsi
	callq	_hb_nal_unit_write_annexb
	addq	%rax, %r13
	movq	-48(%rbp), %rax
	leaq	(%rbx,%rax,4), %r14
	movl	%r12d, %ebx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	subq	%r14, %rax
	sarq	$2, %rax
	cmpq	-64(%rbp), %rax                 ## 8-byte Folded Reload
	jg	LBB0_8
	jmp	LBB0_12
LBB0_9:
	xorl	%edi, %edi
	callq	_hb_buffer_init
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_12
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
	callq	_hb_error
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_hb_log
LBB0_11:
	xorl	%r15d, %r15d
LBB0_12:
	movq	%r15, %rax
	addq	$40, %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	"hb_nal_bitstream_mp4_to_annexb: truncated bitstream (remaining: %lu, expected: %lu)"

L_.str.1:                               ## @.str.1
	.asciz	"hb_nal_bitstream_mp4_to_annexb: hb_buffer_init failed"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hb_nal_bitstream_mp4_to_annexb ; -- Begin function hb_nal_bitstream_mp4_to_annexb
	.p2align	2
_hb_nal_bitstream_mp4_to_annexb:        ; @hb_nal_bitstream_mp4_to_annexb
	.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	x19, x2
	sxtw	x24, w19
	cmp	x24, x1
	b.ge	LBB0_8
; %bb.1:
	mov	x21, x1
	mov	x20, x0
	mov	x22, #0
	add	x25, x0, x1, lsl #2
	mov	x23, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #8
	mov	x0, x23
	mov	x1, x19
	bl	_mp4_nal_unit_length
	add	x23, x23, w0, sxtw #2
	sub	x8, x25, x23
	ldr	x2, [sp, #8]
	cmp	x2, x8, asr #2
	b.hi	LBB0_10
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, #0
	mov	x1, x23
	bl	_hb_nal_unit_write_annexb
	add	x22, x0, x22
	ldr	x8, [sp, #8]
	add	x23, x23, x8, lsl #2
	sub	x8, x25, x23
	cmp	x24, x8, asr #2
	b.lt	LBB0_2
; %bb.4:
	mov	x0, x22
	bl	_hb_buffer_init
	cbz	x0, LBB0_9
; %bb.5:
	mov	x22, x0
	cmp	x24, x21
	b.ge	LBB0_12
; %bb.6:
	mov	x21, #0
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x19
	bl	_mp4_nal_unit_length
	add	x20, x20, w0, sxtw #2
	ldr	x8, [x22]
	add	x0, x8, x21, lsl #2
	ldr	x2, [sp, #8]
	mov	x1, x20
	bl	_hb_nal_unit_write_annexb
	add	x21, x0, x21
	ldr	x8, [sp, #8]
	add	x20, x20, x8, lsl #2
	sub	x8, x25, x20
	cmp	x24, x8, asr #2
	b.lt	LBB0_7
	b	LBB0_12
LBB0_8:
	mov	x0, #0
	bl	_hb_buffer_init
	mov	x22, x0
	cbnz	x0, LBB0_12
LBB0_9:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_hb_error
	b	LBB0_11
LBB0_10:
	lsr	x1, x8, #2
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_hb_log
LBB0_11:
	mov	x22, #0
LBB0_12:
	mov	x0, x22
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hb_nal_bitstream_mp4_to_annexb: truncated bitstream (remaining: %lu, expected: %lu)"

l_.str.1:                               ; @.str.1
	.asciz	"hb_nal_bitstream_mp4_to_annexb: hb_buffer_init failed"

.subsections_via_symbols
