	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dhav_read_header
_dhav_read_header:                      ## @dhav_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	$40, %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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	16(%rdi), %r12
	movq	8(%rdi), %rdi
	movl	$5, %esi
	callq	_ffio_ensure_seekback
	movq	8(%r15), %rdi
	leaq	-80(%rbp), %rbx
	movq	%rbx, %rsi
	movl	$20, %edx
	callq	_avio_read
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	$5, %edx
	callq	_memcmp
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	leaq	-80(%rbp), %rdi
	movl	$4, %edx
	callq	_memcmp
	movq	8(%r15), %r14
	testl	%eax, %eax
	je	LBB0_3
## %bb.5:
	cmpq	$0, (%r14)
	je	LBB0_10
## %bb.6:
	movq	%r14, %rdi
	callq	_avio_size
                                        ## kill: def $eax killed $eax def $rax
	leal	-8(%rax), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_avio_seek
	movq	8(%r15), %rdi
	callq	_avio_rl32
	movl	%eax, %ebx
	movl	$100, %edi
	movl	$104, %esi
	movl	$97, %edx
	movl	$118, %ecx
	callq	_MKTAG
	cmpl	%eax, %ebx
	jne	LBB0_10
## %bb.7:
	movq	_SEEK_CUR@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rdi
	callq	_avio_rl32
	movl	%eax, %ebx
	leal	8(%rbx), %r13d
	movq	8(%r15), %rdi
	callq	_avio_tell
	movl	%eax, (%r12)
	cmpl	%eax, %r13d
	jg	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r15), %rdi
	movl	$-8, %esi
	subl	%ebx, %esi
	movl	(%r14), %edx
	callq	_avio_seek
	movq	8(%r15), %rdi
	callq	_avio_rl32
	movl	%eax, %ebx
	movl	$100, %edi
	movl	$104, %esi
	movl	$97, %edx
	movl	$118, %ecx
	callq	_MKTAG
	cmpl	%eax, %ebx
	je	LBB0_8
	jmp	LBB0_10
LBB0_1:
	movq	8(%r15), %rdi
	movl	$1019, %esi                     ## imm = 0x3FB
	callq	_avio_skip
	jmp	LBB0_4
LBB0_3:
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$-5, %esi
	callq	_avio_seek
LBB0_4:
	movq	8(%r15), %rdi
	callq	_avio_tell
	movl	%eax, (%r12)
LBB0_10:
	movq	_AVFMTCTX_NOHEADER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	movq	$-1, 4(%r12)
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DAHUA"

L_.str.1:                               ## @.str.1
	.asciz	"DHAV"

	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_AVFMTCTX_NOHEADER,4,2          ## @AVFMTCTX_NOHEADER
	.no_dead_strip	_dhav_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dhav_read_header
_dhav_read_header:                      ; @dhav_read_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldp	x0, x21, [x0, #8]
	mov	w1, #5
	bl	_ffio_ensure_seekback
	ldr	x0, [x19, #8]
	add	x1, sp, #4
	mov	w2, #20
	bl	_avio_read
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x0, sp, #4
	mov	w2, #5
	bl	_memcmp
	cbz	w0, LBB0_7
; %bb.1:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #4
	mov	w2, #4
	bl	_memcmp
	ldr	x20, [x19, #8]
	cbz	w0, LBB0_8
; %bb.2:
	ldr	x8, [x20]
	cbz	x8, LBB0_10
; %bb.3:
	mov	x0, x20
	bl	_avio_size
	sub	w1, w0, #8
Lloh7:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_avio_seek
	ldr	x0, [x19, #8]
	bl	_avio_rl32
	mov	x20, x0
	mov	w0, #100
	mov	w1, #104
	mov	w2, #97
	mov	w3, #118
	bl	_MKTAG
	cmp	w20, w0
	b.ne	LBB0_10
; %bb.4:
	mov	w22, #-8
Lloh10:
	adrp	x23, _SEEK_CUR@GOTPAGE
Lloh11:
	ldr	x23, [x23, _SEEK_CUR@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19, #8]
	bl	_avio_rl32
	mov	x20, x0
	add	w24, w0, #8
	ldr	x0, [x19, #8]
	bl	_avio_tell
	str	w0, [x21]
	cmp	w24, w0
	b.gt	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x19, #8]
	sub	w1, w22, w20
	ldr	w2, [x23]
	bl	_avio_seek
	ldr	x0, [x19, #8]
	bl	_avio_rl32
	mov	x20, x0
	mov	w0, #100
	mov	w1, #104
	mov	w2, #97
	mov	w3, #118
	bl	_MKTAG
	cmp	w20, w0
	b.eq	LBB0_5
	b	LBB0_10
LBB0_7:
	ldr	x0, [x19, #8]
	mov	w1, #1019
	bl	_avio_skip
	b	LBB0_9
LBB0_8:
Lloh12:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #-5
	bl	_avio_seek
LBB0_9:
	ldr	x0, [x19, #8]
	bl	_avio_tell
	str	w0, [x21]
LBB0_10:
Lloh15:
	adrp	x8, _AVFMTCTX_NOHEADER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AVFMTCTX_NOHEADER@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	movi.2d	v0, #0xffffffffffffffff
	stur	d0, [x21, #4]
	ldr	x8, [sp, #24]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	w0, #0
	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
	add	sp, sp, #96
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DAHUA"

l_.str.1:                               ; @.str.1
	.asciz	"DHAV"

	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_AVFMTCTX_NOHEADER,4,2          ; @AVFMTCTX_NOHEADER
	.no_dead_strip	_dhav_read_header
.subsections_via_symbols
