	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sbp2_agent_reset
_sbp2_agent_reset:                      ## @sbp2_agent_reset
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_flush_scheduled_work
LBB0_2:
	movq	_SBP2_AGENT_RESET_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ntohl
	movl	%eax, -20(%rbp)
	movq	_SBP2_AGENT_RESET_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%r14), %rsi
	movl	16(%r14), %edi
	leaq	-20(%rbp), %rdx
	movl	$4, %ecx
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:
	callq	_hpsb_node_write
	testl	%eax, %eax
	js	LBB0_6
LBB0_7:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	$0, 8(%r14)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	jmp	LBB0_8
LBB0_4:
	callq	_sbp2util_node_write_no_wait
	testl	%eax, %eax
	jns	LBB0_7
LBB0_6:
	leaq	L_.str(%rip), %rdi
	callq	_SBP2_ERR
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SBP2_AGENT_RESET_DATA,4,2      ## @SBP2_AGENT_RESET_DATA
	.comm	_SBP2_AGENT_RESET_OFFSET,8,3    ## @SBP2_AGENT_RESET_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hpsb_node_write failed.\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_sbp2_agent_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sbp2_agent_reset
_sbp2_agent_reset:                      ; @sbp2_agent_reset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	cbz	w1, LBB0_2
; %bb.1:
	bl	_flush_scheduled_work
LBB0_2:
Lloh0:
	adrp	x8, _SBP2_AGENT_RESET_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SBP2_AGENT_RESET_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_ntohl
	str	w0, [sp, #12]
	ldr	x8, [x19, #24]
Lloh3:
	adrp	x9, _SBP2_AGENT_RESET_OFFSET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SBP2_AGENT_RESET_OFFSET@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
	ldr	w0, [x19, #16]
	add	x2, sp, #12
	mov	w3, #4
	cbz	w20, LBB0_5
; %bb.3:
	bl	_hpsb_node_write
	tbnz	w0, #31, LBB0_6
LBB0_4:
	mov	x0, x19
	bl	_spin_lock_irqsave
	str	xzr, [x19, #8]
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_7
LBB0_5:
	bl	_sbp2util_node_write_no_wait
	tbz	w0, #31, LBB0_4
LBB0_6:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_SBP2_ERR
Lloh8:
	adrp	x8, _EIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SBP2_AGENT_RESET_DATA,4,2      ; @SBP2_AGENT_RESET_DATA
	.comm	_SBP2_AGENT_RESET_OFFSET,8,3    ; @SBP2_AGENT_RESET_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hpsb_node_write failed.\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_sbp2_agent_reset
.subsections_via_symbols
