	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qed_iov_alloc_vf_igu_sbs
_qed_iov_alloc_vf_igu_sbs:              ## @qed_iov_alloc_vf_igu_sbs
	.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
	movl	%ecx, %r14d
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movl	(%rax), %ecx
	cmpl	%r14d, %ecx
	cmovll	%ecx, %r14d
	subl	%r14d, %ecx
	movl	%ecx, (%rax)
	movq	_IGU_MAPPING_LINE_FUNCTION_NUMBER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rdx), %edx
	xorl	%edi, %edi
	callq	_SET_FIELD
	movq	_IGU_MAPPING_LINE_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	movl	$1, %edx
	callq	_SET_FIELD
	movq	_IGU_MAPPING_LINE_PF_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	xorl	%edx, %edx
	callq	_SET_FIELD
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	testl	%r14d, %r14d
	jle	LBB0_3
## %bb.1:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_qed_get_igu_free_sb
	movq	%rax, %r13
	movl	(%rax), %eax
	movq	8(%r15), %rcx
	movl	%eax, (%rcx,%r14,4)
	movq	_QED_IGU_STATUS_FREE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 4(%r13)
	movq	_IGU_MAPPING_LINE_VECTOR_NUMBER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	movl	%r14d, %edx
	callq	_SET_FIELD
	movslq	(%r13), %rdx
	shlq	$2, %rdx
	movq	_IGU_REG_MAPPING_MEMORY@GOTPCREL(%rip), %rax
	addq	(%rax), %rdx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_qed_wr
	movl	(%r12), %edx
	movl	(%r15), %ecx
	movq	%r12, %rdi
	leaq	-72(%rbp), %r15
	movq	%r15, %rsi
	movl	$1, %r8d
	callq	_qed_init_cau_sb_entry
	movslq	(%r13), %rcx
	shlq	$2, %rcx
	movq	_CAU_REG_SB_VAR_MEMORY@GOTPCREL(%rip), %rax
	addq	(%rax), %rcx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	$2, %r8d
	xorl	%r9d, %r9d
	callq	_qed_dmae_host2grc
	incq	%r14
	cmpq	%r14, -56(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_2
LBB0_3:
	movslq	-44(%rbp), %rax                 ## 4-byte Folded Reload
	movq	%rax, 16(%r15)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IGU_MAPPING_LINE_FUNCTION_NUMBER,4,2 ## @IGU_MAPPING_LINE_FUNCTION_NUMBER
	.comm	_IGU_MAPPING_LINE_VALID,4,2     ## @IGU_MAPPING_LINE_VALID
	.comm	_IGU_MAPPING_LINE_PF_VALID,4,2  ## @IGU_MAPPING_LINE_PF_VALID
	.comm	_QED_IGU_STATUS_FREE,4,2        ## @QED_IGU_STATUS_FREE
	.comm	_IGU_MAPPING_LINE_VECTOR_NUMBER,4,2 ## @IGU_MAPPING_LINE_VECTOR_NUMBER
	.comm	_IGU_REG_MAPPING_MEMORY,8,3     ## @IGU_REG_MAPPING_MEMORY
	.comm	_CAU_REG_SB_VAR_MEMORY,8,3      ## @CAU_REG_SB_VAR_MEMORY
	.no_dead_strip	_qed_iov_alloc_vf_igu_sbs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qed_iov_alloc_vf_igu_sbs
_qed_iov_alloc_vf_igu_sbs:              ; @qed_iov_alloc_vf_igu_sbs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	w9, [x8]
	cmp	w9, w3
	csel	w24, w9, w3, lt
	sub	w9, w9, w24
	str	w9, [x8]
Lloh0:
	adrp	x8, _IGU_MAPPING_LINE_FUNCTION_NUMBER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IGU_MAPPING_LINE_FUNCTION_NUMBER@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	w2, [x2]
	mov	w0, #0
	bl	_SET_FIELD
Lloh3:
	adrp	x8, _IGU_MAPPING_LINE_VALID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IGU_MAPPING_LINE_VALID@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #0
	mov	w2, #1
	bl	_SET_FIELD
Lloh6:
	adrp	x8, _IGU_MAPPING_LINE_PF_VALID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IGU_MAPPING_LINE_PF_VALID@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w0, #0
	mov	w2, #0
	bl	_SET_FIELD
	cmp	w24, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x22, #0
Lloh9:
	adrp	x25, _QED_IGU_STATUS_FREE@GOTPAGE
Lloh10:
	ldr	x25, [x25, _QED_IGU_STATUS_FREE@GOTPAGEOFF]
Lloh11:
	adrp	x26, _IGU_MAPPING_LINE_VECTOR_NUMBER@GOTPAGE
Lloh12:
	ldr	x26, [x26, _IGU_MAPPING_LINE_VECTOR_NUMBER@GOTPAGEOFF]
Lloh13:
	adrp	x27, _IGU_REG_MAPPING_MEMORY@GOTPAGE
Lloh14:
	ldr	x27, [x27, _IGU_REG_MAPPING_MEMORY@GOTPAGEOFF]
Lloh15:
	adrp	x28, _CAU_REG_SB_VAR_MEMORY@GOTPAGE
Lloh16:
	ldr	x28, [x28, _CAU_REG_SB_VAR_MEMORY@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	w1, #0
	bl	_qed_get_igu_free_sb
	mov	x23, x0
	ldr	w8, [x0]
	ldr	x9, [x19, #8]
	str	w8, [x9, x22, lsl #2]
	ldr	w8, [x25]
	ldr	w9, [x0, #4]
	bic	w8, w9, w8
	str	w8, [x0, #4]
	ldr	w1, [x26]
	mov	w0, #0
	mov	x2, x22
	bl	_SET_FIELD
	ldr	x8, [x27]
	ldrsw	x9, [x23]
	add	x2, x8, x9, lsl #2
	mov	x0, x21
	mov	x1, x20
	mov	w3, #0
	bl	_qed_wr
	ldr	w2, [x21]
	ldr	w3, [x19]
	add	x1, sp, #8
	mov	x0, x21
	mov	w4, #1
	bl	_qed_init_cau_sb_entry
	ldr	x8, [x28]
	ldrsw	x9, [x23]
	add	x3, x8, x9, lsl #2
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x20
	mov	w4, #2
	mov	x5, #0
	bl	_qed_dmae_host2grc
	add	x22, x22, #1
	cmp	x24, x22
	b.ne	LBB0_2
LBB0_3:
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	sxtw	x0, w24
	str	x0, [x19, #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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_IGU_MAPPING_LINE_FUNCTION_NUMBER,4,2 ; @IGU_MAPPING_LINE_FUNCTION_NUMBER
	.comm	_IGU_MAPPING_LINE_VALID,4,2     ; @IGU_MAPPING_LINE_VALID
	.comm	_IGU_MAPPING_LINE_PF_VALID,4,2  ; @IGU_MAPPING_LINE_PF_VALID
	.comm	_QED_IGU_STATUS_FREE,4,2        ; @QED_IGU_STATUS_FREE
	.comm	_IGU_MAPPING_LINE_VECTOR_NUMBER,4,2 ; @IGU_MAPPING_LINE_VECTOR_NUMBER
	.comm	_IGU_REG_MAPPING_MEMORY,8,3     ; @IGU_REG_MAPPING_MEMORY
	.comm	_CAU_REG_SB_VAR_MEMORY,8,3      ; @CAU_REG_SB_VAR_MEMORY
	.no_dead_strip	_qed_iov_alloc_vf_igu_sbs
.subsections_via_symbols
