	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mlxsw_core_reg_access_cmd
_mlxsw_core_reg_access_cmd:             ## @mlxsw_core_reg_access_cmd
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rax
	movl	(%rax), %r14d
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rbx
	movq	%rbx, %rdi
	callq	_mlxsw_reg_id_str
	movl	%eax, %r15d
	movl	%r12d, %edi
	callq	_mlxsw_core_reg_access_type_str
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movq	%rbx, %rdx
	movl	%r15d, %ecx
	movl	%eax, %r8d
	callq	_dev_dbg
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mlxsw_cmd_mbox_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mlxsw_cmd_mbox_alloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r14
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mlxsw_core_tid_get
	movq	%r13, %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	movl	%r12d, %edx
	movl	%eax, %ecx
	callq	_mlxsw_emad_pack_op_tlv
	movq	_MLXSW_EMAD_OP_TLV_LEN@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	(,%rax,4), %rdi
	addq	%r13, %rdi
	movq	%rbx, %rsi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	callq	_mlxsw_emad_pack_reg_tlv
	movq	(%rbx), %rax
	movq	_MLXSW_REG_MRSR_ID@GOTPCREL(%rip), %rcx
	xorl	%r15d, %r15d
	cmpq	(%rcx), %rax
	sete	%r15b
	movl	$-1, %r12d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %esi
	movq	%r13, %rdx
	movq	%r14, %rcx
	callq	_mlxsw_cmd_access_reg
	testl	%eax, %eax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	leaq	-64(%rbp), %rsi
	callq	_mlxsw_emad_process_status
	testl	%eax, %eax
	je	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %ebx
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%r12d
	movq	_MLXSW_EMAD_MAX_RETRY@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jl	LBB0_5
LBB0_10:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %r12d
	movl	-64(%rbp), %r15d
	movl	%r15d, %edi
	callq	_mlxsw_emad_op_tlv_status_str
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edi
	movq	%r15, %rdx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_12
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_16
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_6:
	movl	%eax, %ebx
	jmp	LBB0_12
LBB0_11:
	movq	%r14, %rdi
	callq	_mlxsw_emad_reg_payload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	8(%rcx), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_memcpy
	xorl	%ebx, %ebx
LBB0_12:
	movq	%r14, %rdi
	callq	_mlxsw_cmd_mbox_free
	movl	-60(%rbp), %r12d                ## 4-byte Reload
LBB0_13:
	movq	%r13, %rdi
	callq	_mlxsw_cmd_mbox_free
	testl	%ebx, %ebx
	je	LBB0_14
## %bb.15:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %r14d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r15
	movq	%r15, %rdi
	callq	_mlxsw_reg_id_str
	movl	%r12d, %edi
	movl	%eax, %r12d
	callq	_mlxsw_core_reg_access_type_str
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	movq	%r15, %rdx
	movl	%r12d, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_16
LBB0_14:
	xorl	%ebx, %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reg cmd access (reg_id=%x(%s),type=%s)\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_MLXSW_EMAD_OP_TLV_LEN,4,2      ## @MLXSW_EMAD_OP_TLV_LEN
	.comm	_MLXSW_REG_MRSR_ID,8,3          ## @MLXSW_REG_MRSR_ID
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_MLXSW_EMAD_MAX_RETRY,4,2       ## @MLXSW_EMAD_MAX_RETRY
L_.str.1:                               ## @.str.1
	.asciz	"Reg cmd access status failed (status=%x(%s))\n"

L_.str.2:                               ## @.str.2
	.asciz	"Reg cmd access failed (reg_id=%x(%s),type=%s)\n"

	.no_dead_strip	_mlxsw_core_reg_access_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mlxsw_core_reg_access_cmd
_mlxsw_core_reg_access_cmd:             ; @mlxsw_core_reg_access_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x23, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0]
	ldr	w22, [x8]
	ldr	x24, [x1]
	mov	x0, x24
	bl	_mlxsw_reg_id_str
	mov	x25, x0
	mov	x0, x19
	bl	_mlxsw_core_reg_access_type_str
	mov	x4, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x2, x24
	mov	x3, x25
	bl	_dev_dbg
	bl	_mlxsw_cmd_mbox_alloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x22, x0
	bl	_mlxsw_cmd_mbox_alloc
	cbz	x0, LBB0_9
; %bb.2:
	mov	x24, x0
	mov	x0, x21
	bl	_mlxsw_core_tid_get
	mov	x3, x0
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	bl	_mlxsw_emad_pack_op_tlv
Lloh2:
	adrp	x8, _MLXSW_EMAD_OP_TLV_LEN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MLXSW_EMAD_OP_TLV_LEN@GOTPAGEOFF]
Lloh4:
	ldrsw	x8, [x8]
	add	x0, x22, x8, lsl #2
	mov	x1, x20
	str	x23, [sp, #16]                  ; 8-byte Folded Spill
	mov	x2, x23
	bl	_mlxsw_emad_pack_reg_tlv
	ldr	x8, [x20]
Lloh5:
	adrp	x9, _MLXSW_REG_MRSR_ID@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MLXSW_REG_MRSR_ID@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w26, eq
	mov	w27, #-1
Lloh8:
	adrp	x28, _EAGAIN@GOTPAGE
Lloh9:
	ldr	x28, [x28, _EAGAIN@GOTPAGEOFF]
Lloh10:
	adrp	x23, _MLXSW_EMAD_MAX_RETRY@GOTPAGE
Lloh11:
	ldr	x23, [x23, _MLXSW_EMAD_MAX_RETRY@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x26
	mov	x2, x22
	mov	x3, x24
	bl	_mlxsw_cmd_access_reg
	cbnz	w0, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x1, sp, #28
	mov	x0, x24
	bl	_mlxsw_emad_process_status
	mov	x25, x0
	cbz	w0, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x28]
	cmn	w25, w8
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x23]
	add	w27, w27, #1
	cmp	w27, w8
	b.lt	LBB0_3
LBB0_7:
	ldr	x8, [x21]
	ldr	w23, [x8]
	ldr	w26, [sp, #28]
	mov	x0, x26
	bl	_mlxsw_emad_op_tlv_status_str
	mov	x3, x0
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	mov	x2, x26
	bl	_dev_err
	b	LBB0_12
LBB0_8:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_15
LBB0_9:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_13
LBB0_10:
	mov	x25, x0
	b	LBB0_12
LBB0_11:
	mov	x0, x24
	bl	_mlxsw_emad_reg_payload
	mov	x1, x0
	ldr	w2, [x20, #8]
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_memcpy
LBB0_12:
	mov	x0, x24
	bl	_mlxsw_cmd_mbox_free
LBB0_13:
	mov	x0, x22
	bl	_mlxsw_cmd_mbox_free
	cbz	w25, LBB0_15
; %bb.14:
	ldr	x8, [x21]
	ldr	w21, [x8]
	ldr	x20, [x20]
	mov	x0, x20
	bl	_mlxsw_reg_id_str
	mov	x22, x0
	mov	x0, x19
	bl	_mlxsw_core_reg_access_type_str
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	mov	x3, x22
	bl	_dev_err
LBB0_15:
	mov	x0, x25
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reg cmd access (reg_id=%x(%s),type=%s)\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_MLXSW_EMAD_OP_TLV_LEN,4,2      ; @MLXSW_EMAD_OP_TLV_LEN
	.comm	_MLXSW_REG_MRSR_ID,8,3          ; @MLXSW_REG_MRSR_ID
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_MLXSW_EMAD_MAX_RETRY,4,2       ; @MLXSW_EMAD_MAX_RETRY
l_.str.1:                               ; @.str.1
	.asciz	"Reg cmd access status failed (status=%x(%s))\n"

l_.str.2:                               ; @.str.2
	.asciz	"Reg cmd access failed (reg_id=%x(%s),type=%s)\n"

	.no_dead_strip	_mlxsw_core_reg_access_cmd
.subsections_via_symbols
