	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_av_rescale_rnd                 ## -- Begin function av_rescale_rnd
	.p2align	4, 0x90
_av_rescale_rnd:                        ## @av_rescale_rnd
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movl	%edx, %r15d
	movl	%esi, %r14d
	movl	%edi, %r12d
	xorl	%edi, %edi
	testl	%edx, %edx
	setg	%dil
	callq	_av_assert2
	movl	%r14d, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_av_assert2
	movq	_AV_ROUND_PASS_MINMAX@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	notl	%eax
	andl	%ebx, %eax
	cmpl	$6, %eax
	setb	%cl
	cmpl	$4, %eax
	setne	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_av_assert2
	testl	%r14d, %r14d
	js	LBB0_4
## %bb.1:
	testl	%r15d, %r15d
	jle	LBB0_4
## %bb.2:
	movl	(%r13), %eax
	movl	%eax, %ecx
	notl	%ecx
	andl	%ebx, %ecx
	cmpl	$5, %ecx
	ja	LBB0_4
## %bb.3:
	cmpl	$4, %ecx
	je	LBB0_4
## %bb.5:
	testl	%ebx, %eax
	je	LBB0_9
## %bb.6:
	movq	_INT64_MIN@GOTPCREL(%rip), %rcx
	cmpl	%r12d, (%rcx)
	je	LBB0_18
## %bb.7:
	movq	_INT64_MAX@GOTPCREL(%rip), %rcx
	cmpl	%r12d, (%rcx)
	je	LBB0_18
## %bb.8:
	subl	%eax, %ebx
LBB0_9:
	testl	%r12d, %r12d
	js	LBB0_10
## %bb.11:
	movq	_AV_ROUND_NEAR_INF@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_13
## %bb.12:
	movl	%r15d, %ecx
	shrl	%ecx
	jmp	LBB0_14
LBB0_10:
	movq	_INT64_MAX@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	subl	(%rax), %esi
	movl	%r12d, %edi
	callq	_FFMAX
	negl	%eax
	movl	%ebx, %ecx
	shrl	%ecx
	andl	$1, %ecx
	xorl	%ebx, %ecx
	movl	%eax, %edi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_av_rescale_rnd
	movl	%eax, %r12d
	negl	%r12d
	jmp	LBB0_18
LBB0_13:
	andl	$1, %ebx
	negl	%ebx
	leal	-1(%r15), %ecx
	andl	%ebx, %ecx
LBB0_14:
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r14d, %eax
	jl	LBB0_18
## %bb.15:
	cmpl	%r15d, %eax
	jl	LBB0_18
## %bb.16:
	cmpl	%r12d, %eax
	jge	LBB0_17
## %bb.19:
	movl	%r12d, %eax
	xorl	%edx, %edx
	divl	%r15d
	movl	%eax, %esi
	imull	%r14d, %edx
	addl	%edx, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%r15d
	movl	%eax, %r12d
	testl	%r14d, %r14d
	je	LBB0_22
## %bb.20:
	movq	_INT32_MAX@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jl	LBB0_22
## %bb.21:
	movq	_INT64_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subl	%r12d, %eax
	cltd
	idivl	%r14d
	cmpl	%eax, %esi
	jle	LBB0_22
LBB0_4:
	movq	_INT64_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_18:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	imull	%r12d, %r14d
	addl	%r14d, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%r15d
	movl	%eax, %r12d
	jmp	LBB0_18
LBB0_22:
	imull	%r14d, %esi
	addl	%esi, %r12d
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_ROUND_PASS_MINMAX,4,2       ## @AV_ROUND_PASS_MINMAX
	.comm	_INT64_MIN,4,2                  ## @INT64_MIN
	.comm	_INT64_MAX,4,2                  ## @INT64_MAX
	.comm	_AV_ROUND_NEAR_INF,4,2          ## @AV_ROUND_NEAR_INF
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_INT32_MAX,4,2                  ## @INT32_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_av_rescale_rnd                 ; -- Begin function av_rescale_rnd
	.p2align	2
_av_rescale_rnd:                        ; @av_rescale_rnd
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	cmp	w2, #0
	cset	w0, gt
	bl	_av_assert2
	mvn	w8, w19
	lsr	w0, w8, #31
	bl	_av_assert2
Lloh0:
	adrp	x23, _AV_ROUND_PASS_MINMAX@GOTPAGE
Lloh1:
	ldr	x23, [x23, _AV_ROUND_PASS_MINMAX@GOTPAGEOFF]
	ldr	w8, [x23]
	bic	w8, w22, w8
	cmp	w8, #6
	ccmp	w8, #4, #4, lo
	cset	w0, ne
	bl	_av_assert2
	tbnz	w19, #31, LBB0_3
; %bb.1:
	subs	w8, w21, #1
	b.lt	LBB0_3
; %bb.2:
	ldr	w9, [x23]
	bic	w10, w22, w9
	cmp	w10, #5
	ccmp	w10, #4, #4, ls
	b.ne	LBB0_5
LBB0_3:
Lloh2:
	adrp	x8, _INT64_MIN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _INT64_MIN@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_5:
	tst	w9, w22
	b.eq	LBB0_8
; %bb.6:
Lloh5:
	adrp	x10, _INT64_MIN@GOTPAGE
Lloh6:
	ldr	x10, [x10, _INT64_MIN@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
Lloh8:
	adrp	x11, _INT64_MAX@GOTPAGE
Lloh9:
	ldr	x11, [x11, _INT64_MAX@GOTPAGEOFF]
Lloh10:
	ldr	w11, [x11]
	cmp	w10, w20
	ccmp	w11, w20, #4, ne
	b.eq	LBB0_4
; %bb.7:
	sub	w22, w22, w9
LBB0_8:
	tbnz	w20, #31, LBB0_11
; %bb.9:
Lloh11:
	adrp	x9, _AV_ROUND_NEAR_INF@GOTPAGE
Lloh12:
	ldr	x9, [x9, _AV_ROUND_NEAR_INF@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w22, w9
	b.ne	LBB0_12
; %bb.10:
	lsr	w8, w21, #1
	b	LBB0_13
LBB0_11:
Lloh14:
	adrp	x8, _INT64_MAX@GOTPAGE
Lloh15:
	ldr	x8, [x8, _INT64_MAX@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w1, w8
	mov	x0, x20
	bl	_FFMAX
	neg	w0, w0
	ubfx	w8, w22, #1, #1
	eor	w3, w8, w22
	mov	x1, x19
	mov	x2, x21
	bl	_av_rescale_rnd
	neg	w20, w0
	b	LBB0_4
LBB0_12:
	sbfx	w9, w22, #0, #1
	and	w8, w9, w8
LBB0_13:
Lloh17:
	adrp	x9, _INT_MAX@GOTPAGE
Lloh18:
	ldr	x9, [x9, _INT_MAX@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	cmp	w9, w19
	b.lt	LBB0_4
; %bb.14:
	cmp	w9, w21
	b.lt	LBB0_4
; %bb.15:
	cmp	w9, w20
	b.ge	LBB0_20
; %bb.16:
	udiv	w9, w20, w21
	msub	w10, w9, w21, w20
	madd	w8, w10, w19, w8
	sdiv	w8, w8, w21
	cbz	w19, LBB0_19
; %bb.17:
Lloh20:
	adrp	x10, _INT32_MAX@GOTPAGE
Lloh21:
	ldr	x10, [x10, _INT32_MAX@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	cmp	w9, w10
	b.lt	LBB0_19
; %bb.18:
Lloh23:
	adrp	x10, _INT64_MAX@GOTPAGE
Lloh24:
	ldr	x10, [x10, _INT64_MAX@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	sub	w10, w10, w8
	sdiv	w10, w10, w19
	cmp	w9, w10
	b.gt	LBB0_3
LBB0_19:
	madd	w20, w9, w19, w8
	b	LBB0_4
LBB0_20:
	madd	w8, w19, w20, w8
	sdiv	w20, w8, w21
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_ROUND_PASS_MINMAX,4,2       ; @AV_ROUND_PASS_MINMAX
	.comm	_INT64_MIN,4,2                  ; @INT64_MIN
	.comm	_INT64_MAX,4,2                  ; @INT64_MAX
	.comm	_AV_ROUND_NEAR_INF,4,2          ; @AV_ROUND_NEAR_INF
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_INT32_MAX,4,2                  ; @INT32_MAX
.subsections_via_symbols
