	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ims_pcu_handle_firmware_update
_ims_pcu_handle_firmware_update:        ## @ims_pcu_handle_firmware_update
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	8(%rdi), %rdi
	movq	_IMS_PCU_FIRMWARE_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%rsi), %ecx
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movq	%rbx, %rdi
	callq	_ims_pcu_count_fw_records
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_ims_pcu_flash_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movq	_LAUNCH_APP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_ims_pcu_execute_bl_command
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r15d
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	movl	%r15d, %ebx
LBB0_3:
	movl	%ebx, (%r14)
	movq	8(%r14), %rdi
	leaq	L_.str.2(%rip), %rdx
	xorl	%esi, %esi
	callq	_sysfs_notify
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Updating firmware %s, size: %zu\n"

	.comm	_IMS_PCU_FIRMWARE_NAME,4,2      ## @IMS_PCU_FIRMWARE_NAME
	.comm	_LAUNCH_APP,4,2                 ## @LAUNCH_APP
L_.str.1:                               ## @.str.1
	.asciz	"Failed to start application image, error: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"update_firmware_status"

	.no_dead_strip	_ims_pcu_handle_firmware_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ims_pcu_handle_firmware_update
_ims_pcu_handle_firmware_update:        ; @ims_pcu_handle_firmware_update
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.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
	ldr	x0, [x0, #8]
Lloh0:
	adrp	x8, _IMS_PCU_FIRMWARE_NAME@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IMS_PCU_FIRMWARE_NAME@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	ldr	w3, [x1]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	mov	x0, x20
	bl	_ims_pcu_count_fw_records
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_ims_pcu_flash_firmware
	mov	x20, x0
	cbnz	w0, LBB0_3
; %bb.1:
Lloh5:
	adrp	x8, _LAUNCH_APP@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LAUNCH_APP@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_ims_pcu_execute_bl_command
	mov	x20, x0
	cbz	w0, LBB0_3
; %bb.2:
	ldr	x0, [x19, #8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_err
LBB0_3:
	str	w20, [x19]
	ldr	x0, [x19, #8]
Lloh10:
	adrp	x2, l_.str.2@PAGE
Lloh11:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x1, #0
	bl	_sysfs_notify
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Updating firmware %s, size: %zu\n"

	.comm	_IMS_PCU_FIRMWARE_NAME,4,2      ; @IMS_PCU_FIRMWARE_NAME
	.comm	_LAUNCH_APP,4,2                 ; @LAUNCH_APP
l_.str.1:                               ; @.str.1
	.asciz	"Failed to start application image, error: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"update_firmware_status"

	.no_dead_strip	_ims_pcu_handle_firmware_update
.subsections_via_symbols
