	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_octeon_setup_sc_buffer_pool    ## -- Begin function octeon_setup_sc_buffer_pool
	.p2align	4, 0x90
_octeon_setup_sc_buffer_pool:           ## @octeon_setup_sc_buffer_pool
	.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
	movq	%rdi, %r12
	callq	_INIT_LIST_HEAD
	leaq	8(%r12), %rdi
	callq	_spin_lock_init
	leaq	4(%r12), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_atomic_set
	movq	_MAX_SOFT_COMMAND_BUFFERS@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_6
## %bb.1:
	xorl	%ebx, %ebx
	movq	_SOFT_COMMAND_BUFFER_SIZE@GOTPCREL(%rip), %r13
	leaq	-48(%rbp), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %esi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_lio_dma_alloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rcx
	movq	%rcx, 8(%rax)
	movl	(%r13), %ecx
	movl	%ecx, 4(%rax)
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_list_add_tail
	incl	%ebx
	cmpl	(%r15), %ebx
	jl	LBB0_2
## %bb.5:
	xorl	%r14d, %r14d
	jmp	LBB0_6
LBB0_3:
	movq	%r12, %rdi
	callq	_octeon_free_sc_buffer_pool
	movl	$1, %r14d
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_SOFT_COMMAND_BUFFERS,4,2   ## @MAX_SOFT_COMMAND_BUFFERS
	.comm	_SOFT_COMMAND_BUFFER_SIZE,4,2   ## @SOFT_COMMAND_BUFFER_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_octeon_setup_sc_buffer_pool    ; -- Begin function octeon_setup_sc_buffer_pool
	.p2align	2
_octeon_setup_sc_buffer_pool:           ; @octeon_setup_sc_buffer_pool
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	bl	_INIT_LIST_HEAD
	add	x0, x19, #8
	bl	_spin_lock_init
	add	x0, x19, #4
	mov	w1, #0
	bl	_atomic_set
Lloh0:
	adrp	x20, _MAX_SOFT_COMMAND_BUFFERS@GOTPAGE
Lloh1:
	ldr	x20, [x20, _MAX_SOFT_COMMAND_BUFFERS@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	w21, #0
Lloh2:
	adrp	x22, _SOFT_COMMAND_BUFFER_SIZE@GOTPAGE
Lloh3:
	ldr	x22, [x22, _SOFT_COMMAND_BUFFER_SIZE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	add	x2, sp, #8
	mov	x0, x19
	bl	_lio_dma_alloc
	cbz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [sp, #8]
	str	x8, [x0, #8]
	ldr	w8, [x22]
	str	w8, [x0, #4]
	mov	x1, x19
	bl	_list_add_tail
	add	w21, w21, #1
	ldr	w8, [x20]
	cmp	w21, w8
	b.lt	LBB0_2
LBB0_4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_octeon_free_sc_buffer_pool
	mov	w0, #1
LBB0_6:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_SOFT_COMMAND_BUFFERS,4,2   ; @MAX_SOFT_COMMAND_BUFFERS
	.comm	_SOFT_COMMAND_BUFFER_SIZE,4,2   ; @SOFT_COMMAND_BUFFER_SIZE
.subsections_via_symbols
