	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function isp_stat_bufs_alloc
_isp_stat_bufs_alloc:                   ## @isp_stat_bufs_alloc
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_ISP_STAT_USES_DMAENGINE
	movq	24(%r12), %rdi
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_2:
	movq	(%rdi), %rax
LBB0_3:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addq	$8, %rdi
	callq	_spin_lock_irqsave
	xorl	%edi, %edi
	cmpq	$0, 48(%r12)
	setne	%dil
	callq	_BUG_ON
	cmpq	%rbx, (%r12)
	jge	LBB0_7
## %bb.4:
	movq	8(%r12), %rax
	movq	_ISPSTAT_DISABLED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	cmpq	$0, 40(%r12)
	je	LBB0_10
LBB0_6:
	movq	24(%r12), %rax
	movq	(%rax), %rdi
	movl	16(%r12), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movq	24(%r12), %rdi
	addq	$8, %rdi
	callq	_spin_unlock_irqrestore
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_9
LBB0_7:
	movq	24(%r12), %rdi
	addq	$8, %rdi
	callq	_spin_unlock_irqrestore
LBB0_8:
	xorl	%r13d, %r13d
LBB0_9:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	24(%r12), %rdi
	addq	$8, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r12, %rdi
	callq	_isp_stat_bufs_free
	movq	%rbx, (%r12)
	movq	_STAT_MAX_BUFS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_8
## %bb.11:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	32(%r12), %r14
	leaq	(%r14,%r15), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_isp_stat_bufs_alloc_one
	testl	%eax, %eax
	js	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	$1, (%r14,%r15)
	movq	24(%r12), %rax
	movq	(%rax), %rdi
	movl	16(%r12), %edx
	leaq	(%r14,%r15), %r8
	addq	$8, %r8
	movl	4(%r14,%r15), %r9d
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %ecx
	callq	_dev_dbg
	incq	%rbx
	movq	_STAT_MAX_BUFS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$12, %r15
	xorl	%r13d, %r13d
	cmpq	%rax, %rbx
	jb	LBB0_12
	jmp	LBB0_9
LBB0_15:
	movl	%eax, %r13d
	movq	24(%r12), %rax
	movq	(%rax), %rdi
	movl	16(%r12), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %ecx
	callq	_dev_err
	movq	%r12, %rdi
	callq	_isp_stat_bufs_free
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_ISPSTAT_DISABLED,8,3           ## @ISPSTAT_DISABLED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: trying to allocate memory when busy\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_STAT_MAX_BUFS,4,2              ## @STAT_MAX_BUFS
L_.str.1:                               ## @.str.1
	.asciz	"%s: Failed to allocate DMA buffer %u\n"

L_.str.2:                               ## @.str.2
	.asciz	"%s: buffer[%u] allocated. dma=%pad virt=%p"

	.no_dead_strip	_isp_stat_bufs_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function isp_stat_bufs_alloc
_isp_stat_bufs_alloc:                   ; @isp_stat_bufs_alloc
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	bl	_ISP_STAT_USES_DMAENGINE
	ldr	x8, [x19, #24]
	cbz	x0, LBB0_2
; %bb.1:
	mov	x21, #0
	b	LBB0_3
LBB0_2:
	ldr	x21, [x8]
LBB0_3:
	add	x0, x8, #8
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #48]
	cmp	x8, #0
	cset	w0, ne
	bl	_BUG_ON
	ldr	x8, [x19]
	cmp	x8, x20
	b.ge	LBB0_7
; %bb.4:
	ldr	x8, [x19, #8]
Lloh0:
	adrp	x9, _ISPSTAT_DISABLED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ISPSTAT_DISABLED@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_10
LBB0_6:
	ldr	x8, [x19, #24]
	ldr	x0, [x8]
	ldr	w2, [x19, #16]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	ldr	x8, [x19, #24]
	add	x0, x8, #8
	bl	_spin_unlock_irqrestore
Lloh5:
	adrp	x8, _EBUSY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_9
LBB0_7:
	ldr	x8, [x19, #24]
	add	x0, x8, #8
	bl	_spin_unlock_irqrestore
LBB0_8:
	mov	w24, #0
LBB0_9:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_10:
	ldr	x8, [x19, #24]
	add	x0, x8, #8
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_isp_stat_bufs_free
	str	x20, [x19]
Lloh8:
	adrp	x26, _STAT_MAX_BUFS@GOTPAGE
Lloh9:
	ldr	x26, [x26, _STAT_MAX_BUFS@GOTPAGEOFF]
	ldr	w8, [x26]
	cbz	w8, LBB0_8
; %bb.11:
	mov	x27, #0
	mov	x22, #0
	mov	w28, #1
Lloh10:
	adrp	x23, l_.str.2@PAGE
Lloh11:
	add	x23, x23, l_.str.2@PAGEOFF
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #32]
	add	x25, x8, x27
	mov	x0, x21
	mov	x1, x25
	mov	x2, x20
	bl	_isp_stat_bufs_alloc_one
	tbnz	w0, #31, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	str	w28, [x25]
	ldr	x8, [x19, #24]
	ldr	x0, [x8]
	ldr	w2, [x19, #16]
	add	x4, x25, #8
	ldr	w5, [x25, #4]
	mov	x1, x23
	mov	x3, x22
	bl	_dev_dbg
	mov	w24, #0
	add	x22, x22, #1
	ldr	w8, [x26]
	add	x27, x27, #12
	cmp	x22, x8
	b.lo	LBB0_12
	b	LBB0_9
LBB0_14:
	mov	x24, x0
	ldr	x8, [x19, #24]
	ldr	x0, [x8]
	ldr	w2, [x19, #16]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x3, x22
	bl	_dev_err
	mov	x0, x19
	bl	_isp_stat_bufs_free
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_ISPSTAT_DISABLED,8,3           ; @ISPSTAT_DISABLED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: trying to allocate memory when busy\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_STAT_MAX_BUFS,4,2              ; @STAT_MAX_BUFS
l_.str.1:                               ; @.str.1
	.asciz	"%s: Failed to allocate DMA buffer %u\n"

l_.str.2:                               ; @.str.2
	.asciz	"%s: buffer[%u] allocated. dma=%pad virt=%p"

	.no_dead_strip	_isp_stat_bufs_alloc
.subsections_via_symbols
