	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nodemgr_do_irm_duties
_nodemgr_do_irm_duties:                 ## @nodemgr_do_irm_duties
	.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	$1, %r14d
	cmpl	$0, 36(%rdi)
	je	LBB0_14
## %bb.1:
	movq	%rdi, %rbx
	cmpq	$-1, (%rdi)
	je	LBB0_14
## %bb.2:
	orb	$64, 35(%rbx)
	cmpl	$65535, 8(%rbx)                 ## imm = 0xFFFF
	jne	LBB0_11
## %bb.3:
	movl	12(%rbx), %r12d
	cmpl	$2, %r12d
	jl	LBB0_11
## %bb.4:
	decl	%r12d
	cmpq	$0, 24(%rbx)
	je	LBB0_5
LBB0_10:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	$-1, %edx
	callq	_hpsb_send_phy_config
LBB0_11:
	cmpl	$0, 16(%rbx)
	jne	LBB0_14
## %bb.12:
	movq	%rbx, %rdi
	callq	_nodemgr_send_resume_packet
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movl	$1, 16(%rbx)
	jmp	LBB0_14
LBB0_5:
	movl	%esi, %r15d
	movq	_LOCAL_BUS@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	orl	%r12d, %r13d
	movq	%rbx, %rdi
	callq	_get_hpsb_generation
	movq	_CSR_REGISTER_BASE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_CSR_CONFIG_ROM@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	leaq	8(%rcx,%rdx), %rcx
	leaq	-44(%rbp), %r8
	movq	%rbx, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	movl	$4, %r9d
	callq	_hpsb_read
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movl	-44(%rbp), %edi
	callq	_be32_to_cpu
	movq	_CSR_CMC_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jb	LBB0_10
LBB0_7:
	leaq	L_.str(%rip), %rdi
	callq	_HPSB_DEBUG
	cmpl	$5, %r15d
	jl	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	callq	_HPSB_DEBUG
	jmp	LBB0_14
LBB0_9:
	movl	20(%rbx), %edi
	callq	_NODEID_TO_NODE
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	$-1, %edx
	callq	_hpsb_send_phy_config
	movq	_LONG_RESET_FORCE_ROOT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_hpsb_reset_bus
	xorl	%r14d, %r14d
LBB0_14:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LOCAL_BUS,4,2                  ## @LOCAL_BUS
	.comm	_CSR_REGISTER_BASE,8,3          ## @CSR_REGISTER_BASE
	.comm	_CSR_CONFIG_ROM,8,3             ## @CSR_CONFIG_ROM
	.comm	_CSR_CMC_SHIFT,4,2              ## @CSR_CMC_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"The root node is not cycle master capable; selecting a new root node and resetting..."

L_.str.1:                               ## @.str.1
	.asciz	"Stopping reset loop for IRM sanity"

	.comm	_LONG_RESET_FORCE_ROOT,4,2      ## @LONG_RESET_FORCE_ROOT
	.no_dead_strip	_nodemgr_do_irm_duties
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nodemgr_do_irm_duties
_nodemgr_do_irm_duties:                 ; @nodemgr_do_irm_duties
	.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
	ldr	w8, [x0, #36]
	cbz	w8, LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
	cmn	x8, #1
	b.eq	LBB0_7
; %bb.2:
	ldr	w8, [x19, #32]
	orr	w8, w8, #0x40000000
	str	w8, [x19, #32]
	ldr	w8, [x19, #8]
	mov	w9, #65535
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.3:
	ldr	w8, [x19, #12]
	cmp	w8, #2
	b.lt	LBB0_6
; %bb.4:
	sub	w21, w8, #1
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_11
LBB0_5:
	mov	x0, x19
	mov	x1, x21
	mov	w2, #-1
	bl	_hpsb_send_phy_config
LBB0_6:
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_9
LBB0_7:
	mov	w0, #1
LBB0_8:
	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_9:
	mov	x0, x19
	bl	_nodemgr_send_resume_packet
	mov	x8, x0
	mov	w0, #1
	cbnz	w8, LBB0_8
; %bb.10:
	str	w0, [x19, #16]
	b	LBB0_8
LBB0_11:
	mov	x20, x1
Lloh0:
	adrp	x8, _LOCAL_BUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LOCAL_BUS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	orr	w22, w8, w21
	mov	x0, x19
	bl	_get_hpsb_generation
	mov	x2, x0
Lloh3:
	adrp	x8, _CSR_REGISTER_BASE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CSR_REGISTER_BASE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _CSR_CONFIG_ROM@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CSR_CONFIG_ROM@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x8, x8, x9
	add	x3, x8, #8
	add	x4, sp, #12
	mov	x0, x19
	mov	x1, x22
	mov	w5, #4
	bl	_hpsb_read
	cbnz	w0, LBB0_13
; %bb.12:
	ldr	w0, [sp, #12]
	bl	_be32_to_cpu
Lloh9:
	adrp	x8, _CSR_CMC_SHIFT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CSR_CMC_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	lsr	w8, w0, w8
	tbnz	w8, #0, LBB0_5
LBB0_13:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_HPSB_DEBUG
	cmp	w20, #5
	b.lt	LBB0_15
; %bb.14:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_HPSB_DEBUG
	mov	w0, #1
	b	LBB0_8
LBB0_15:
	ldr	w0, [x19, #20]
	bl	_NODEID_TO_NODE
	mov	x1, x0
	mov	x0, x19
	mov	w2, #-1
	bl	_hpsb_send_phy_config
Lloh16:
	adrp	x8, _LONG_RESET_FORCE_ROOT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LONG_RESET_FORCE_ROOT@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_hpsb_reset_bus
	mov	w0, #0
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_LOCAL_BUS,4,2                  ; @LOCAL_BUS
	.comm	_CSR_REGISTER_BASE,8,3          ; @CSR_REGISTER_BASE
	.comm	_CSR_CONFIG_ROM,8,3             ; @CSR_CONFIG_ROM
	.comm	_CSR_CMC_SHIFT,4,2              ; @CSR_CMC_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"The root node is not cycle master capable; selecting a new root node and resetting..."

l_.str.1:                               ; @.str.1
	.asciz	"Stopping reset loop for IRM sanity"

	.comm	_LONG_RESET_FORCE_ROOT,4,2      ; @LONG_RESET_FORCE_ROOT
	.no_dead_strip	_nodemgr_do_irm_duties
.subsections_via_symbols
