	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function estimate_qp
_estimate_qp:                           ## @estimate_qp
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movq	24(%rbx), %rcx
	movl	%eax, (%rcx)
	movq	40(%rbx), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%rcx)
	testl	%esi, %esi
	jne	LBB0_5
## %bb.2:
	movl	$0, (%rbx)
	jmp	LBB0_5
LBB0_3:
	cmpl	$0, 48(%rbx)
	jne	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_ff_rate_estimate_qscale
	movq	24(%rbx), %rcx
	movl	%eax, (%rcx)
	movq	40(%rbx), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%rcx)
	testl	%eax, %eax
	js	LBB0_17
LBB0_5:
	cmpq	$0, 32(%rbx)
	je	LBB0_9
## %bb.6:
	movl	4(%rbx), %eax
	leal	-129(%rax), %ecx
	cmpl	$3, %ecx
	jae	LBB0_10
## %bb.7:
	movq	_CONFIG_H263_ENCODER@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_14
## %bb.8:
	movq	%rbx, %rdi
	callq	_ff_clean_h263_qscales
	jmp	LBB0_14
LBB0_9:
	movq	24(%rbx), %rax
	jmp	LBB0_15
LBB0_10:
	cmpl	$128, %eax
	jne	LBB0_13
## %bb.11:
	movq	_CONFIG_MPEG4_ENCODER@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_14
## %bb.12:
	movq	%rbx, %rdi
	callq	_ff_clean_mpeg4_qscales
	jmp	LBB0_14
LBB0_13:
	movq	%rbx, %rdi
	callq	_ff_init_qscale_tab
LBB0_14:
	movq	16(%rbx), %rax
LBB0_15:
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	callq	_update_qscale
	xorl	%eax, %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_17:
	movl	$-1, %eax
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_CONFIG_MPEG4_ENCODER,4,2       ## @CONFIG_MPEG4_ENCODER
	.comm	_CONFIG_H263_ENCODER,4,2        ## @CONFIG_H263_ENCODER
	.no_dead_strip	_estimate_qp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function estimate_qp
_estimate_qp:                           ; @estimate_qp
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_3
; %bb.1:
	ldr	x9, [x19, #24]
	str	w8, [x9]
	ldr	x9, [x19, #40]
	ldr	x9, [x9]
	str	w8, [x9]
	cbnz	w1, LBB0_5
; %bb.2:
	str	wzr, [x19]
	b	LBB0_5
LBB0_3:
	ldr	w8, [x19, #48]
	cbnz	w8, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_ff_rate_estimate_qscale
	ldr	x8, [x19, #24]
	str	w0, [x8]
	ldr	x8, [x19, #40]
	ldr	x8, [x8]
	str	w0, [x8]
	tbnz	w0, #31, LBB0_17
LBB0_5:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_9
; %bb.6:
	ldr	w8, [x19, #4]
	sub	w9, w8, #129
	cmp	w9, #3
	b.hs	LBB0_10
; %bb.7:
Lloh0:
	adrp	x8, _CONFIG_H263_ENCODER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CONFIG_H263_ENCODER@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_14
; %bb.8:
	mov	x0, x19
	bl	_ff_clean_h263_qscales
	b	LBB0_14
LBB0_9:
	ldr	x8, [x19, #24]
	b	LBB0_15
LBB0_10:
	cmp	w8, #128
	b.ne	LBB0_13
; %bb.11:
Lloh3:
	adrp	x8, _CONFIG_MPEG4_ENCODER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CONFIG_MPEG4_ENCODER@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cbz	w8, LBB0_14
; %bb.12:
	mov	x0, x19
	bl	_ff_clean_mpeg4_qscales
	b	LBB0_14
LBB0_13:
	mov	x0, x19
	bl	_ff_init_qscale_tab
LBB0_14:
	ldr	x8, [x19, #16]
LBB0_15:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	mov	x0, x19
	bl	_update_qscale
	mov	w0, #0
LBB0_16:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_17:
	mov	w0, #-1
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CONFIG_MPEG4_ENCODER,4,2       ; @CONFIG_MPEG4_ENCODER
	.comm	_CONFIG_H263_ENCODER,4,2        ; @CONFIG_H263_ENCODER
	.no_dead_strip	_estimate_qp
.subsections_via_symbols
