	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_header
_read_header:                           ## @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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %rbx
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%rbx), %rcx
	movl	%eax, 4(%rcx)
	movq	_AV_CODEC_ID_CDGRAPHICS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rcx)
	movq	%rbx, %rdi
	movl	$32, %esi
	movl	$1, %edx
	movl	$300, %ecx                      ## imm = 0x12C
	callq	_avpriv_set_pts_info
	movl	(%r14), %edi
	callq	_avio_size
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	imull	4(%rbx), %eax
	movq	_CDG_PACKET_SIZE@GOTPCREL(%rip), %rcx
	imull	$300, (%rcx), %ecx              ## imm = 0x12C
	cltd
	idivl	%ecx
	movl	%eax, (%rbx)
	jmp	LBB0_4
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_2:
	movq	_AV_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	callq	_av_log
LBB0_4:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_CDGRAPHICS,4,2     ## @AV_CODEC_ID_CDGRAPHICS
	.comm	_AV_LOG_WARNING,4,2             ## @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot calculate duration as file size cannot be determined\n"

	.comm	_CDG_PACKET_SIZE,4,2            ## @CDG_PACKET_SIZE
	.no_dead_strip	_read_header
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_header
_read_header:                           ; @read_header
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x9, [x0, #8]
Lloh3:
	adrp	x10, _AV_CODEC_ID_CDGRAPHICS@GOTPAGE
Lloh4:
	ldr	x10, [x10, _AV_CODEC_ID_CDGRAPHICS@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	stp	w10, w8, [x9]
	mov	w21, #300
	mov	w1, #32
	mov	w2, #1
	mov	w3, #300
	bl	_avpriv_set_pts_info
	ldr	w0, [x19]
	bl	_avio_size
	tbnz	w0, #31, LBB0_4
; %bb.2:
	ldr	w8, [x20, #4]
	mul	w8, w8, w0
Lloh6:
	adrp	x9, _CDG_PACKET_SIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CDG_PACKET_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	mul	w9, w9, w21
	sdiv	w8, w8, w9
	str	w8, [x20]
	b	LBB0_5
LBB0_3:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_4:
Lloh12:
	adrp	x8, _AV_LOG_WARNING@GOTPAGE
Lloh13:
	ldr	x8, [x8, _AV_LOG_WARNING@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x2, l_.str@PAGE
Lloh16:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
LBB0_5:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AV_CODEC_ID_CDGRAPHICS,4,2     ; @AV_CODEC_ID_CDGRAPHICS
	.comm	_AV_LOG_WARNING,4,2             ; @AV_LOG_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot calculate duration as file size cannot be determined\n"

	.comm	_CDG_PACKET_SIZE,4,2            ; @CDG_PACKET_SIZE
	.no_dead_strip	_read_header
.subsections_via_symbols
