	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function WriteEEProm
_WriteEEProm:                           ## @WriteEEProm
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movl	%edx, -72(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_MICNG_EE_START@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	leaq	9(%r15), %rbx
	movq	_MICNG_EE_END@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rbx
	jae	LBB0_1
## %bb.2:
	movq	%rsi, %r13
	movl	$-1, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$80, %esi
	movq	%r15, %rdx
	leaq	-60(%rbp), %rcx
	movl	$12, %r8d
	callq	_i2c_read_eeprom
	testl	%eax, %eax
	jne	LBB0_24
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-60(%rbp), %eax
	shll	$8, %eax
	orl	-56(%rbp), %eax
	movslq	%eax, %rdx
	movq	_MICNG_EETAG_END0@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	je	LBB0_24
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_MICNG_EETAG_END1@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	je	LBB0_24
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-52(%rbp), %ecx
	cmpq	%r13, %rdx
	je	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movslq	%ecx, %rax
	leaq	(%r15,%rax), %rbx
	addq	$18, %rbx
	addq	%rax, %r15
	addq	$9, %r15
	movq	_MICNG_EE_END@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, %rbx
	jb	LBB0_3
	jmp	LBB0_9
LBB0_1:
	xorl	%edx, %edx
                                        ## implicit-def: $ecx
LBB0_9:
	movslq	%ecx, %rsi
	addq	%rbx, %rsi
	cmpq	%rax, %rsi
	jbe	LBB0_11
## %bb.10:
	leaq	L_.str(%rip), %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	movl	$-1, %r14d
	jmp	LBB0_24
LBB0_11:
	movl	-72(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, %ecx
	jge	LBB0_12
## %bb.14:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_24
LBB0_12:
	testl	%eax, %eax
	jle	LBB0_13
## %bb.15:
	movl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
LBB0_16:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_19 Depth 2
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r15,4), %ecx
	movq	%r12, %rdi
	movl	$80, %esi
	movq	%rbx, %rdx
	callq	_i2c_write_eeprom
	testl	%eax, %eax
	jne	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	$-10, %r13d
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_19 Depth=2
	incl	%r13d
	je	LBB0_23
LBB0_19:                                ##   Parent Loop BB0_16 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$50, %edi
	callq	_msleep
	movq	%r12, %rdi
	movl	$80, %esi
	movq	%rbx, %rdx
	leaq	-84(%rbp), %rcx
	movl	$1, %r8d
	callq	_i2c_read_eeprom
	testl	%eax, %eax
	jne	LBB0_26
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=2
	movl	-84(%rbp), %eax
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	cmpl	(%rcx,%r15,4), %eax
	je	LBB0_22
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=2
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_22
LBB0_23:                                ##   in Loop: Header=BB0_16 Depth=1
	incq	%r15
	incq	%rbx
	xorl	%r14d, %r14d
	cmpq	-72(%rbp), %r15                 ## 8-byte Folded Reload
	jne	LBB0_16
	jmp	LBB0_24
LBB0_7:
	movq	_MICNG_EE_END@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r13, %rdx
	jmp	LBB0_9
LBB0_26:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_24
LBB0_13:
	xorl	%r14d, %r14d
LBB0_24:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_27
## %bb.25:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movl	%eax, %r14d
	jmp	LBB0_24
LBB0_27:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MICNG_EE_START,8,3             ## @MICNG_EE_START
	.comm	_MICNG_EE_END,8,3               ## @MICNG_EE_END
	.comm	_MICNG_EETAG_END0,8,3           ## @MICNG_EETAG_END0
	.comm	_MICNG_EETAG_END1,8,3           ## @MICNG_EETAG_END1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reached EOEE @ Tag = %04x Length = %3d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"eeprom write error\n"

L_.str.2:                               ## @.str.2
	.asciz	"Timeout polling eeprom\n"

	.no_dead_strip	_WriteEEProm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function WriteEEProm
_WriteEEProm:                           ; @WriteEEProm
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x20, x3
	mov	x23, x2
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldr	x19, [x0]
Lloh3:
	adrp	x8, _MICNG_EE_START@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MICNG_EE_START@GOTPAGEOFF]
Lloh5:
	ldr	x25, [x8]
	add	x22, x25, #9
Lloh6:
	adrp	x26, _MICNG_EE_END@GOTPAGE
Lloh7:
	ldr	x26, [x26, _MICNG_EE_END@GOTPAGEOFF]
	ldr	x9, [x26]
	cmp	x22, x9
	b.hs	LBB0_7
; %bb.1:
	mov	x24, x1
Lloh8:
	adrp	x27, _MICNG_EETAG_END0@GOTPAGE
Lloh9:
	ldr	x27, [x27, _MICNG_EETAG_END0@GOTPAGEOFF]
Lloh10:
	adrp	x28, _MICNG_EETAG_END1@GOTPAGE
Lloh11:
	ldr	x28, [x28, _MICNG_EETAG_END1@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	add	x3, sp, #28
	mov	x0, x21
	mov	w1, #80
	mov	x2, x25
	mov	w4, #12
	bl	_i2c_read_eeprom
	cbnz	w0, LBB0_12
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldp	w8, w9, [sp, #28]
	orr	w8, w9, w8, lsl #8
	sxtw	x10, w8
	ldr	x8, [x27]
	ldr	x9, [x28]
	cmp	x8, x10
	ccmp	x9, x10, #4, ne
	b.eq	LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [sp, #36]
	cmp	x10, x24
	b.eq	LBB0_22
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	sxtw	x9, w8
	add	x9, x25, x9
	add	x25, x9, #9
	add	x22, x9, #18
	ldr	x9, [x26]
	cmp	x22, x9
	b.lo	LBB0_2
; %bb.6:
	mov	x24, x10
	b	LBB0_8
LBB0_7:
	mov	x24, #0
                                        ; implicit-def: $w8
LBB0_8:
	add	x10, x22, w8, sxtw
	cmp	x10, x9
	b.ls	LBB0_10
; %bb.9:
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	stp	x24, x8, [sp]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	w24, #-1
	b	LBB0_25
LBB0_10:
	cmp	w8, w23
	b.ge	LBB0_13
; %bb.11:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_25
LBB0_12:
	mov	w24, #-1
	b	LBB0_25
LBB0_13:
	cmp	w23, #1
	b.lt	LBB0_24
; %bb.14:
	mov	x25, #0
	mov	w26, w23
Lloh17:
	adrp	x23, l_.str.1@PAGE
Lloh18:
	add	x23, x23, l_.str.1@PAGEOFF
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	ldr	w3, [x20, x25, lsl #2]
	mov	x0, x21
	mov	w1, #80
	mov	x2, x22
	bl	_i2c_write_eeprom
	cbnz	w0, LBB0_27
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	w27, #-10
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=2
	adds	w27, w27, #1
	b.hs	LBB0_21
LBB0_18:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	w0, #50
	bl	_msleep
	add	x3, sp, #24
	mov	x0, x21
	mov	w1, #80
	mov	x2, x22
	mov	w4, #1
	bl	_i2c_read_eeprom
	cbnz	w0, LBB0_23
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=2
	ldr	w8, [sp, #24]
	ldr	w9, [x20, x25, lsl #2]
	cmp	w8, w9
	b.eq	LBB0_17
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=2
	mov	x0, x19
	mov	x1, x23
	bl	_dev_err
	b	LBB0_17
LBB0_21:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	w24, #0
	add	x25, x25, #1
	add	x22, x22, #1
	cmp	x25, x26
	b.ne	LBB0_15
	b	LBB0_25
LBB0_22:
	ldr	x9, [x26]
	b	LBB0_8
LBB0_23:
	mov	x24, x0
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_25
LBB0_24:
	mov	w24, #0
LBB0_25:
	ldr	x8, [sp, #40]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_28
; %bb.26:
	mov	x0, x24
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_27:
	mov	x24, x0
	b	LBB0_25
LBB0_28:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_MICNG_EE_START,8,3             ; @MICNG_EE_START
	.comm	_MICNG_EE_END,8,3               ; @MICNG_EE_END
	.comm	_MICNG_EETAG_END0,8,3           ; @MICNG_EETAG_END0
	.comm	_MICNG_EETAG_END1,8,3           ; @MICNG_EETAG_END1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reached EOEE @ Tag = %04x Length = %3d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"eeprom write error\n"

l_.str.2:                               ; @.str.2
	.asciz	"Timeout polling eeprom\n"

	.no_dead_strip	_WriteEEProm
.subsections_via_symbols
