	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_create_cq
_mthca_create_cq:                       ## @mthca_create_cq
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	jle	LBB0_27
## %bb.1:
	movq	%r8, %r15
	movq	%rcx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r12
	callq	_to_mdev
	cmpl	%ebx, 4(%rax)
	jge	LBB0_2
LBB0_27:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_2:
	testq	%r14, %r14
	je	LBB0_7
## %bb.3:
	leaq	-72(%rbp), %rdi
	movq	%r15, %rsi
	movl	$24, %edx
	callq	_ib_copy_from_udata
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_25
LBB0_7:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kmalloc
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_10
LBB0_12:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	$1, %eax
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, %r15d
	leal	(%r15,%r15), %eax
	cmpl	%ebx, %r15d
	jle	LBB0_13
## %bb.14:
	movq	%r12, %rdi
	callq	_to_mdev
	movq	%rax, %rbx
	testq	%r14, %r14
	je	LBB0_15
## %bb.17:
	movq	%r14, %rdi
	callq	_to_mucontext
	movl	-64(%rbp), %ecx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%rax, %rdx
	movq	%r13, %r8
	callq	_mthca_init_cq
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_20
## %bb.18:
	leaq	16(%r13), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	$4, %edx
	callq	_ib_copy_to_udata
	testq	%rax, %rax
	je	LBB0_16
## %bb.19:
	movq	%r12, %rdi
	callq	_to_mdev
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_mthca_free_cq
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_5:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	callq	_to_mdev
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_to_mucontext
	leaq	4(%rax), %r13
	movq	%r14, %rdi
	callq	_to_mucontext
	movl	(%rax), %edx
	movl	-72(%rbp), %ecx
	movl	-52(%rbp), %r8d
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_mthca_map_user_db
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %edi
	jmp	LBB0_25
LBB0_15:
	movq	%r12, %rdi
	callq	_to_mdev
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	xorl	%edx, %edx
	movq	%r13, %r8
	callq	_mthca_init_cq
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_16
LBB0_20:
	movq	%r13, %rdi
	callq	_kfree
	movl	%ebx, %r13d
	testq	%r14, %r14
	jne	LBB0_22
	jmp	LBB0_24
LBB0_8:
	movq	%r12, %rdi
	callq	_to_mdev
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_to_mucontext
	leaq	4(%rax), %r13
	movq	%r14, %rdi
	callq	_to_mucontext
	movl	(%rax), %edx
	movl	-68(%rbp), %ecx
	movl	-56(%rbp), %r8d
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_mthca_map_user_db
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_23
## %bb.9:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kmalloc
	testq	%rax, %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_10
## %bb.11:
	movq	%rax, %r13
	movl	-60(%rbp), %eax
	movl	%eax, 28(%r13)
	movl	-72(%rbp), %eax
	movl	%eax, 24(%r13)
	movl	-68(%rbp), %eax
	movl	%eax, 20(%r13)
	jmp	LBB0_12
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	testq	%r14, %r14
	je	LBB0_24
LBB0_22:
	movq	%r12, %rdi
	callq	_to_mdev
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_to_mucontext
	leaq	4(%rax), %rbx
	movq	%r14, %rdi
	callq	_to_mucontext
	movl	(%rax), %edx
	movl	-68(%rbp), %ecx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_mthca_unmap_user_db
LBB0_23:
	movq	%r12, %rdi
	callq	_to_mdev
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_to_mucontext
	leaq	4(%rax), %rbx
	movq	%r14, %rdi
	callq	_to_mucontext
	movl	(%rax), %edx
	movl	-72(%rbp), %ecx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_mthca_unmap_user_db
LBB0_24:
	movl	%r13d, %edi
LBB0_25:
	callq	_ERR_PTR
	movq	%rax, %r13
LBB0_26:
	movq	%r13, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	$0, 8(%r13)
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_mthca_create_cq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_create_cq
_mthca_create_cq:                       ; @mthca_create_cq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	cmp	w1, #1
	b.lt	LBB0_2
; %bb.1:
	mov	x21, x4
	mov	x19, x3
	mov	x22, x1
	mov	x20, x0
	bl	_to_mdev
	ldr	w8, [x0, #4]
	cmp	w8, w22
	b.ge	LBB0_3
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_ERR_PTR
LBB0_3:
	cbz	x19, LBB0_6
; %bb.4:
	add	x0, sp, #8
	mov	x1, x21
	mov	w2, #24
	bl	_ib_copy_from_udata
	cbz	x0, LBB0_13
; %bb.5:
Lloh3:
	adrp	x8, _EFAULT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_24
LBB0_6:
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kmalloc
	mov	x23, x0
	cbz	x0, LBB0_17
LBB0_7:
	mov	w8, #1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x24, x8
	lsl	w8, w8, #1
	cmp	w24, w22
	b.le	LBB0_8
; %bb.9:
	mov	x0, x20
	bl	_to_mdev
	mov	x22, x0
	cbz	x19, LBB0_18
; %bb.10:
	mov	x0, x19
	bl	_to_mucontext
	mov	x2, x0
	ldr	w3, [sp, #16]
	mov	x0, x22
	mov	x1, x24
	mov	x4, x23
	bl	_mthca_init_cq
	mov	x24, x0
	cbnz	w0, LBB0_19
; %bb.11:
	add	x1, x23, #16
	mov	x0, x21
	mov	w2, #4
	bl	_ib_copy_to_udata
	cbz	x0, LBB0_26
; %bb.12:
	mov	x0, x20
	bl	_to_mdev
	mov	x1, x23
	bl	_mthca_free_cq
	mov	w24, #0
	b	LBB0_19
LBB0_13:
	mov	x0, x20
	bl	_to_mdev
	mov	x23, x0
	mov	x0, x19
	bl	_to_mucontext
	add	x24, x0, #4
	mov	x0, x19
	bl	_to_mucontext
	ldr	w2, [x0]
	ldr	w3, [sp, #8]
	ldr	w4, [sp, #28]
	mov	x0, x23
	mov	x1, x24
	bl	_mthca_map_user_db
	cbnz	w0, LBB0_24
; %bb.14:
	mov	x0, x20
	bl	_to_mdev
	mov	x23, x0
	mov	x0, x19
	bl	_to_mucontext
	add	x24, x0, #4
	mov	x0, x19
	bl	_to_mucontext
	ldr	w2, [x0]
	ldr	w3, [sp, #12]
	ldr	w4, [sp, #24]
	mov	x0, x23
	mov	x1, x24
	bl	_mthca_map_user_db
	mov	x24, x0
	cbnz	w0, LBB0_22
; %bb.15:
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kmalloc
	cbz	x0, LBB0_17
; %bb.16:
	mov	x23, x0
	ldr	w8, [sp, #20]
	str	w8, [x0, #28]
	ldr	d0, [sp, #8]
	rev64.2s	v0, v0
	stur	d0, [x0, #20]
	b	LBB0_7
LBB0_17:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_20
LBB0_18:
	mov	x0, x20
	bl	_to_mdev
	ldr	w3, [x0]
	mov	x0, x22
	mov	x1, x24
	mov	x2, #0
	mov	x4, x23
	bl	_mthca_init_cq
	mov	x24, x0
	cbz	w0, LBB0_26
LBB0_19:
	mov	x0, x23
	bl	_kfree
LBB0_20:
	cbz	x19, LBB0_23
; %bb.21:
	mov	x0, x20
	bl	_to_mdev
	mov	x21, x0
	mov	x0, x19
	bl	_to_mucontext
	add	x22, x0, #4
	mov	x0, x19
	bl	_to_mucontext
	ldr	w2, [x0]
	ldr	w3, [sp, #12]
	mov	x0, x21
	mov	x1, x22
	bl	_mthca_unmap_user_db
LBB0_22:
	mov	x0, x20
	bl	_to_mdev
	mov	x20, x0
	mov	x0, x19
	bl	_to_mucontext
	add	x21, x0, #4
	mov	x0, x19
	bl	_to_mucontext
	ldr	w2, [x0]
	ldr	w3, [sp, #8]
	mov	x0, x20
	mov	x1, x21
	bl	_mthca_unmap_user_db
LBB0_23:
	mov	x0, x24
LBB0_24:
	bl	_ERR_PTR
	mov	x23, x0
LBB0_25:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_26:
	str	xzr, [x23, #8]
	b	LBB0_25
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_mthca_create_cq
.subsections_via_symbols
