	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nut_read_header
_nut_read_header:                       ## @nut_read_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	%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	%rdi, %r14
	movq	16(%rdi), %r12
	movq	24(%rdi), %r15
	movq	%rdi, 8(%r15)
	xorl	%ebx, %ebx
	movq	_MAIN_STARTCODE@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_find_startcode
	testl	%eax, %eax
	js	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%eax, %ebx
	incl	%ebx
	movq	%r15, %rdi
	callq	_decode_main_header
	testq	%rax, %rax
	js	LBB0_1
## %bb.5:
	cmpl	$0, (%r14)
	jle	LBB0_10
## %bb.6:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	_STREAM_STARTCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_find_startcode
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%eax, %ebx
	incl	%ebx
	movq	%r15, %rdi
	callq	_decode_stream_header
	shrq	$63, %rax
	xorl	$1, %eax
	addl	%eax, %r13d
	cmpl	(%r14), %r13d
	jl	LBB0_7
LBB0_10:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_find_any_startcode
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_avio_tell
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.11:
	movl	%eax, %r13d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_find_any_startcode
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_avio_tell
	movl	%eax, %r13d
	testq	%rbx, %rbx
	je	LBB0_16
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	_SYNCPOINT_STARTCODE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	_INFO_STARTCODE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%r15, %rdi
	callq	_decode_info_header
	jmp	LBB0_15
LBB0_2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_3
LBB0_16:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_3
LBB0_8:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
LBB0_3:
	movq	%r14, %rdi
	callq	_av_log
	movq	%r14, %rdi
	callq	_nut_read_close
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	%rbx, (%r15)
	addl	$-8, %r13d
	movq	8(%r14), %rax
	movl	%r13d, (%rax)
	movq	_AVIO_SEEKABLE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_19
## %bb.18:
	movq	%r12, %rdi
	callq	_avio_tell
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_find_and_decode_index
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_avio_seek
	movq	(%r15), %rbx
LBB0_19:
	xorl	%edi, %edi
	movq	_SYNCPOINT_STARTCODE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	sete	%dil
	callq	_av_assert0
	movq	_ff_nut_metadata_conv@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_ff_metadata_conv_ctx
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_MAIN_STARTCODE,4,2             ## @MAIN_STARTCODE
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No main startcode found.\n"

	.comm	_STREAM_STARTCODE,4,2           ## @STREAM_STARTCODE
L_.str.1:                               ## @.str.1
	.asciz	"Not all stream headers found.\n"

L_.str.2:                               ## @.str.2
	.asciz	"EOF before video frames\n"

	.comm	_SYNCPOINT_STARTCODE,8,3        ## @SYNCPOINT_STARTCODE
	.comm	_INFO_STARTCODE,8,3             ## @INFO_STARTCODE
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ## @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_ff_nut_metadata_conv,4,2       ## @ff_nut_metadata_conv
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.no_dead_strip	_nut_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nut_read_header
_nut_read_header:                       ; @nut_read_header
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x0
	mov	w22, #0
	ldp	x21, x20, [x0, #16]
	str	x0, [x20, #8]
Lloh0:
	adrp	x23, _MAIN_STARTCODE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _MAIN_STARTCODE@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x23]
	mov	x0, x21
	mov	x2, x22
	bl	_find_startcode
	tbnz	w0, #31, LBB0_13
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w22, w0, #1
	mov	x0, x20
	bl	_decode_main_header
	tbnz	x0, #63, LBB0_1
; %bb.3:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.4:
	mov	w22, #0
	mov	w23, #0
Lloh2:
	adrp	x24, _STREAM_STARTCODE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _STREAM_STARTCODE@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x24]
	mov	x0, x21
	mov	x2, x22
	bl	_find_startcode
	tbnz	w0, #31, LBB0_15
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w22, w0, #1
	mov	x0, x20
	bl	_decode_stream_header
	lsr	x8, x0, #63
	eor	w8, w8, #0x1
	ldr	w9, [x19]
	add	w23, w8, w23
	cmp	w23, w9
	b.lt	LBB0_5
LBB0_7:
	mov	x0, x21
	mov	w1, #0
	bl	_find_any_startcode
	mov	x22, x0
	mov	x0, x21
	bl	_avio_tell
	cbz	x22, LBB0_14
; %bb.8:
	mov	x23, x0
Lloh4:
	adrp	x24, _SYNCPOINT_STARTCODE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _SYNCPOINT_STARTCODE@GOTPAGEOFF]
Lloh6:
	adrp	x25, _INFO_STARTCODE@GOTPAGE
Lloh7:
	ldr	x25, [x25, _INFO_STARTCODE@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x21
	mov	x1, x23
	bl	_find_any_startcode
	mov	x22, x0
	mov	x0, x21
	bl	_avio_tell
	mov	x23, x0
	cbz	x22, LBB0_14
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	cmp	x22, x8
	b.eq	LBB0_18
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x25]
	cmp	x22, x8
	b.ne	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=1
	mov	x0, x20
	bl	_decode_info_header
	b	LBB0_9
LBB0_13:
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_16
LBB0_14:
Lloh13:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x2, l_.str.2@PAGE
Lloh17:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_16
LBB0_15:
Lloh18:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x2, l_.str.1@PAGE
Lloh22:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_16:
	mov	x0, x19
	bl	_av_log
	mov	x0, x19
	bl	_nut_read_close
Lloh23:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh24:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_18:
	str	x22, [x20]
	sub	w8, w23, #8
	ldr	x9, [x19, #8]
	str	w8, [x9]
	ldr	w8, [x21]
Lloh26:
	adrp	x9, _AVIO_SEEKABLE_NORMAL@GOTPAGE
Lloh27:
	ldr	x9, [x9, _AVIO_SEEKABLE_NORMAL@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.19:
	mov	x0, x21
	bl	_avio_tell
	mov	x22, x0
	mov	x0, x20
	bl	_find_and_decode_index
Lloh29:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x22
	bl	_avio_seek
	ldr	x22, [x20]
LBB0_20:
	ldr	x8, [x24]
	cmp	x22, x8
	cset	w0, eq
	bl	_av_assert0
Lloh32:
	adrp	x8, _ff_nut_metadata_conv@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ff_nut_metadata_conv@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, #0
	bl	_ff_metadata_conv_ctx
	mov	w0, #0
	b	LBB0_17
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_MAIN_STARTCODE,4,2             ; @MAIN_STARTCODE
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No main startcode found.\n"

	.comm	_STREAM_STARTCODE,4,2           ; @STREAM_STARTCODE
l_.str.1:                               ; @.str.1
	.asciz	"Not all stream headers found.\n"

l_.str.2:                               ; @.str.2
	.asciz	"EOF before video frames\n"

	.comm	_SYNCPOINT_STARTCODE,8,3        ; @SYNCPOINT_STARTCODE
	.comm	_INFO_STARTCODE,8,3             ; @INFO_STARTCODE
	.comm	_AVIO_SEEKABLE_NORMAL,4,2       ; @AVIO_SEEKABLE_NORMAL
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_ff_nut_metadata_conv,4,2       ; @ff_nut_metadata_conv
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.no_dead_strip	_nut_read_header
.subsections_via_symbols
