	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function update_tpsram
_update_tpsram:                         ## @update_tpsram
	.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	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	(%rdi), %r14
	callq	_t3rev2char
	testb	%al, %al
	je	LBB0_1
## %bb.2:
	movq	_TPSRAM_NAME@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movsbl	%al, %ecx
	leaq	-96(%rbp), %r15
	movq	%r15, %rdi
	movl	$64, %esi
	callq	_snprintf
	leaq	-104(%rbp), %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_request_firmware
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	-104(%rbp), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edx
	movq	%rbx, %rdi
	callq	_t3_check_tpsram
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movq	-104(%rbp), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_t3_set_proto_sram
	movl	%eax, %r15d
	movq	_TP_VERSION_MAJOR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_TP_VERSION_MINOR@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_TP_VERSION_MICRO@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.7:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_8
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_9
LBB0_3:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rsi
	leaq	-96(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_info
	xorl	%r15d, %r15d
LBB0_8:
	movq	-104(%rbp), %rdi
	callq	_release_firmware
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%r15d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TPSRAM_NAME,8,3                ## @TPSRAM_NAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not load TP SRAM: unable to load %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"successful update of protocol engine to %d.%d.%d\n"

	.comm	_TP_VERSION_MAJOR,4,2           ## @TP_VERSION_MAJOR
	.comm	_TP_VERSION_MINOR,4,2           ## @TP_VERSION_MINOR
	.comm	_TP_VERSION_MICRO,4,2           ## @TP_VERSION_MICRO
L_.str.2:                               ## @.str.2
	.asciz	"failed to update of protocol engine %d.%d.%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"loading protocol SRAM failed\n"

	.no_dead_strip	_update_tpsram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function update_tpsram
_update_tpsram:                         ; @update_tpsram
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	ldr	x19, [x0]
	bl	_t3rev2char
	cbz	w0, LBB0_5
; %bb.1:
	mov	x3, x0
Lloh3:
	adrp	x8, _TPSRAM_NAME@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TPSRAM_NAME@GOTPAGEOFF]
Lloh5:
	ldr	x2, [x8]
	add	x22, sp, #40
	add	x0, sp, #40
	mov	w1, #64
	bl	_snprintf
	add	x0, sp, #32
	add	x1, sp, #40
	mov	x2, x19
	bl	_request_firmware
	tbnz	w0, #31, LBB0_6
; %bb.2:
	ldr	x8, [sp, #32]
	ldp	w1, w2, [x8]
	mov	x0, x21
	bl	_t3_check_tpsram
	mov	x20, x0
	cbnz	w0, LBB0_8
; %bb.3:
	ldr	x8, [sp, #32]
	ldr	w1, [x8]
	mov	x0, x21
	bl	_t3_set_proto_sram
	mov	x20, x0
Lloh6:
	adrp	x8, _TP_VERSION_MAJOR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TP_VERSION_MAJOR@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _TP_VERSION_MINOR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TP_VERSION_MINOR@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
Lloh12:
	adrp	x8, _TP_VERSION_MICRO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TP_VERSION_MICRO@GOTPAGEOFF]
Lloh14:
	ldr	w4, [x8]
	cbz	w0, LBB0_7
; %bb.4:
	stp	x3, x4, [sp, #8]
	str	x2, [sp]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_8
LBB0_5:
	mov	w20, #0
	b	LBB0_9
LBB0_6:
	mov	x20, x0
	str	x22, [sp]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_9
LBB0_7:
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
                                        ; kill: def $w3 killed $w3 killed $x3
                                        ; kill: def $w4 killed $w4 killed $x4
	bl	_dev_info
LBB0_8:
	ldr	x0, [sp, #32]
	bl	_release_firmware
LBB0_9:
	ldur	x8, [x29, #-40]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x20
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_TPSRAM_NAME,8,3                ; @TPSRAM_NAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not load TP SRAM: unable to load %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"successful update of protocol engine to %d.%d.%d\n"

	.comm	_TP_VERSION_MAJOR,4,2           ; @TP_VERSION_MAJOR
	.comm	_TP_VERSION_MINOR,4,2           ; @TP_VERSION_MINOR
	.comm	_TP_VERSION_MICRO,4,2           ; @TP_VERSION_MICRO
l_.str.2:                               ; @.str.2
	.asciz	"failed to update of protocol engine %d.%d.%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"loading protocol SRAM failed\n"

	.no_dead_strip	_update_tpsram
.subsections_via_symbols
