	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hns_roce_srq_alloc
_hns_roce_srq_alloc:                    ## @hns_roce_srq_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, %r13d
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	16(%rbp), %r14
	leaq	16(%rdi), %rsi
	movl	16(%r14), %edx
	leaq	-60(%rbp), %rcx
	callq	_hns_roce_table_find
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%rax, %r12
	leaq	12(%rbx), %rsi
	movl	12(%r14), %edx
	leaq	-56(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_hns_roce_table_find
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	%r15d, -48(%rbp)                ## 4-byte Spill
	leaq	20(%rbx), %r15
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_hns_roce_bitmap_alloc
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.8:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	leaq	24(%rbx), %r13
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_hns_roce_table_get
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.9:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	leaq	28(%rbx), %r13
	movl	(%r14), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movq	%r14, %rdx
	callq	_xa_store
	movl	%eax, %edi
	callq	_xa_err
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.10:
	movq	%rbx, %rdi
	callq	_hns_roce_alloc_cmd_mailbox
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_15
## %bb.11:
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
	jmp	LBB0_12
LBB0_1:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_5:
	movl	8(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_2:
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_17
LBB0_7:
	movl	8(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_15:
	movq	(%rbx), %r10
	movl	(%r15), %r9d
	movl	-60(%rbp), %r11d
	movl	-56(%rbp), %eax
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	pushq	%rax
	pushq	%r11
	pushq	-80(%rbp)                       ## 8-byte Folded Reload
	pushq	%r12
	callq	*(%r10)
	addq	$32, %rsp
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_hns_roce_sw2hw_srq
	movq	%r15, %rsi
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_hns_roce_free_cmd_mailbox
	testl	%r15d, %r15d
	je	LBB0_16
LBB0_12:
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_xa_erase
LBB0_13:
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_hns_roce_table_put
LBB0_14:
	movl	(%r14), %esi
	movq	_BITMAP_NO_RR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_hns_roce_bitmap_free
LBB0_17:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	leaq	8(%r14), %rdi
	movl	$1, %esi
	callq	_atomic_set
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_init_completion
	xorl	%r15d, %r15d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SRQ alloc.Failed to find srq buf addr.\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"SRQ alloc.Failed to find idx que buf addr.\n"

L_.str.2:                               ## @.str.2
	.asciz	"SRQ alloc.Failed to alloc index.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_BITMAP_NO_RR,4,2               ## @BITMAP_NO_RR
	.no_dead_strip	_hns_roce_srq_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hns_roce_srq_alloc
_hns_roce_srq_alloc:                    ; @hns_roce_srq_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x6
	mov	x24, x3
	mov	x23, x2
	mov	x25, x1
	mov	x20, x0
	add	x1, x0, #16
	ldr	w2, [x6, #16]
	add	x3, sp, #28
	bl	_hns_roce_table_find
	cbz	x0, LBB0_7
; %bb.1:
	mov	x26, x0
	add	x1, x20, #12
	ldr	w2, [x19, #12]
	add	x3, sp, #24
	mov	x0, x20
	bl	_hns_roce_table_find
	cbz	x0, LBB0_8
; %bb.2:
	mov	x28, x0
	add	x21, x20, #20
	mov	x0, x21
	mov	x1, x19
	bl	_hns_roce_bitmap_alloc
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.3:
	add	x22, x20, #24
	ldr	w2, [x19]
	mov	x0, x20
	mov	x1, x22
	bl	_hns_roce_table_get
	mov	x27, x0
	cbnz	w0, LBB0_15
; %bb.4:
	str	x22, [sp, #16]                  ; 8-byte Folded Spill
	add	x22, x20, #28
	ldr	w1, [x19]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x22
	mov	x2, x19
	bl	_xa_store
	bl	_xa_err
	mov	x27, x0
	cbnz	w0, LBB0_14
; %bb.5:
	str	x22, [sp, #8]                   ; 8-byte Folded Spill
	mov	x0, x20
	bl	_hns_roce_alloc_cmd_mailbox
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_12
; %bb.6:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x27, x0
	b	LBB0_13
LBB0_7:
	ldr	w0, [x20, #8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_9
LBB0_8:
	ldr	w0, [x20, #8]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_9:
	bl	_dev_err
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_16
LBB0_11:
	ldr	w0, [x20, #8]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_10
LBB0_12:
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w5, [x22]
	ldp	w10, w9, [sp, #24]
	stp	w9, w10, [sp]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x25
	mov	x3, x24
	mov	x4, x23
	mov	x6, x26
	mov	x7, x28
	blr	x8
	ldr	w2, [x19]
	mov	x0, x20
	mov	x1, x22
	bl	_hns_roce_sw2hw_srq
	mov	x27, x0
	mov	x0, x20
	mov	x1, x22
	bl	_hns_roce_free_cmd_mailbox
	cbz	w27, LBB0_17
LBB0_13:
	ldr	w1, [x19]
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_xa_erase
LBB0_14:
	ldr	w2, [x19]
	mov	x0, x20
	ldr	x1, [sp, #16]                   ; 8-byte Folded Reload
	bl	_hns_roce_table_put
LBB0_15:
	ldr	w1, [x19]
Lloh13:
	adrp	x8, _BITMAP_NO_RR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BITMAP_NO_RR@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_hns_roce_bitmap_free
LBB0_16:
	mov	x0, x27
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_17:
	add	x0, x19, #8
	mov	w1, #1
	bl	_atomic_set
	add	x0, x19, #4
	bl	_init_completion
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SRQ alloc.Failed to find srq buf addr.\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"SRQ alloc.Failed to find idx que buf addr.\n"

l_.str.2:                               ; @.str.2
	.asciz	"SRQ alloc.Failed to alloc index.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_BITMAP_NO_RR,4,2               ; @BITMAP_NO_RR
	.no_dead_strip	_hns_roce_srq_alloc
.subsections_via_symbols
