	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function create_cq
_create_cq:                             ## @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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_to_mctx
	cmpl	$4194304, (%rbx)                ## imm = 0x400000
	jl	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	movq	%rax, %r13
	movl	4(%rbx), %eax
	movq	_CREATE_CQ_SUPPORTED_COMP_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	testl	%ecx, %eax
	je	LBB0_5
LBB0_4:
	movq	_ENOTSUP@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_27:
	xorl	%r14d, %r14d
LBB0_28:
	movq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_IBV_CQ_INIT_ATTR_MASK_FLAGS@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	_CREATE_CQ_SUPPORTED_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	testl	%eax, 8(%rbx)
	jne	LBB0_4
LBB0_7:
	movl	12(%rbx), %eax
	movq	_CREATE_CQ_SUPPORTED_WC_FLAGS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	testl	%ecx, %eax
	jne	LBB0_27
## %bb.8:
	movq	_IBV_WC_EX_WITH_SLID@GOTPCREL(%rip), %rcx
	movq	_IBV_WC_EX_WITH_SL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	testl	%eax, %edx
	je	LBB0_10
## %bb.9:
	movq	_IBV_WC_EX_WITH_COMPLETION_TIMESTAMP@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_4
LBB0_10:
	movl	$56, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_27
## %bb.11:
	movq	%rax, %r14
	movq	$0, 48(%rax)
	leaq	44(%rax), %rdi
	movq	_PTHREAD_PROCESS_PRIVATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pthread_spin_init
	testq	%rax, %rax
	jne	LBB0_26
## %bb.12:
	movl	(%rbx), %edi
	incl	%edi
	callq	_align_queue_size
	movl	%eax, (%rbx)
	movl	(%r12), %edi
	callq	_to_mdev
	leaq	8(%r14), %rsi
	movl	(%rbx), %edx
	movl	(%r13), %ecx
	movl	%eax, %edi
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	callq	_mlx4_alloc_cq_buf
	testq	%rax, %rax
	jne	LBB0_26
## %bb.13:
	movl	(%r13), %eax
	movl	%eax, 40(%r14)
	movq	%r12, %rdi
	callq	_to_mctx
	movq	_MLX4_DB_TYPE_CQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_mlx4_alloc_db
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_25
## %bb.14:
	movq	%rax, %rcx
	addq	$8, %rcx
	movq	%rcx, 32(%r14)
	movl	$1, (%r14)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movl	%r15d, 4(%r14)
	movq	_IBV_CQ_INIT_ATTR_MASK_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rbx)
	je	LBB0_17
## %bb.15:
	movq	_IBV_CREATE_CQ_ATTR_SINGLE_THREADED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_17
## %bb.16:
	movq	_MLX4_CQ_FLAGS_SINGLE_THREADED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%r15d, %eax
	movl	%eax, 4(%r14)
LBB0_17:
	decl	(%rbx)
	movq	_MLX4_CQ_FLAGS_EXTENDED@GOTPCREL(%rip), %r13
	testl	%r15d, (%r13)
	je	LBB0_19
## %bb.18:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_mlx4_cmd_create_cq_ex
	jmp	LBB0_20
LBB0_19:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	callq	_mlx4_cmd_create_cq
LBB0_20:
	testl	%eax, %eax
	je	LBB0_21
## %bb.24:
	movq	%r12, %rdi
	callq	_to_mctx
	movq	_MLX4_DB_TYPE_CQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	16(%r14), %rdx
	movq	%rax, %rdi
	callq	_mlx4_free_db
LBB0_25:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx4_free_buf
LBB0_26:
	movq	%r14, %rdi
	callq	_free
	jmp	LBB0_27
LBB0_21:
	testl	%r15d, (%r13)
	je	LBB0_23
## %bb.22:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_mlx4_cq_fill_pfns
LBB0_23:
	addq	$24, %r14
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_CREATE_CQ_SUPPORTED_COMP_MASK,4,2 ## @CREATE_CQ_SUPPORTED_COMP_MASK
	.comm	_ENOTSUP,4,2                    ## @ENOTSUP
	.comm	_IBV_CQ_INIT_ATTR_MASK_FLAGS,4,2 ## @IBV_CQ_INIT_ATTR_MASK_FLAGS
	.comm	_CREATE_CQ_SUPPORTED_FLAGS,4,2  ## @CREATE_CQ_SUPPORTED_FLAGS
	.comm	_CREATE_CQ_SUPPORTED_WC_FLAGS,4,2 ## @CREATE_CQ_SUPPORTED_WC_FLAGS
	.comm	_IBV_WC_EX_WITH_SLID,4,2        ## @IBV_WC_EX_WITH_SLID
	.comm	_IBV_WC_EX_WITH_SL,4,2          ## @IBV_WC_EX_WITH_SL
	.comm	_IBV_WC_EX_WITH_COMPLETION_TIMESTAMP,4,2 ## @IBV_WC_EX_WITH_COMPLETION_TIMESTAMP
	.comm	_PTHREAD_PROCESS_PRIVATE,4,2    ## @PTHREAD_PROCESS_PRIVATE
	.comm	_MLX4_DB_TYPE_CQ,4,2            ## @MLX4_DB_TYPE_CQ
	.comm	_IBV_CREATE_CQ_ATTR_SINGLE_THREADED,4,2 ## @IBV_CREATE_CQ_ATTR_SINGLE_THREADED
	.comm	_MLX4_CQ_FLAGS_SINGLE_THREADED,4,2 ## @MLX4_CQ_FLAGS_SINGLE_THREADED
	.comm	_MLX4_CQ_FLAGS_EXTENDED,4,2     ## @MLX4_CQ_FLAGS_EXTENDED
	.no_dead_strip	_create_cq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function create_cq
_create_cq:                             ; @create_cq
	.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	x20, x2
	mov	x19, x1
	mov	x21, x0
	bl	_to_mctx
	ldr	w8, [x19]
	cmp	w8, #1024, lsl #12              ; =4194304
	b.lt	LBB0_2
; %bb.1:
	mov	x0, #0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	ldr	w8, [x19, #4]
Lloh2:
	adrp	x9, _CREATE_CQ_SUPPORTED_COMP_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CREATE_CQ_SUPPORTED_COMP_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	bics	wzr, w8, w9
	b.eq	LBB0_6
LBB0_3:
	mov	x0, #0
Lloh5:
	adrp	x8, _ENOTSUP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOTSUP@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _errno@GOTPAGE
Lloh8:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh9:
	str	w8, [x9]
LBB0_5:
	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_6:
	mov	x24, x0
Lloh10:
	adrp	x25, _IBV_CQ_INIT_ATTR_MASK_FLAGS@GOTPAGE
Lloh11:
	ldr	x25, [x25, _IBV_CQ_INIT_ATTR_MASK_FLAGS@GOTPAGEOFF]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.7:
	ldr	w8, [x19, #8]
Lloh12:
	adrp	x9, _CREATE_CQ_SUPPORTED_FLAGS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CREATE_CQ_SUPPORTED_FLAGS@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	bics	wzr, w8, w9
	b.ne	LBB0_3
LBB0_8:
	ldr	w8, [x19, #12]
Lloh15:
	adrp	x9, _CREATE_CQ_SUPPORTED_WC_FLAGS@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CREATE_CQ_SUPPORTED_WC_FLAGS@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	bics	wzr, w8, w9
	b.eq	LBB0_10
LBB0_9:
	mov	x0, #0
	b	LBB0_5
LBB0_10:
Lloh18:
	adrp	x9, _IBV_WC_EX_WITH_SLID@GOTPAGE
Lloh19:
	ldr	x9, [x9, _IBV_WC_EX_WITH_SLID@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _IBV_WC_EX_WITH_SL@GOTPAGE
Lloh22:
	ldr	x10, [x10, _IBV_WC_EX_WITH_SL@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
Lloh24:
	adrp	x9, _IBV_WC_EX_WITH_COMPLETION_TIMESTAMP@GOTPAGE
Lloh25:
	ldr	x9, [x9, _IBV_WC_EX_WITH_COMPLETION_TIMESTAMP@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_3
LBB0_12:
	mov	w0, #56
	bl	_malloc
	cbz	x0, LBB0_5
; %bb.13:
	mov	x22, x0
	str	xzr, [x0, #48]
	add	x0, x0, #44
Lloh27:
	adrp	x8, _PTHREAD_PROCESS_PRIVATE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PTHREAD_PROCESS_PRIVATE@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	bl	_pthread_spin_init
	cbnz	x0, LBB0_25
; %bb.14:
	ldr	w8, [x19]
	add	w0, w8, #1
	bl	_align_queue_size
	str	w0, [x19]
	ldr	w0, [x21]
	bl	_to_mdev
	add	x23, x22, #8
	ldr	w2, [x19]
	ldr	w3, [x24]
	mov	x1, x23
	bl	_mlx4_alloc_cq_buf
	cbnz	x0, LBB0_25
; %bb.15:
	ldr	w8, [x24]
	str	w8, [x22, #40]
	mov	x0, x21
	bl	_to_mctx
Lloh30:
	adrp	x24, _MLX4_DB_TYPE_CQ@GOTPAGE
Lloh31:
	ldr	x24, [x24, _MLX4_DB_TYPE_CQ@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_mlx4_alloc_db
	str	x0, [x22, #16]
	cbz	x0, LBB0_24
; %bb.16:
	mov	x8, x0
	str	xzr, [x8, #8]!
	str	x8, [x22, #32]
	mov	w8, #1
	str	w8, [x22]
	str	xzr, [x0]
	str	w20, [x22, #4]
	ldr	w8, [x19, #4]
	ldr	w9, [x25]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.17:
	ldr	w8, [x19, #8]
Lloh32:
	adrp	x9, _IBV_CREATE_CQ_ATTR_SINGLE_THREADED@GOTPAGE
Lloh33:
	ldr	x9, [x9, _IBV_CREATE_CQ_ATTR_SINGLE_THREADED@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.18:
Lloh35:
	adrp	x8, _MLX4_CQ_FLAGS_SINGLE_THREADED@GOTPAGE
Lloh36:
	ldr	x8, [x8, _MLX4_CQ_FLAGS_SINGLE_THREADED@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	orr	w8, w8, w20
	str	w8, [x22, #4]
LBB0_19:
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
Lloh38:
	adrp	x25, _MLX4_CQ_FLAGS_EXTENDED@GOTPAGE
Lloh39:
	ldr	x25, [x25, _MLX4_CQ_FLAGS_EXTENDED@GOTPAGEOFF]
	ldr	w8, [x25]
	mov	x0, x21
	mov	x1, x19
	mov	x2, x22
	tst	w8, w20
	b.eq	LBB0_21
; %bb.20:
	bl	_mlx4_cmd_create_cq_ex
	b	LBB0_22
LBB0_21:
	bl	_mlx4_cmd_create_cq
LBB0_22:
	cbz	w0, LBB0_26
; %bb.23:
	mov	x0, x21
	bl	_to_mctx
	ldr	w1, [x24]
	ldr	x2, [x22, #16]
	bl	_mlx4_free_db
LBB0_24:
	mov	x0, x23
	bl	_mlx4_free_buf
LBB0_25:
	mov	x0, x22
	bl	_free
	b	LBB0_9
LBB0_26:
	ldr	w8, [x25]
	tst	w8, w20
	b.eq	LBB0_28
; %bb.27:
	mov	x0, x22
	mov	x1, x19
	bl	_mlx4_cq_fill_pfns
LBB0_28:
	add	x0, x22, #24
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_CREATE_CQ_SUPPORTED_COMP_MASK,4,2 ; @CREATE_CQ_SUPPORTED_COMP_MASK
	.comm	_ENOTSUP,4,2                    ; @ENOTSUP
	.comm	_IBV_CQ_INIT_ATTR_MASK_FLAGS,4,2 ; @IBV_CQ_INIT_ATTR_MASK_FLAGS
	.comm	_CREATE_CQ_SUPPORTED_FLAGS,4,2  ; @CREATE_CQ_SUPPORTED_FLAGS
	.comm	_CREATE_CQ_SUPPORTED_WC_FLAGS,4,2 ; @CREATE_CQ_SUPPORTED_WC_FLAGS
	.comm	_IBV_WC_EX_WITH_SLID,4,2        ; @IBV_WC_EX_WITH_SLID
	.comm	_IBV_WC_EX_WITH_SL,4,2          ; @IBV_WC_EX_WITH_SL
	.comm	_IBV_WC_EX_WITH_COMPLETION_TIMESTAMP,4,2 ; @IBV_WC_EX_WITH_COMPLETION_TIMESTAMP
	.comm	_PTHREAD_PROCESS_PRIVATE,4,2    ; @PTHREAD_PROCESS_PRIVATE
	.comm	_MLX4_DB_TYPE_CQ,4,2            ; @MLX4_DB_TYPE_CQ
	.comm	_IBV_CREATE_CQ_ATTR_SINGLE_THREADED,4,2 ; @IBV_CREATE_CQ_ATTR_SINGLE_THREADED
	.comm	_MLX4_CQ_FLAGS_SINGLE_THREADED,4,2 ; @MLX4_CQ_FLAGS_SINGLE_THREADED
	.comm	_MLX4_CQ_FLAGS_EXTENDED,4,2     ; @MLX4_CQ_FLAGS_EXTENDED
	.no_dead_strip	_create_cq
.subsections_via_symbols
