	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlx5_alloc_cmd_msg
_mlx5_alloc_cmd_msg:                    ## @mlx5_alloc_cmd_msg
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %ebx
	movq	%rdi, %r13
	movl	$16, %edi
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movl	%ebx, (%rax)
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_mlx5_calc_cmd_blocks
	testl	%eax, %eax
	jle	LBB0_4
## %bb.5:
	movl	%eax, %ebx
	decl	%ebx
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=1
	movl	8(%r14), %edi
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=1
	callq	_cpu_to_be64
	movl	%eax, 8(%r12)
	movl	%ebx, %edi
	callq	_cpu_to_be32
	movl	%eax, 4(%r12)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r12)
	movq	%r15, %r14
	addl	$-1, %ebx
	jae	LBB0_14
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_alloc_cmd_box
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_7
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	16(%r15), %r12
	movq	%r14, (%r15)
	testq	%r14, %r14
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	xorl	%edi, %edi
	jmp	LBB0_13
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	jmp	LBB0_2
LBB0_4:
	xorl	%r15d, %r15d
LBB0_14:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, 8(%rax)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_mlx5_core_warn
	movq	%r15, %rdi
	callq	_PTR_ERR
	movl	%eax, %r15d
	testq	%r14, %r14
	je	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rbx
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_free_cmd_box
	movq	%rbx, %r14
	testq	%rbx, %rbx
	jne	LBB0_8
LBB0_9:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_kfree
	movl	%r15d, %edi
LBB0_2:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed allocating block\n"

	.no_dead_strip	_mlx5_alloc_cmd_msg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlx5_alloc_cmd_msg
_mlx5_alloc_cmd_msg:                    ; @mlx5_alloc_cmd_msg
	.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	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x20, x0
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x19, x0
	str	w23, [x0]
	bl	_mlx5_calc_cmd_blocks
	subs	w23, w0, #1
	b.lt	LBB0_9
; %bb.2:
	mov	x25, #0
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x25, #8]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_cpu_to_be64
	str	w0, [x26, #8]
	mov	x0, x23
	bl	_cpu_to_be32
	stp	w21, w0, [x26]
	sub	w23, w23, #1
	mov	x25, x24
	cmn	w23, #1
	b.eq	LBB0_10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_alloc_cmd_box
	mov	x24, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_11
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x26, [x24, #16]
	str	x25, [x24]
	cbnz	x25, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #0
	b	LBB0_4
LBB0_8:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_14
LBB0_9:
	mov	x24, #0
LBB0_10:
	str	x24, [x19, #8]
	mov	x0, x19
	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_11:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_mlx5_core_warn
	mov	x0, x24
	bl	_PTR_ERR
	mov	x21, x0
	cbz	x25, LBB0_13
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x22, [x25]
	mov	x0, x20
	mov	x1, x25
	bl	_free_cmd_box
	mov	x25, x22
	cbnz	x22, LBB0_12
LBB0_13:
	mov	x0, x19
	bl	_kfree
	mov	x0, x21
LBB0_14:
	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
	b	_ERR_PTR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed allocating block\n"

	.no_dead_strip	_mlx5_alloc_cmd_msg
.subsections_via_symbols
