	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msg_to_mgmt_sync
_msg_to_mgmt_sync:                      ## @msg_to_mgmt_sync
	.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
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	32(%rbp), %r12
	movq	32(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	callq	_down
	leaq	28(%rbx), %r14
	movq	_MSG_NOT_RESP@GOTPCREL(%rip), %rcx
	movq	%r12, %rax
	cmpq	%r12, (%rcx)
	jne	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_SYNC_MSG_ID
LBB0_2:
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_init_completion
	movq	_MSG_ACK@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%r13d, %edx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	-80(%rbp), %r8                  ## 8-byte Reload
	pushq	%r12
	movl	24(%rbp), %eax
	pushq	%rax
	callq	_send_msg_to_mgmt
	addq	$16, %rsp
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
LBB0_11:
	movq	%rbx, %rdi
	callq	_up
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_MGMT_MSG_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_smp_rmb
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, 8(%rbx)
	jne	LBB0_7
## %bb.8:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.9:
	movq	16(%rbx), %rdx
	movq	_MAX_PF_MGMT_BUF_SIZE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jg	LBB0_11
## %bb.10:
	movq	16(%rbp), %r14
	movl	24(%rbx), %esi
	callq	_memcpy
	movq	16(%rbx), %rax
	movq	%rax, (%r14)
	jmp	LBB0_11
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_11
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EFAULT@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_MSG_NOT_RESP,8,3               ## @MSG_NOT_RESP
	.comm	_MSG_ACK,4,2                    ## @MSG_ACK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to send sync msg to mgmt\n"

	.comm	_MGMT_MSG_TIMEOUT,4,2           ## @MGMT_MSG_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"MGMT timeout, MSG id = %d\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
L_.str.2:                               ## @.str.2
	.asciz	"incorrect MSG for id = %d\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_MAX_PF_MGMT_BUF_SIZE,8,3       ## @MAX_PF_MGMT_BUF_SIZE
	.no_dead_strip	_msg_to_mgmt_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msg_to_mgmt_sync
_msg_to_mgmt_sync:                      ; @msg_to_mgmt_sync
	.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	x24, x7
	stp	x6, x5, [sp, #16]               ; 16-byte Folded Spill
	mov	x26, x4
	mov	x27, x3
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x28, [x29, #16]
	ldr	x8, [x0, #32]
	ldr	x22, [x8]
	bl	_down
	add	x25, x19, #28
Lloh0:
	adrp	x8, _MSG_NOT_RESP@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSG_NOT_RESP@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	mov	x23, x28
	cmp	x8, x28
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_SYNC_MSG_ID
	mov	x23, x0
LBB0_2:
	mov	x0, x25
	bl	_init_completion
Lloh3:
	adrp	x8, _MSG_ACK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MSG_ACK@GOTPAGEOFF]
Lloh5:
	ldr	w5, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	x3, x27
	mov	x4, x26
	mov	x6, x24
	mov	x7, x28
	bl	_send_msg_to_mgmt
	cbz	w0, LBB0_4
; %bb.3:
	mov	x20, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_dev_err
	b	LBB0_12
LBB0_4:
Lloh8:
	adrp	x8, _MGMT_MSG_TIMEOUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MGMT_MSG_TIMEOUT@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x25
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_9
; %bb.5:
	bl	_smp_rmb
	ldr	x8, [x19, #8]
	cmp	x8, x23
	b.ne	LBB0_10
; %bb.6:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	cbz	x0, LBB0_8
; %bb.7:
	ldr	x2, [x19, #16]
Lloh11:
	adrp	x8, _MAX_PF_MGMT_BUF_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MAX_PF_MGMT_BUF_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x2, x8
	b.le	LBB0_13
LBB0_8:
	mov	w20, #0
	b	LBB0_12
LBB0_9:
	str	x23, [sp]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_dev_err
Lloh16:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
	str	x23, [sp]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_dev_err
Lloh20:
	adrp	x8, _EFAULT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_12:
	mov	x0, x19
	bl	_up
	mov	x0, x20
	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
LBB0_13:
	ldr	w1, [x19, #24]
	bl	_memcpy
	mov	w20, #0
	ldr	x8, [x19, #16]
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	str	x8, [x9]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MSG_NOT_RESP,8,3               ; @MSG_NOT_RESP
	.comm	_MSG_ACK,4,2                    ; @MSG_ACK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to send sync msg to mgmt\n"

	.comm	_MGMT_MSG_TIMEOUT,4,2           ; @MGMT_MSG_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"MGMT timeout, MSG id = %d\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
l_.str.2:                               ; @.str.2
	.asciz	"incorrect MSG for id = %d\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_MAX_PF_MGMT_BUF_SIZE,8,3       ; @MAX_PF_MGMT_BUF_SIZE
	.no_dead_strip	_msg_to_mgmt_sync
.subsections_via_symbols
