	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2400m_bm_cmd
_i2400m_bm_cmd:                         ## @i2400m_bm_cmd
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movq	%r8, %r12
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, %r13
	movq	%rdi, %r14
	callq	_i2400m_dev
	movq	%rax, %rbx
	testq	%r13, %r13
	je	LBB0_1
## %bb.2:
	movq	%r13, %rdi
	callq	_i2400m_brh_get_opcode
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_3
LBB0_1:
	movl	$-1, -44(%rbp)                  ## 4-byte Folded Spill
LBB0_3:
	leaq	L_.str(%rip), %rdx
	movl	$6, %edi
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rsi
	movq	%r14, %rcx
	movq	%r13, %r8
	movq	%r15, %r9
	pushq	%r12
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	callq	_d_fnstart
	addq	$16, %rsp
	xorl	%edi, %edi
	cmpq	$12, %r12
	setb	%dil
	callq	_BUG_ON
	xorl	%edi, %edi
	cmpq	$0, (%r14)
	sete	%dil
	callq	_BUG_ON
	testq	%r13, %r13
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.4:
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %ecx
	callq	*8(%r14)
	testq	%rax, %rax
	js	LBB0_5
## %bb.6:
	movq	_I2400M_BM_CMD_RAW@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_8
## %bb.7:
	movq	%r13, %rdi
	callq	_i2400m_brh_get_use_checksum
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_i2400m_brh_get_response_required
	movl	%eax, %r15d
	movq	%r13, %rdi
	callq	_i2400m_brh_get_direct_access
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	8(%r13), %eax
	movl	(%r13), %r11d
	movl	4(%r13), %r10d
	leaq	L_.str.1(%rip), %rdx
	movl	$5, %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ebx, %r8d
	movl	%r15d, %r9d
	pushq	%r11
	pushq	%r10
	pushq	%rax
	pushq	-72(%rbp)                       ## 8-byte Folded Reload
	callq	_d_printf
	addq	$32, %rsp
LBB0_8:
	movq	%r14, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	*16(%r14)
	movq	%rax, %r15
	testq	%rax, %rax
	js	LBB0_9
## %bb.10:
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rdx
	movq	%r12, %rcx
	movl	-48(%rbp), %r8d                 ## 4-byte Reload
	callq	___i2400m_bm_ack_verify
	testq	%rax, %rax
	cmovsq	%rax, %r15
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%r15d, %ecx
	callq	_dev_err
	jmp	LBB0_11
LBB0_5:
	movq	%rax, %r15
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_11:
	subq	$8, %rsp
	leaq	L_.str.3(%rip), %rdx
	movl	$6, %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rcx
	movq	%r13, %r8
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	pushq	%r15
	pushq	%r12
	pushq	%rbx
	callq	_d_fnend
	addq	$32, %rsp
	movq	%r15, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,8,3                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(i2400m %p cmd %p size %zu ack %p size %zu)\n"

	.comm	_I2400M_BM_CMD_RAW,4,2          ## @I2400M_BM_CMD_RAW
L_.str.1:                               ## @.str.1
	.asciz	"boot-mode cmd %d csum %u rr %u da %u: addr 0x%04x size %u block csum 0x%04x\n"

L_.str.2:                               ## @.str.2
	.asciz	"boot-mode cmd %d: error waiting for an ack: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"(i2400m %p cmd %p size %zu ack %p size %zu) = %d\n"

	.no_dead_strip	_i2400m_bm_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2400m_bm_cmd
_i2400m_bm_cmd:                         ; @i2400m_bm_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x5
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	bl	_i2400m_dev
	mov	x24, x0
	cbz	x22, LBB0_2
; %bb.1:
	mov	x0, x22
	bl	_i2400m_brh_get_opcode
	mov	x26, x0
	b	LBB0_3
LBB0_2:
	mov	w26, #-1
LBB0_3:
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #6
	mov	x1, x24
	mov	x3, x23
	mov	x4, x22
	mov	x5, x21
	mov	x6, x20
	mov	x7, x19
	bl	_d_fnstart
	cmp	x19, #12
	cset	w0, lo
	bl	_BUG_ON
	ldr	x8, [x23]
	cmp	x8, #0
	cset	w0, eq
	bl	_BUG_ON
	cbz	x22, LBB0_7
; %bb.4:
	ldr	x8, [x23, #8]
	mov	x0, x23
	mov	x1, x22
	mov	x2, x21
	mov	x3, x25
	blr	x8
	tbnz	x0, #63, LBB0_10
; %bb.5:
Lloh2:
	adrp	x8, _I2400M_BM_CMD_RAW@GOTPAGE
Lloh3:
	ldr	x8, [x8, _I2400M_BM_CMD_RAW@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w25
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x22
	bl	_i2400m_brh_get_use_checksum
	mov	x27, x0
	mov	x0, x22
	bl	_i2400m_brh_get_response_required
	mov	x28, x0
	mov	x0, x22
	bl	_i2400m_brh_get_direct_access
	mov	x6, x0
	ldp	w8, w7, [x22, #4]
	ldr	w9, [x22]
	stp	w8, w9, [sp]
Lloh5:
	adrp	x2, l_.str.1@PAGE
Lloh6:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w0, #5
	mov	x1, x24
	mov	x3, x26
	mov	x4, x27
	mov	x5, x28
	bl	_d_printf
LBB0_7:
	ldr	x8, [x23, #16]
	mov	x0, x23
	mov	x1, x20
	mov	x2, x19
	blr	x8
	mov	x27, x0
	tbnz	x0, #63, LBB0_9
; %bb.8:
	mov	x0, x23
	mov	x1, x26
	mov	x2, x20
	mov	x3, x19
	mov	x4, x25
	bl	___i2400m_bm_ack_verify
	cmp	x0, #0
	csel	x27, x0, x27, lt
	b	LBB0_11
LBB0_9:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x24
	mov	x2, x26
	mov	x3, x27
	bl	_dev_err
	b	LBB0_11
LBB0_10:
	mov	x27, x0
LBB0_11:
	str	w27, [sp]
Lloh9:
	adrp	x2, l_.str.3@PAGE
Lloh10:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	w0, #6
	mov	x1, x24
	mov	x3, x23
	mov	x4, x22
	mov	x5, x21
	mov	x6, x20
	mov	x7, x19
	bl	_d_fnend
	mov	x0, x27
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,8,3                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(i2400m %p cmd %p size %zu ack %p size %zu)\n"

	.comm	_I2400M_BM_CMD_RAW,4,2          ; @I2400M_BM_CMD_RAW
l_.str.1:                               ; @.str.1
	.asciz	"boot-mode cmd %d csum %u rr %u da %u: addr 0x%04x size %u block csum 0x%04x\n"

l_.str.2:                               ; @.str.2
	.asciz	"boot-mode cmd %d: error waiting for an ack: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"(i2400m %p cmd %p size %zu ack %p size %zu) = %d\n"

	.no_dead_strip	_i2400m_bm_cmd
.subsections_via_symbols
