	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_create_qp_ex              ## -- Begin function mlx4_create_qp_ex
	.p2align	4, 0x90
_mlx4_create_qp_ex:                     ## @mlx4_create_qp_ex
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_to_mctx
	movq	(%rax), %rcx
	movq	8(%rbx), %rdx
	testq	%rcx, %rcx
	je	LBB0_5
## %bb.1:
	cmpq	%rcx, %rdx
	jg	LBB0_51
## %bb.2:
	cmpq	%rcx, 16(%rbx)
	jg	LBB0_51
## %bb.3:
	movq	8(%rax), %rax
	cmpq	%rax, 24(%rbx)
	jg	LBB0_51
## %bb.4:
	cmpq	%rax, 32(%rbx)
	jle	LBB0_9
	jmp	LBB0_51
LBB0_5:
	cmpq	$65536, %rdx                    ## imm = 0x10000
	jg	LBB0_51
## %bb.6:
	cmpq	$65536, 16(%rbx)                ## imm = 0x10000
	jg	LBB0_51
## %bb.7:
	cmpq	$64, 24(%rbx)
	jg	LBB0_51
## %bb.8:
	cmpq	$64, 32(%rbx)
	jg	LBB0_51
LBB0_9:
	cmpl	$1024, 40(%rbx)                 ## imm = 0x400
	jg	LBB0_51
## %bb.10:
	movq	_MLX4_CREATE_QP_SUP_COMP_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	testl	%eax, (%rbx)
	jne	LBB0_51
## %bb.11:
	movl	$1, %edi
	movl	$112, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_51
## %bb.12:
	movq	%rax, %r14
	leaq	8(%rbx), %r13
	movq	%rax, %r15
	movl	56(%rbx), %esi
	movq	_IBV_QPT_XRC_RECV@GOTPCREL(%rip), %rax
	cmpl	(%rax), %esi
	jne	LBB0_14
## %bb.13:
	movq	$0, (%r13)
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_14:
	movq	%r13, %rdi
	movq	%r15, %rdx
	callq	_mlx4_calc_sq_wqe_size
	movb	60(%r15), %cl
	movl	$2048, %edi                     ## imm = 0x800
	shrl	%cl, %edi
	incl	%edi
	movl	%edi, (%r15)
	addl	(%r13), %edi
	callq	_align_queue_size
LBB0_15:
	movl	%eax, 56(%r15)
	cmpq	$0, 64(%rbx)
	je	LBB0_16
LBB0_18:
	movq	$0, 32(%rbx)
	movl	$0, 16(%r15)
	movq	$0, 16(%rbx)
LBB0_23:
	movl	56(%rbx), %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%r15, %rcx
	callq	_mlx4_alloc_qp_buf
	testq	%rax, %rax
	jne	LBB0_50
## %bb.24:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_mlx4_init_qp_indices
	leaq	72(%r14), %rdi
	movq	_PTHREAD_PROCESS_PRIVATE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_pthread_spin_init
	testq	%rax, %rax
	jne	LBB0_47
## %bb.25:
	leaq	48(%r14), %rdi
	movl	(%r13), %esi
	callq	_pthread_spin_init
	testq	%rax, %rax
	je	LBB0_26
LBB0_47:
	movq	64(%r15), %rdi
	callq	_free
	cmpl	$0, 16(%r15)
	je	LBB0_49
## %bb.48:
	movq	40(%r15), %rdi
	callq	_free
LBB0_49:
	addq	$8, %r14
	movq	%r14, %rdi
	callq	_mlx4_free_buf
LBB0_50:
	movq	%r15, %rdi
	callq	_free
LBB0_51:
	xorl	%r14d, %r14d
LBB0_52:
	movq	%r14, %rax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	56(%rbx), %eax
	movq	_IBV_QPT_XRC_SEND@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_18
## %bb.17:
	movq	_IBV_QPT_XRC_RECV@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_18
## %bb.19:
	movl	16(%rbx), %edi
	callq	_align_queue_size
	movl	%eax, 16(%r15)
	cmpq	$0, 32(%rbx)
	jg	LBB0_21
## %bb.20:
	movq	$1, 32(%rbx)
LBB0_21:
	cmpq	$0, 16(%rbx)
	jg	LBB0_23
## %bb.22:
	movq	$1, 16(%rbx)
	jmp	LBB0_23
LBB0_26:
	cmpq	$0, 32(%rbx)
	je	LBB0_29
## %bb.27:
	movq	%r12, %rdi
	callq	_to_mctx
	movq	_MLX4_DB_TYPE_RQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_mlx4_alloc_db
	movq	%rax, 80(%r15)
	testq	%rax, %rax
	je	LBB0_47
## %bb.28:
	movq	$0, (%rax)
	movq	%rax, -96(%rbp)
	jmp	LBB0_30
LBB0_29:
	movq	$0, -96(%rbp)
LBB0_30:
	movq	8(%r15), %rax
	movq	%rax, -88(%rbp)
	movl	60(%r15), %eax
	movl	%eax, -80(%rbp)
	movl	56(%r15), %eax
	movl	$-1, %ecx
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	incl	%ecx
	movl	$1, %edx
	shll	%cl, %edx
	cmpl	%edx, %eax
	jg	LBB0_31
## %bb.32:
	movl	%ecx, -76(%rbp)
	movq	$0, -64(%rbp)
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	%r12, %rdi
	callq	_to_mctx
	leaq	16(%rax), %rdi
	callq	_pthread_mutex_lock
	movq	_MLX4_CREATE_QP_EX2_COMP_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_34
## %bb.33:
	leaq	-96(%rbp), %rdx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rcx
	callq	_mlx4_cmd_create_qp_ex
	jmp	LBB0_35
LBB0_34:
	leaq	88(%r14), %rsi
	leaq	-72(%rbp), %r8
	leaq	-56(%rbp), %rax
	movq	%r12, %rdi
	movl	$4, %edx
	movq	%rbx, %rcx
	movl	$40, %r9d
	pushq	$4
	pushq	%rax
	callq	_ibv_cmd_create_qp_ex
	addq	$16, %rsp
LBB0_35:
	testl	%eax, %eax
	jne	LBB0_45
## %bb.36:
	cmpl	$0, 56(%r15)
	jne	LBB0_38
## %bb.37:
	cmpl	$0, 16(%r15)
	je	LBB0_39
LBB0_38:
	movq	%r12, %rdi
	callq	_to_mctx
	movl	88(%r15), %esi
	movq	%rax, %rdi
	movq	%r15, %rdx
	callq	_mlx4_store_qp
	testl	%eax, %eax
	je	LBB0_39
## %bb.44:
	leaq	88(%r14), %rdi
	callq	_ibv_cmd_destroy_qp
LBB0_45:
	movq	%r12, %rdi
	callq	_to_mctx
	leaq	16(%rax), %rdi
	callq	_pthread_mutex_unlock
	cmpq	$0, 32(%rbx)
	je	LBB0_47
## %bb.46:
	movq	%r12, %rdi
	callq	_to_mctx
	movq	_MLX4_DB_TYPE_RQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	80(%r15), %rdx
	movq	%rax, %rdi
	callq	_mlx4_free_db
	jmp	LBB0_47
LBB0_39:
	movq	%r12, %rdi
	callq	_to_mctx
	leaq	16(%rax), %rdi
	callq	_pthread_mutex_unlock
	movq	16(%rbx), %rax
	movq	%rax, 24(%r15)
	movl	%eax, 16(%r15)
	movq	32(%rbx), %rax
	movq	%rax, 32(%r15)
	movl	56(%rbx), %edx
	movq	_IBV_QPT_XRC_RECV@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	je	LBB0_41
## %bb.40:
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_mlx4_set_sq_sizes
LBB0_41:
	addq	$88, %r14
	movl	88(%r15), %edi
	shll	$8, %edi
	callq	_htobe32
	movq	%rax, 104(%r15)
	cmpq	$0, 48(%rbx)
	je	LBB0_43
## %bb.42:
	movq	_MLX4_WQE_CTRL_CQ_UPDATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htobe32
	movq	%rax, 96(%r15)
	jmp	LBB0_52
LBB0_43:
	movq	$0, 96(%r15)
	jmp	LBB0_52
	.cfi_endproc
                                        ## -- End function
	.comm	_MLX4_CREATE_QP_SUP_COMP_MASK,4,2 ## @MLX4_CREATE_QP_SUP_COMP_MASK
	.comm	_IBV_QPT_XRC_RECV,4,2           ## @IBV_QPT_XRC_RECV
	.comm	_IBV_QPT_XRC_SEND,4,2           ## @IBV_QPT_XRC_SEND
	.comm	_PTHREAD_PROCESS_PRIVATE,4,2    ## @PTHREAD_PROCESS_PRIVATE
	.comm	_MLX4_DB_TYPE_RQ,4,2            ## @MLX4_DB_TYPE_RQ
	.comm	_MLX4_CREATE_QP_EX2_COMP_MASK,4,2 ## @MLX4_CREATE_QP_EX2_COMP_MASK
	.comm	_MLX4_WQE_CTRL_CQ_UPDATE,4,2    ## @MLX4_WQE_CTRL_CQ_UPDATE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx4_create_qp_ex              ; -- Begin function mlx4_create_qp_ex
	.p2align	2
_mlx4_create_qp_ex:                     ; @mlx4_create_qp_ex
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x1
	mov	x21, x0
	bl	_to_mctx
	ldr	x8, [x0]
	ldr	x9, [x19, #8]
	cbz	x8, LBB0_5
; %bb.1:
	cmp	x9, x8
	b.gt	LBB0_24
; %bb.2:
	ldr	x9, [x19, #16]
	cmp	x9, x8
	b.gt	LBB0_24
; %bb.3:
	ldr	x9, [x19, #24]
	ldr	x8, [x0, #8]
	cmp	x9, x8
	b.gt	LBB0_24
; %bb.4:
	ldr	x9, [x19, #32]
	cmp	x9, x8
	b.le	LBB0_9
	b	LBB0_24
LBB0_5:
	cmp	x9, #16, lsl #12                ; =65536
	b.gt	LBB0_24
; %bb.6:
	ldr	x8, [x19, #16]
	cmp	x8, #16, lsl #12                ; =65536
	b.gt	LBB0_24
; %bb.7:
	ldr	x8, [x19, #24]
	cmp	x8, #64
	b.gt	LBB0_24
; %bb.8:
	ldr	x8, [x19, #32]
	cmp	x8, #64
	b.gt	LBB0_24
LBB0_9:
	ldr	w8, [x19, #40]
	cmp	w8, #1024
	b.gt	LBB0_24
; %bb.10:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _MLX4_CREATE_QP_SUP_COMP_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MLX4_CREATE_QP_SUP_COMP_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	bics	wzr, w8, w9
	b.ne	LBB0_24
; %bb.11:
	mov	w0, #1
	mov	w1, #112
	bl	_calloc
	cbz	x0, LBB0_24
; %bb.12:
	mov	x20, x0
	add	x22, x19, #8
	ldr	w1, [x19, #56]
Lloh3:
	adrp	x23, _IBV_QPT_XRC_RECV@GOTPAGE
Lloh4:
	ldr	x23, [x23, _IBV_QPT_XRC_RECV@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w1, w8
	b.ne	LBB0_14
; %bb.13:
	mov	w0, #0
	str	xzr, [x22]
	b	LBB0_15
LBB0_14:
	mov	x0, x22
	mov	x2, x20
	bl	_mlx4_calc_sq_wqe_size
	ldr	w8, [x20, #60]
	mov	w9, #2048
	lsr	w8, w9, w8
	add	w8, w8, #1
	str	w8, [x20]
	ldr	w9, [x22]
	add	w0, w8, w9
	bl	_align_queue_size
LBB0_15:
	str	w0, [x20, #56]
	ldr	x8, [x19, #64]
	cbz	x8, LBB0_26
LBB0_16:
	str	xzr, [x19, #32]
	str	wzr, [x20, #16]
	str	xzr, [x19, #16]
LBB0_17:
	ldr	w2, [x19, #56]
	mov	x0, x21
	mov	x1, x22
	mov	x3, x20
	bl	_mlx4_alloc_qp_buf
	cbnz	x0, LBB0_23
; %bb.18:
	mov	x0, x20
	bl	_mlx4_init_qp_indices
	add	x0, x20, #72
Lloh5:
	adrp	x23, _PTHREAD_PROCESS_PRIVATE@GOTPAGE
Lloh6:
	ldr	x23, [x23, _PTHREAD_PROCESS_PRIVATE@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_pthread_spin_init
	cbnz	x0, LBB0_20
; %bb.19:
	add	x0, x20, #48
	ldr	w1, [x23]
	bl	_pthread_spin_init
	cbz	x0, LBB0_32
LBB0_20:
	ldr	x0, [x20, #64]
	bl	_free
	ldr	w8, [x20, #16]
	cbz	w8, LBB0_22
; %bb.21:
	ldr	x0, [x20, #40]
	bl	_free
LBB0_22:
	add	x0, x20, #8
	bl	_mlx4_free_buf
LBB0_23:
	mov	x0, x20
	bl	_free
LBB0_24:
	mov	x21, #0
LBB0_25:
	mov	x0, x21
	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
	add	sp, sp, #112
	ret
LBB0_26:
	ldr	w8, [x19, #56]
Lloh7:
	adrp	x9, _IBV_QPT_XRC_SEND@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IBV_QPT_XRC_SEND@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_16
; %bb.27:
	ldr	w9, [x23]
	cmp	w8, w9
	b.eq	LBB0_16
; %bb.28:
	ldr	w0, [x19, #16]
	bl	_align_queue_size
	str	w0, [x20, #16]
	ldr	x8, [x19, #32]
	cmp	x8, #0
	b.gt	LBB0_30
; %bb.29:
	mov	w8, #1
	str	x8, [x19, #32]
LBB0_30:
	ldr	x8, [x19, #16]
	cmp	x8, #0
	b.gt	LBB0_17
; %bb.31:
	mov	w8, #1
	str	x8, [x19, #16]
	b	LBB0_17
LBB0_32:
	ldr	x8, [x19, #32]
Lloh10:
	adrp	x24, _MLX4_DB_TYPE_RQ@GOTPAGE
Lloh11:
	ldr	x24, [x24, _MLX4_DB_TYPE_RQ@GOTPAGEOFF]
	cbz	x8, LBB0_35
; %bb.33:
	mov	x0, x21
	bl	_to_mctx
	ldr	w1, [x24]
	bl	_mlx4_alloc_db
	str	x0, [x20, #80]
	cbz	x0, LBB0_20
; %bb.34:
	str	xzr, [x0]
	str	x0, [sp, #8]
	b	LBB0_36
LBB0_35:
	str	xzr, [sp, #8]
LBB0_36:
	ldr	x8, [x20, #8]
	str	x8, [sp, #16]
	ldp	w9, w8, [x20, #56]
	str	w8, [sp, #24]
	mov	w8, #-1
	mov	w10, #1
LBB0_37:                                ; =>This Inner Loop Header: Depth=1
	add	w8, w8, #1
	lsl	w11, w10, w8
	cmp	w9, w11
	b.gt	LBB0_37
; %bb.38:
	str	w8, [sp, #28]
	str	xzr, [sp, #40]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	mov	x0, x21
	bl	_to_mctx
	add	x0, x0, #16
	bl	_pthread_mutex_lock
	ldr	w8, [x19]
Lloh12:
	adrp	x9, _MLX4_CREATE_QP_EX2_COMP_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _MLX4_CREATE_QP_EX2_COMP_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_40
; %bb.39:
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x19
	mov	x3, x20
	bl	_mlx4_cmd_create_qp_ex
	b	LBB0_41
LBB0_40:
	add	x1, x20, #88
	add	x8, sp, #8
	add	x4, x8, #24
	mov	x6, sp
	mov	x0, x21
	mov	w2, #4
	mov	x3, x19
	mov	w5, #40
	mov	w7, #4
	bl	_ibv_cmd_create_qp_ex
LBB0_41:
	cbnz	w0, LBB0_46
; %bb.42:
	ldr	w8, [x20, #56]
	cbnz	w8, LBB0_44
; %bb.43:
	ldr	w8, [x20, #16]
	cbz	w8, LBB0_48
LBB0_44:
	mov	x0, x21
	bl	_to_mctx
	mov	x23, x20
	ldr	w1, [x23, #88]!
	mov	x2, x20
	bl	_mlx4_store_qp
	cbz	w0, LBB0_48
; %bb.45:
	mov	x0, x23
	bl	_ibv_cmd_destroy_qp
LBB0_46:
	mov	x0, x21
	bl	_to_mctx
	add	x0, x0, #16
	bl	_pthread_mutex_unlock
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_20
; %bb.47:
	mov	x0, x21
	bl	_to_mctx
	ldr	w1, [x24]
	ldr	x2, [x20, #80]
	bl	_mlx4_free_db
	b	LBB0_20
LBB0_48:
	mov	x0, x21
	bl	_to_mctx
	add	x0, x0, #16
	bl	_pthread_mutex_unlock
	ldr	x8, [x19, #16]
	str	w8, [x20, #16]
	ldr	x9, [x19, #32]
	stp	x8, x9, [x20, #24]
	ldr	w2, [x19, #56]
Lloh15:
	adrp	x8, _IBV_QPT_XRC_RECV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IBV_QPT_XRC_RECV@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w2, w8
	b.eq	LBB0_50
; %bb.49:
	mov	x0, x20
	mov	x1, x22
	bl	_mlx4_set_sq_sizes
LBB0_50:
	mov	x21, x20
	ldr	w8, [x21, #88]!
	lsl	w0, w8, #8
	bl	_htobe32
	str	x0, [x21, #16]
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_52
; %bb.51:
Lloh18:
	adrp	x8, _MLX4_WQE_CTRL_CQ_UPDATE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MLX4_WQE_CTRL_CQ_UPDATE@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	bl	_htobe32
	str	x0, [x20, #96]
	b	LBB0_25
LBB0_52:
	str	xzr, [x20, #96]
	b	LBB0_25
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MLX4_CREATE_QP_SUP_COMP_MASK,4,2 ; @MLX4_CREATE_QP_SUP_COMP_MASK
	.comm	_IBV_QPT_XRC_RECV,4,2           ; @IBV_QPT_XRC_RECV
	.comm	_IBV_QPT_XRC_SEND,4,2           ; @IBV_QPT_XRC_SEND
	.comm	_PTHREAD_PROCESS_PRIVATE,4,2    ; @PTHREAD_PROCESS_PRIVATE
	.comm	_MLX4_DB_TYPE_RQ,4,2            ; @MLX4_DB_TYPE_RQ
	.comm	_MLX4_CREATE_QP_EX2_COMP_MASK,4,2 ; @MLX4_CREATE_QP_EX2_COMP_MASK
	.comm	_MLX4_WQE_CTRL_CQ_UPDATE,4,2    ; @MLX4_WQE_CTRL_CQ_UPDATE
.subsections_via_symbols
