	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rvt_create_srq                 ## -- Begin function rvt_create_srq
	.p2align	4, 0x90
_rvt_create_srq:                        ## @rvt_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_ib_to_rvt
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_ibsrq_to_rvtsrq
	movq	%rax, %r14
	movq	(%r13), %rax
	movq	_IB_SRQT_BASIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.3:
	movq	8(%r13), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	cmpq	24(%r15), %rax
	jg	LBB0_7
## %bb.5:
	movq	16(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.6:
	cmpq	32(%r15), %rsi
	jle	LBB0_8
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	incq	%rsi
	movq	%rsi, (%r14)
	movq	%rax, 8(%r14)
	leal	4(,%rax,4), %ebx
	imull	%ebx, %esi
	movl	48(%r15), %edx
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%r12, %rcx
	callq	_rvt_alloc_rq
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_10:
	testq	%r12, %r12
	je	LBB0_14
## %bb.11:
	cmpl	$4, (%r12)
	jb	LBB0_14
## %bb.12:
	imull	(%r14), %ebx
	addl	$4, %ebx
	movl	20(%r14), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movq	%r12, %rdx
	callq	_rvt_create_mmap_info
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_20
## %bb.13:
	addq	$4, %rax
	movq	%r12, %rdi
	movq	%rax, %rsi
	movl	$4, %edx
	callq	_ib_copy_to_udata
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_16
LBB0_14:
	movq	%r14, %rdi
	addq	$16, %rdi
	callq	_spin_lock_init
	movl	24(%r13), %eax
	movl	%eax, 32(%r14)
	leaq	16(%r15), %rbx
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	(%r15), %rax
	cmpq	40(%r15), %rax
	jne	LBB0_17
## %bb.15:
	movq	%rbx, %rdi
	callq	_spin_unlock
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movq	24(%r14), %rdi
	callq	_kfree
	jmp	LBB0_21
LBB0_17:
	incq	%rax
	movq	%rax, (%r15)
	movq	%rbx, %rdi
	callq	_spin_unlock
	xorl	%ebx, %ebx
	cmpq	$0, 24(%r14)
	je	LBB0_19
## %bb.18:
	leaq	8(%r15), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irq
	movq	24(%r14), %rdi
	addq	$12, %r15
	movq	%r15, %rsi
	callq	_list_add
	movq	%r12, %rdi
	callq	_spin_unlock_irq
	jmp	LBB0_19
LBB0_20:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_21:
	movq	%r14, %rdi
	callq	_rvt_free_rq
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_SRQT_BASIC,8,3              ## @IB_SRQT_BASIC
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rvt_create_srq                 ; -- Begin function rvt_create_srq
	.p2align	2
_rvt_create_srq:                        ; @rvt_create_srq
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x0]
	bl	_ib_to_rvt
	mov	x20, x0
	mov	x0, x19
	bl	_ibsrq_to_rvtsrq
	ldr	x8, [x21]
Lloh0:
	adrp	x9, _IB_SRQT_BASIC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IB_SRQT_BASIC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_5
; %bb.2:
	ldr	x9, [x20, #24]
	cmp	x8, x9
	b.gt	LBB0_5
; %bb.3:
	ldr	x9, [x21, #16]
	cbz	x9, LBB0_5
; %bb.4:
	ldr	x10, [x20, #32]
	cmp	x9, x10
	b.le	LBB0_9
LBB0_5:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh5:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x19, x0
	add	x9, x9, #1
	stp	x9, x8, [x0]
	lsl	w8, w8, #2
	add	w23, w8, #4
	mul	w1, w23, w9
	ldr	w2, [x20, #48]
	mov	x3, x22
	bl	_rvt_alloc_rq
	cbz	x0, LBB0_11
; %bb.10:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_7
LBB0_11:
	cbz	x22, LBB0_15
; %bb.12:
	ldr	w8, [x22]
	cmp	w8, #4
	b.lo	LBB0_15
; %bb.13:
	ldr	w8, [x19]
	orr	w9, wzr, #0x4
	madd	w1, w23, w8, w9
	ldr	w3, [x19, #20]
	mov	x0, x20
	mov	x2, x22
	bl	_rvt_create_mmap_info
	str	x0, [x19, #24]
	cbz	x0, LBB0_21
; %bb.14:
	add	x1, x0, #4
	mov	x0, x22
	mov	w2, #4
	bl	_ib_copy_to_udata
	mov	x22, x0
	cbnz	w0, LBB0_17
LBB0_15:
	add	x0, x19, #16
	bl	_spin_lock_init
	ldr	w8, [x21, #24]
	str	w8, [x19, #32]
	add	x21, x20, #16
	mov	x0, x21
	bl	_spin_lock
	ldr	x8, [x20]
	ldr	x9, [x20, #40]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.16:
	mov	x0, x21
	bl	_spin_unlock
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_17:
	ldr	x0, [x19, #24]
	bl	_kfree
	b	LBB0_22
LBB0_18:
	add	x8, x8, #1
	str	x8, [x20]
	mov	x0, x21
	bl	_spin_unlock
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_20
; %bb.19:
	add	x21, x20, #8
	mov	x0, x21
	bl	_spin_lock_irq
	ldr	x0, [x19, #24]
	add	x1, x20, #12
	bl	_list_add
	mov	x0, x21
	bl	_spin_unlock_irq
LBB0_20:
	mov	w22, #0
	b	LBB0_8
LBB0_21:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_22:
	mov	x0, x19
	bl	_rvt_free_rq
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_SRQT_BASIC,8,3              ; @IB_SRQT_BASIC
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
