	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gxf_seek
_gxf_seek:                              ## @gxf_seek
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	(%rax), %rbx
	movslq	%esi, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %rax
	cmpq	%rdx, %rax
	cmovgq	%rax, %r12
	movq	%r12, %rsi
	subq	%rax, %rsi
	movq	_AVSEEK_FLAG_ANY@GOTPCREL(%rip), %rax
	movq	_AVSEEK_FLAG_BACKWARD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_av_index_search_timestamp
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	16(%rbx), %rcx
	movl	%eax, %edx
	movl	(%rcx,%rdx,4), %r15d
	movl	8(%rbx), %esi
	addl	$-2, %esi
	movl	$104857600, %edi                ## imm = 0x6400000
	cmpl	%esi, %eax
	jge	LBB0_4
## %bb.3:
	movl	8(%rcx,%rdx,4), %edi
	subl	%r15d, %edi
LBB0_4:
	movl	$204800, %esi                   ## imm = 0x32000
	callq	_FFMAX
	movl	%eax, %ebx
	movl	(%r14), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %esi
	callq	_avio_seek
	testq	%rax, %rax
	js	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	$-1, %edx
	movq	%r12, %rcx
	callq	_gxf_resync_media
	subq	%r12, %rax
	movq	%rax, %rdi
	callq	_FFABS
	movl	%eax, %ecx
	xorl	%eax, %eax
	cmpl	$5, %ecx
	setge	%al
	negl	%eax
	jmp	LBB0_6
LBB0_1:
	movl	$-1, %eax
LBB0_6:
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AVSEEK_FLAG_ANY,4,2            ## @AVSEEK_FLAG_ANY
	.comm	_AVSEEK_FLAG_BACKWARD,4,2       ## @AVSEEK_FLAG_BACKWARD
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.no_dead_strip	_gxf_seek
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gxf_seek
_gxf_seek:                              ; @gxf_seek
	.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	x20, x0
	ldr	x8, [x0, #8]
	ldr	x9, [x8, w1, sxtw #3]
	ldr	x22, [x8]
	ldr	x8, [x9]
	cmp	x8, x2
	csel	x19, x8, x2, gt
Lloh0:
	adrp	x9, _AVSEEK_FLAG_ANY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AVSEEK_FLAG_ANY@GOTPAGEOFF]
	sub	x1, x19, x8
Lloh2:
	ldr	w8, [x9]
Lloh3:
	adrp	x9, _AVSEEK_FLAG_BACKWARD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AVSEEK_FLAG_BACKWARD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x22
	bl	_av_index_search_timestamp
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	x8, [x22, #16]
	ldr	w21, [x8, w0, uxtw #2]
	ldr	w9, [x22, #8]
	sub	w9, w9, #2
	cmp	w0, w9
	b.ge	LBB0_4
; %bb.2:
	add	w9, w0, #2
	ldr	w8, [x8, w9, uxtw #2]
	sub	w0, w8, w21
	b	LBB0_5
LBB0_3:
	mov	w0, #-1
	b	LBB0_7
LBB0_4:
	mov	w0, #104857600
LBB0_5:
	mov	w1, #8192
	movk	w1, #3, lsl #16
	bl	_FFMAX
	mov	x22, x0
	ldr	w0, [x20]
Lloh6:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_avio_seek
	tbnz	x0, #63, LBB0_7
; %bb.6:
	mov	x0, x20
	mov	x1, x22
	mov	w2, #-1
	mov	x3, x19
	bl	_gxf_resync_media
	sub	x0, x0, x19
	bl	_FFABS
	cmp	w0, #4
	csetm	w0, gt
LBB0_7:
                                        ; kill: def $w0 killed $w0 killed $x0
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_AVSEEK_FLAG_ANY,4,2            ; @AVSEEK_FLAG_ANY
	.comm	_AVSEEK_FLAG_BACKWARD,4,2       ; @AVSEEK_FLAG_BACKWARD
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.no_dead_strip	_gxf_seek
.subsections_via_symbols
