	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvrdma_create_srq              ## -- Begin function pvrdma_create_srq
	.p2align	4, 0x90
_pvrdma_create_srq:                     ## @pvrdma_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	$104, %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, %r12
	movq	%rdi, %r14
	callq	_to_vsrq
	movq	%rax, %r13
	movl	4(%r14), %edi
	callq	_to_vdev
	movq	%rax, %rbx
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	testq	%r15, %r15
	je	LBB0_5
## %bb.1:
	movl	24(%r12), %edx
	movq	_IB_SRQT_BASIC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	jne	LBB0_6
## %bb.2:
	movq	(%r12), %rcx
	movq	24(%rbx), %rdx
	cmpq	(%rdx), %rcx
	jg	LBB0_4
## %bb.3:
	movq	8(%r12), %rcx
	cmpq	8(%rdx), %rcx
	jle	LBB0_10
LBB0_4:
	movq	8(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_7
LBB0_5:
	movq	8(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_warn
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	8(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_8:
	subl	(%rax), %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	16(%rdx), %rdx
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_atomic_add_unless
	testl	%eax, %eax
	je	LBB0_13
## %bb.11:
	leaq	36(%r13), %rdi
	callq	_spin_lock_init
	leaq	32(%r13), %rdi
	movl	$1, %esi
	callq	_refcount_set
	leaq	28(%r13), %rdi
	callq	_init_completion
	movq	8(%rbx), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	leaq	-64(%rbp), %rdi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	$8, %edx
	callq	_ib_copy_from_udata
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	movq	%rbx, %r14
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_22
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	jmp	LBB0_8
LBB0_14:
	movl	-64(%rbp), %edx
	movl	-60(%rbp), %esi
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_ib_umem_get
	movl	%eax, 16(%r13)
	movl	%eax, %edi
	callq	_IS_ERR
	movl	16(%r13), %edi
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	%rbx, %r14
	callq	_PTR_ERR
	movl	%eax, %r15d
	jmp	LBB0_22
LBB0_16:
	callq	_ib_umem_page_count
	movq	%rax, (%r13)
	testq	%rax, %rax
	js	LBB0_20
## %bb.17:
	movq	_PVRDMA_PAGE_DIR_MAX_PAGES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_20
## %bb.18:
	leaq	20(%r13), %rsi
	movq	%rbx, %rdi
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdx
	xorl	%ecx, %ecx
	callq	_pvrdma_page_dir_init
	movq	%rbx, %rcx
	movq	%r13, %rbx
	testl	%eax, %eax
	je	LBB0_23
## %bb.19:
	movl	%eax, %r15d
	movq	%rbx, %r13
	movq	%rcx, %r14
	movq	8(%rcx), %rdi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_21
LBB0_20:
	movq	%rbx, %r14
	movq	8(%rbx), %rdi
	leaq	L_.str.4(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_warn
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_21:
	movl	16(%r13), %edi
	callq	_ib_umem_release
LBB0_22:
	movq	%r14, %rdi
	callq	_atomic_dec
	jmp	LBB0_9
LBB0_23:
	movl	16(%rbx), %esi
	movq	%rcx, %r13
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%edx, %edx
	callq	_pvrdma_page_dir_insert_umem
	leaq	-144(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$56, %edx
	callq	_memset
	movq	_PVRDMA_CMD_CREATE_SRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	movl	24(%r12), %eax
	movl	%eax, -100(%rbp)
	movq	(%rbx), %rax
	movq	%rax, -144(%rbp)
	movl	(%r14), %edi
	callq	_to_vpd
	movl	(%rax), %eax
	movl	%eax, -104(%rbp)
	movups	(%r12), %xmm0
	movups	%xmm0, -128(%rbp)
	movl	16(%r12), %eax
	movl	%eax, -112(%rbp)
	movl	20(%rbx), %eax
	movl	%eax, -136(%rbp)
	movq	_PVRDMA_CMD_CREATE_SRQ_RESP@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-88(%rbp), %rdx
	movq	%r13, %r14
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_pvrdma_cmd_post
	testl	%eax, %eax
	js	LBB0_26
## %bb.24:
	movq	-88(%rbp), %rax
	movq	%rax, 8(%rbx)
	movq	%rax, -80(%rbp)
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	addq	$16, %rdi
	movq	%rdi, %r15
	callq	_spin_lock_irqsave
	movq	24(%r14), %rdx
	movq	32(%r14), %rcx
	movq	8(%rbx), %rax
	movq	16(%rdx), %rsi
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_27
## %bb.25:
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_28
LBB0_26:
	movl	%eax, %r15d
	movq	%rbx, %r13
	movq	%r14, %rbx
	movq	8(%r14), %rdi
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_warn
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_pvrdma_page_dir_cleanup
	jmp	LBB0_21
LBB0_27:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
LBB0_28:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%rbx, (%rcx,%rdx,8)
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	leaq	-80(%rbp), %rsi
	movq	%r12, %rdi
	movl	$8, %edx
	callq	_ib_copy_to_udata
	testq	%rax, %rax
	je	LBB0_30
## %bb.29:
	movq	8(%r14), %rdi
	leaq	L_.str.7(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dev_warn
	addq	$24, %rbx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_pvrdma_destroy_srq
	jmp	LBB0_7
LBB0_30:
	xorl	%r15d, %r15d
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no shared receive queue support for kernel client\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_IB_SRQT_BASIC,4,2              ## @IB_SRQT_BASIC
L_.str.1:                               ## @.str.1
	.asciz	"shared receive queue type %d not supported\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"shared receive queue size invalid\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"create shared receive queue from user space\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_PVRDMA_PAGE_DIR_MAX_PAGES,8,3  ## @PVRDMA_PAGE_DIR_MAX_PAGES
L_.str.4:                               ## @.str.4
	.asciz	"overflow pages in shared receive queue\n"

L_.str.5:                               ## @.str.5
	.asciz	"could not allocate page directory\n"

	.comm	_PVRDMA_CMD_CREATE_SRQ,4,2      ## @PVRDMA_CMD_CREATE_SRQ
	.comm	_PVRDMA_CMD_CREATE_SRQ_RESP,4,2 ## @PVRDMA_CMD_CREATE_SRQ_RESP
L_.str.6:                               ## @.str.6
	.asciz	"could not create shared receive queue, error: %d\n"

L_.str.7:                               ## @.str.7
	.asciz	"failed to copy back udata\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvrdma_create_srq              ; -- Begin function pvrdma_create_srq
	.p2align	2
_pvrdma_create_srq:                     ; @pvrdma_create_srq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	bl	_to_vsrq
	mov	x20, x0
	ldr	w0, [x23, #4]
	bl	_to_vdev
	mov	x19, x0
	cbz	x21, LBB0_5
; %bb.1:
	ldr	w8, [x22, #24]
Lloh0:
	adrp	x9, _IB_SRQT_BASIC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IB_SRQT_BASIC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.2:
	ldr	x9, [x22]
	ldr	x8, [x19, #24]
	ldr	x10, [x8]
	cmp	x9, x10
	b.gt	LBB0_4
; %bb.3:
	ldr	x9, [x22, #8]
	ldr	x10, [x8, #8]
	cmp	x9, x10
	b.le	LBB0_11
LBB0_4:
	ldr	x0, [x19, #8]
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_5:
	ldr	x0, [x19, #8]
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh7:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
	ldr	x0, [x19, #8]
	str	x8, [sp]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	bl	_dev_warn
LBB0_8:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_10:
	mov	x0, x24
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_11:
	ldr	x2, [x8, #16]
	mov	x0, x19
	mov	w1, #1
	bl	_atomic_add_unless
	cbz	w0, LBB0_14
; %bb.12:
	add	x0, x20, #36
	bl	_spin_lock_init
	add	x0, x20, #32
	mov	w1, #1
	bl	_refcount_set
	add	x0, x20, #28
	bl	_init_completion
	ldr	x0, [x19, #8]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
	add	x0, sp, #16
	mov	x1, x21
	mov	w2, #8
	bl	_ib_copy_from_udata
	cbz	x0, LBB0_15
; %bb.13:
Lloh15:
	adrp	x8, _EFAULT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_23
LBB0_14:
Lloh18:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_9
LBB0_15:
	ldp	w2, w1, [sp, #16]
	mov	x0, x21
	mov	w3, #0
	mov	w4, #0
	bl	_ib_umem_get
	str	w0, [x20, #16]
	bl	_IS_ERR
	mov	x8, x0
	ldr	w0, [x20, #16]
	cbz	x8, LBB0_17
; %bb.16:
	bl	_PTR_ERR
	mov	x24, x0
	b	LBB0_23
LBB0_17:
	bl	_ib_umem_page_count
	str	x0, [x20]
	tbnz	x0, #63, LBB0_21
; %bb.18:
	mov	x2, x0
Lloh20:
	adrp	x8, _PVRDMA_PAGE_DIR_MAX_PAGES@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PVRDMA_PAGE_DIR_MAX_PAGES@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x0, x8
	b.gt	LBB0_21
; %bb.19:
	add	x25, x20, #20
	mov	x0, x19
	mov	x1, x25
	mov	w3, #0
	bl	_pvrdma_page_dir_init
	cbz	w0, LBB0_24
; %bb.20:
	mov	x24, x0
	ldr	x0, [x19, #8]
Lloh23:
	adrp	x1, l_.str.5@PAGE
Lloh24:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_warn
	b	LBB0_22
LBB0_21:
	ldr	x0, [x19, #8]
Lloh25:
	adrp	x1, l_.str.4@PAGE
Lloh26:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_warn
Lloh27:
	adrp	x8, _EINVAL@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_22:
	ldr	w0, [x20, #16]
	bl	_ib_umem_release
LBB0_23:
	mov	x0, x19
	bl	_atomic_dec
	b	LBB0_10
LBB0_24:
	ldr	w1, [x20, #16]
	mov	x0, x25
	mov	w2, #0
	bl	_pvrdma_page_dir_insert_umem
	add	x0, sp, #40
	mov	w1, #0
	mov	w2, #56
	bl	_memset
Lloh30:
	adrp	x8, _PVRDMA_CMD_CREATE_SRQ@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PVRDMA_CMD_CREATE_SRQ@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	ldr	w9, [x22, #24]
	stp	w9, w8, [sp, #84]
	ldr	x8, [x20]
	str	x8, [sp, #40]
	ldr	w0, [x23]
	bl	_to_vpd
	ldr	w8, [x0]
	ldr	q0, [x22]
	stur	q0, [sp, #56]
	ldr	w9, [x22, #16]
	str	w8, [sp, #80]
	str	w9, [sp, #72]
	ldr	w8, [x20, #20]
	str	w8, [sp, #48]
Lloh33:
	adrp	x8, _PVRDMA_CMD_CREATE_SRQ_RESP@GOTPAGE
Lloh34:
	ldr	x8, [x8, _PVRDMA_CMD_CREATE_SRQ_RESP@GOTPAGEOFF]
Lloh35:
	ldr	w3, [x8]
	add	x1, sp, #40
	add	x2, sp, #32
	mov	x0, x19
	bl	_pvrdma_cmd_post
	tbnz	w0, #31, LBB0_27
; %bb.25:
	ldr	x8, [sp, #32]
	str	x8, [x20, #8]
	str	x8, [sp, #24]
	add	x22, x19, #16
	mov	x0, x22
	bl	_spin_lock_irqsave
	ldr	x8, [x20, #8]
	ldp	x10, x9, [x19, #24]
	ldr	x10, [x10, #16]
	udiv	x11, x8, x10
	msub	x8, x11, x10, x8
	str	x20, [x9, x8, lsl #3]
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	add	x1, sp, #24
	mov	x0, x21
	mov	w2, #8
	bl	_ib_copy_to_udata
	cbz	x0, LBB0_28
; %bb.26:
	ldr	x0, [x19, #8]
Lloh36:
	adrp	x1, l_.str.7@PAGE
Lloh37:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_dev_warn
	add	x0, x20, #24
	mov	x1, x21
	bl	_pvrdma_destroy_srq
	b	LBB0_8
LBB0_27:
	mov	x24, x0
	ldr	x0, [x19, #8]
	str	x24, [sp]
Lloh38:
	adrp	x1, l_.str.6@PAGE
Lloh39:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_dev_warn
	mov	x0, x19
	mov	x1, x25
	bl	_pvrdma_page_dir_cleanup
	b	LBB0_22
LBB0_28:
	mov	w24, #0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no shared receive queue support for kernel client\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_IB_SRQT_BASIC,4,2              ; @IB_SRQT_BASIC
l_.str.1:                               ; @.str.1
	.asciz	"shared receive queue type %d not supported\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"shared receive queue size invalid\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"create shared receive queue from user space\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_PVRDMA_PAGE_DIR_MAX_PAGES,8,3  ; @PVRDMA_PAGE_DIR_MAX_PAGES
l_.str.4:                               ; @.str.4
	.asciz	"overflow pages in shared receive queue\n"

l_.str.5:                               ; @.str.5
	.asciz	"could not allocate page directory\n"

	.comm	_PVRDMA_CMD_CREATE_SRQ,4,2      ; @PVRDMA_CMD_CREATE_SRQ
	.comm	_PVRDMA_CMD_CREATE_SRQ_RESP,4,2 ; @PVRDMA_CMD_CREATE_SRQ_RESP
l_.str.6:                               ; @.str.6
	.asciz	"could not create shared receive queue, error: %d\n"

l_.str.7:                               ; @.str.7
	.asciz	"failed to copy back udata\n"

.subsections_via_symbols
