	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hw_atl_utils_mpi_set_state
_hw_atl_utils_mpi_set_state:            ## @hw_atl_utils_mpi_set_state
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_HW_ATL_MPI_CONTROL_ADR@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_aq_hw_read_reg
	movq	%rax, %r12
	movq	_MPI_RESET@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	cmpl	%ebx, (%rax)
	jne	LBB0_2
## %bb.1:
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_hw_atl_utils_mpi_read_mbox
	movq	-48(%rbp), %rdx
	movq	_hw_atl_utils_get_mpi_mbox_tid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	movl	$1000, %r8d                     ## imm = 0x3E8
	movl	$100000, %r9d                   ## imm = 0x186A0
	callq	_readx_poll_timeout_atomic
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_3
LBB0_2:
	movq	_MPI_DEINIT@GOTPCREL(%rip), %rax
	movq	_MPI_POWER@GOTPCREL(%rip), %rcx
	movq	_HW_ATL_MPI_DIRTY_WAKE_MSK@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	movq	%rsi, %rdx
	orq	%r12, %rdx
	notq	%rsi
	andq	%r12, %rsi
	cmpl	%ebx, (%rcx)
	cmoveq	%rdx, %rsi
	cmpl	%ebx, (%rax)
	cmoveq	%rdx, %rsi
	movq	_HW_ATL_MPI_STATE_MSK@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%rdx, %rax
	notq	%rax
	andq	%rsi, %rax
	andl	%ebx, %edx
	orq	%rax, %rdx
	movl	(%r13), %esi
	movq	%r14, %rdi
	callq	_aq_hw_write_reg
LBB0_3:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HW_ATL_MPI_CONTROL_ADR,4,2     ## @HW_ATL_MPI_CONTROL_ADR
	.comm	_MPI_RESET,4,2                  ## @MPI_RESET
	.comm	_hw_atl_utils_get_mpi_mbox_tid,4,2 ## @hw_atl_utils_get_mpi_mbox_tid
	.comm	_MPI_DEINIT,4,2                 ## @MPI_DEINIT
	.comm	_MPI_POWER,4,2                  ## @MPI_POWER
	.comm	_HW_ATL_MPI_DIRTY_WAKE_MSK,8,3  ## @HW_ATL_MPI_DIRTY_WAKE_MSK
	.comm	_HW_ATL_MPI_STATE_MSK,8,3       ## @HW_ATL_MPI_STATE_MSK
	.no_dead_strip	_hw_atl_utils_mpi_set_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hw_atl_utils_mpi_set_state
_hw_atl_utils_mpi_set_state:            ; @hw_atl_utils_mpi_set_state
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _HW_ATL_MPI_CONTROL_ADR@GOTPAGE
Lloh1:
	ldr	x23, [x23, _HW_ATL_MPI_CONTROL_ADR@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_aq_hw_read_reg
	mov	x21, x0
Lloh2:
	adrp	x8, _MPI_RESET@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MPI_RESET@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_2
; %bb.1:
	add	x1, sp, #8
	mov	x0, x19
	bl	_hw_atl_utils_mpi_read_mbox
	ldr	x2, [sp, #8]
Lloh5:
	adrp	x8, _hw_atl_utils_get_mpi_mbox_tid@GOTPAGE
Lloh6:
	ldr	x8, [x8, _hw_atl_utils_get_mpi_mbox_tid@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x19
	mov	w3, #0
	mov	w4, #1000
	mov	w5, #34464
	movk	w5, #1, lsl #16
	bl	_readx_poll_timeout_atomic
	mov	x22, x0
	tbz	w0, #31, LBB0_3
	b	LBB0_4
LBB0_2:
	mov	w22, #0
LBB0_3:
Lloh8:
	adrp	x8, _MPI_DEINIT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MPI_DEINIT@GOTPAGEOFF]
Lloh10:
	adrp	x9, _MPI_POWER@GOTPAGE
Lloh11:
	ldr	x9, [x9, _MPI_POWER@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	ldr	w9, [x9]
	cmp	w9, w20
	ccmp	w8, w20, #4, ne
Lloh14:
	adrp	x8, _HW_ATL_MPI_DIRTY_WAKE_MSK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _HW_ATL_MPI_DIRTY_WAKE_MSK@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	orr	x9, x8, x21
	bic	x8, x21, x8
	csel	x8, x9, x8, eq
Lloh17:
	adrp	x9, _HW_ATL_MPI_STATE_MSK@GOTPAGE
Lloh18:
	ldr	x9, [x9, _HW_ATL_MPI_STATE_MSK@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	bic	x8, x8, x9
	mov	w10, w20
	and	x9, x9, x10
	orr	x2, x8, x9
	ldr	w1, [x23]
	mov	x0, x19
	bl	_aq_hw_write_reg
LBB0_4:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_HW_ATL_MPI_CONTROL_ADR,4,2     ; @HW_ATL_MPI_CONTROL_ADR
	.comm	_MPI_RESET,4,2                  ; @MPI_RESET
	.comm	_hw_atl_utils_get_mpi_mbox_tid,4,2 ; @hw_atl_utils_get_mpi_mbox_tid
	.comm	_MPI_DEINIT,4,2                 ; @MPI_DEINIT
	.comm	_MPI_POWER,4,2                  ; @MPI_POWER
	.comm	_HW_ATL_MPI_DIRTY_WAKE_MSK,8,3  ; @HW_ATL_MPI_DIRTY_WAKE_MSK
	.comm	_HW_ATL_MPI_STATE_MSK,8,3       ; @HW_ATL_MPI_STATE_MSK
	.no_dead_strip	_hw_atl_utils_mpi_set_state
.subsections_via_symbols
