	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t4_fw_upgrade                  ## -- Begin function t4_fw_upgrade
	.p2align	4, 0x90
_t4_fw_upgrade:                         ## @t4_fw_upgrade
	.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	%r8d, %r14d
	movl	%ecx, %r12d
	movq	%rdx, %r15
	movl	%esi, %ebx
	movq	%rdi, %r13
	movq	%rdx, %rsi
	callq	_t4_fw_matches_chip
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_CXGB4_FW_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%r13)
	movq	%r13, %rdi
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_t4_fw_halt
	testl	%r14d, %r14d
	jne	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_7
LBB0_4:
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	_t4_load_fw
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_t4_load_cfg
	movl	(%r15), %edi
	callq	_be32_to_cpu
	movq	_FW_HDR_FLAGS_RESET_HALT@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	andl	(%rcx), %eax
	sete	%dl
	movq	%r13, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_t4_fw_restart
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_t4_init_devlog_params
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_5:
	movl	%eax, %ebx
LBB0_7:
	movq	_CXGB4_FW_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r13)
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CXGB4_FW_OK,4,2                ## @CXGB4_FW_OK
	.comm	_FW_HDR_FLAGS_RESET_HALT,4,2    ## @FW_HDR_FLAGS_RESET_HALT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_t4_fw_upgrade                  ; -- Begin function t4_fw_upgrade
	.p2align	2
_t4_fw_upgrade:                         ; @t4_fw_upgrade
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x24, x4
	mov	x22, x3
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	mov	x1, x2
	bl	_t4_fw_matches_chip
	cbz	w0, LBB0_5
; %bb.1:
Lloh0:
	adrp	x25, _CXGB4_FW_OK@GOTPAGE
Lloh1:
	ldr	x25, [x25, _CXGB4_FW_OK@GOTPAGEOFF]
	ldr	w8, [x25]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	mov	x0, x19
	mov	x1, x20
	mov	x2, x24
	bl	_t4_fw_halt
	cbnz	w24, LBB0_3
; %bb.2:
	mov	x23, x0
	tbnz	w0, #31, LBB0_7
LBB0_3:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	bl	_t4_load_fw
	tbnz	w0, #31, LBB0_6
; %bb.4:
	mov	x0, x19
	mov	x1, #0
	mov	w2, #0
	bl	_t4_load_cfg
	ldr	w0, [x21]
	bl	_be32_to_cpu
Lloh2:
	adrp	x8, _FW_HDR_FLAGS_RESET_HALT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FW_HDR_FLAGS_RESET_HALT@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w0
	cset	w2, eq
	mov	x0, x19
	mov	x1, x20
	bl	_t4_fw_restart
	mov	x23, x0
	mov	x0, x19
	bl	_t4_init_devlog_params
	b	LBB0_7
LBB0_5:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_8
LBB0_6:
	mov	x23, x0
LBB0_7:
	ldr	w8, [x25]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_8:
	mov	x0, x23
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CXGB4_FW_OK,4,2                ; @CXGB4_FW_OK
	.comm	_FW_HDR_FLAGS_RESET_HALT,4,2    ; @FW_HDR_FLAGS_RESET_HALT
.subsections_via_symbols
