	.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	%rdi, %rbx
	movl	4(%rdi), %edi
	callq	_get_ocrdma_pd
	movq	%rax, %r15
	movl	(%rbx), %edi
	callq	_get_ocrdma_dev
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_get_ocrdma_srq
	movq	%rax, %r14
	movq	(%r13), %rax
	cmpq	16(%r12), %rax
	jg	LBB0_1
## %bb.2:
	movq	8(%r13), %rax
	cmpq	24(%r12), %rax
	jle	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r14, %rdi
	addq	$32, %rdi
	callq	_spin_lock_init
	movq	%r15, 24(%r14)
	movslq	(%r15), %rax
	movslq	(%r12), %rcx
	imulq	%rax, %rcx
	addq	8(%r12), %rcx
	movq	%rcx, 16(%r14)
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	movq	%r15, %rcx
	callq	_ocrdma_mbx_create_srq
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_14
## %bb.4:
	cmpq	$0, -48(%rbp)                   ## 8-byte Folded Reload
	jne	LBB0_9
## %bb.5:
	movl	12(%r14), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movl	$4, %esi
	callq	_kcalloc
	movl	%eax, 8(%r14)
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movl	12(%r14), %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, (%r14)
	movl	(%rbx), %edx
	movl	$4, %esi
	callq	_kmalloc_array
	movl	%eax, 4(%r14)
	testl	%eax, %eax
	je	LBB0_6
## %bb.8:
	movl	(%r14), %edx
	shll	$2, %edx
	movl	%eax, %edi
	movl	$255, %esi
	callq	_memset
LBB0_9:
	cmpq	$0, 16(%r13)
	je	LBB0_11
## %bb.10:
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_ocrdma_mbx_modify_srq
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_13
LBB0_11:
	xorl	%ebx, %ebx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	testq	%rdx, %rdx
	je	LBB0_14
## %bb.12:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_ocrdma_copy_srq_uresp
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_13
	jmp	LBB0_14
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_13:
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_ocrdma_mbx_destroy_srq
	movl	8(%r14), %edi
	callq	_kfree
	movl	4(%r14), %edi
	callq	_kfree
	movl	%r13d, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.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	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	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w0, [x0, #4]
	bl	_get_ocrdma_pd
	mov	x23, x0
	ldr	w0, [x19]
	bl	_get_ocrdma_dev
	mov	x20, x0
	mov	x0, x19
	bl	_get_ocrdma_srq
	ldr	x8, [x22]
	ldr	x9, [x20, #16]
	cmp	x8, x9
	b.gt	LBB0_2
; %bb.1:
	ldr	x8, [x22, #8]
	ldr	x9, [x20, #24]
	cmp	x8, x9
	b.le	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_3:
	mov	x0, x23
	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_4:
	mov	x19, x0
	add	x0, x0, #32
	bl	_spin_lock_init
	ldr	x8, [x20, #8]
	ldrsw	x9, [x23]
	ldrsw	x10, [x20]
	madd	x8, x10, x9, x8
	stp	x8, x23, [x19, #16]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	mov	x3, x23
	bl	_ocrdma_mbx_create_srq
	mov	x23, x0
	cbnz	w0, LBB0_3
; %bb.5:
	cbnz	x21, LBB0_9
; %bb.6:
	ldr	w0, [x19, #12]
Lloh3:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w2, [x23]
	mov	w1, #4
	bl	_kcalloc
	str	w0, [x19, #8]
	cbz	w0, LBB0_13
; %bb.7:
	ldr	w8, [x19, #12]
	add	w9, w8, #31
	cmp	w8, #0
	csel	w9, w9, w8, lt
	asr	w9, w9, #5
	tst	w8, #0x1f
	cinc	w0, w9, ne
	str	w0, [x19]
	ldr	w2, [x23]
	mov	w1, #4
	bl	_kmalloc_array
	str	w0, [x19, #4]
	cbz	w0, LBB0_13
; %bb.8:
	ldr	w8, [x19]
	lsl	w2, w8, #2
	mov	w1, #255
	bl	_memset
LBB0_9:
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x19
	mov	x1, x22
	bl	_ocrdma_mbx_modify_srq
	mov	x23, x0
	cbnz	w0, LBB0_14
LBB0_11:
	cbz	x21, LBB0_15
; %bb.12:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_ocrdma_copy_srq_uresp
	mov	x23, x0
	cbnz	w0, LBB0_14
	b	LBB0_3
LBB0_13:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_14:
	mov	x0, x20
	mov	x1, x19
	bl	_ocrdma_mbx_destroy_srq
	ldr	w0, [x19, #8]
	bl	_kfree
	ldr	w0, [x19, #4]
	bl	_kfree
	b	LBB0_3
LBB0_15:
	mov	w23, #0
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
