	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qedr_alloc_resources
_qedr_alloc_resources:                  ## @qedr_alloc_resources
	.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	%rdi, %r14
	movq	_QEDR_MAX_SGID@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	$4, %esi
	callq	_kcalloc
	movq	%rax, 8(%r14)
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	leaq	68(%r14), %rdi
	callq	_spin_lock_init
	movq	%r14, %rdi
	callq	_IS_IWARP
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	leaq	64(%r14), %rdi
	movq	_XA_FLAGS_LOCK_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_xa_init_flags
	leaq	L_.str(%rip), %rdi
	callq	_create_singlethread_workqueue
	movl	%eax, 60(%r14)
LBB0_3:
	movl	(%r14), %edi
	movl	(%rbx), %edx
	movl	$48, %esi
	callq	_kcalloc
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	movl	(%r14), %edi
	movl	(%rbx), %edx
	movl	$48, %esi
	callq	_kcalloc
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	movq	48(%r14), %rax
	movl	40(%r14), %edi
	callq	*8(%rax)
	movq	%rax, 32(%r14)
	movq	_u32@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_QED_RDMA_MAX_CNQ_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_QEDR_ROCE_MAX_CNQ_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_min_t
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	cmpl	$0, (%r14)
	jle	LBB0_14
## %bb.6:
	movq	$-48, %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movq	24(%r14), %r13
	leaq	(%rax,%r12), %rsi
	addq	$48, %rsi
	movq	32(%r14), %rdx
	addq	%rbx, %rdx
	movq	%r14, %rdi
	callq	_qedr_alloc_mem_sb
	testl	%eax, %eax
	jne	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	48(%r14), %rax
	movq	(%rax), %r10
	movl	40(%r14), %edi
	movq	_QED_CHAIN_USE_TO_CONSUME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_QED_CHAIN_MODE_PBL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_QED_CHAIN_CNT_TYPE_U16@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	52(%r13,%r12), %rax
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	$8, %r9d
	pushq	$0
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	pushq	%rax
	callq	*(%r10)
	addq	$16, %rsp
	testl	%eax, %eax
	jne	LBB0_16
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%r14, 88(%r13,%r12)
	movq	16(%r14), %rax
	leaq	(%rax,%r12), %rcx
	addq	$48, %rcx
	movq	%rcx, 80(%r13,%r12)
	movq	72(%rax,%r12), %rax
	movq	_QED_ROCE_PROTOCOL_INDEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	movq	%rcx, 64(%r13,%r12)
	movl	%ebx, 48(%r13,%r12)
	movl	56(%r13,%r12), %r15d
	movl	56(%r14), %edi
	callq	_pci_name
	movl	%r15d, %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	movq	%rax, %rcx
	callq	_sprintf
	movq	_QEDR_MSG_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_qed_chain_get_cons_idx
	movq	%r14, %rdi
	movl	%r15d, %esi
	leaq	L_.str.2(%rip), %rdx
	movl	%ebx, %ecx
	movl	%eax, %r8d
	callq	_DP_DEBUG
	incq	%rbx
	movslq	(%r14), %rax
	addq	$48, %r12
	cmpq	%rax, %rbx
	jl	LBB0_7
LBB0_14:
	xorl	%r15d, %r15d
	jmp	LBB0_23
LBB0_11:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_23
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_22
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_21
LBB0_15:
	movl	%eax, %r15d
	jmp	LBB0_17
LBB0_16:
	movl	%eax, %r15d
	movq	16(%r14), %rax
	leaq	(%rax,%r12), %rsi
	addq	$48, %rsi
	movq	32(%r14), %rdx
	addq	%rbx, %rdx
	movq	%r14, %rdi
	callq	_qedr_free_mem_sb
LBB0_17:
	testl	%ebx, %ebx
	je	LBB0_20
## %bb.18:
	incq	%rbx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	48(%r14), %rax
	movq	(%rax), %rax
	movl	40(%r14), %edi
	movq	24(%r14), %rcx
	leaq	(%rcx,%r12), %rsi
	addq	$4, %rsi
	callq	*8(%rax)
	movq	16(%r14), %rsi
	addq	%r12, %rsi
	movq	32(%r14), %rax
	leaq	(%rbx,%rax), %rdx
	addq	$-2, %rdx
	movq	%r14, %rdi
	callq	_qedr_free_mem_sb
	decq	%rbx
	addq	$-48, %r12
	cmpq	$1, %rbx
	ja	LBB0_19
LBB0_20:
	movq	24(%r14), %rdi
	callq	_kfree
LBB0_21:
	movq	16(%r14), %rdi
	callq	_kfree
LBB0_22:
	movq	8(%r14), %rdi
	callq	_kfree
LBB0_23:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_QEDR_MAX_SGID,4,2              ## @QEDR_MAX_SGID
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_XA_FLAGS_LOCK_IRQ,4,2          ## @XA_FLAGS_LOCK_IRQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"qedr_iwarpq"

	.comm	_u32,4,2                        ## @u32
	.comm	_QED_RDMA_MAX_CNQ_SIZE,4,2      ## @QED_RDMA_MAX_CNQ_SIZE
	.comm	_QEDR_ROCE_MAX_CNQ_SIZE,4,2     ## @QEDR_ROCE_MAX_CNQ_SIZE
	.comm	_QED_CHAIN_USE_TO_CONSUME,4,2   ## @QED_CHAIN_USE_TO_CONSUME
	.comm	_QED_CHAIN_MODE_PBL,4,2         ## @QED_CHAIN_MODE_PBL
	.comm	_QED_CHAIN_CNT_TYPE_U16,4,2     ## @QED_CHAIN_CNT_TYPE_U16
	.comm	_QED_ROCE_PROTOCOL_INDEX,8,3    ## @QED_ROCE_PROTOCOL_INDEX
L_.str.1:                               ## @.str.1
	.asciz	"qedr%d@pci:%s"

	.comm	_QEDR_MSG_INIT,4,2              ## @QEDR_MSG_INIT
L_.str.2:                               ## @.str.2
	.asciz	"cnq[%d].cons=%d\n"

	.no_dead_strip	_qedr_alloc_resources
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qedr_alloc_resources
_qedr_alloc_resources:                  ; @qedr_alloc_resources
	.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	x19, x0
Lloh0:
	adrp	x8, _QEDR_MAX_SGID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QEDR_MAX_SGID@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x20, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x20, [x20, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	w1, #4
	bl	_kcalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_11
; %bb.1:
	add	x0, x19, #68
	bl	_spin_lock_init
	mov	x0, x19
	bl	_IS_IWARP
	cbz	x0, LBB0_3
; %bb.2:
	add	x0, x19, #64
Lloh5:
	adrp	x8, _XA_FLAGS_LOCK_IRQ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _XA_FLAGS_LOCK_IRQ@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_xa_init_flags
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_create_singlethread_workqueue
	str	w0, [x19, #60]
LBB0_3:
	ldr	w0, [x19]
	ldr	w2, [x20]
	mov	w1, #48
	bl	_kcalloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_12
; %bb.4:
	ldr	w0, [x19]
	ldr	w2, [x20]
	mov	w1, #48
	bl	_kcalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_13
; %bb.5:
	ldr	x8, [x19, #48]
	ldr	x8, [x8, #8]
	ldr	w0, [x19, #40]
	blr	x8
	str	x0, [x19, #32]
Lloh10:
	adrp	x8, _u32@GOTPAGE
Lloh11:
	ldr	x8, [x8, _u32@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x8, _QED_RDMA_MAX_CNQ_SIZE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _QED_RDMA_MAX_CNQ_SIZE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _QEDR_ROCE_MAX_CNQ_SIZE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _QEDR_ROCE_MAX_CNQ_SIZE@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	bl	_min_t
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.6:
	mov	x21, x0
	mov	x20, #0
	mov	x26, #-48
Lloh19:
	adrp	x23, l_.str.1@PAGE
Lloh20:
	add	x23, x23, l_.str.1@PAGEOFF
Lloh21:
	adrp	x28, _QEDR_MSG_INIT@GOTPAGE
Lloh22:
	ldr	x28, [x28, _QEDR_MSG_INIT@GOTPAGEOFF]
Lloh23:
	adrp	x24, l_.str.2@PAGE
Lloh24:
	add	x24, x24, l_.str.2@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	x8, x25, [x19, #16]
	add	x8, x8, x26
	add	x1, x8, #48
	ldr	x8, [x19, #32]
	add	x2, x20, x8
	mov	x0, x19
	bl	_qedr_alloc_mem_sb
	cbnz	w0, LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #48]
	ldr	x8, [x8]
	ldr	x8, [x8]
	ldr	w0, [x19, #40]
Lloh25:
	adrp	x9, _QED_CHAIN_USE_TO_CONSUME@GOTPAGE
Lloh26:
	ldr	x9, [x9, _QED_CHAIN_USE_TO_CONSUME@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x9]
Lloh28:
	adrp	x9, _QED_CHAIN_MODE_PBL@GOTPAGE
Lloh29:
	ldr	x9, [x9, _QED_CHAIN_MODE_PBL@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x9]
Lloh31:
	adrp	x9, _QED_CHAIN_CNT_TYPE_U16@GOTPAGE
Lloh32:
	ldr	x9, [x9, _QED_CHAIN_CNT_TYPE_U16@GOTPAGEOFF]
Lloh33:
	ldr	w3, [x9]
	add	x27, x25, x26
	add	x25, x27, #52
	mov	x4, x21
	mov	w5, #8
	mov	x6, x25
	mov	x7, #0
	blr	x8
	cbnz	w0, LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x26
	add	x9, x8, #48
	stp	x9, x19, [x27, #80]
	ldr	x8, [x8, #72]
	ldr	x8, [x8]
Lloh34:
	adrp	x9, _QED_ROCE_PROTOCOL_INDEX@GOTPAGE
Lloh35:
	ldr	x9, [x9, _QED_ROCE_PROTOCOL_INDEX@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	add	x8, x8, x9, lsl #2
	str	x8, [x27, #64]
	str	w20, [x27, #48]
	ldr	w22, [x27, #56]
	ldr	w0, [x19, #56]
	bl	_pci_name
	mov	x3, x0
	mov	x0, x22
	mov	x1, x23
	mov	x2, x20
	bl	_sprintf
	ldr	w22, [x28]
	mov	x0, x25
	bl	_qed_chain_get_cons_idx
	mov	x4, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x24
	mov	x3, x20
	bl	_DP_DEBUG
	add	x20, x20, #1
	ldrsw	x8, [x19]
	add	x26, x26, #48
	cmp	x20, x8
	b.lt	LBB0_7
LBB0_10:
	mov	w22, #0
	b	LBB0_22
LBB0_11:
Lloh37:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_22
LBB0_12:
Lloh40:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_21
LBB0_13:
Lloh43:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh44:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_20
LBB0_14:
	mov	x22, x0
	b	LBB0_16
LBB0_15:
	mov	x22, x0
	ldr	x8, [x19, #16]
	add	x8, x8, x26
	add	x1, x8, #48
	ldr	x8, [x19, #32]
	add	x2, x8, x20
	mov	x0, x19
	bl	_qedr_free_mem_sb
LBB0_16:
	cbz	w20, LBB0_19
; %bb.17:
	add	x20, x20, #1
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #48]
	ldr	x8, [x8]
	ldr	x8, [x8, #8]
	ldr	w0, [x19, #40]
	ldr	x9, [x19, #24]
	add	x9, x9, x26
	add	x1, x9, #4
	blr	x8
	ldr	x8, [x19, #16]
	add	x1, x8, x26
	ldr	x8, [x19, #32]
	add	x8, x20, x8
	sub	x2, x8, #2
	mov	x0, x19
	bl	_qedr_free_mem_sb
	sub	x20, x20, #1
	sub	x26, x26, #48
	cmp	x20, #1
	b.hi	LBB0_18
LBB0_19:
	ldr	x0, [x19, #24]
	bl	_kfree
LBB0_20:
	ldr	x0, [x19, #16]
	bl	_kfree
LBB0_21:
	ldr	x0, [x19, #8]
	bl	_kfree
LBB0_22:
	mov	x0, x22
	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
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_QEDR_MAX_SGID,4,2              ; @QEDR_MAX_SGID
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_XA_FLAGS_LOCK_IRQ,4,2          ; @XA_FLAGS_LOCK_IRQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"qedr_iwarpq"

	.comm	_u32,4,2                        ; @u32
	.comm	_QED_RDMA_MAX_CNQ_SIZE,4,2      ; @QED_RDMA_MAX_CNQ_SIZE
	.comm	_QEDR_ROCE_MAX_CNQ_SIZE,4,2     ; @QEDR_ROCE_MAX_CNQ_SIZE
	.comm	_QED_CHAIN_USE_TO_CONSUME,4,2   ; @QED_CHAIN_USE_TO_CONSUME
	.comm	_QED_CHAIN_MODE_PBL,4,2         ; @QED_CHAIN_MODE_PBL
	.comm	_QED_CHAIN_CNT_TYPE_U16,4,2     ; @QED_CHAIN_CNT_TYPE_U16
	.comm	_QED_ROCE_PROTOCOL_INDEX,8,3    ; @QED_ROCE_PROTOCOL_INDEX
l_.str.1:                               ; @.str.1
	.asciz	"qedr%d@pci:%s"

	.comm	_QEDR_MSG_INIT,4,2              ; @QEDR_MSG_INIT
l_.str.2:                               ; @.str.2
	.asciz	"cnq[%d].cons=%d\n"

	.no_dead_strip	_qedr_alloc_resources
.subsections_via_symbols
