	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lme2510_download_firmware
_lme2510_download_firmware:             ## @lme2510_download_firmware
	.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	$2104, %rsp                     ## imm = 0x838
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -2112(%rbp)               ## 8-byte Spill
	movq	%rdi, -2120(%rbp)               ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	-2096(%rbp), %rdi
	movl	$2048, %esi                     ## imm = 0x800
	callq	___bzero
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_info
	movl	$511, %ecx                      ## imm = 0x1FF
	xorl	%r12d, %r12d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	$129, -2096(%rbp)
	movl	%ecx, %r13d
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%r13d, -2092(%rbp)
	leal	1(%r13), %r15d
	leaq	-2088(%rbp), %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	leal	4(%r13), %eax
	movl	%eax, -2100(%rbp)               ## 4-byte Spill
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_check_sum
	movslq	%r13d, %rcx
	movl	%eax, -2084(%rbp,%rcx,4)
	movl	-2084(%rbp), %edx
	movl	-2088(%rbp,%rcx,4), %ecx
	movl	$1, %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %r8d
	callq	_deb_info
	movq	-2120(%rbp), %rbx               ## 8-byte Reload
	movq	%rbx, %rdi
	leaq	-2096(%rbp), %r15
	movq	%r15, %rsi
	movl	-2100(%rbp), %edx               ## 4-byte Reload
	movl	$1, %ecx
	callq	_lme2510_bulk_write
	orl	%eax, %r12d
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_lme2510_bulk_read
	orl	%eax, %r12d
	cmpl	$136, -2096(%rbp)
	movl	$-1, %eax
	cmovnel	%eax, %r12d
	addq	$50, %r14
	movl	-2128(%rbp), %ecx               ## 4-byte Reload
	addl	$-50, %ecx
	cmpl	$512, %r14d                     ## imm = 0x200
	jge	LBB0_5
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	-2112(%rbp), %rax               ## 8-byte Reload
	movq	8(%rax), %rbx
	addq	%r14, %rbx
	cmpl	$462, %r14d                     ## imm = 0x1CE
	movl	%ecx, -2128(%rbp)               ## 4-byte Spill
	jg	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	$1, -2096(%rbp)
	movl	$49, %r13d
	jmp	LBB0_4
LBB0_5:
	movq	-2112(%rbp), %rax               ## 8-byte Reload
	movl	(%rax), %eax
	cmpl	$513, %eax                      ## imm = 0x201
	jl	LBB0_6
## %bb.7:
	leal	-513(%rax), %ecx
	movl	$512, %r13d                     ## imm = 0x200
	movq	%rax, -2136(%rbp)               ## 8-byte Spill
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	$2, -2096(%rbp)
	movl	$49, %r14d
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	movl	%r14d, -2092(%rbp)
	leal	1(%r14), %r15d
	leaq	-2088(%rbp), %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	leal	4(%r14), %eax
	movl	%eax, -2100(%rbp)               ## 4-byte Spill
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_check_sum
	movslq	%r14d, %rcx
	movl	%eax, -2084(%rbp,%rcx,4)
	movl	-2084(%rbp), %edx
	movl	-2088(%rbp,%rcx,4), %ecx
	movl	$1, %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %r8d
	callq	_deb_info
	movq	-2120(%rbp), %rbx               ## 8-byte Reload
	movq	%rbx, %rdi
	leaq	-2096(%rbp), %r14
	movq	%r14, %rsi
	movl	-2100(%rbp), %edx               ## 4-byte Reload
	movl	$1, %ecx
	callq	_lme2510_bulk_write
	orl	%eax, %r12d
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_lme2510_bulk_read
	movl	%eax, %ebx
	orl	%r12d, %ebx
	cmpl	$136, -2096(%rbp)
	movl	$-1, %eax
	cmovnel	%eax, %ebx
	addq	$50, %r13
	movq	-2128(%rbp), %rcx               ## 8-byte Reload
	addl	$-50, %ecx
	movl	%ebx, %r12d
	cmpl	%r13d, -2136(%rbp)              ## 4-byte Folded Reload
	jle	LBB0_12
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	-2112(%rbp), %rax               ## 8-byte Reload
	movq	8(%rax), %rbx
	addq	%r13, %rbx
	leal	1(%rcx), %eax
	cmpl	$49, %eax
	movq	%rcx, -2128(%rbp)               ## 8-byte Spill
	jg	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	$130, -2096(%rbp)
	movq	%rcx, %r14
                                        ## kill: def $r14d killed $r14d killed $r14 def $r14
	jmp	LBB0_11
LBB0_6:
	movl	%r12d, %ebx
LBB0_12:
	movq	-2120(%rbp), %r14               ## 8-byte Reload
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	subq	$8, %rsp
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	$6, %edx
	movl	$128, %ecx
	movl	$512, %r8d                      ## imm = 0x200
	xorl	%r9d, %r9d
	pushq	$1000                           ## imm = 0x3E8
	pushq	$265                            ## imm = 0x109
	leaq	-2096(%rbp), %r12
	pushq	%r12
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	$138, -2096(%rbp)
	movl	$2000, %edi                     ## imm = 0x7D0
	callq	_msleep
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_lme2510_bulk_write
	movl	%eax, %r15d
	orl	%ebx, %r15d
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_lme2510_bulk_read
	movl	%eax, %ebx
	movl	$400, %edi                      ## imm = 0x190
	callq	_msleep
	orl	%r15d, %ebx
	js	LBB0_13
## %bb.14:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_info
	jmp	LBB0_15
LBB0_13:
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_info
LBB0_15:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_17
## %bb.16:
	sarl	$31, %ebx
	andl	%eax, %ebx
	movl	%ebx, %eax
	addq	$2104, %rsp                     ## imm = 0x838
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FRM Starting Firmware Download"

L_.str.1:                               ## @.str.1
	.asciz	"Data S=%02x:E=%02x CS= %02x"

L_.str.2:                               ## @.str.2
	.asciz	"FRM Firmware Download Failed (%04x)"

L_.str.3:                               ## @.str.3
	.asciz	"FRM Firmware Download Completed - Resetting Device"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_lme2510_download_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lme2510_download_firmware
_lme2510_download_firmware:             ; @lme2510_download_firmware
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #2080
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
	add	x21, sp, #16
	add	x0, sp, #16
	mov	w1, #2048
	bl	_bzero
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_info
	mov	x28, #0
	mov	w26, #0
	add	x21, x21, #8
	mov	w22, #511
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w8, #129
	str	w8, [sp, #16]
	mov	x27, x22
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #8]
	add	x23, x28, x8
	str	w27, [sp, #20]
	add	w24, w27, #1
	mov	x0, x21
	mov	x1, x23
	mov	x2, x24
	bl	_memcpy
	add	w25, w27, #4
	mov	x0, x23
	mov	x1, x24
	bl	_check_sum
	mov	x4, x0
	add	x8, sp, #16
	add	x8, x8, w27, sxtw #2
	str	w0, [x8, #12]
	ldr	w2, [sp, #28]
	ldr	w3, [x8, #8]
	mov	w0, #1
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_deb_info
	add	x1, sp, #16
	mov	x0, x19
	mov	x2, x25
	mov	w3, #1
	bl	_lme2510_bulk_write
	orr	w23, w0, w26
	add	x1, sp, #16
	mov	x0, x19
	mov	w2, #1
	mov	w3, #1
	bl	_lme2510_bulk_read
	orr	w8, w23, w0
	ldr	w9, [sp, #16]
	cmp	w9, #136
	csinv	w26, w8, wzr, eq
	add	x28, x28, #50
	sub	w22, w22, #50
	cmp	w28, #512
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w28, #462
	b.gt	LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w8, #1
	str	w8, [sp, #16]
	mov	w27, #49
	b	LBB0_2
LBB0_5:
	ldr	w8, [x20]
	str	w8, [sp, #12]                   ; 4-byte Folded Spill
	subs	w27, w8, #513
	b.lt	LBB0_11
; %bb.6:
	mov	w22, #512
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	w8, #2
	str	w8, [sp, #16]
	mov	w28, #49
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x20, #8]
	add	x23, x22, x8
	str	w28, [sp, #20]
	add	w24, w28, #1
	mov	x0, x21
	mov	x1, x23
	mov	x2, x24
	bl	_memcpy
	add	w25, w28, #4
	mov	x0, x23
	mov	x1, x24
	bl	_check_sum
	mov	x4, x0
	add	x8, sp, #16
	add	x8, x8, w28, sxtw #2
	str	w0, [x8, #12]
	ldr	w2, [sp, #28]
	ldr	w3, [x8, #8]
	mov	w0, #1
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_deb_info
	add	x1, sp, #16
	mov	x0, x19
	mov	x2, x25
	mov	w3, #1
	bl	_lme2510_bulk_write
	orr	w23, w0, w26
	add	x1, sp, #16
	mov	x0, x19
	mov	w2, #1
	mov	w3, #1
	bl	_lme2510_bulk_read
	orr	w8, w23, w0
	ldr	w9, [sp, #16]
	cmp	w9, #136
	csinv	w26, w8, wzr, eq
	add	x22, x22, #50
	sub	w27, w27, #50
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	cmp	w8, w22
	b.le	LBB0_11
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	w8, w27, #1
	cmp	w8, #49
	b.gt	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	w8, #130
	str	w8, [sp, #16]
	mov	x28, x27
	b	LBB0_8
LBB0_11:
	mov	x0, x19
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
	mov	w8, #1000
	str	w8, [sp]
	add	x6, sp, #16
	mov	x0, x19
	mov	w2, #6
	mov	w3, #128
	mov	w4, #512
	mov	w5, #0
	mov	w7, #265
	bl	_usb_control_msg
	mov	w8, #138
	str	w8, [sp, #16]
	mov	w0, #2000
	bl	_msleep
	add	x1, sp, #16
	mov	x0, x19
	mov	w2, #1
	mov	w3, #1
	bl	_lme2510_bulk_write
	orr	w20, w0, w26
	add	x1, sp, #16
	mov	x0, x19
	mov	w2, #1
	mov	w3, #1
	bl	_lme2510_bulk_read
	orr	w19, w20, w0
	mov	w0, #400
	bl	_msleep
	tbnz	w19, #31, LBB0_13
; %bb.12:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_14
LBB0_13:
	str	x19, [sp]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_14:
	bl	_info
Lloh13:
	adrp	x8, _ENODEV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldur	x9, [x29, #-96]
Lloh16:
	adrp	x10, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x10, [x10, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
	cmp	x10, x9
	b.ne	LBB0_16
; %bb.15:
	neg	w8, w8
	and	w0, w8, w19, asr #31
	add	sp, sp, #2080
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FRM Starting Firmware Download"

l_.str.1:                               ; @.str.1
	.asciz	"Data S=%02x:E=%02x CS= %02x"

l_.str.2:                               ; @.str.2
	.asciz	"FRM Firmware Download Failed (%04x)"

l_.str.3:                               ; @.str.3
	.asciz	"FRM Firmware Download Completed - Resetting Device"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_lme2510_download_firmware
.subsections_via_symbols
