	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5p_mfc_set_enc_params_mpeg4
_s5p_mfc_set_enc_params_mpeg4:          ## @s5p_mfc_set_enc_params_mpeg4
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	72(%rdi), %r14
	callq	_s5p_mfc_set_enc_params
	movq	_S5P_FIMV_ENC_PIC_TYPE_CTRL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_mfc_read
	andl	$-196609, %eax                  ## imm = 0xFFFCFFFF
	movl	(%rbx), %esi
	shll	$16, %esi
	orl	%eax, %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_mfc_write
	movq	_S5P_FIMV_ENC_PROFILE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_mfc_read
	andl	$-65344, %eax                   ## imm = 0xFFFF00C0
	movl	40(%rbx), %esi
	shll	$8, %esi
	orl	%eax, %esi
	orl	44(%rbx), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_mfc_write
	movl	48(%rbx), %esi
	movq	_S5P_FIMV_ENC_MPEG4_QUART_PXL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_mfc_write
	cmpq	$0, 32(%rbx)
	jne	LBB0_2
## %bb.1:
	movq	_P_B_FRAME_QP@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_s5p_mfc_read_info_v5
	andl	$-4096, %eax                    ## imm = 0xF000
	movl	52(%rbx), %ecx
	movl	56(%rbx), %esi
	andl	$63, %ecx
	shll	$6, %ecx
	orl	%eax, %ecx
	andl	$63, %esi
	orl	%ecx, %esi
	movl	(%r15), %edx
	movq	%rbx, %rdi
	callq	_s5p_mfc_write_info_v5
	cmpq	$0, 32(%rbx)
	je	LBB0_4
LBB0_2:
	movl	4(%rbx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_5
## %bb.3:
	imull	$1000, 8(%rbx), %eax            ## imm = 0x3E8
	cltd
	idivl	%ecx
	movq	_S5P_FIMV_ENC_RC_FRAME_RATE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mfc_write
	movq	_RC_VOP_TIMING@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_s5p_mfc_read_info_v5
	movl	8(%rbx), %eax
	shll	$16, %eax
	movzwl	4(%rbx), %esi
	orl	%eax, %esi
	orl	$-2147483648, %esi              ## imm = 0x80000000
	movl	(%r15), %edx
	movq	%rbx, %rdi
	callq	_s5p_mfc_write_info_v5
	jmp	LBB0_5
LBB0_4:
	movq	_S5P_FIMV_ENC_RC_FRAME_RATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_mfc_write
LBB0_5:
	movq	_S5P_FIMV_ENC_RC_CONFIG@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_mfc_read
	andl	$-64, %eax
	orl	60(%rbx), %eax
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mfc_write
	movq	_S5P_FIMV_ENC_RC_QBOUND@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_mfc_read
	andl	$-16192, %eax                   ## imm = 0xC0C0
	movl	64(%rbx), %esi
	shll	$8, %esi
	orl	%eax, %esi
	orl	68(%rbx), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_mfc_write
	movq	_EXT_ENC_CONTROL@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_s5p_mfc_read_info_v5
	movq	16(%rbx), %rcx
	movq	_V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_7
## %bb.6:
	movzwl	%ax, %ecx
	movl	24(%rbx), %eax
	shll	$16, %eax
	orl	%ecx, %eax
LBB0_7:
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_s5p_mfc_write_info_v5
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_S5P_FIMV_ENC_PIC_TYPE_CTRL,4,2 ## @S5P_FIMV_ENC_PIC_TYPE_CTRL
	.comm	_S5P_FIMV_ENC_PROFILE,4,2       ## @S5P_FIMV_ENC_PROFILE
	.comm	_S5P_FIMV_ENC_MPEG4_QUART_PXL,4,2 ## @S5P_FIMV_ENC_MPEG4_QUART_PXL
	.comm	_P_B_FRAME_QP,4,2               ## @P_B_FRAME_QP
	.comm	_S5P_FIMV_ENC_RC_FRAME_RATE,4,2 ## @S5P_FIMV_ENC_RC_FRAME_RATE
	.comm	_RC_VOP_TIMING,4,2              ## @RC_VOP_TIMING
	.comm	_S5P_FIMV_ENC_RC_CONFIG,4,2     ## @S5P_FIMV_ENC_RC_CONFIG
	.comm	_S5P_FIMV_ENC_RC_QBOUND,4,2     ## @S5P_FIMV_ENC_RC_QBOUND
	.comm	_EXT_ENC_CONTROL,4,2            ## @EXT_ENC_CONTROL
	.comm	_V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT,8,3 ## @V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT
	.no_dead_strip	_s5p_mfc_set_enc_params_mpeg4
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5p_mfc_set_enc_params_mpeg4
_s5p_mfc_set_enc_params_mpeg4:          ; @s5p_mfc_set_enc_params_mpeg4
	.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	x19, x0
	ldr	x20, [x0, #72]
	bl	_s5p_mfc_set_enc_params
Lloh0:
	adrp	x21, _S5P_FIMV_ENC_PIC_TYPE_CTRL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _S5P_FIMV_ENC_PIC_TYPE_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_mfc_read
	and	w8, w0, #0xfffcffff
	ldr	w9, [x19]
	orr	w1, w8, w9, lsl #16
	ldr	w2, [x21]
	mov	x0, x20
	bl	_mfc_write
Lloh2:
	adrp	x21, _S5P_FIMV_ENC_PROFILE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _S5P_FIMV_ENC_PROFILE@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_mfc_read
	mov	w8, #-65344
	and	w8, w0, w8
	ldp	w9, w10, [x19, #40]
	orr	w8, w8, w9, lsl #8
	orr	w1, w8, w10
	ldr	w2, [x21]
	mov	x0, x20
	bl	_mfc_write
	ldr	w1, [x19, #48]
Lloh4:
	adrp	x8, _S5P_FIMV_ENC_MPEG4_QUART_PXL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _S5P_FIMV_ENC_MPEG4_QUART_PXL@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_mfc_write
	ldr	x8, [x19, #32]
	cbnz	x8, LBB0_2
; %bb.1:
Lloh7:
	adrp	x21, _P_B_FRAME_QP@GOTPAGE
Lloh8:
	ldr	x21, [x21, _P_B_FRAME_QP@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_s5p_mfc_read_info_v5
	and	w1, w0, #0xfffff000
	ldp	w8, w9, [x19, #52]
	bfi	w1, w8, #6, #6
	bfxil	w1, w9, #0, #6
	ldr	w2, [x21]
	mov	x0, x19
	bl	_s5p_mfc_write_info_v5
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_4
LBB0_2:
	ldr	w8, [x19, #4]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	ldr	w9, [x19, #8]
	mov	w10, #1000
	mul	w9, w9, w10
Lloh9:
	adrp	x10, _S5P_FIMV_ENC_RC_FRAME_RATE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _S5P_FIMV_ENC_RC_FRAME_RATE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x10]
	sdiv	w1, w9, w8
	mov	x0, x20
	bl	_mfc_write
Lloh12:
	adrp	x21, _RC_VOP_TIMING@GOTPAGE
Lloh13:
	ldr	x21, [x21, _RC_VOP_TIMING@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_s5p_mfc_read_info_v5
	ldr	w8, [x19, #8]
	ldrh	w9, [x19, #4]
	bfi	w9, w8, #16, #16
	orr	w1, w9, #0x80000000
	ldr	w2, [x21]
	mov	x0, x19
	bl	_s5p_mfc_write_info_v5
	b	LBB0_5
LBB0_4:
Lloh14:
	adrp	x8, _S5P_FIMV_ENC_RC_FRAME_RATE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _S5P_FIMV_ENC_RC_FRAME_RATE@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_mfc_write
LBB0_5:
Lloh17:
	adrp	x21, _S5P_FIMV_ENC_RC_CONFIG@GOTPAGE
Lloh18:
	ldr	x21, [x21, _S5P_FIMV_ENC_RC_CONFIG@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_mfc_read
	and	w8, w0, #0xffffffc0
	ldr	w9, [x19, #60]
	orr	w1, w8, w9
	ldr	w2, [x21]
	mov	x0, x20
	bl	_mfc_write
Lloh19:
	adrp	x21, _S5P_FIMV_ENC_RC_QBOUND@GOTPAGE
Lloh20:
	ldr	x21, [x21, _S5P_FIMV_ENC_RC_QBOUND@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_mfc_read
	mov	w8, #-16192
	and	w8, w0, w8
	ldp	w9, w10, [x19, #64]
	orr	w8, w8, w9, lsl #8
	orr	w1, w8, w10
	ldr	w2, [x21]
	mov	x0, x20
	bl	_mfc_write
Lloh21:
	adrp	x20, _EXT_ENC_CONTROL@GOTPAGE
Lloh22:
	ldr	x20, [x20, _EXT_ENC_CONTROL@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_s5p_mfc_read_info_v5
	mov	x1, x0
	ldr	x8, [x19, #16]
Lloh23:
	adrp	x9, _V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	ldr	w8, [x19, #24]
	bfi	w1, w8, #16, #16
LBB0_7:
	ldr	w2, [x20]
	mov	x0, x19
	bl	_s5p_mfc_write_info_v5
	mov	w0, #0
	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	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_S5P_FIMV_ENC_PIC_TYPE_CTRL,4,2 ; @S5P_FIMV_ENC_PIC_TYPE_CTRL
	.comm	_S5P_FIMV_ENC_PROFILE,4,2       ; @S5P_FIMV_ENC_PROFILE
	.comm	_S5P_FIMV_ENC_MPEG4_QUART_PXL,4,2 ; @S5P_FIMV_ENC_MPEG4_QUART_PXL
	.comm	_P_B_FRAME_QP,4,2               ; @P_B_FRAME_QP
	.comm	_S5P_FIMV_ENC_RC_FRAME_RATE,4,2 ; @S5P_FIMV_ENC_RC_FRAME_RATE
	.comm	_RC_VOP_TIMING,4,2              ; @RC_VOP_TIMING
	.comm	_S5P_FIMV_ENC_RC_CONFIG,4,2     ; @S5P_FIMV_ENC_RC_CONFIG
	.comm	_S5P_FIMV_ENC_RC_QBOUND,4,2     ; @S5P_FIMV_ENC_RC_QBOUND
	.comm	_EXT_ENC_CONTROL,4,2            ; @EXT_ENC_CONTROL
	.comm	_V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT,8,3 ; @V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT
	.no_dead_strip	_s5p_mfc_set_enc_params_mpeg4
.subsections_via_symbols
