	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function t4_fw_restart
_t4_fw_restart:                         ## @t4_fw_restart
	.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
	movq	%rdi, %rbx
	testl	%edx, %edx
	je	LBB0_4
## %bb.1:
	movl	%esi, %r15d
	movq	_PCIE_FW_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PCIE_FW_HALT_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_t4_set_reg_field
	movq	_PCIE_FW_MASTER_M@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jb	LBB0_3
## %bb.2:
	movq	_CIM_BOOT_CFG_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_UPCRST_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_t4_set_reg_field
	movl	$100, %edi
	callq	_msleep
	movq	_PIORST_F@GOTPCREL(%rip), %rax
	movq	_PIORSTMODE_F@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_t4_fw_reset
	testq	%rax, %rax
	je	LBB0_10
LBB0_3:
	movq	_PL_RST_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PIORST_F@GOTPCREL(%rip), %rax
	movq	_PIORSTMODE_F@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_t4_write_reg
	movl	$2000, %edi                     ## imm = 0x7D0
	callq	_msleep
	jmp	LBB0_10
LBB0_4:
	movq	_CIM_BOOT_CFG_A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_UPCRST_F@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_t4_set_reg_field
	movq	_FW_CMD_MAX_TIMEOUT@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_9
## %bb.5:
	movq	_PCIE_FW_A@GOTPCREL(%rip), %r12
	movq	_PCIE_FW_HALT_F@GOTPCREL(%rip), %r13
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_t4_read_reg
	testl	%eax, (%r13)
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	$100, %edi
	callq	_msleep
	addl	$100, %r14d
	cmpl	(%r15), %r14d
	jl	LBB0_6
LBB0_9:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_10
LBB0_7:
	xorl	%r14d, %r14d
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCIE_FW_A,4,2                  ## @PCIE_FW_A
	.comm	_PCIE_FW_HALT_F,4,2             ## @PCIE_FW_HALT_F
	.comm	_PCIE_FW_MASTER_M,4,2           ## @PCIE_FW_MASTER_M
	.comm	_CIM_BOOT_CFG_A,4,2             ## @CIM_BOOT_CFG_A
	.comm	_UPCRST_F,4,2                   ## @UPCRST_F
	.comm	_PIORST_F,4,2                   ## @PIORST_F
	.comm	_PIORSTMODE_F,4,2               ## @PIORSTMODE_F
	.comm	_PL_RST_A,4,2                   ## @PL_RST_A
	.comm	_FW_CMD_MAX_TIMEOUT,4,2         ## @FW_CMD_MAX_TIMEOUT
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_t4_fw_restart
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function t4_fw_restart
_t4_fw_restart:                         ; @t4_fw_restart
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	cbz	w2, LBB0_5
; %bb.1:
	mov	x20, x1
Lloh0:
	adrp	x8, _PCIE_FW_A@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCIE_FW_A@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _PCIE_FW_HALT_F@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCIE_FW_HALT_F@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	bl	_t4_set_reg_field
Lloh6:
	adrp	x8, _PCIE_FW_MASTER_M@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PCIE_FW_MASTER_M@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x21, _PIORST_F@GOTPAGE
Lloh10:
	ldr	x21, [x21, _PIORST_F@GOTPAGEOFF]
Lloh11:
	adrp	x22, _PIORSTMODE_F@GOTPAGE
Lloh12:
	ldr	x22, [x22, _PIORSTMODE_F@GOTPAGEOFF]
	cmp	w8, w20
	b.lo	LBB0_3
; %bb.2:
Lloh13:
	adrp	x8, _CIM_BOOT_CFG_A@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CIM_BOOT_CFG_A@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _UPCRST_F@GOTPAGE
Lloh17:
	ldr	x8, [x8, _UPCRST_F@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	bl	_t4_set_reg_field
	mov	w0, #100
	bl	_msleep
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w2, w9, w8
	mov	x0, x19
	mov	x1, x20
	bl	_t4_fw_reset
	cbz	x0, LBB0_10
LBB0_3:
Lloh19:
	adrp	x8, _PL_RST_A@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PL_RST_A@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	ldr	w8, [x21]
	ldr	w9, [x22]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_t4_write_reg
	mov	w0, #2000
	bl	_msleep
LBB0_4:
	mov	w0, #0
	b	LBB0_10
LBB0_5:
Lloh22:
	adrp	x8, _CIM_BOOT_CFG_A@GOTPAGE
Lloh23:
	ldr	x8, [x8, _CIM_BOOT_CFG_A@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x8, _UPCRST_F@GOTPAGE
Lloh26:
	ldr	x8, [x8, _UPCRST_F@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	bl	_t4_set_reg_field
Lloh28:
	adrp	x20, _FW_CMD_MAX_TIMEOUT@GOTPAGE
Lloh29:
	ldr	x20, [x20, _FW_CMD_MAX_TIMEOUT@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.6:
	mov	w21, #0
Lloh30:
	adrp	x22, _PCIE_FW_A@GOTPAGE
Lloh31:
	ldr	x22, [x22, _PCIE_FW_A@GOTPAGEOFF]
Lloh32:
	adrp	x23, _PCIE_FW_HALT_F@GOTPAGE
Lloh33:
	ldr	x23, [x23, _PCIE_FW_HALT_F@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_t4_read_reg
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w0, #100
	bl	_msleep
	add	w21, w21, #100
	ldr	w8, [x20]
	cmp	w21, w8
	b.lt	LBB0_7
LBB0_9:
Lloh34:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_PCIE_FW_A,4,2                  ; @PCIE_FW_A
	.comm	_PCIE_FW_HALT_F,4,2             ; @PCIE_FW_HALT_F
	.comm	_PCIE_FW_MASTER_M,4,2           ; @PCIE_FW_MASTER_M
	.comm	_CIM_BOOT_CFG_A,4,2             ; @CIM_BOOT_CFG_A
	.comm	_UPCRST_F,4,2                   ; @UPCRST_F
	.comm	_PIORST_F,4,2                   ; @PIORST_F
	.comm	_PIORSTMODE_F,4,2               ; @PIORSTMODE_F
	.comm	_PL_RST_A,4,2                   ; @PL_RST_A
	.comm	_FW_CMD_MAX_TIMEOUT,4,2         ; @FW_CMD_MAX_TIMEOUT
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_t4_fw_restart
.subsections_via_symbols
