	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5p_mfc_set_enc_ref_buffer_v6
_s5p_mfc_set_enc_ref_buffer_v6:         ## @s5p_mfc_set_enc_ref_buffer_v6
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	72(%rdi), %r14
	movq	8(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	callq	_mfc_debug_enter
	movq	56(%rbx), %r15
	movl	64(%rbx), %r12d
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	movq	%r15, %rdx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_mfc_debug
	movq	%r14, %rdi
	callq	_IS_MFCV10
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %ecx
	testq	%rax, %rax
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	je	LBB0_10
## %bb.1:
	testl	%ecx, %ecx
	jle	LBB0_13
## %bb.2:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	56(%rax), %rsi
	addq	%r14, %rsi
	movq	%r15, %rdi
	callq	_writel
	movq	48(%r13), %rax
	addq	%rax, %r15
	subl	%eax, %r12d
	incq	%rbx
	movslq	(%r13), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	jl	LBB0_3
## %bb.4:
	testl	%eax, %eax
	jle	LBB0_13
## %bb.5:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	48(%rax), %rsi
	addq	%r14, %rsi
	movq	%r15, %rdi
	callq	_writel
	movq	40(%r13), %rax
	addq	%rax, %r15
	subl	%eax, %r12d
	incq	%rbx
	movslq	(%r13), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	jl	LBB0_6
## %bb.7:
	testl	%eax, %eax
	jle	LBB0_13
## %bb.8:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	40(%rax), %rsi
	addq	%r14, %rsi
	movq	%r15, %rdi
	callq	_writel
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	32(%rcx), %rax
	addq	%rax, %r15
	subl	%eax, %r12d
	incq	%rbx
	movslq	(%rcx), %rax
	addq	$4, %r14
	cmpq	%rax, %rbx
	jl	LBB0_9
	jmp	LBB0_13
LBB0_10:
	testl	%ecx, %ecx
	jle	LBB0_13
## %bb.11:
	xorl	%r13d, %r13d
	xorl	%ecx, %ecx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	56(%r14), %rsi
	addq	%r13, %rsi
	movq	%r15, %rdi
	callq	_writel
	addq	48(%rbx), %r15
	movq	48(%r14), %rsi
	addq	%r13, %rsi
	movq	%r15, %rdi
	callq	_writel
	addq	40(%rbx), %r15
	movq	40(%r14), %rsi
	addq	%r13, %rsi
	movq	%r15, %rdi
	callq	_writel
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	32(%rbx), %rax
	addq	%rax, %r15
	addl	48(%rbx), %eax
	addl	40(%rbx), %eax
	subl	%eax, %r12d
	incq	%rcx
	movslq	(%rbx), %rax
	addq	$4, %r13
	cmpq	%rax, %rcx
	jl	LBB0_12
LBB0_13:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	32(%rbx), %rsi
	movq	%r15, %rdi
	callq	_writel
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	8(%r14), %rdi
	movq	24(%rbx), %rsi
	callq	_writel
	movq	8(%r14), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	addq	%rax, %r15
	movq	16(%rbx), %rsi
	movq	%r15, %rdi
	callq	_writel
	movl	16(%r14), %eax
	sarl	%eax
	movslq	%eax, %r13
	addq	%r15, %r13
	movq	8(%rbx), %rsi
	movq	%r13, %rdi
	callq	_writel
	movl	(%r14), %r8d
	movl	16(%r14), %eax
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	addl	%eax, %edi
	sarl	%eax
	movslq	%eax, %rdx
	addq	%r13, %rdx
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %ecx
	subl	%edi, %ecx
	movq	%rdi, %rbx
	xorl	%r15d, %r15d
	movl	$2, %edi
	xorl	%eax, %eax
	callq	_mfc_debug
	cmpl	%ebx, %r12d
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	js	LBB0_14
## %bb.15:
	movq	24(%r14), %rdi
	movq	(%rcx), %rsi
	callq	_writel
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %edi
	movq	_cmd_host2risc@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_S5P_FIMV_CH_INIT_BUFS_V6@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%r8d, %r8d
	callq	_s5p_mfc_hw_call
	xorl	%eax, %eax
	callq	_mfc_debug_leave
	jmp	LBB0_16
LBB0_14:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	movl	$2, %edi
	xorl	%eax, %eax
	callq	_mfc_debug
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_16:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Buf1: %p (%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"Buf1: %zu, buf_size1: %d (ref frames %d)\n"

L_.str.2:                               ## @.str.2
	.asciz	"Not enough memory has been allocated.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_cmd_host2risc,4,2              ## @cmd_host2risc
	.comm	_S5P_FIMV_CH_INIT_BUFS_V6,4,2   ## @S5P_FIMV_CH_INIT_BUFS_V6
	.no_dead_strip	_s5p_mfc_set_enc_ref_buffer_v6
.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_ref_buffer_v6
_s5p_mfc_set_enc_ref_buffer_v6:         ; @s5p_mfc_set_enc_ref_buffer_v6
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x20, x0
	ldr	x19, [x0, #72]
	ldr	x22, [x19, #8]
	bl	_mfc_debug_enter
	ldr	x21, [x20, #56]
	ldr	w23, [x20, #64]
	stp	x21, x23, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_mfc_debug
	mov	x0, x19
	bl	_IS_MFCV10
	ldr	w8, [x20]
	cmp	w8, #1
	cbz	x0, LBB0_10
; %bb.1:
	b.lt	LBB0_13
; %bb.2:
	mov	x24, #0
	mov	x25, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #56]
	add	x1, x24, x8
	mov	x0, x21
	bl	_writel
	ldr	x8, [x20, #48]
	add	x21, x8, x21
	sub	w23, w23, w8
	add	x25, x25, #1
	ldrsw	x8, [x20]
	add	x24, x24, #4
	cmp	x25, x8
	b.lt	LBB0_3
; %bb.4:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.5:
	mov	x24, #0
	mov	x25, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #48]
	add	x1, x24, x8
	mov	x0, x21
	bl	_writel
	ldr	x8, [x20, #40]
	add	x21, x8, x21
	sub	w23, w23, w8
	add	x25, x25, #1
	ldrsw	x8, [x20]
	add	x24, x24, #4
	cmp	x25, x8
	b.lt	LBB0_6
; %bb.7:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.8:
	mov	x24, #0
	mov	x25, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #40]
	add	x1, x24, x8
	mov	x0, x21
	bl	_writel
	ldr	x8, [x20, #32]
	add	x21, x8, x21
	sub	w23, w23, w8
	add	x25, x25, #1
	ldrsw	x8, [x20]
	add	x24, x24, #4
	cmp	x25, x8
	b.lt	LBB0_9
	b	LBB0_13
LBB0_10:
	b.lt	LBB0_13
; %bb.11:
	mov	x24, #0
	mov	x25, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22, #56]
	add	x1, x24, x8
	mov	x0, x21
	bl	_writel
	ldr	x8, [x20, #48]
	add	x21, x8, x21
	ldr	x8, [x22, #48]
	add	x1, x24, x8
	mov	x0, x21
	bl	_writel
	ldr	x8, [x20, #40]
	add	x21, x8, x21
	ldr	x8, [x22, #40]
	add	x1, x24, x8
	mov	x0, x21
	bl	_writel
	ldr	x8, [x20, #32]
	add	x21, x8, x21
	ldr	w9, [x20, #48]
	ldr	w10, [x20, #40]
	add	w8, w9, w8
	add	w8, w8, w10
	sub	w23, w23, w8
	add	x25, x25, #1
	ldrsw	x8, [x20]
	add	x24, x24, #4
	cmp	x25, x8
	b.lt	LBB0_12
LBB0_13:
	ldr	x1, [x22, #32]
	mov	x0, x21
	bl	_writel
	ldr	x0, [x20, #8]
	ldr	x1, [x22, #24]
	bl	_writel
	ldr	x24, [x20, #8]
	add	x21, x24, x21
	ldr	x1, [x22, #16]
	mov	x0, x21
	bl	_writel
	ldr	w8, [x20, #16]
	asr	w8, w8, #1
	add	x21, x21, w8, sxtw
	ldr	x1, [x22, #8]
	mov	x0, x21
	bl	_writel
	ldr	w8, [x20, #16]
	asr	w9, w8, #1
	add	x9, x21, w9, sxtw
	add	w8, w8, w24
	sub	w21, w23, w8
	ldr	w8, [x20]
	stp	x21, x8, [sp, #8]
	str	x9, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #2
	bl	_mfc_debug
	tbnz	w21, #31, LBB0_15
; %bb.14:
	ldr	x0, [x20, #24]
	ldr	x1, [x22]
	bl	_writel
	ldr	w0, [x19]
Lloh4:
	adrp	x8, _cmd_host2risc@GOTPAGE
Lloh5:
	ldr	x8, [x8, _cmd_host2risc@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _S5P_FIMV_CH_INIT_BUFS_V6@GOTPAGE
Lloh8:
	ldr	x8, [x8, _S5P_FIMV_CH_INIT_BUFS_V6@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x2, x19
	mov	x4, #0
	bl	_s5p_mfc_hw_call
	bl	_mfc_debug_leave
	mov	w0, #0
	b	LBB0_16
LBB0_15:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #2
	bl	_mfc_debug
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_16:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Buf1: %p (%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"Buf1: %zu, buf_size1: %d (ref frames %d)\n"

l_.str.2:                               ; @.str.2
	.asciz	"Not enough memory has been allocated.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_cmd_host2risc,4,2              ; @cmd_host2risc
	.comm	_S5P_FIMV_CH_INIT_BUFS_V6,4,2   ; @S5P_FIMV_CH_INIT_BUFS_V6
	.no_dead_strip	_s5p_mfc_set_enc_ref_buffer_v6
.subsections_via_symbols
