	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ims_pcu_init_bootloader_mode
_ims_pcu_init_bootloader_mode:          ## @ims_pcu_init_bootloader_mode
	.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	%rdi, %rbx
	movq	_QUERY_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IMS_PCU_CMD_RESPONSE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ims_pcu_execute_bl_command
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	4(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_4
LBB0_2:
	movq	24(%rbx), %rax
	movq	_IMS_PCU_DATA_OFFSET@GOTPCREL(%rip), %r15
	movslq	(%r15), %rcx
	leaq	(%rax,%rcx,4), %rdi
	addq	$44, %rdi
	callq	_get_unaligned_le32
	movq	%rax, 16(%rbx)
	movq	24(%rbx), %rax
	movslq	(%r15), %rcx
	leaq	(%rax,%rcx,4), %rdi
	addq	$60, %rdi
	callq	_get_unaligned_le32
	movq	%rax, 8(%rbx)
	movl	4(%rbx), %edi
	movq	16(%rbx), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rcx
	callq	_dev_info
	movq	_THIS_MODULE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_IMS_PCU_FIRMWARE_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	4(%rbx), %ecx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_ims_pcu_process_async_firmware@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movl	$1, %esi
	movq	%rbx, %r9
	callq	_request_firmware_nowait
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_complete
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_QUERY_DEVICE,4,2               ## @QUERY_DEVICE
	.comm	_IMS_PCU_CMD_RESPONSE_TIMEOUT,4,2 ## @IMS_PCU_CMD_RESPONSE_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bootloader does not respond, aborting\n"

	.comm	_IMS_PCU_DATA_OFFSET,4,2        ## @IMS_PCU_DATA_OFFSET
L_.str.1:                               ## @.str.1
	.asciz	"Device is in bootloader mode (addr 0x%08x-0x%08x), requesting firmware\n"

	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
	.comm	_IMS_PCU_FIRMWARE_NAME,4,2      ## @IMS_PCU_FIRMWARE_NAME
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ims_pcu_process_async_firmware,4,2 ## @ims_pcu_process_async_firmware
	.no_dead_strip	_ims_pcu_init_bootloader_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ims_pcu_init_bootloader_mode
_ims_pcu_init_bootloader_mode:          ; @ims_pcu_init_bootloader_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
Lloh0:
	adrp	x8, _QUERY_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QUERY_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _IMS_PCU_CMD_RESPONSE_TIMEOUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IMS_PCU_CMD_RESPONSE_TIMEOUT@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
	mov	x2, #0
	mov	w3, #0
	bl	_ims_pcu_execute_bl_command
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #4]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_4
LBB0_2:
	ldr	x8, [x19, #24]
Lloh8:
	adrp	x21, _IMS_PCU_DATA_OFFSET@GOTPAGE
Lloh9:
	ldr	x21, [x21, _IMS_PCU_DATA_OFFSET@GOTPAGEOFF]
	ldrsw	x9, [x21]
	add	x8, x8, x9, lsl #2
	add	x0, x8, #44
	bl	_get_unaligned_le32
	str	x0, [x19, #16]
	ldr	x8, [x19, #24]
	ldrsw	x9, [x21]
	add	x8, x8, x9, lsl #2
	add	x0, x8, #60
	bl	_get_unaligned_le32
	mov	x3, x0
	str	x0, [x19, #8]
	ldr	w0, [x19, #4]
	ldr	x2, [x19, #16]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
Lloh12:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _IMS_PCU_FIRMWARE_NAME@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IMS_PCU_FIRMWARE_NAME@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	ldr	w3, [x19, #4]
Lloh18:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh20:
	ldr	w4, [x8]
Lloh21:
	adrp	x8, _ims_pcu_process_async_firmware@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ims_pcu_process_async_firmware@GOTPAGEOFF]
Lloh23:
	ldr	w6, [x8]
	mov	w1, #1
	mov	x5, x19
	bl	_request_firmware_nowait
	cbz	w0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_complete
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_QUERY_DEVICE,4,2               ; @QUERY_DEVICE
	.comm	_IMS_PCU_CMD_RESPONSE_TIMEOUT,4,2 ; @IMS_PCU_CMD_RESPONSE_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bootloader does not respond, aborting\n"

	.comm	_IMS_PCU_DATA_OFFSET,4,2        ; @IMS_PCU_DATA_OFFSET
l_.str.1:                               ; @.str.1
	.asciz	"Device is in bootloader mode (addr 0x%08x-0x%08x), requesting firmware\n"

	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
	.comm	_IMS_PCU_FIRMWARE_NAME,4,2      ; @IMS_PCU_FIRMWARE_NAME
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ims_pcu_process_async_firmware,4,2 ; @ims_pcu_process_async_firmware
	.no_dead_strip	_ims_pcu_init_bootloader_mode
.subsections_via_symbols
