	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function grab_read_header
_grab_read_header:                      ## @grab_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	8(%rdi), %rbx
	movq	24(%rbx), %rsi
	testq	%rsi, %rsi
	jne	LBB0_3
## %bb.1:
	movl	(%rbx), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	jae	LBB0_12
## %bb.2:
	cltq
	leaq	l_reltable.grab_read_header(%rip), %rcx
	movslq	(%rcx,%rax,4), %rdi
	addq	%rcx, %rdi
	callq	_av_strdup
	movq	%rax, %rsi
	movq	%rax, 24(%rbx)
LBB0_3:
	leaq	-40(%rbp), %rdi
	callq	_av_parse_video_rate
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_avformat_new_stream
	testq	%rax, %rax
	je	LBB0_6
## %bb.8:
	movq	%rax, %r12
	movq	%rax, %rdi
	movl	$64, %esi
	movl	$1, %edx
	movl	$1000000, %ecx                  ## imm = 0xF4240
	callq	_avpriv_set_pts_info
	imull	$1000000, -40(%rbp), %eax       ## imm = 0xF4240
	cltd
	idivl	-36(%rbp)
	movl	%eax, 4(%rbx)
	movq	_AVMEDIA_TYPE_VIDEO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r12), %rcx
	movl	%eax, 16(%rcx)
	movq	_AV_PIX_FMT_YUV420P@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rcx)
	movq	_AV_CODEC_ID_RAWVIDEO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rcx)
	movl	20(%rbx), %eax
	movl	%eax, 4(%rcx)
	movl	16(%rbx), %eax
	movl	%eax, (%rcx)
	movq	-40(%rbp), %rax
	movq	%rax, (%r12)
	movl	(%r15), %edi
	movl	20(%rbx), %esi
	movl	(%rbx), %ecx
	movl	16(%rbx), %edx
	leaq	12(%rbx), %r8
	addq	$8, %rbx
	movl	$-1, (%rsp)
	xorps	%xmm0, %xmm0
	movq	%rbx, %r9
	callq	_bktr_init
	testq	%rax, %rax
	js	LBB0_9
## %bb.10:
	movq	_nsignals@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_last_frame_time@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	jmp	LBB0_11
LBB0_4:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	24(%rbx), %rcx
	leaq	L_.str.4(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	jmp	LBB0_11
LBB0_12:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_9:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pal"

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

L_.str.2:                               ## @.str.2
	.asciz	"25"

	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
L_.str.3:                               ## @.str.3
	.asciz	"Unknown standard.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.4:                               ## @.str.4
	.asciz	"Could not parse framerate '%s'.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ## @AVMEDIA_TYPE_VIDEO
	.comm	_AV_PIX_FMT_YUV420P,4,2         ## @AV_PIX_FMT_YUV420P
	.comm	_AV_CODEC_ID_RAWVIDEO,4,2       ## @AV_CODEC_ID_RAWVIDEO
	.comm	_EIO,4,2                        ## @EIO
	.comm	_nsignals,8,3                   ## @nsignals
	.comm	_last_frame_time,8,3            ## @last_frame_time
	.no_dead_strip	_grab_read_header
	.section	__TEXT,__const
	.p2align	2                               ## @reltable.grab_read_header
l_reltable.grab_read_header:
	.long	L_.str.2-l_reltable.grab_read_header
	.long	L_.str-l_reltable.grab_read_header
	.long	L_.str.1-l_reltable.grab_read_header

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function grab_read_header
_grab_read_header:                      ; @grab_read_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x0
	ldr	x22, [x0, #8]
	ldr	x1, [x22, #24]
	cbnz	x1, LBB0_3
; %bb.1:
	ldr	w8, [x22]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hs	LBB0_8
; %bb.2:
Lloh0:
	adrp	x9, l_switch.table.grab_read_header@PAGE
Lloh1:
	add	x9, x9, l_switch.table.grab_read_header@PAGEOFF
	ldr	x0, [x9, w8, sxtw #3]
	bl	_av_strdup
	mov	x1, x0
	str	x0, [x22, #24]
LBB0_3:
	add	x0, sp, #8
	bl	_av_parse_video_rate
	mov	x19, x0
	tbnz	w0, #31, LBB0_7
; %bb.4:
	mov	x0, x20
	mov	x1, #0
	bl	_avformat_new_stream
	cbz	x0, LBB0_9
; %bb.5:
	mov	x21, x0
	mov	w23, #16960
	movk	w23, #15, lsl #16
	mov	w1, #64
	mov	w2, #1
	mov	w3, #16960
	movk	w3, #15, lsl #16
	bl	_avpriv_set_pts_info
	ldp	w8, w9, [sp, #8]
	mul	w8, w8, w23
	sdiv	w8, w8, w9
	str	w8, [x22, #4]
Lloh2:
	adrp	x8, _AVMEDIA_TYPE_VIDEO@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AVMEDIA_TYPE_VIDEO@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	x9, [x21, #8]
	str	w8, [x9, #16]
Lloh5:
	adrp	x8, _AV_PIX_FMT_YUV420P@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_PIX_FMT_YUV420P@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x10, _AV_CODEC_ID_RAWVIDEO@GOTPAGE
Lloh9:
	ldr	x10, [x10, _AV_CODEC_ID_RAWVIDEO@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	stp	w10, w8, [x9, #8]
	ldr	d0, [x22, #16]
	str	d0, [x9]
	ldr	x8, [sp, #8]
	str	x8, [x21]
	ldr	w0, [x20]
	ldp	w2, w1, [x22, #16]
	ldr	w3, [x22]
	add	x4, x22, #12
	add	x5, x22, #8
	movi	d0, #0000000000000000
	mov	w6, #-1
	bl	_bktr_init
	tbnz	x0, #63, LBB0_10
; %bb.6:
Lloh11:
	adrp	x8, _nsignals@GOTPAGE
Lloh12:
	ldr	x8, [x8, _nsignals@GOTPAGEOFF]
Lloh13:
	str	xzr, [x8]
Lloh14:
	adrp	x8, _last_frame_time@GOTPAGE
Lloh15:
	ldr	x8, [x8, _last_frame_time@GOTPAGEOFF]
Lloh16:
	str	xzr, [x8]
	b	LBB0_12
LBB0_7:
Lloh17:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	x8, [x22, #24]
	str	x8, [sp]
Lloh20:
	adrp	x2, l_.str.4@PAGE
Lloh21:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_av_log
	b	LBB0_12
LBB0_8:
Lloh22:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x2, l_.str.3@PAGE
Lloh26:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_av_log
Lloh27:
	adrp	x8, _EINVAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	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
	add	sp, sp, #80
	b	_AVERROR
LBB0_9:
Lloh30:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh32:
	adrp	x8, _EIO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x19, x0
LBB0_12:
	mov	x0, x19
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pal"

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

l_.str.2:                               ; @.str.2
	.asciz	"25"

	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
l_.str.3:                               ; @.str.3
	.asciz	"Unknown standard.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.4:                               ; @.str.4
	.asciz	"Could not parse framerate '%s'.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVMEDIA_TYPE_VIDEO,4,2         ; @AVMEDIA_TYPE_VIDEO
	.comm	_AV_PIX_FMT_YUV420P,4,2         ; @AV_PIX_FMT_YUV420P
	.comm	_AV_CODEC_ID_RAWVIDEO,4,2       ; @AV_CODEC_ID_RAWVIDEO
	.comm	_EIO,4,2                        ; @EIO
	.comm	_nsignals,8,3                   ; @nsignals
	.comm	_last_frame_time,8,3            ; @last_frame_time
	.no_dead_strip	_grab_read_header
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.grab_read_header
l_switch.table.grab_read_header:
	.quad	l_.str.2
	.quad	l_.str
	.quad	l_.str.1

.subsections_via_symbols
