	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gdv_read_header
_gdv_read_header:                       ## @gdv_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %r12
	movq	8(%rdi), %r13
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_avio_skip
	movq	%r12, %rdi
	callq	_avio_rl16
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_25
## %bb.1:
	movq	%rax, %r14
	movq	$0, 8(%rax)
	movq	%r12, %rdi
	callq	_avio_rl16
	movq	%rax, 16(%r14)
	movq	%rax, 24(%r14)
	movq	%r12, %rdi
	callq	_avio_rl16
	movq	%rax, %rbx
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.3:
	movq	%r12, %rdi
	callq	_avio_rl16
	testb	$1, %al
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jne	LBB0_4
## %bb.11:
	movq	%r12, %rdi
	movl	$2, %esi
	callq	_avio_skip
	jmp	LBB0_12
LBB0_2:
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_24
LBB0_4:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_25
## %bb.5:
	movq	%rax, %r15
	movq	$0, 8(%rax)
	movq	_AVMEDIA_TYPE_AUDIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r15), %rcx
	movl	%eax, 36(%rcx)
	movq	$0, 24(%rcx)
	movq	%r12, %rdi
	callq	_avio_rl16
	movq	(%r15), %rcx
	movl	%eax, (%rcx)
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	btl	$1, %edx
	adcl	$1, %ebx
	movl	%ebx, 4(%rcx)
	movl	%edx, %ebx
	andl	$8, %ebx
	jne	LBB0_6
## %bb.7:
	testb	$4, %dl
	jne	LBB0_8
## %bb.9:
	movq	_AV_CODEC_ID_PCM_U8@GOTPCREL(%rip), %rdx
	jmp	LBB0_10
LBB0_25:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_6:
	movq	_AV_CODEC_ID_GREMLIN_DPCM@GOTPCREL(%rip), %rdx
	jmp	LBB0_10
LBB0_8:
	movq	_AV_CODEC_ID_PCM_S16LE@GOTPCREL(%rip), %rdx
LBB0_10:
	movl	(%rdx), %edx
	movl	%edx, 32(%rcx)
	movq	%r15, %rdi
	movl	$64, %esi
	movl	$1, %edx
	movl	%eax, %ecx
	callq	_avpriv_set_pts_info
	movq	(%r15), %rcx
	movl	(%rcx), %eax
	xorl	%esi, %esi
	xorl	%edx, %edx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	divl	%edi
	btl	$2, -48(%rbp)                   ## 4-byte Folded Reload
	adcl	$1, %esi
	imull	%esi, %eax
	imull	4(%rcx), %eax
	shrl	$3, %ebx
	incl	%ebx
	xorl	%edx, %edx
	divl	%ebx
	movq	%rdi, %rbx
	movl	%eax, (%r13)
	movl	$1, 4(%r13)
LBB0_12:
	movq	%r12, %rdi
	callq	_avio_rl16
	movq	%rax, %r15
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_avio_skip
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r14), %rcx
	movl	%eax, 36(%rcx)
	movq	_AV_CODEC_ID_GDV@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rcx)
	movq	$0, 24(%rcx)
	movq	%r12, %rdi
	callq	_avio_rl16
	movq	(%r14), %rcx
	movq	%rax, 16(%rcx)
	movq	%r12, %rdi
	callq	_avio_rl16
	movq	(%r14), %rcx
	movq	%rax, 8(%rcx)
	cmpq	$0, 16(%rcx)
	je	LBB0_14
## %bb.13:
	testq	%rax, %rax
	jne	LBB0_20
LBB0_14:
	movq	_FixedSize@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_FF_ARRAY_ELEMS
	cmpl	$2, %eax
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	jl	LBB0_15
## %bb.16:
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	_FixedSize@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	%eax, (%rdi,%rbx)
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=1
	incq	%r15
	callq	_FF_ARRAY_ELEMS
	decl	%eax
	cltq
	addq	$24, %rbx
	cmpq	%rax, %r15
	jl	LBB0_17
	jmp	LBB0_19
LBB0_15:
	xorl	%r15d, %r15d
LBB0_19:
	movq	_FixedSize@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%r15d, %ecx
	movq	(%r14), %rdx
	leaq	(%rcx,%rcx,2), %rcx
	movups	8(%rax,%rcx,8), %xmm0
	movups	%xmm0, 8(%rdx)
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_20:
	movq	%r14, %rdi
	movl	$64, %esi
	movl	$1, %edx
	movl	%ebx, %ecx
	callq	_avpriv_set_pts_info
	testb	$1, %r15b
	je	LBB0_23
## %bb.21:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_avio_r8
	movl	%eax, %r14d
	movq	%r12, %rdi
	callq	_avio_r8
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_avio_r8
	shll	$18, %r14d
	shll	$10, %ebx
	orl	%r14d, %ebx
	shll	$2, %eax
	orl	%ebx, %eax
	orl	$-16777216, %eax                ## imm = 0xFF000000
	movq	8(%r13), %rcx
	movl	%eax, (%rcx,%r15,4)
	incq	%r15
	cmpq	$256, %r15                      ## imm = 0x100
	jne	LBB0_22
LBB0_23:
	movl	$1, 16(%r13)
	xorl	%eax, %eax
LBB0_24:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ## @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CODEC_ID_GREMLIN_DPCM,4,2   ## @AV_CODEC_ID_GREMLIN_DPCM
	.comm	_AV_CODEC_ID_PCM_S16LE,4,2      ## @AV_CODEC_ID_PCM_S16LE
	.comm	_AV_CODEC_ID_PCM_U8,4,2         ## @AV_CODEC_ID_PCM_U8
	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_GDV,4,2            ## @AV_CODEC_ID_GDV
	.comm	_FixedSize,8,3                  ## @FixedSize
	.no_dead_strip	_gdv_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gdv_read_header
_gdv_read_header:                       ; @gdv_read_header
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x0
	ldp	x19, x25, [x0]
	mov	x0, x19
	mov	w1, #4
	bl	_avio_skip
	mov	x0, x19
	bl	_avio_rl16
	mov	x22, x0
	mov	x0, x24
	mov	w1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_8
; %bb.1:
	mov	x20, x0
	str	xzr, [x0, #8]
	mov	x0, x19
	bl	_avio_rl16
	stp	x0, x0, [x20, #16]
	mov	x0, x19
	bl	_avio_rl16
	mov	x21, x0
	cbz	w21, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_avio_rl16
	mov	x23, x0
	tbnz	w23, #0, LBB0_5
; %bb.3:
	mov	x0, x19
	mov	w1, #2
	bl	_avio_skip
	b	LBB0_11
LBB0_4:
Lloh0:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	b	LBB0_23
LBB0_5:
	mov	x0, x24
	mov	w1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_8
; %bb.6:
	mov	x24, x0
	str	xzr, [x0, #8]
Lloh3:
	adrp	x8, _AVMEDIA_TYPE_AUDIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AVMEDIA_TYPE_AUDIO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	x9, [x0]
	str	w8, [x9, #36]
	str	xzr, [x9, #24]
	mov	x0, x19
	bl	_avio_rl16
	mov	x3, x0
	ldr	x8, [x24]
	ubfx	w9, w23, #1, #1
	add	w9, w9, #1
	stp	w3, w9, [x8]
	and	w26, w23, #0x8
	tbnz	w23, #3, LBB0_9
; %bb.7:
Lloh6:
	adrp	x9, _AV_CODEC_ID_PCM_S16LE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AV_CODEC_ID_PCM_S16LE@GOTPAGEOFF]
Lloh8:
	adrp	x10, _AV_CODEC_ID_PCM_U8@GOTPAGE
Lloh9:
	ldr	x10, [x10, _AV_CODEC_ID_PCM_U8@GOTPAGEOFF]
	tst	w23, #0x4
	csel	x9, x10, x9, eq
	b	LBB0_10
LBB0_8:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_9:
Lloh13:
	adrp	x9, _AV_CODEC_ID_GREMLIN_DPCM@GOTPAGE
Lloh14:
	ldr	x9, [x9, _AV_CODEC_ID_GREMLIN_DPCM@GOTPAGEOFF]
LBB0_10:
	ldr	w9, [x9]
	str	w9, [x8, #32]
	mov	w27, #1
	mov	x0, x24
	mov	w1, #64
	mov	w2, #1
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_avpriv_set_pts_info
	ldr	x8, [x24]
	ldp	w9, w8, [x8]
	udiv	w9, w9, w21
	ubfx	w10, w23, #2, #1
	madd	w9, w9, w10, w9
	mul	w8, w9, w8
	lsr	w9, w26, #3
	add	w9, w9, #1
	udiv	w8, w8, w9
	stp	w8, w27, [x25]
LBB0_11:
	mov	x0, x19
	bl	_avio_rl16
	mov	x23, x0
	mov	x0, x19
	mov	w1, #4
	bl	_avio_skip
Lloh15:
	adrp	x8, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	x9, [x20]
Lloh18:
	adrp	x10, _AV_CODEC_ID_GDV@GOTPAGE
Lloh19:
	ldr	x10, [x10, _AV_CODEC_ID_GDV@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	stp	w10, w8, [x9, #32]
	str	xzr, [x9, #24]
	mov	x0, x19
	bl	_avio_rl16
	ldr	x8, [x20]
	str	x0, [x8, #16]
	mov	x0, x19
	bl	_avio_rl16
	ldr	x8, [x20]
	str	x0, [x8, #8]
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_13
; %bb.12:
	cbnz	x0, LBB0_19
LBB0_13:
Lloh21:
	adrp	x24, _FixedSize@GOTPAGE
Lloh22:
	ldr	x24, [x24, _FixedSize@GOTPAGEOFF]
	ldr	x0, [x24]
	bl	_FF_ARRAY_ELEMS
	cmp	w0, #2
	b.lt	LBB0_17
; %bb.14:
	mov	x27, #0
	mov	x26, #0
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x24]
	ldr	w8, [x0, x27]
	cmp	w8, w22
	b.eq	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	add	x26, x26, #1
	bl	_FF_ARRAY_ELEMS
	sub	w8, w0, #1
	add	x27, x27, #24
	cmp	x26, w8, sxtw
	b.lt	LBB0_15
	b	LBB0_18
LBB0_17:
	mov	x26, #0
LBB0_18:
	ldr	x8, [x24]
	and	x9, x26, #0xffffffff
	mov	w10, #24
	madd	x8, x9, x10, x8
	ldr	x9, [x20]
	ldp	x8, x10, [x8, #8]
	stp	x8, x10, [x9, #8]
LBB0_19:
	mov	w22, #1
	mov	x0, x20
	mov	w1, #64
	mov	w2, #1
	mov	x3, x21
	bl	_avpriv_set_pts_info
	tbz	w23, #0, LBB0_22
; %bb.20:
	mov	x23, #0
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_avio_r8
	mov	x20, x0
	mov	x0, x19
	bl	_avio_r8
	mov	x21, x0
	mov	x0, x19
	bl	_avio_r8
	lsl	w8, w20, #18
	orr	w8, w8, w21, lsl #10
	orr	w8, w8, w0, lsl #2
	orr	w8, w8, #0xff000000
	ldr	x9, [x25, #8]
	str	w8, [x9, x23]
	add	x23, x23, #4
	cmp	x23, #1024
	b.ne	LBB0_21
LBB0_22:
	mov	w0, #0
	str	w22, [x25, #16]
LBB0_23:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.comm	_AVMEDIA_TYPE_AUDIO,4,2         ; @AVMEDIA_TYPE_AUDIO
	.comm	_AV_CODEC_ID_GREMLIN_DPCM,4,2   ; @AV_CODEC_ID_GREMLIN_DPCM
	.comm	_AV_CODEC_ID_PCM_S16LE,4,2      ; @AV_CODEC_ID_PCM_S16LE
	.comm	_AV_CODEC_ID_PCM_U8,4,2         ; @AV_CODEC_ID_PCM_U8
	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_GDV,4,2            ; @AV_CODEC_ID_GDV
	.comm	_FixedSize,8,3                  ; @FixedSize
	.no_dead_strip	_gdv_read_header
.subsections_via_symbols
