	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_ib_create_cq              ## -- Begin function mlx4_ib_create_cq
	.p2align	4, 0x90
_mlx4_ib_create_cq:                     ## @mlx4_ib_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
	movq	%r8, %r13
	movq	%rcx, %r15
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r12
	callq	_to_mdev
	testl	%ebx, %ebx
	jle	LBB0_2
## %bb.1:
	movq	%rax, %r14
	movq	8(%rax), %rax
	cmpl	%ebx, (%rax)
	jge	LBB0_4
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	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_4:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$88, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r13
	incl	%ebx
	movl	%ebx, %edi
	callq	_roundup_pow_of_two
	movl	%eax, %ebx
	decl	%eax
	movl	%eax, 16(%r13)
	leaq	84(%r13), %rdi
	callq	_mutex_init
	leaq	80(%r13), %rdi
	callq	_spin_lock_init
	xorps	%xmm0, %xmm0
	movups	%xmm0, 64(%r13)
	testq	%r15, %r15
	je	LBB0_12
## %bb.7:
	leaq	-72(%rbp), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	$8, %edx
	callq	_ib_copy_from_udata
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_27
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_12:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rbx
	movq	8(%r14), %rdi
	movq	%r13, %rsi
	movl	$1, %edx
	callq	_mlx4_db_alloc
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_27
## %bb.13:
	movq	8(%r13), %rax
	movq	%rax, 56(%r13)
	leaq	8(%rax), %rcx
	movq	%rcx, 48(%r13)
	leaq	20(%r13), %rsi
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movq	%r14, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_mlx4_ib_alloc_cq_buf
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_14
LBB0_26:
	movq	8(%r14), %rdi
	movq	%r13, %rsi
	callq	_mlx4_db_free
	jmp	LBB0_27
LBB0_9:
	leaq	20(%r13), %rdx
	leaq	24(%r13), %rcx
	movl	-68(%rbp), %r8d
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%ebx, %r9d
	callq	_mlx4_ib_get_cq_umem
	movl	%ebx, %ecx
	movq	%r15, %rbx
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_27
## %bb.10:
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_to_mucontext
	movl	-72(%rbp), %esi
	movq	%rax, %rdi
	movq	%r13, %rdx
	callq	_mlx4_ib_db_map_user
	testl	%eax, %eax
	je	LBB0_11
## %bb.23:
	movl	%eax, %r15d
	jmp	LBB0_24
LBB0_14:
	movq	%r14, %rcx
	addq	$16, %rcx
	jmp	LBB0_15
LBB0_11:
	movq	%rbx, %rdi
	callq	_to_mucontext
	movq	%rax, %rcx
LBB0_15:
	movq	(%r14), %rsi
	testq	%rsi, %rsi
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_17
## %bb.16:
                                        ## kill: def $eax killed $eax killed $rax
	cltd
	idivl	(%r12)
	movslq	%edx, %rax
	movl	(%rsi,%rax,4), %eax
LBB0_17:
	movq	8(%r14), %rdi
	leaq	20(%r13), %rbx
	movl	(%r13), %r8d
	leaq	32(%r13), %r12
	subq	$8, %rsp
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rdx
	movq	%r12, %r9
	pushq	$0
	pushq	$0
	pushq	%rax
	callq	_mlx4_cq_alloc
	addq	$32, %rsp
	testl	%eax, %eax
	je	LBB0_18
## %bb.21:
	movl	%eax, %r15d
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	jne	LBB0_22
## %bb.25:
	movq	8(%r14), %rdi
	movq	%rbx, %rsi
	callq	_mlx4_mtt_cleanup
	movl	16(%r13), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mlx4_ib_free_cq_buf
	jmp	LBB0_26
LBB0_18:
	leaq	16(%r13), %rbx
	movq	_mlx4_ib_cq_comp@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r13)
	movq	_mlx4_ib_cq_event@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r13)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_28
## %bb.19:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_ib_copy_to_udata
	testq	%rax, %rax
	je	LBB0_28
## %bb.20:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_22:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_to_mucontext
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_mlx4_ib_db_unmap_user
LBB0_24:
	movq	8(%r14), %rdi
	movq	%r13, %rsi
	addq	$20, %rsi
	callq	_mlx4_mtt_cleanup
	movl	24(%r13), %edi
	callq	_ib_umem_release
LBB0_27:
	movq	%r13, %rdi
	callq	_kfree
	movl	%r15d, %edi
	callq	_ERR_PTR
	movq	%rax, %rbx
LBB0_28:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_mlx4_ib_cq_comp,4,2            ## @mlx4_ib_cq_comp
	.comm	_mlx4_ib_cq_event,4,2           ## @mlx4_ib_cq_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_ib_create_cq              ; -- Begin function mlx4_ib_create_cq
	.p2align	2
_mlx4_ib_create_cq:                     ; @mlx4_ib_create_cq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x4
	mov	x21, x3
	mov	x23, x2
	mov	x24, x1
	mov	x25, x0
	bl	_to_mdev
	cmp	w24, #1
	b.lt	LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
	cmp	w8, w24
	b.ge	LBB0_4
LBB0_2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_ERR_PTR
LBB0_4:
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #88
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.5:
	mov	x19, x0
	add	w0, w24, #1
	bl	_roundup_pow_of_two
	mov	x26, x0
	sub	w8, w0, #1
	mov	x24, x19
	str	w8, [x24, #16]!
	add	x0, x24, #68
	bl	_mutex_init
	add	x0, x24, #64
	bl	_spin_lock_init
	stp	xzr, xzr, [x24, #48]
	cbz	x21, LBB0_9
; %bb.6:
	add	x0, sp, #8
	mov	x1, x22
	mov	w2, #8
	bl	_ib_copy_from_udata
	cbz	x0, LBB0_12
; %bb.7:
Lloh5:
	adrp	x8, _EFAULT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_27
LBB0_8:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_3
LBB0_9:
	ldr	x0, [x20, #8]
	mov	x1, x19
	mov	w2, #1
	bl	_mlx4_db_alloc
	mov	x27, x0
	cbnz	w0, LBB0_27
; %bb.10:
	ldr	x8, [x19, #8]
	add	x9, x8, #8
	stp	x9, x8, [x19, #48]
	add	x1, x19, #20
	stp	xzr, xzr, [x8]
	mov	x0, x20
	mov	x2, x26
	bl	_mlx4_ib_alloc_cq_buf
	mov	x27, x0
	cbz	w0, LBB0_15
LBB0_11:
	ldr	x0, [x20, #8]
	mov	x1, x19
	bl	_mlx4_db_free
	b	LBB0_27
LBB0_12:
	add	x2, x19, #20
	add	x3, x19, #24
	ldr	w4, [sp, #12]
	mov	x0, x20
	mov	x1, x21
	mov	x5, x26
	bl	_mlx4_ib_get_cq_umem
	mov	x27, x0
	cbnz	w0, LBB0_27
; %bb.13:
	mov	x0, x21
	bl	_to_mucontext
	ldr	w1, [sp, #8]
	mov	x2, x19
	bl	_mlx4_ib_db_map_user
	cbz	w0, LBB0_16
; %bb.14:
	mov	x27, x0
	b	LBB0_26
LBB0_15:
	add	x3, x20, #16
	b	LBB0_17
LBB0_16:
	mov	x0, x21
	bl	_to_mucontext
	mov	x3, x0
LBB0_17:
	ldr	x8, [x20]
	cbz	x8, LBB0_19
; %bb.18:
	ldr	w9, [x25]
	sdiv	w10, w23, w9
	msub	w9, w10, w9, w23
	ldr	w23, [x8, w9, sxtw #2]
LBB0_19:
	ldr	x0, [x20, #8]
	add	x2, x19, #20
	mov	x25, x19
	ldr	w4, [x25], #32
	str	wzr, [sp]
	mov	x1, x26
	mov	x5, x25
	mov	x6, x23
	mov	w7, #0
	bl	_mlx4_cq_alloc
	cbz	w0, LBB0_22
; %bb.20:
	mov	x27, x0
	cbnz	x21, LBB0_25
; %bb.21:
	ldr	x0, [x20, #8]
	add	x21, x19, #20
	mov	x1, x21
	bl	_mlx4_mtt_cleanup
	ldr	w2, [x19, #16]
	mov	x0, x20
	mov	x1, x21
	bl	_mlx4_ib_free_cq_buf
	b	LBB0_11
LBB0_22:
Lloh10:
	adrp	x8, _mlx4_ib_cq_comp@GOTPAGE
Lloh11:
	ldr	x8, [x8, _mlx4_ib_cq_comp@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _mlx4_ib_cq_event@GOTPAGE
Lloh14:
	ldr	x9, [x9, _mlx4_ib_cq_event@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #36]
	cbz	x21, LBB0_28
; %bb.23:
	mov	x0, x22
	mov	x1, x25
	mov	w2, #4
	bl	_ib_copy_to_udata
	cbz	x0, LBB0_28
; %bb.24:
Lloh16:
	adrp	x8, _EFAULT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w27, w8
LBB0_25:
	mov	x0, x21
	bl	_to_mucontext
	mov	x1, x19
	bl	_mlx4_ib_db_unmap_user
LBB0_26:
	ldr	x0, [x20, #8]
	add	x1, x19, #20
	bl	_mlx4_mtt_cleanup
	ldr	w0, [x19, #24]
	bl	_ib_umem_release
LBB0_27:
	mov	x0, x19
	bl	_kfree
	mov	x0, x27
	bl	_ERR_PTR
	mov	x24, x0
LBB0_28:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_mlx4_ib_cq_comp,4,2            ; @mlx4_ib_cq_comp
	.comm	_mlx4_ib_cq_event,4,2           ; @mlx4_ib_cq_event
.subsections_via_symbols
