	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_create_wq                 ## -- Begin function mlx5_create_wq
	.p2align	4, 0x90
_mlx5_create_wq:                        ## @mlx5_create_wq
	.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	$104, %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, %r14
	callq	_to_mctx
	movq	%rax, %r15
	movq	(%rbx), %rax
	movq	_IBV_WQT_RQ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_17
## %bb.1:
	movq	(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	-96(%rbp), %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	leaq	-144(%rbp), %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movl	$1, %edi
	movl	$96, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_18
## %bb.2:
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_rwq_sig_enabled
	movq	%rax, 88(%r13)
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_MLX5_RWQ_FLAG_SIGNATURE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
LBB0_4:
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_mlx5_calc_rwq_size
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movl	%eax, (%r13)
	movq	%r14, %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_mlx5_alloc_rwq_buf
	testq	%rax, %rax
	jne	LBB0_16
## %bb.7:
	movq	%r13, %rdi
	callq	_mlx5_init_rwq_indices
	leaq	56(%r13), %rdi
	callq	_mlx5_spinlock_init
	testq	%rax, %rax
	jne	LBB0_15
## %bb.8:
	movq	%r15, %rdi
	callq	_mlx5_alloc_dbrec
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_15
## %bb.9:
	movq	_MLX5_RCV_DBR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movq	$0, (%rax,%rdx,8)
	movq	_MLX5_SND_DBR@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	$0, (%rax,%rdx,8)
	movq	64(%r13), %rdx
	movq	48(%r13), %rsi
	addq	%rdx, %rsi
	movq	%rsi, 80(%r13)
	movq	(%rcx), %rcx
	leaq	(%rax,%rcx,8), %rcx
	movq	%rcx, 72(%r13)
	movq	%rdx, -96(%rbp)
	movq	%rax, -88(%rbp)
	movl	44(%r13), %eax
	movl	%eax, -68(%rbp)
	movl	40(%r13), %eax
	movl	%eax, -72(%rbp)
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_mlx5_store_uidx
	testq	%rax, %rax
	js	LBB0_10
## %bb.11:
	movq	%rax, -80(%rbp)
	movq	%r13, %r12
	addq	$16, %r12
	leaq	-52(%rbp), %rcx
	leaq	-104(%rbp), %rax
	subq	$8, %rsp
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	movl	$4, %r8d
	movl	$48, %r9d
	pushq	$48
	pushq	$4
	pushq	%rax
	callq	_ibv_cmd_create_wq
	addq	$32, %rsp
	testl	%eax, %eax
	je	LBB0_12
## %bb.13:
	movq	-80(%rbp), %rsi
	movq	%r15, %rdi
	callq	_mlx5_clear_uidx
	jmp	LBB0_14
LBB0_5:
	negl	%eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_16
LBB0_10:
	movq	_MLX5_DBG_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlx5_dbg
LBB0_14:
	movq	%r14, %rdi
	callq	_to_mctx
	movq	8(%r13), %rsi
	movq	%rax, %rdi
	callq	_mlx5_free_db
LBB0_15:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_mlx5_free_rwq_buf
LBB0_16:
	movq	%r13, %rdi
	callq	_free
LBB0_17:
	xorl	%r12d, %r12d
LBB0_18:
	movq	%r12, %rax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_MLX5_RSC_TYPE_RWQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r13)
	movq	-80(%rbp), %rax
	movq	%rax, 24(%r13)
	movq	_mlx5_post_wq_recv@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r13)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_IBV_WQT_RQ,8,3                 ## @IBV_WQT_RQ
	.comm	_MLX5_RWQ_FLAG_SIGNATURE,4,2    ## @MLX5_RWQ_FLAG_SIGNATURE
	.comm	_errno,4,2                      ## @errno
	.comm	_MLX5_RCV_DBR,8,3               ## @MLX5_RCV_DBR
	.comm	_MLX5_SND_DBR,8,3               ## @MLX5_SND_DBR
	.comm	_MLX5_DBG_QP,4,2                ## @MLX5_DBG_QP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't find free user index\n"

	.comm	_MLX5_RSC_TYPE_RWQ,4,2          ## @MLX5_RSC_TYPE_RWQ
	.comm	_mlx5_post_wq_recv,4,2          ## @mlx5_post_wq_recv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_create_wq                 ; -- Begin function mlx5_create_wq
	.p2align	2
_mlx5_create_wq:                        ; @mlx5_create_wq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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	x22, x1
	mov	x19, x0
	bl	_to_mctx
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _IBV_WQT_RQ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IBV_WQT_RQ@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.1:
	mov	x21, x0
	ldr	x23, [x0]
	add	x0, sp, #64
	mov	w1, #0
	mov	w2, #48
	bl	_memset
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #48
	bl	_memset
	mov	w0, #1
	mov	w1, #96
	bl	_calloc
	cbz	x0, LBB0_16
; %bb.2:
	mov	x20, x0
	mov	x0, x19
	bl	_rwq_sig_enabled
	str	x0, [x20, #88]
	cbz	x0, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _MLX5_RWQ_FLAG_SIGNATURE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MLX5_RWQ_FLAG_SIGNATURE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #96]
LBB0_4:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x22
	bl	_mlx5_calc_rwq_size
	mov	x2, x0
	tbnz	w0, #31, LBB0_11
; %bb.5:
	str	w2, [x20]
	mov	x0, x19
	mov	x1, x20
	bl	_mlx5_alloc_rwq_buf
	cbnz	x0, LBB0_15
; %bb.6:
	mov	x0, x20
	bl	_mlx5_init_rwq_indices
	add	x0, x20, #56
	bl	_mlx5_spinlock_init
	cbnz	x0, LBB0_14
; %bb.7:
	mov	x0, x21
	bl	_mlx5_alloc_dbrec
	str	x0, [x20, #8]
	cbz	x0, LBB0_14
; %bb.8:
Lloh6:
	adrp	x8, _MLX5_RCV_DBR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MLX5_RCV_DBR@GOTPAGEOFF]
	ldr	x9, [x8]
	str	xzr, [x0, x9, lsl #3]
Lloh8:
	adrp	x9, _MLX5_SND_DBR@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MLX5_SND_DBR@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	str	xzr, [x0, x9, lsl #3]
	ldr	x9, [x20, #64]
	ldr	x10, [x20, #48]
	add	x10, x10, x9
	ldr	x8, [x8]
	add	x8, x0, x8, lsl #3
	stp	x8, x10, [x20, #72]
	stp	x9, x0, [sp, #64]
	ldr	d0, [x20, #40]
	str	d0, [sp, #88]
	mov	x0, x21
	mov	x1, x20
	bl	_mlx5_store_uidx
	tbnz	x0, #63, LBB0_12
; %bb.9:
	str	x0, [sp, #80]
	add	x23, x20, #16
	add	x8, sp, #64
	add	x3, x8, #44
	add	x8, sp, #16
	add	x6, x8, #40
	mov	w8, #48
	str	w8, [sp]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	mov	w4, #4
	mov	w5, #48
	mov	w7, #4
	bl	_ibv_cmd_create_wq
	cbz	w0, LBB0_18
; %bb.10:
	ldr	x1, [sp, #80]
	mov	x0, x21
	bl	_mlx5_clear_uidx
	b	LBB0_13
LBB0_11:
	neg	w8, w2
Lloh11:
	adrp	x9, _errno@GOTPAGE
Lloh12:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh13:
	str	w8, [x9]
	b	LBB0_15
LBB0_12:
Lloh14:
	adrp	x8, _MLX5_DBG_QP@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MLX5_DBG_QP@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x2, l_.str@PAGE
Lloh18:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x23
	bl	_mlx5_dbg
LBB0_13:
	mov	x0, x19
	bl	_to_mctx
	ldr	x1, [x20, #8]
	bl	_mlx5_free_db
LBB0_14:
	mov	x0, x20
	mov	x1, x19
	bl	_mlx5_free_rwq_buf
LBB0_15:
	mov	x0, x20
	bl	_free
LBB0_16:
	mov	x23, #0
LBB0_17:
	mov	x0, x23
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_18:
Lloh19:
	adrp	x8, _MLX5_RSC_TYPE_RWQ@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MLX5_RSC_TYPE_RWQ@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	str	w8, [x20, #32]
	ldr	x8, [sp, #80]
	str	x8, [x20, #24]
Lloh22:
	adrp	x8, _mlx5_post_wq_recv@GOTPAGE
Lloh23:
	ldr	x8, [x8, _mlx5_post_wq_recv@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x20, #16]
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_IBV_WQT_RQ,8,3                 ; @IBV_WQT_RQ
	.comm	_MLX5_RWQ_FLAG_SIGNATURE,4,2    ; @MLX5_RWQ_FLAG_SIGNATURE
	.comm	_errno,4,2                      ; @errno
	.comm	_MLX5_RCV_DBR,8,3               ; @MLX5_RCV_DBR
	.comm	_MLX5_SND_DBR,8,3               ; @MLX5_SND_DBR
	.comm	_MLX5_DBG_QP,4,2                ; @MLX5_DBG_QP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't find free user index\n"

	.comm	_MLX5_RSC_TYPE_RWQ,4,2          ; @MLX5_RSC_TYPE_RWQ
	.comm	_mlx5_post_wq_recv,4,2          ; @mlx5_post_wq_recv
.subsections_via_symbols
