	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i2400m_fw_dnload
_i2400m_fw_dnload:                      ## @i2400m_fw_dnload
	.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	%ecx, %r15d
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r13
	callq	_i2400m_dev
	movl	(%r13), %r14d
	leaq	L_.str(%rip), %rdx
	movl	$5, %edi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rsi
	movq	%r13, %rcx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %r8
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %r9
	callq	_d_fnstart
	movl	$1, 4(%r13)
	xorl	%eax, %eax
	callq	_wmb
	testl	%r14d, %r14d
	je	LBB0_18
## %bb.1:
	decl	%r14d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	orl	%r15d, %r12d
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.7(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_I2400M_BRI_SOFT@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	movl	%r12d, %r15d
	addl	$-1, %r14d
	jae	LBB0_18
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_I2400M_BRI_MAC_REINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	testl	%r15d, %r12d
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_i2400m_bootrom_init
	testl	%eax, %eax
	js	LBB0_19
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_I2400M_BRI_MAC_REINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_i2400m_dnload_init
	movl	%eax, %ebx
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_17
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%ebx, %ebx
	js	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_i2400m_dnload_bcf
	movl	%eax, %ebx
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_17
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%ebx, %ebx
	js	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	callq	_i2400m_dnload_finalize
	movl	%eax, %ebx
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	je	LBB0_17
## %bb.12:
	movl	8(%r13), %ecx
	testl	%ebx, %ebx
	js	LBB0_13
## %bb.15:
	leaq	L_.str.5(%rip), %rdx
	movl	$2, %edi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	callq	_d_printf
	movl	$0, 4(%r13)
	xorl	%eax, %eax
	callq	_wmb
	jmp	LBB0_16
LBB0_18:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_16
LBB0_19:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_16
LBB0_7:
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_10:
	movl	8(%r13), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	jmp	LBB0_14
LBB0_13:
	leaq	L_.str.4(%rip), %rsi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	movl	%ecx, %edx
LBB0_14:
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_16:
	movl	%ebx, (%rsp)
	leaq	L_.str.6(%rip), %rdx
	movl	$5, %edi
	movq	%r14, %rsi
	movq	%r13, %rcx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	movq	-64(%rbp), %r9                  ## 8-byte Reload
	callq	_d_fnend
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(i2400m %p bcf %p size %zu)\n"

	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
L_.str.1:                               ## @.str.1
	.asciz	"device rebooted too many times, aborting\n"

	.comm	_I2400M_BRI_MAC_REINIT,4,2      ## @I2400M_BRI_MAC_REINIT
L_.str.2:                               ## @.str.2
	.asciz	"bootrom init failed: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"fw %s: download failed: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"fw %s: download finalization failed: %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"fw %s successfully uploaded\n"

L_.str.6:                               ## @.str.6
	.asciz	"(i2400m %p bcf %p size %zu) = %d\n"

L_.str.7:                               ## @.str.7
	.asciz	"device rebooted, %d tries left\n"

	.comm	_I2400M_BRI_SOFT,4,2            ## @I2400M_BRI_SOFT
	.no_dead_strip	_i2400m_fw_dnload
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i2400m_fw_dnload
_i2400m_fw_dnload:                      ; @i2400m_fw_dnload
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x24, x3
	mov	x23, x2
	mov	x20, x1
	mov	x21, x0
	bl	_i2400m_dev
	mov	x22, x0
	ldr	w19, [x21]
Lloh0:
	adrp	x2, l_.str@PAGE
Lloh1:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #5
	mov	x1, x22
	mov	x3, x21
	mov	x4, x20
	str	x23, [sp, #24]                  ; 8-byte Folded Spill
	mov	x5, x23
	bl	_d_fnstart
	mov	w8, #1
	str	w8, [x21, #4]
	bl	_wmb
Lloh2:
	adrp	x26, _ERESTARTSYS@GOTPAGE
Lloh3:
	ldr	x26, [x26, _ERESTARTSYS@GOTPAGEOFF]
	cbz	w19, LBB0_13
; %bb.1:
	sub	w27, w19, #1
Lloh4:
	adrp	x28, _I2400M_BRI_MAC_REINIT@GOTPAGE
Lloh5:
	ldr	x28, [x28, _I2400M_BRI_MAC_REINIT@GOTPAGEOFF]
Lloh6:
	adrp	x25, l_.str.7@PAGE
Lloh7:
	add	x25, x25, l_.str.7@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	orr	w19, w19, w24
	str	x27, [sp]
	mov	x0, x22
	mov	x1, x25
	bl	_dev_err
Lloh8:
	adrp	x8, _I2400M_BRI_SOFT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I2400M_BRI_SOFT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w24, w19, w8
	sub	w27, w27, #1
	cmn	w27, #1
	b.eq	LBB0_13
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w19, [x28]
	tst	w19, w24
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	x1, x24
	bl	_i2400m_bootrom_init
	tbnz	w0, #31, LBB0_14
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w19, [x28]
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	x1, x20
	bl	_i2400m_dnload_init
	ldr	w8, [x26]
	cmn	w0, w8
	b.eq	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x23, x0
	tbnz	w0, #31, LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	x1, x20
	ldr	x2, [sp, #24]                   ; 8-byte Folded Reload
	bl	_i2400m_dnload_bcf
	ldr	w8, [x26]
	cmn	w0, w8
	b.eq	LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x23, x0
	tbnz	w0, #31, LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	x1, x20
	mov	x2, x23
	bl	_i2400m_dnload_finalize
	ldr	w8, [x26]
	cmn	w0, w8
	b.eq	LBB0_2
; %bb.11:
	mov	x23, x0
	ldr	w3, [x21, #8]
	tbnz	w0, #31, LBB0_16
; %bb.12:
Lloh11:
	adrp	x2, l_.str.5@PAGE
Lloh12:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	w0, #2
	mov	x1, x22
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_d_printf
	str	wzr, [x21, #4]
	bl	_wmb
	b	LBB0_18
LBB0_13:
	ldr	w8, [x26]
	neg	w23, w8
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_14:
	mov	x23, x0
	str	x23, [sp]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_17
LBB0_15:
	mov	x8, x23
	ldr	w9, [x21, #8]
	stp	x9, x8, [sp]
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_17
LBB0_16:
	mov	x8, x23
	stp	x3, x8, [sp]
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_17:
	mov	x0, x22
	bl	_dev_err
LBB0_18:
Lloh21:
	adrp	x2, l_.str.6@PAGE
Lloh22:
	add	x2, x2, l_.str.6@PAGEOFF
	mov	w0, #5
	mov	x1, x22
	mov	x3, x21
	mov	x4, x20
	ldr	x5, [sp, #24]                   ; 8-byte Folded Reload
	mov	x6, x23
	bl	_d_fnend
	mov	x0, x23
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(i2400m %p bcf %p size %zu)\n"

	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
l_.str.1:                               ; @.str.1
	.asciz	"device rebooted too many times, aborting\n"

	.comm	_I2400M_BRI_MAC_REINIT,4,2      ; @I2400M_BRI_MAC_REINIT
l_.str.2:                               ; @.str.2
	.asciz	"bootrom init failed: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"fw %s: download failed: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"fw %s: download finalization failed: %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"fw %s successfully uploaded\n"

l_.str.6:                               ; @.str.6
	.asciz	"(i2400m %p bcf %p size %zu) = %d\n"

l_.str.7:                               ; @.str.7
	.asciz	"device rebooted, %d tries left\n"

	.comm	_I2400M_BRI_SOFT,4,2            ; @I2400M_BRI_SOFT
	.no_dead_strip	_i2400m_fw_dnload
.subsections_via_symbols
