	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function convert_hevc_nal_units
LCPI0_0:
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_convert_hevc_nal_units
	.p2align	4, 0x90
_convert_hevc_nal_units:                ## @convert_hevc_nal_units
	.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
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movl	$-1, %r14d
	cmpq	$4, %rsi
	jb	LBB0_24
## %bb.1:
	movq	%rdi, %rbx
	cmpl	$0, (%rdi)
	jne	LBB0_4
## %bb.2:
	cmpl	$0, 4(%rbx)
	jne	LBB0_4
## %bb.3:
	cmpl	$2, 8(%rbx)
	jl	LBB0_24
LBB0_4:
	cmpq	$22, %rsi
	jg	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	callq	_ALOGE
	jmp	LBB0_24
LBB0_6:
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	testq	%r9, %r9
	je	LBB0_8
## %bb.7:
	movl	84(%rbx), %eax
	andl	$3, %eax
	incq	%rax
	movq	%rax, (%r9)
LBB0_8:
	movl	88(%rbx), %eax
	movl	$0, %r13d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jle	LBB0_23
## %bb.9:
	leaq	(%rbx,%rsi,4), %r15
	addq	$92, %rbx
	xorl	%edx, %edx
	xorl	%eax, %eax
LBB0_10:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movq	%r15, %rcx
	subq	%rbx, %rcx
	cmpq	$11, %rcx
	jle	LBB0_11
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	4(%rbx), %r12d
	shll	$8, %r12d
	orl	8(%rbx), %r12d
	addq	$12, %rbx
	testl	%r12d, %r12d
	jle	LBB0_14
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rcx
	subq	%rbx, %rcx
	cmpq	$7, %rcx
	jle	LBB0_11
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=2
	movl	(%rbx), %r14d
	shll	$8, %r14d
	orl	4(%rbx), %r14d
	js	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=2
	addq	$8, %rbx
	movq	%r15, %rcx
	subq	%rbx, %rcx
	sarq	$2, %rcx
	cmpq	%r14, %rcx
	jl	LBB0_18
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=2
	leal	(%r14,%rax), %r13d
	addl	$4, %r13d
	movslq	%r13d, %rcx
	cmpq	-72(%rbp), %rcx                 ## 8-byte Folded Reload
	ja	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_15 Depth=2
	movslq	%eax, %rcx
	addl	$4, %eax
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [0,0,0,1]
	movups	%xmm0, (%rdx,%rcx,4)
	cltq
	leaq	(%rdx,%rax,4), %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	leaq	(%rbx,%r14,4), %rbx
	movl	%r13d, %eax
	decl	%r12d
	jne	LBB0_15
	jmp	LBB0_22
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	%eax, %r13d
LBB0_22:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	incl	%edx
	movl	%r13d, %eax
	cmpl	-44(%rbp), %edx                 ## 4-byte Folded Reload
	jne	LBB0_10
LBB0_23:
	movslq	%r13d, %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	xorl	%r14d, %r14d
	jmp	LBB0_24
LBB0_18:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_12
LBB0_20:
	leaq	L_.str.2(%rip), %rdi
LBB0_12:
	callq	_ALOGE
	movl	$-1, %r14d
LBB0_24:
	movl	%r14d, %eax
	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	"Input Metadata too small"

L_.str.1:                               ## @.str.1
	.asciz	"NAL unit size does not match Input Metadata size"

L_.str.2:                               ## @.str.2
	.asciz	"Output buffer too small"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_convert_hevc_nal_units         ; -- Begin function convert_hevc_nal_units
	.p2align	2
_convert_hevc_nal_units:                ; @convert_hevc_nal_units
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cmp	x1, #4
	b.hs	LBB0_2
LBB0_1:
	mov	w0, #-1
	b	LBB0_23
LBB0_2:
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	ldr	w8, [x0]
	cbnz	w8, LBB0_5
; %bb.3:
	ldr	w8, [x0, #4]
	cbnz	w8, LBB0_5
; %bb.4:
	ldr	w8, [x0, #8]
	cmp	w8, #2
	b.lt	LBB0_1
LBB0_5:
	cmp	x1, #22
	b.gt	LBB0_8
LBB0_6:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
LBB0_7:
	bl	_ALOGE
	mov	w0, #-1
	b	LBB0_23
LBB0_8:
	cbz	x5, LBB0_10
; %bb.9:
	ldr	w8, [x0, #84]
	and	x8, x8, #0x3
	add	x8, x8, #1
	str	x8, [x5]
LBB0_10:
	ldr	w8, [x0, #88]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	cmp	w8, #1
	b.lt	LBB0_21
; %bb.11:
	mov	w25, #0
	mov	w9, #0
	add	x8, x0, #92
	mov	x26, #4294967296
	add	x27, x0, x1, lsl #2
LBB0_12:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_14 Depth 2
	sub	x10, x27, x8
	cmp	x10, #11
	b.le	LBB0_6
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldp	w10, w11, [x8, #4]
	orr	w28, w11, w10, lsl #8
	add	x8, x8, #12
	cmp	w28, #1
	b.lt	LBB0_19
LBB0_14:                                ;   Parent Loop BB0_12 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	x10, x27, x8
	cmp	x10, #7
	b.le	LBB0_6
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=2
	ldp	w10, w11, [x8]
	orr	w22, w11, w10, lsl #8
	tbnz	w22, #31, LBB0_24
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=2
	add	x23, x8, #8
	sub	x8, x27, x23
	cmp	x22, x8, asr #2
	b.gt	LBB0_24
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=2
	sxtw	x9, w9
	add	x8, x9, #4
	add	w24, w22, w8
	sxtw	x10, w24
	cmp	x10, x20
	b.hi	LBB0_25
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=2
	add	x9, x21, x9, lsl #2
	stp	xzr, x26, [x9]
	add	x0, x21, x8, lsl #2
	mov	x1, x23
	mov	x2, x22
	bl	_memcpy
	add	x8, x23, x22, lsl #2
	mov	x9, x24
	subs	w28, w28, #1
	b.ne	LBB0_14
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	x24, x9
LBB0_20:                                ;   in Loop: Header=BB0_12 Depth=1
	add	w25, w25, #1
	mov	x9, x24
	ldr	w10, [sp, #12]                  ; 4-byte Folded Reload
	cmp	w25, w10
	b.ne	LBB0_12
	b	LBB0_22
LBB0_21:
	mov	w24, #0
LBB0_22:
	mov	w0, #0
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	sxtw	x8, w24
	str	x8, [x19]
LBB0_23:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_24:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_25:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Input Metadata too small"

l_.str.1:                               ; @.str.1
	.asciz	"NAL unit size does not match Input Metadata size"

l_.str.2:                               ; @.str.2
	.asciz	"Output buffer too small"

.subsections_via_symbols
