	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_cmd_init                  ## -- Begin function mlx5_cmd_init
	.p2align	4, 0x90
_mlx5_cmd_init:                         ## @mlx5_cmd_init
	.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
	movq	%rdi, %r15
	movl	$4, %edi
	callq	_roundup_pow_of_two
	movl	%eax, %r12d
	leaq	16(%r15), %r14
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$80, %edx
	callq	_memset
	movq	%r15, %rdi
	callq	_cmdif_rev
	movq	_CMD_IF_REV@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	cmpl	%edx, %eax
	jne	LBB0_5
## %bb.1:
	movl	8(%r15), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	movl	$4, %edx
	movl	%r12d, %ecx
	xorl	%r8d, %r8d
	callq	_dma_pool_create
	movl	%eax, 44(%r15)
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_alloc_cmd_page
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.3:
	movq	(%r15), %rdi
	callq	_ioread32be
	movl	%eax, %ecx
	shrl	$4, %ecx
	andl	$15, %ecx
	movl	%ecx, 16(%r15)
	andl	$15, %eax
	movl	$1, %edx
	shll	%cl, %edx
	movl	%eax, 20(%r15)
	movq	_MLX5_MAX_COMMANDS@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jle	LBB0_7
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_mlx5_core_err
	jmp	LBB0_9
LBB0_5:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_mlx5_core_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_7:
	addl	%ecx, %eax
	movq	_MLX5_ADAPTER_PAGE_SHIFT@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %eax
	jle	LBB0_14
## %bb.8:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_mlx5_core_err
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %ebx
LBB0_11:
	negl	%ebx
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_free_cmd_page
LBB0_12:
	movl	44(%r15), %edi
	callq	_dma_pool_destroy
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movl	$-1, %eax
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movl	$1, 24(%r15)
	notl	%eax
	movl	%eax, 28(%r15)
	movq	$-1, %rdx
	movl	%eax, %ecx
	shlq	%cl, %rdx
	notq	%rdx
	movq	%rdx, 32(%r15)
	movq	(%r15), %rdi
	addq	$8, %rdi
	callq	_ioread32be
	sarl	$16, %eax
	movl	%eax, 40(%r15)
	movl	(%r13), %edx
	cmpl	%edx, %eax
	jle	LBB0_16
## %bb.15:
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_mlx5_core_err
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_16:
	leaq	92(%r15), %rdi
	callq	_spin_lock_init
	leaq	88(%r15), %rdi
	callq	_spin_lock_init
	movq	80(%r15), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_19
## %bb.17:
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	80(%r15), %rdi
	addq	%r12, %rdi
	callq	_spin_lock_init
	incq	%rbx
	movq	80(%r15), %rdi
	callq	_ARRAY_SIZE
	cltq
	addq	$4, %r12
	cmpq	%rax, %rbx
	jl	LBB0_18
LBB0_19:
	leaq	76(%r15), %rdi
	movl	28(%r15), %esi
	callq	_sema_init
	leaq	72(%r15), %rdi
	movl	$1, %esi
	callq	_sema_init
	movl	64(%r15), %ebx
	testl	$4095, %ebx                     ## imm = 0xFFF
	je	LBB0_21
## %bb.20:
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_mlx5_core_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_21:
	movq	(%r15), %rsi
	addq	$4, %rsi
	callq	_iowrite32be
	movq	(%r15), %rsi
	movl	%ebx, %edi
	callq	_iowrite32be
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_wmb
	movq	64(%r15), %rdx
	leaq	L_.str.6(%rip), %rsi
	movq	%r15, %rdi
	callq	_mlx5_core_dbg
	movq	_CMD_MODE_POLLING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r15)
	movq	%r15, %rdi
	callq	_create_msg_cache
	movq	%r15, %rdi
	callq	_set_wqname
	movl	52(%r15), %edi
	callq	_create_singlethread_workqueue
	movl	%eax, 48(%r15)
	testl	%eax, %eax
	je	LBB0_23
## %bb.22:
	movq	%r15, %rdi
	callq	_create_debugfs_files
	jmp	LBB0_13
LBB0_23:
	leaq	L_.str.7(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_mlx5_core_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_destroy_msg_cache
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_CMD_IF_REV,4,2                 ## @CMD_IF_REV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Driver cmdif rev(%d) differs from firmware's(%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"mlx5_cmd"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MLX5_MAX_COMMANDS,4,2          ## @MLX5_MAX_COMMANDS
L_.str.2:                               ## @.str.2
	.asciz	"firmware reports too many outstanding commands %d\n"

	.comm	_MLX5_ADAPTER_PAGE_SHIFT,4,2    ## @MLX5_ADAPTER_PAGE_SHIFT
L_.str.3:                               ## @.str.3
	.asciz	"command queue size overflow\n"

L_.str.4:                               ## @.str.4
	.asciz	"driver does not support command interface version. driver %d, firmware %d\n"

	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
L_.str.5:                               ## @.str.5
	.asciz	"invalid command queue address\n"

L_.str.6:                               ## @.str.6
	.asciz	"descriptor at dma 0x%llx\n"

	.comm	_CMD_MODE_POLLING,4,2           ## @CMD_MODE_POLLING
L_.str.7:                               ## @.str.7
	.asciz	"failed to create command workqueue\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mlx5_cmd_init                  ; -- Begin function mlx5_cmd_init
	.p2align	2
_mlx5_cmd_init:                         ; @mlx5_cmd_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	mov	w0, #4
	bl	_roundup_pow_of_two
	mov	x21, x0
	add	x20, x19, #16
	mov	x0, x20
	mov	w1, #0
	mov	w2, #80
	bl	_memset
	mov	x0, x19
	bl	_cmdif_rev
                                        ; kill: def $w0 killed $w0 def $x0
Lloh0:
	adrp	x22, _CMD_IF_REV@GOTPAGE
Lloh1:
	ldr	x22, [x22, _CMD_IF_REV@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.1:
	ldr	w1, [x19, #8]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w2, #4
	mov	x3, x21
	mov	w4, #0
	bl	_dma_pool_create
	str	w0, [x19, #44]
	cbz	w0, LBB0_6
; %bb.2:
	mov	x0, x19
	mov	x1, x20
	bl	_alloc_cmd_page
	mov	x21, x0
	cbnz	w0, LBB0_13
; %bb.3:
	ldr	x0, [x19]
	bl	_ioread32be
	ubfx	w8, w0, #4, #4
	and	w9, w0, #0xf
	stp	w8, w9, [x19, #16]
	mov	w10, #1
	lsl	w10, w10, w8
Lloh4:
	adrp	x11, _MLX5_MAX_COMMANDS@GOTPAGE
Lloh5:
	ldr	x11, [x11, _MLX5_MAX_COMMANDS@GOTPAGEOFF]
Lloh6:
	ldr	w11, [x11]
	cmp	w10, w11
	b.le	LBB0_8
; %bb.4:
	str	x10, [sp]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_5:
	stp	x8, x0, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mlx5_core_err
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_14
LBB0_8:
Lloh15:
	adrp	x10, _MLX5_ADAPTER_PAGE_SHIFT@GOTPAGE
Lloh16:
	ldr	x10, [x10, _MLX5_ADAPTER_PAGE_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	add	w9, w8, w9
	cmp	w9, w10
	b.le	LBB0_15
; %bb.9:
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_10:
	mov	x0, x19
	bl	_mlx5_core_err
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w21, [x8]
LBB0_12:
	neg	w21, w21
	mov	x0, x19
	mov	x1, x20
	bl	_free_cmd_page
LBB0_13:
	ldr	w0, [x19, #44]
	bl	_dma_pool_destroy
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_15:
	mov	w9, #1
	mov	w10, #-1
	lsl	w8, w10, w8
	mvn	w8, w8
	stp	w9, w8, [x19, #24]
	mov	x9, #-1
	lsl	x8, x9, x8
	mvn	x8, x8
	str	x8, [x19, #32]
	ldr	x8, [x19]
	add	x0, x8, #8
	bl	_ioread32be
	asr	w8, w0, #16
	str	w8, [x19, #40]
	ldr	w9, [x22]
	cmp	w8, w9
	b.le	LBB0_17
; %bb.16:
	stp	x9, x8, [sp]
Lloh22:
	adrp	x1, l_.str.4@PAGE
Lloh23:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_mlx5_core_err
Lloh24:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
	b	LBB0_11
LBB0_17:
	add	x0, x19, #92
	bl	_spin_lock_init
	add	x0, x19, #88
	bl	_spin_lock_init
	ldr	x0, [x19, #80]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_20
; %bb.18:
	mov	x21, #0
	mov	x22, #0
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #80]
	add	x0, x8, x21
	bl	_spin_lock_init
	add	x22, x22, #1
	ldr	x0, [x19, #80]
	bl	_ARRAY_SIZE
	add	x21, x21, #4
	cmp	x22, w0, sxtw
	b.lt	LBB0_19
LBB0_20:
	add	x0, x19, #76
	ldr	w1, [x19, #28]
	bl	_sema_init
	add	x0, x19, #72
	mov	w1, #1
	bl	_sema_init
	ldr	w21, [x19, #64]
	tst	w21, #0xfff
	b.eq	LBB0_22
; %bb.21:
Lloh26:
	adrp	x1, l_.str.5@PAGE
Lloh27:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_mlx5_core_err
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_11
LBB0_22:
	ldr	x8, [x19]
	add	x1, x8, #4
	bl	_iowrite32be
	ldr	x1, [x19]
	mov	x0, x21
	bl	_iowrite32be
	bl	_wmb
	ldr	x2, [x19, #64]
Lloh30:
	adrp	x1, l_.str.6@PAGE
Lloh31:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_mlx5_core_dbg
Lloh32:
	adrp	x8, _CMD_MODE_POLLING@GOTPAGE
Lloh33:
	ldr	x8, [x8, _CMD_MODE_POLLING@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	str	w8, [x19, #56]
	mov	x0, x19
	bl	_create_msg_cache
	mov	x0, x19
	bl	_set_wqname
	ldr	w0, [x19, #52]
	bl	_create_singlethread_workqueue
	str	w0, [x19, #48]
	cbz	w0, LBB0_24
; %bb.23:
	mov	x0, x19
	bl	_create_debugfs_files
	mov	w21, #0
	b	LBB0_14
LBB0_24:
Lloh35:
	adrp	x1, l_.str.7@PAGE
Lloh36:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_mlx5_core_err
Lloh37:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh39:
	ldr	w21, [x8]
	mov	x0, x19
	bl	_destroy_msg_cache
	b	LBB0_12
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_CMD_IF_REV,4,2                 ; @CMD_IF_REV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Driver cmdif rev(%d) differs from firmware's(%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"mlx5_cmd"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MLX5_MAX_COMMANDS,4,2          ; @MLX5_MAX_COMMANDS
l_.str.2:                               ; @.str.2
	.asciz	"firmware reports too many outstanding commands %d\n"

	.comm	_MLX5_ADAPTER_PAGE_SHIFT,4,2    ; @MLX5_ADAPTER_PAGE_SHIFT
l_.str.3:                               ; @.str.3
	.asciz	"command queue size overflow\n"

l_.str.4:                               ; @.str.4
	.asciz	"driver does not support command interface version. driver %d, firmware %d\n"

	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
l_.str.5:                               ; @.str.5
	.asciz	"invalid command queue address\n"

l_.str.6:                               ; @.str.6
	.asciz	"descriptor at dma 0x%llx\n"

	.comm	_CMD_MODE_POLLING,4,2           ; @CMD_MODE_POLLING
l_.str.7:                               ; @.str.7
	.asciz	"failed to create command workqueue\n"

.subsections_via_symbols
