	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbr_hf_calc_npatches
_sbr_hf_calc_npatches:                  ## @sbr_hf_calc_npatches
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	(%rsi), %r8
	movq	8(%rsi), %rcx
	movl	(%r8), %r15d
	movl	4(%rcx), %r9d
	movl	16(%rsi), %esi
	movl	%esi, %eax
	sarl	%eax
	addl	$2048000, %eax                  ## imm = 0x1F4000
	cltd
	idivl	%esi
	movl	$0, 20(%r13)
	movq	24(%r13), %rdx
	movl	4(%rdx), %edx
	addl	4(%rcx), %edx
	cmpl	%edx, %eax
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	jge	LBB0_3
## %bb.1:
	movq	32(%r13), %rcx
	movl	$-1, %edi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	incl	%edi
	leaq	4(%rcx), %rdx
	cmpl	%eax, (%rcx)
	movq	%rdx, %rcx
	jl	LBB0_2
	jmp	LBB0_4
LBB0_3:
	movl	40(%r13), %edi
LBB0_4:
	movl	$-1, %eax
	xorl	%ecx, %ecx
	movl	$-1, %esi
	xorl	%r14d, %r14d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r13), %rsi
	movq	24(%r13), %rbx
	movl	4(%rbx), %ebx
	addl	4(%rsi), %ebx
	movl	%r15d, %esi
	movl	%r10d, %r15d
	cmpl	%ebx, %r14d
	je	LBB0_19
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movl	%edi, %r10d
	cmpl	%eax, %edi
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%esi, %r15d
	je	LBB0_23
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movslq	%r10d, %r11
	movl	(%r8), %eax
	leaq	(,%r11,4), %rdx
	xorl	%edi, %edi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=2
	movq	32(%r13), %rbx
	addq	%rdx, %rbx
	movl	(%rbx,%rdi,4), %r14d
	leal	(%rax,%r14), %r12d
	andl	$1, %r12d
	movq	%rsi, %rdi
LBB0_8:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	subq	$1, %rsi
	jb	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	movl	%r12d, %ebx
	notl	%ebx
	addl	%r15d, %ebx
	addl	%eax, %ebx
	cmpl	%ebx, %r14d
	jg	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$6, %ecx
	jge	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r11, -64(%rbp)                 ## 8-byte Spill
	movl	%r10d, %ebx
	movl	%r14d, %edi
	subl	%r9d, %edi
	xorl	%esi, %esi
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	callq	_FFMAX
	movq	48(%r13), %rdx
	movslq	20(%r13), %rcx
	movl	%eax, (%rdx,%rcx,4)
	movq	(%r13), %r8
	movq	56(%r13), %rax
	movl	(%r8), %ecx
	movslq	20(%r13), %rsi
	addl	(%rdx,%rsi,4), %r12d
	subl	%r12d, %ecx
	movl	%ecx, (%rax,%rsi,4)
	movslq	20(%r13), %rcx
	cmpl	$0, (%rdx,%rcx,4)
	jle	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	incl	%ecx
	movl	%ecx, 20(%r13)
	movl	%r14d, %r10d
	movl	%r14d, %r9d
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r13), %rax
	movl	4(%rax), %r10d
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %eax
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	32(%r13), %rsi
	movl	(%rsi,%rdi,4), %esi
	subl	%r14d, %esi
	movl	%ebx, %edi
	cmpl	$2, %esi
	jg	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	40(%r13), %edi
	jmp	LBB0_18
LBB0_23:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%eax, %eax
	callq	_av_log
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_22
LBB0_12:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	xorl	%eax, %eax
	callq	_av_log
	movl	$-1, %eax
	jmp	LBB0_22
LBB0_19:
	xorl	%eax, %eax
	cmpl	$2, %ecx
	jl	LBB0_22
## %bb.20:
	decl	%ecx
	cmpl	$2, (%rdx,%rcx,4)
	jg	LBB0_22
## %bb.21:
	movl	%ecx, 20(%r13)
LBB0_22:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"patch construction failed\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
L_.str.1:                               ## @.str.1
	.asciz	"Too many patches: %d\n"

	.no_dead_strip	_sbr_hf_calc_npatches
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbr_hf_calc_npatches
_sbr_hf_calc_npatches:                  ; @sbr_hf_calc_npatches
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
	ldp	x9, x10, [x1]
	ldr	w21, [x9]
	ldr	w22, [x10, #4]
	ldr	w8, [x1, #16]
	asr	w11, w8, #1
	add	w11, w11, #500, lsl #12         ; =2048000
	sdiv	w8, w11, w8
	str	wzr, [x1, #20]
	ldr	w10, [x10, #4]
	ldr	x11, [x1, #24]
	ldr	w11, [x11, #4]
	add	w10, w11, w10
	cmp	w8, w10
	b.ge	LBB0_3
; %bb.1:
	ldr	x10, [x19, #32]
	mov	w11, #-1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x10], #4
	add	w11, w11, #1
	cmp	w12, w8
	b.lt	LBB0_2
	b	LBB0_4
LBB0_3:
	ldr	w11, [x19, #40]
LBB0_4:
	mov	w8, #0
	mov	w23, #0
	mov	w24, #-1
	mov	w13, #-1
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x13, [x19, #8]
	ldr	w13, [x13, #4]
	ldr	x14, [x19, #24]
	ldr	w14, [x14, #4]
	add	w13, w14, w13
	cmp	w23, w13
	mov	x13, x21
	mov	x21, x12
	b.eq	LBB0_20
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	mov	x10, x24
	mov	x24, x11
	cmp	w11, w10
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w21, w13
	b.eq	LBB0_18
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x10, #0
	mov	w26, #0
	sxtw	x25, w24
	ldr	w9, [x9]
	sbfiz	x11, x24, #2, #32
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	ldr	x12, [x19, #32]
	add	x12, x12, x11
	ldr	w23, [x12, x10, lsl #2]
	add	w12, w9, w23
	and	w26, w12, #0x1
	sub	x10, x10, #1
LBB0_10:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cbz	x10, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	mvn	w12, w26
	add	w12, w21, w12
	add	w12, w12, w9
	cmp	w23, w12
	b.gt	LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w8, #6
	b.ge	LBB0_19
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	sub	w0, w23, w22
	mov	w1, #0
	bl	_FFMAX
	ldrsw	x8, [x19, #20]
	ldp	x10, x11, [x19, #48]
	str	w0, [x10, x8, lsl #2]
	ldr	x9, [x19]
	ldr	w8, [x9]
	ldrsw	x12, [x19, #20]
	lsl	x12, x12, #2
	ldr	w13, [x10, x12]
	add	w13, w26, w13
	sub	w8, w8, w13
	str	w8, [x11, x12]
	ldrsw	x8, [x19, #20]
	ldr	w11, [x10, x8, lsl #2]
	cmp	w11, #1
	b.lt	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_6 Depth=1
	add	w8, w8, #1
	str	w8, [x19, #20]
	mov	x12, x23
	mov	x22, x23
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x11, [x19, #8]
	ldr	w12, [x11, #4]
LBB0_16:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x11, [x19, #32]
	ldr	w11, [x11, x25, lsl #2]
	sub	w13, w11, w23
	mov	x11, x24
	cmp	w13, #2
	b.gt	LBB0_5
; %bb.17:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w11, [x19, #40]
	b	LBB0_5
LBB0_18:
	ldr	w0, [x20]
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
Lloh5:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_24
LBB0_19:
	ldr	w0, [x20]
Lloh8:
	adrp	x9, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x9]
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	str	x8, [sp]
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_av_log
	mov	w0, #-1
	b	LBB0_24
LBB0_20:
	cmp	w8, #2
	b.lt	LBB0_23
; %bb.21:
	sub	w8, w8, #1
	ldr	w9, [x10, w8, uxtw #2]
	cmp	w9, #2
	b.gt	LBB0_23
; %bb.22:
	mov	w0, #0
	str	w8, [x19, #20]
	b	LBB0_24
LBB0_23:
	mov	w0, #0
LBB0_24:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"patch construction failed\n"

	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
l_.str.1:                               ; @.str.1
	.asciz	"Too many patches: %d\n"

	.no_dead_strip	_sbr_hf_calc_npatches
.subsections_via_symbols
