	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_create_srq              ## -- Begin function ocrdma_create_srq
	.p2align	4, 0x90
_ocrdma_create_srq:                     ## @ocrdma_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, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	callq	_get_ocrdma_pd
	movq	%rax, %r14
	movq	8(%rax), %r12
	movq	(%r13), %rax
	cmpq	16(%r12), %rax
	jle	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %edi
	jmp	LBB0_6
LBB0_2:
	movq	8(%r13), %rax
	cmpq	24(%r12), %rax
	jle	LBB0_4
## %bb.3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_6
LBB0_4:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	%rax, %rbx
	leaq	56(%rax), %rdi
	callq	_spin_lock_init
	movq	%r12, 48(%rbx)
	movq	%r14, 40(%rbx)
	movslq	(%r14), %rax
	movslq	(%r12), %rcx
	imulq	%rax, %rcx
	addq	8(%r12), %rcx
	movq	%rcx, 32(%rbx)
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	callq	_ocrdma_mbx_create_srq
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_17
## %bb.8:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	testq	%r15, %r15
	jne	LBB0_12
## %bb.9:
	movl	28(%rbx), %edi
	shll	$2, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	movq	%rax, 16(%rbx)
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_16
## %bb.10:
	movl	28(%rbx), %eax
	leal	31(%rax), %edi
	testl	%eax, %eax
	cmovnsl	%eax, %edi
	sarl	$5, %edi
	andl	$31, %eax
	cmpl	$1, %eax
	sbbl	$-1, %edi
	movl	%edi, (%rbx)
	shll	$2, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_16
## %bb.11:
	movl	(%rbx), %edx
	shll	$2, %edx
	movq	%rax, %rdi
	movl	$255, %esi
	callq	_memset
LBB0_12:
	cmpq	$0, 16(%r13)
	je	LBB0_14
## %bb.13:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_ocrdma_mbx_modify_srq
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_16
LBB0_14:
	testq	%r15, %r15
	je	LBB0_18
## %bb.15:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_ocrdma_copy_srq_uresp
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_18
LBB0_16:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ocrdma_mbx_destroy_srq
LBB0_17:
	movq	16(%rbx), %rdi
	callq	_kfree
	movq	8(%rbx), %rdi
	callq	_kfree
	movq	%rbx, %rdi
	callq	_kfree
	movl	%r14d, %edi
	jmp	LBB0_6
LBB0_5:
	movl	%r15d, %edi
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_18:
	addq	$24, %rbx
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_create_srq              ; -- Begin function ocrdma_create_srq
	.p2align	2
_ocrdma_create_srq:                     ; @ocrdma_create_srq
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	bl	_get_ocrdma_pd
	ldr	x19, [x0, #8]
	ldr	x8, [x22]
	ldr	x9, [x19, #16]
	cmp	x8, x9
	b.gt	LBB0_2
; %bb.1:
	ldr	x8, [x22, #8]
	ldr	x9, [x19, #24]
	cmp	x8, x9
	b.le	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_4:
	mov	x23, x0
Lloh6:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	w0, #64
	bl	_kzalloc
	cbz	x0, LBB0_9
; %bb.5:
	mov	x20, x0
	add	x0, x0, #56
	bl	_spin_lock_init
	str	x19, [x20, #48]
	ldr	x8, [x19, #8]
	ldrsw	x9, [x23]
	ldrsw	x10, [x19]
	madd	x8, x10, x9, x8
	stp	x8, x23, [x20, #32]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	bl	_ocrdma_mbx_create_srq
	mov	x23, x0
	cbnz	w0, LBB0_18
; %bb.6:
	cbz	x21, LBB0_10
; %bb.7:
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_13
LBB0_8:
	mov	x0, x20
	mov	x1, x22
	bl	_ocrdma_mbx_modify_srq
	mov	x23, x0
	cbnz	w0, LBB0_17
	b	LBB0_13
LBB0_9:
	neg	w0, w25
	b	LBB0_3
LBB0_10:
	ldr	w8, [x20, #28]
	lsl	w0, w8, #2
	ldr	w1, [x24]
	bl	_kzalloc
	str	x0, [x20, #16]
	cbz	x0, LBB0_16
; %bb.11:
	ldr	w8, [x20, #28]
	add	w9, w8, #31
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w9, w9, #5
	tst	w8, #0x1f
	cinc	w8, w9, ne
	str	w8, [x20]
	lsl	w0, w8, #2
	ldr	w1, [x24]
	bl	_kmalloc
	str	x0, [x20, #8]
	cbz	x0, LBB0_16
; %bb.12:
	ldr	w8, [x20]
	lsl	w2, w8, #2
	mov	w1, #255
	bl	_memset
	ldr	x8, [x22, #16]
	cbnz	x8, LBB0_8
LBB0_13:
	cbz	x21, LBB0_15
; %bb.14:
	mov	x0, x20
	mov	x1, x21
	bl	_ocrdma_copy_srq_uresp
	mov	x23, x0
	cbnz	w0, LBB0_17
LBB0_15:
	add	x0, x20, #24
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_16:
	mov	w23, #0
LBB0_17:
	mov	x0, x19
	mov	x1, x20
	bl	_ocrdma_mbx_destroy_srq
LBB0_18:
	ldr	x0, [x20, #16]
	bl	_kfree
	ldr	x0, [x20, #8]
	bl	_kfree
	mov	x0, x20
	bl	_kfree
	mov	x0, x23
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
.subsections_via_symbols
