	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function x8_setup_spatial_predictor
_x8_setup_spatial_predictor:            ## @x8_setup_spatial_predictor
	.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
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	48(%rdi), %rax
	movslq	%esi, %rbx
	movl	(%rax,%rbx,4), %edi
	movl	40(%r12), %esi
	movq	32(%r12), %rax
	movq	(%rax), %rax
	xorl	%ecx, %ecx
	testl	%ebx, %ebx
	setg	%cl
	movl	(%rax,%rcx,4), %edx
	movl	(%r12), %r9d
	leaq	-40(%rbp), %rcx
	leaq	-36(%rbp), %r8
	callq	*56(%r12)
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.1:
	movl	8(%r12), %eax
	movl	%eax, 4(%r12)
	leaq	12(%r12), %rax
	jmp	LBB0_3
LBB0_2:
	leaq	16(%r12), %rax
LBB0_3:
	movl	(%rax), %ecx
	movl	$0, 20(%r12)
	movl	-40(%rbp), %eax
	cmpl	%ecx, %eax
	jl	LBB0_5
## %bb.4:
	cmpl	$2, %eax
	jg	LBB0_7
LBB0_5:
	movl	$0, 4(%r12)
	cmpl	$2, %eax
	jg	LBB0_7
## %bb.6:
	movl	$1, 20(%r12)
	movl	-36(%rbp), %eax
	addl	$9, %eax
	movl	%eax, -36(%rbp)
	imull	$6899, %eax, %eax               ## imm = 0x1AF3
	sarl	$17, %eax
	movl	%eax, 24(%r12)
LBB0_7:
	xorl	%r15d, %r15d
	testl	%r14d, %r14d
	jne	LBB0_19
## %bb.8:
	xorl	%edi, %edi
	cmpl	$3, 4(%r12)
	setl	%dil
	callq	_av_assert2
	movl	16(%r12), %eax
	addl	%eax, %eax
	cmpl	%eax, -40(%rbp)
	jge	LBB0_16
## %bb.9:
	xorl	%eax, %eax
	testb	$3, (%r12)
	je	LBB0_10
LBB0_14:
	movl	%eax, 4(%r12)
LBB0_15:
	movl	$0, 28(%r12)
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_16:
	movq	%r12, %rdi
	callq	_x8_get_orient_vlc
	movl	%eax, 28(%r12)
	testl	%eax, %eax
	js	LBB0_17
## %bb.18:
	xorl	%edi, %edi
	cmpl	$12, %eax
	setb	%dil
	callq	_av_assert2
	xorl	%edi, %edi
	cmpl	$3, 4(%r12)
	setl	%dil
	callq	_av_assert2
	movslq	4(%r12), %rax
	movslq	28(%r12), %rcx
	leaq	(%rax,%rax,2), %rax
	shlq	$4, %rax
	leaq	_x8_setup_spatial_predictor.prediction_table(%rip), %rdx
	addq	%rax, %rdx
	movl	(%rdx,%rcx,4), %eax
	movl	%eax, 4(%r12)
	jmp	LBB0_19
LBB0_10:
	movl	4(%r12), %eax
	cmpl	$1, %eax
	je	LBB0_11
## %bb.12:
	cmpl	$2, %eax
	jne	LBB0_15
## %bb.13:
	movl	$10, %eax
	jmp	LBB0_14
LBB0_17:
	movl	$-1, %r15d
LBB0_19:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	$11, %eax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @x8_setup_spatial_predictor.prediction_table
_x8_setup_spatial_predictor.prediction_table:
	.long	0                               ## 0x0
	.long	8                               ## 0x8
	.long	4                               ## 0x4
	.long	10                              ## 0xa
	.long	11                              ## 0xb
	.long	2                               ## 0x2
	.long	6                               ## 0x6
	.long	9                               ## 0x9
	.long	1                               ## 0x1
	.long	3                               ## 0x3
	.long	5                               ## 0x5
	.long	7                               ## 0x7
	.long	4                               ## 0x4
	.long	0                               ## 0x0
	.long	8                               ## 0x8
	.long	11                              ## 0xb
	.long	10                              ## 0xa
	.long	3                               ## 0x3
	.long	5                               ## 0x5
	.long	2                               ## 0x2
	.long	6                               ## 0x6
	.long	9                               ## 0x9
	.long	1                               ## 0x1
	.long	7                               ## 0x7
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	4                               ## 0x4
	.long	10                              ## 0xa
	.long	11                              ## 0xb
	.long	1                               ## 0x1
	.long	7                               ## 0x7
	.long	2                               ## 0x2
	.long	6                               ## 0x6
	.long	9                               ## 0x9
	.long	3                               ## 0x3
	.long	5                               ## 0x5

	.no_dead_strip	_x8_setup_spatial_predictor
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function x8_setup_spatial_predictor
_x8_setup_spatial_predictor:            ; @x8_setup_spatial_predictor
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	ldp	x9, x8, [x0, #48]
	ldr	w0, [x9, w1, sxtw #2]
	ldr	w1, [x19, #40]
	ldr	x9, [x19, #32]
	ldr	x9, [x9]
	cmp	w20, #0
	cset	w10, gt
	ldr	w2, [x9, w10, uxtw #2]
	ldr	w5, [x19]
	add	x3, sp, #12
	add	x4, sp, #8
	blr	x8
	cbz	w20, LBB0_2
; %bb.1:
	ldr	w8, [x19, #8]
	str	w8, [x19, #4]
	add	x8, x19, #12
	b	LBB0_3
LBB0_2:
	add	x8, x19, #16
LBB0_3:
	ldr	w9, [x8]
	str	wzr, [x19, #20]
	ldr	w8, [sp, #12]
	cmp	w8, w9
	b.lt	LBB0_5
; %bb.4:
	cmp	w8, #2
	b.gt	LBB0_7
LBB0_5:
	str	wzr, [x19, #4]
	cmp	w8, #2
	b.gt	LBB0_7
; %bb.6:
	mov	w8, #1
	ldr	w9, [sp, #8]
	add	w9, w9, #9
	str	w9, [sp, #8]
	mov	w10, #6899
	mul	w9, w9, w10
	asr	w9, w9, #17
	stp	w8, w9, [x19, #20]
LBB0_7:
	cbz	w20, LBB0_9
; %bb.8:
	mov	w0, #0
	b	LBB0_20
LBB0_9:
	ldr	w8, [x19, #4]
	cmp	w8, #3
	cset	w0, lt
	bl	_av_assert2
	ldr	w8, [sp, #12]
	ldr	w9, [x19, #16]
	cmp	w8, w9, lsl #1
	b.ge	LBB0_14
; %bb.10:
	ldrb	w8, [x19]
	tst	w8, #0x3
	b.eq	LBB0_16
; %bb.11:
	mov	w8, #0
LBB0_12:
	str	w8, [x19, #4]
LBB0_13:
	mov	w0, #0
	str	wzr, [x19, #28]
	b	LBB0_20
LBB0_14:
	mov	x0, x19
	bl	_x8_get_orient_vlc
	str	w0, [x19, #28]
	tbnz	w0, #31, LBB0_19
; %bb.15:
	cmp	w0, #12
	cset	w0, lo
	bl	_av_assert2
	ldr	w8, [x19, #4]
	cmp	w8, #3
	cset	w0, lt
	bl	_av_assert2
	mov	w0, #0
	ldrsw	x8, [x19, #4]
	ldrsw	x9, [x19, #28]
	mov	w10, #48
Lloh0:
	adrp	x11, _x8_setup_spatial_predictor.prediction_table@PAGE
Lloh1:
	add	x11, x11, _x8_setup_spatial_predictor.prediction_table@PAGEOFF
	madd	x8, x8, x10, x11
	ldr	w8, [x8, x9, lsl #2]
	str	w8, [x19, #4]
	b	LBB0_20
LBB0_16:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.eq	LBB0_21
; %bb.17:
	cmp	w8, #2
	b.ne	LBB0_13
; %bb.18:
	mov	w8, #10
	b	LBB0_12
LBB0_19:
	mov	w0, #-1
LBB0_20:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_21:
	mov	w8, #11
	b	LBB0_12
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @x8_setup_spatial_predictor.prediction_table
_x8_setup_spatial_predictor.prediction_table:
	.long	0                               ; 0x0
	.long	8                               ; 0x8
	.long	4                               ; 0x4
	.long	10                              ; 0xa
	.long	11                              ; 0xb
	.long	2                               ; 0x2
	.long	6                               ; 0x6
	.long	9                               ; 0x9
	.long	1                               ; 0x1
	.long	3                               ; 0x3
	.long	5                               ; 0x5
	.long	7                               ; 0x7
	.long	4                               ; 0x4
	.long	0                               ; 0x0
	.long	8                               ; 0x8
	.long	11                              ; 0xb
	.long	10                              ; 0xa
	.long	3                               ; 0x3
	.long	5                               ; 0x5
	.long	2                               ; 0x2
	.long	6                               ; 0x6
	.long	9                               ; 0x9
	.long	1                               ; 0x1
	.long	7                               ; 0x7
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.long	4                               ; 0x4
	.long	10                              ; 0xa
	.long	11                              ; 0xb
	.long	1                               ; 0x1
	.long	7                               ; 0x7
	.long	2                               ; 0x2
	.long	6                               ; 0x6
	.long	9                               ; 0x9
	.long	3                               ; 0x3
	.long	5                               ; 0x5

	.no_dead_strip	_x8_setup_spatial_predictor
.subsections_via_symbols
