	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qedr_create_srq                ## -- Begin function qedr_create_srq
	.p2align	4, 0x90
_qedr_create_srq:                       ## @qedr_create_srq
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	$0, -96(%rbp)
	movl	4(%rdi), %edi
	callq	_get_qedr_dev
	movq	%rax, %r14
	movl	(%rbx), %edi
	callq	_get_qedr_pd
	movq	%rax, %r13
	movl	$0, -48(%rbp)
	movq	%rbx, %rdi
	callq	_get_qedr_srq
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_QEDR_MSG_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testq	%r15, %r15
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str(%rip), %rdx
	xorl	%r12d, %r12d
	movq	%r14, %rdi
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, %r8
	movq	%r14, %rbx
	xorl	%eax, %eax
	callq	_DP_DEBUG
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_qedr_check_srq_params
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_2:
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%rbx, 56(%r13)
	leaq	24(%r13), %rdi
	callq	_spin_lock_init
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	4(%rdx), %eax
	movl	%eax, 48(%r13)
	movl	(%rdx), %eax
	movl	%eax, 44(%r13)
	testq	%r15, %r15
	movq	%r15, %r12
	je	LBB0_7
## %bb.3:
	leaq	-48(%rbp), %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_ib_copy_from_udata
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_DP_ERR
	jmp	LBB0_19
LBB0_7:
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_qedr_alloc_srq_kernel_params
	testl	%eax, %eax
	jne	LBB0_19
## %bb.8:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rbx
	movq	%r13, %r12
	addq	$40, %r12
	movq	%r12, %rdi
	callq	_qed_chain_get_page_cnt
	movq	%rax, %r15
	movq	%r12, %rdi
	movq	%rbx, %r12
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	callq	_qed_chain_get_pbl_phys
	movq	_QED_CHAIN_PAGE_SIZE@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_5:
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r13, %rsi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_qedr_init_srq_user_params
	testl	%eax, %eax
	jne	LBB0_19
## %bb.6:
	movq	8(%r13), %rax
	movq	16(%r13), %r15
	movq	(%rax), %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
LBB0_9:
	movq	(%rcx), %rcx
	movq	32(%r13), %rdx
	movl	(%r14), %esi
	movl	%esi, -96(%rbp)
	movq	%rax, -104(%rbp)
	movq	%rdx, -112(%rbp)
	movq	%r15, -120(%rbp)
	movq	%rcx, -128(%rbp)
	movq	8(%rbx), %rax
	movl	(%rbx), %edi
	leaq	-128(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	callq	*(%rax)
	testl	%eax, %eax
	jne	LBB0_16
## %bb.10:
	movl	-64(%rbp), %esi
	movl	%esi, (%r13)
	testq	%r12, %r12
	je	LBB0_13
## %bb.11:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	%r12, %rdx
	callq	_qedr_copy_srq_uresp
	testl	%eax, %eax
	jne	LBB0_15
## %bb.12:
	movl	(%r13), %esi
LBB0_13:
	movq	%rbx, %rdi
	addq	$16, %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdx
	callq	_xa_insert_irq
	testl	%eax, %eax
	je	LBB0_14
LBB0_15:
	movl	(%r13), %eax
	movl	%eax, -72(%rbp)
	movq	8(%rbx), %rax
	movl	(%rbx), %edi
	leaq	-72(%rbp), %rsi
	callq	*8(%rax)
LBB0_16:
	movq	%r13, %rdi
	testq	%r12, %r12
	je	LBB0_18
## %bb.17:
	callq	_qedr_free_srq_user_params
	jmp	LBB0_19
LBB0_18:
	callq	_qedr_free_srq_kernel_params
LBB0_19:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
LBB0_20:
	subl	(%rax), %r12d
LBB0_21:
	movl	%r12d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_QEDR_MSG_SRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	(%r13), %rcx
	leaq	L_.str.4(%rip), %rdx
	xorl	%r12d, %r12d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	_DP_DEBUG
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_QEDR_MSG_QP,4,2                ## @QEDR_MSG_QP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"create SRQ called from %s (pd %p)\n"

L_.str.1:                               ## @.str.1
	.asciz	"User lib"

L_.str.2:                               ## @.str.2
	.asciz	"kernel"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"create srq: problem copying data from user space\n"

	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_QED_CHAIN_PAGE_SIZE,8,3        ## @QED_CHAIN_PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_QEDR_MSG_SRQ,4,2               ## @QEDR_MSG_SRQ
L_.str.4:                               ## @.str.4
	.asciz	"create srq: created srq with srq_id=0x%0x\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qedr_create_srq                ; -- Begin function qedr_create_srq
	.p2align	2
_qedr_create_srq:                       ; @qedr_create_srq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x19, x2
	mov	x23, x1
	mov	x21, x0
	str	xzr, [sp, #64]
	ldr	w0, [x0, #4]
	bl	_get_qedr_dev
	mov	x20, x0
	ldr	w0, [x21]
	bl	_get_qedr_pd
	mov	x22, x0
	str	wzr, [sp, #16]
	mov	x0, x21
	bl	_get_qedr_srq
	mov	x21, x0
Lloh0:
	adrp	x8, _QEDR_MSG_QP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QEDR_MSG_QP@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, l_.str.1@PAGE
Lloh4:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh5:
	adrp	x9, l_.str.2@PAGE
Lloh6:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	x19, #0
	csel	x3, x9, x8, eq
	str	x22, [sp]
Lloh7:
	adrp	x2, l_.str@PAGE
Lloh8:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_DP_DEBUG
	mov	x0, x20
	mov	x1, x23
	mov	x2, x19
	bl	_qedr_check_srq_params
	cbz	w0, LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_19
LBB0_2:
	str	x20, [x21, #56]
	add	x0, x21, #24
	bl	_spin_lock_init
	ldr	d0, [x23]
	stur	d0, [x21, #44]
	cbz	x19, LBB0_5
; %bb.3:
	add	x0, sp, #16
	mov	x1, x19
	mov	w2, #4
	bl	_ib_copy_from_udata
	cbz	x0, LBB0_7
; %bb.4:
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_DP_ERR
	b	LBB0_18
LBB0_5:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x23
	bl	_qedr_alloc_srq_kernel_params
	cbnz	w0, LBB0_18
; %bb.6:
	add	x24, x21, #40
	mov	x0, x24
	bl	_qed_chain_get_page_cnt
	mov	x23, x0
	mov	x0, x24
	bl	_qed_chain_get_pbl_phys
Lloh13:
	adrp	x8, _QED_CHAIN_PAGE_SIZE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _QED_CHAIN_PAGE_SIZE@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
	add	x2, sp, #16
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	mov	w4, #0
	bl	_qedr_init_srq_user_params
	cbnz	w0, LBB0_18
; %bb.8:
	ldp	x8, x23, [x21, #8]
	ldr	x0, [x8]
Lloh15:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
LBB0_9:
	ldr	x8, [x8]
	ldr	x9, [x21, #32]
	ldr	w10, [x22]
	str	w10, [sp, #64]
	stp	x9, x0, [sp, #48]
	stp	x8, x23, [sp, #32]
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	w0, [x20]
	add	x1, sp, #32
	add	x2, sp, #24
	blr	x8
	cbnz	w0, LBB0_15
; %bb.10:
	ldr	w1, [sp, #24]
	str	w1, [x21]
	cbz	x19, LBB0_13
; %bb.11:
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_qedr_copy_srq_uresp
	cbnz	w0, LBB0_14
; %bb.12:
	ldr	w1, [x21]
LBB0_13:
	add	x0, x20, #16
Lloh17:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	mov	x2, x21
	bl	_xa_insert_irq
	cbz	w0, LBB0_21
LBB0_14:
	ldr	w8, [x21]
	stur	w8, [x29, #-56]
	ldr	x8, [x20, #8]
	ldr	x8, [x8, #8]
	ldr	w0, [x20]
	sub	x1, x29, #56
	blr	x8
LBB0_15:
	mov	x0, x21
	cbz	x19, LBB0_17
; %bb.16:
	bl	_qedr_free_srq_user_params
	b	LBB0_18
LBB0_17:
	bl	_qedr_free_srq_kernel_params
LBB0_18:
Lloh20:
	adrp	x8, _EFAULT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_20:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_21:
Lloh22:
	adrp	x8, _QEDR_MSG_SRQ@GOTPAGE
Lloh23:
	ldr	x8, [x8, _QEDR_MSG_SRQ@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	ldrsw	x3, [x21]
Lloh25:
	adrp	x2, l_.str.4@PAGE
Lloh26:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_DP_DEBUG
	mov	w0, #0
	b	LBB0_20
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_QEDR_MSG_QP,4,2                ; @QEDR_MSG_QP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"create SRQ called from %s (pd %p)\n"

l_.str.1:                               ; @.str.1
	.asciz	"User lib"

l_.str.2:                               ; @.str.2
	.asciz	"kernel"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"create srq: problem copying data from user space\n"

	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_QED_CHAIN_PAGE_SIZE,8,3        ; @QED_CHAIN_PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_QEDR_MSG_SRQ,4,2               ; @QEDR_MSG_SRQ
l_.str.4:                               ; @.str.4
	.asciz	"create srq: created srq with srq_id=0x%0x\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
.subsections_via_symbols
