	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __ims_pcu_execute_bl_command
___ims_pcu_execute_bl_command:          ## @__ims_pcu_execute_bl_command
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r15d
	movl	%r8d, %r14d
	movq	%rcx, %rbx
	movq	%rdx, %rax
	movq	%rdi, %r12
	movq	(%rdi), %rdx
	movl	%esi, (%rdx)
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	addq	$4, %rdx
	movq	%rdx, %rdi
	movq	%rax, %rsi
	movq	%rbx, %rdx
	callq	_memcpy
	movq	(%r12), %rdx
LBB0_2:
	movq	_IMS_PCU_CMD_BOOTLOADER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	incq	%rbx
	movl	%r14d, %r8d
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	movq	_IMS_PCU_RSP_BOOTLOADER@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
LBB0_4:
	movq	%r12, %rdi
	movq	%rbx, %rcx
	movl	%r15d, %r9d
	callq	___ims_pcu_execute_command
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	movl	8(%r12), %edi
	movq	(%r12), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %ecx
	callq	_dev_err
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%ebx, %ebx
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.7:
	movq	(%r12), %rax
	movl	8(%rax), %edx
	cmpl	%r14d, %edx
	je	LBB0_9
## %bb.8:
	movl	8(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %ecx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_IMS_PCU_CMD_BOOTLOADER,4,2     ## @IMS_PCU_CMD_BOOTLOADER
	.comm	_IMS_PCU_RSP_BOOTLOADER,4,2     ## @IMS_PCU_RSP_BOOTLOADER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failure when sending 0x%02x command to bootloader, error: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Unexpected response from bootloader: 0x%02x, wanted 0x%02x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	___ims_pcu_execute_bl_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __ims_pcu_execute_bl_command
___ims_pcu_execute_bl_command:          ; @__ims_pcu_execute_bl_command
	.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	x21, x5
	mov	x19, x4
	mov	x22, x3
	mov	x8, x2
	mov	x20, x0
	ldr	x2, [x0]
	str	w1, [x2]
	cbz	x8, LBB0_2
; %bb.1:
	add	x0, x2, #4
	mov	x1, x8
	mov	x2, x22
	bl	_memcpy
	ldr	x2, [x20]
LBB0_2:
Lloh0:
	adrp	x8, _IMS_PCU_CMD_BOOTLOADER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IMS_PCU_CMD_BOOTLOADER@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x3, x22, #1
Lloh3:
	adrp	x8, _IMS_PCU_RSP_BOOTLOADER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IMS_PCU_RSP_BOOTLOADER@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w19, #0
	csel	w4, wzr, w8, eq
	mov	x0, x20
	mov	x5, x21
	bl	___ims_pcu_execute_command
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
	ldr	w0, [x20, #8]
	ldr	x8, [x20]
	ldr	w2, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x21
	bl	_dev_err
	b	LBB0_8
LBB0_4:
	cbz	w19, LBB0_6
; %bb.5:
	ldr	x8, [x20]
	ldr	w2, [x8, #8]
	cmp	w2, w19
	b.ne	LBB0_7
LBB0_6:
	mov	w21, #0
	b	LBB0_8
LBB0_7:
	ldr	w0, [x20, #8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x3, x19
	bl	_dev_err
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	mov	x0, x21
	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	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_IMS_PCU_CMD_BOOTLOADER,4,2     ; @IMS_PCU_CMD_BOOTLOADER
	.comm	_IMS_PCU_RSP_BOOTLOADER,4,2     ; @IMS_PCU_RSP_BOOTLOADER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failure when sending 0x%02x command to bootloader, error: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Unexpected response from bootloader: 0x%02x, wanted 0x%02x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	___ims_pcu_execute_bl_command
.subsections_via_symbols
