	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function eeprom_write
_eeprom_write:                          ## @eeprom_write
	.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	%edx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	(%rdi), %r13
	movl	$0, -48(%rbp)
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_eeprom_wait_ready
	testl	%eax, %eax
	js	LBB0_22
## %bb.1:
	movq	_LBCIF_CONTROL_REGISTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_LBCIF_CONTROL_LBCIF_ENABLE@GOTPCREL(%rip), %rcx
	movq	_LBCIF_CONTROL_I2C_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	(%rcx), %edx
	movq	%r13, %rdi
	callq	_pci_write_config_byte
	testq	%rax, %rax
	je	LBB0_2
## %bb.23:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_22
LBB0_2:
	movq	_MAX_NUM_WRITE_RETRIES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movl	$0, %eax
	jle	LBB0_14
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_LBCIF_ADDRESS_REGISTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r14d, %edx
	callq	_pci_write_config_dword
	testq	%rax, %rax
	jne	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_LBCIF_DATA_REGISTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r15d, %edx
	callq	_pci_write_config_byte
	testq	%rax, %rax
	jne	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	leaq	-52(%rbp), %rsi
	callq	_eeprom_wait_ready
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-52(%rbp), %eax
	movq	_LBCIF_STATUS_GENERAL_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r12), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_13
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_LBCIF_STATUS_ACK_ERROR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	$10, %edi
	callq	_udelay
	incl	%ebx
	movq	_MAX_NUM_WRITE_RETRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jl	LBB0_4
LBB0_13:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_7:
	xorl	%eax, %eax
	jmp	LBB0_22
LBB0_11:
	movl	$1, %eax
LBB0_14:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$10, %edi
	callq	_udelay
	movq	_LBCIF_ADDRESS_REGISTER@GOTPCREL(%rip), %r12
	movq	_LBCIF_DATA_REGISTER@GOTPCREL(%rip), %r15
	leaq	-48(%rbp), %rbx
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_15:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
                                        ##       Child Loop BB0_17 Depth 3
	movq	_LBCIF_CONTROL_REGISTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_LBCIF_CONTROL_LBCIF_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_pci_write_config_byte
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_15 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_17 Depth 3
	movl	(%r12), %esi
	movq	%r13, %rdi
	movl	%r14d, %edx
	callq	_pci_write_config_dword
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_15 Depth=1
                                        ##     Parent Loop BB0_16 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	(%r15), %esi
	movq	%r13, %rdi
	movq	%rbx, %rdx
	callq	_pci_read_config_dword
	movl	-48(%rbp), %eax
	testl	$65536, %eax                    ## imm = 0x10000
	je	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=2
	testl	$262144, %eax                   ## imm = 0x40000
	jne	LBB0_16
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=1
	cmpq	$0, -72(%rbp)                   ## 8-byte Folded Reload
	movl	$0, %ecx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	cmovnel	%ecx, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	andl	$65280, %eax                    ## imm = 0xFF00
	cmpl	$49152, %eax                    ## imm = 0xC000
	jne	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leal	1(%rcx), %eax
	cmpl	$10000, %ecx                    ## imm = 0x2710
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_15
LBB0_21:
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	xorl	%ecx, %ecx
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	cmovnel	%ecx, %eax
LBB0_22:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LBCIF_CONTROL_REGISTER,4,2     ## @LBCIF_CONTROL_REGISTER
	.comm	_LBCIF_CONTROL_LBCIF_ENABLE,4,2 ## @LBCIF_CONTROL_LBCIF_ENABLE
	.comm	_LBCIF_CONTROL_I2C_WRITE,4,2    ## @LBCIF_CONTROL_I2C_WRITE
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MAX_NUM_WRITE_RETRIES,4,2      ## @MAX_NUM_WRITE_RETRIES
	.comm	_LBCIF_ADDRESS_REGISTER,4,2     ## @LBCIF_ADDRESS_REGISTER
	.comm	_LBCIF_DATA_REGISTER,4,2        ## @LBCIF_DATA_REGISTER
	.comm	_LBCIF_STATUS_GENERAL_ERROR,4,2 ## @LBCIF_STATUS_GENERAL_ERROR
	.comm	_LBCIF_STATUS_ACK_ERROR,4,2     ## @LBCIF_STATUS_ACK_ERROR
	.no_dead_strip	_eeprom_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function eeprom_write
_eeprom_write:                          ; @eeprom_write
	.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	x21, x2
	mov	x19, x1
	mov	x22, x0
	ldr	x20, [x0]
	str	wzr, [sp, #8]
	mov	x0, x20
	mov	x1, #0
	bl	_eeprom_wait_ready
	tbnz	w0, #31, LBB0_20
; %bb.1:
Lloh0:
	adrp	x23, _LBCIF_CONTROL_REGISTER@GOTPAGE
Lloh1:
	ldr	x23, [x23, _LBCIF_CONTROL_REGISTER@GOTPAGEOFF]
Lloh2:
	adrp	x24, _LBCIF_CONTROL_LBCIF_ENABLE@GOTPAGE
Lloh3:
	ldr	x24, [x24, _LBCIF_CONTROL_LBCIF_ENABLE@GOTPAGEOFF]
	ldr	w1, [x23]
	ldr	w8, [x24]
Lloh4:
	adrp	x9, _LBCIF_CONTROL_I2C_WRITE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _LBCIF_CONTROL_I2C_WRITE@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x20
	bl	_pci_write_config_byte
	cbz	x0, LBB0_3
; %bb.2:
Lloh7:
	adrp	x8, _EIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_20
LBB0_3:
Lloh10:
	adrp	x27, _MAX_NUM_WRITE_RETRIES@GOTPAGE
Lloh11:
	ldr	x27, [x27, _MAX_NUM_WRITE_RETRIES@GOTPAGEOFF]
	ldr	w8, [x27]
Lloh12:
	adrp	x25, _LBCIF_ADDRESS_REGISTER@GOTPAGE
Lloh13:
	ldr	x25, [x25, _LBCIF_ADDRESS_REGISTER@GOTPAGEOFF]
Lloh14:
	adrp	x26, _LBCIF_DATA_REGISTER@GOTPAGE
Lloh15:
	ldr	x26, [x26, _LBCIF_DATA_REGISTER@GOTPAGEOFF]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.4:
	mov	w28, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x25]
	mov	x0, x20
	mov	x2, x19
	bl	_pci_write_config_dword
	cbnz	x0, LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w1, [x26]
	mov	x0, x20
	mov	x2, x21
	bl	_pci_write_config_byte
	cbnz	x0, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x1, sp, #12
	mov	x0, x20
	bl	_eeprom_wait_ready
	tbnz	w0, #31, LBB0_21
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [sp, #12]
Lloh16:
	adrp	x9, _LBCIF_STATUS_GENERAL_ERROR@GOTPAGE
Lloh17:
	ldr	x9, [x9, _LBCIF_STATUS_GENERAL_ERROR@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x22]
	ldr	x9, [x9]
	cbz	x9, LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh19:
	adrp	x9, _LBCIF_STATUS_ACK_ERROR@GOTPAGE
Lloh20:
	ldr	x9, [x9, _LBCIF_STATUS_ACK_ERROR@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_22
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	w0, #10
	bl	_udelay
	add	w28, w28, #1
	ldr	w8, [x27]
	cmp	w28, w8
	b.lt	LBB0_5
LBB0_12:
	mov	w22, #0
LBB0_13:
	mov	w0, #10
	bl	_udelay
	mov	w27, #0
	mov	w28, #10000
LBB0_14:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_15 Depth 2
                                        ;       Child Loop BB0_16 Depth 3
	ldr	w1, [x23]
	ldr	w2, [x24]
	mov	x0, x20
	bl	_pci_write_config_byte
	mov	x21, x0
LBB0_15:                                ;   Parent Loop BB0_14 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_16 Depth 3
	ldr	w1, [x25]
	mov	x0, x20
	mov	x2, x19
	bl	_pci_write_config_dword
LBB0_16:                                ;   Parent Loop BB0_14 Depth=1
                                        ;     Parent Loop BB0_15 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w1, [x26]
	add	x2, sp, #8
	mov	x0, x20
	bl	_pci_read_config_dword
	ldr	w8, [sp, #8]
	tbz	w8, #16, LBB0_16
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=2
	tbnz	w8, #18, LBB0_15
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
	cmp	x21, #0
	csel	w22, w22, wzr, eq
	and	w8, w8, #0xff00
	cmp	w8, #12, lsl #12                ; =49152
	ccmp	w27, w28, #4, eq
	add	w27, w27, #1
	b.ne	LBB0_14
; %bb.19:
Lloh22:
	adrp	x8, _EIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	cmp	w22, #0
	csneg	w0, wzr, w8, ne
LBB0_20:
	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
LBB0_21:
	mov	w0, #0
	b	LBB0_20
LBB0_22:
	mov	w22, #1
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_LBCIF_CONTROL_REGISTER,4,2     ; @LBCIF_CONTROL_REGISTER
	.comm	_LBCIF_CONTROL_LBCIF_ENABLE,4,2 ; @LBCIF_CONTROL_LBCIF_ENABLE
	.comm	_LBCIF_CONTROL_I2C_WRITE,4,2    ; @LBCIF_CONTROL_I2C_WRITE
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MAX_NUM_WRITE_RETRIES,4,2      ; @MAX_NUM_WRITE_RETRIES
	.comm	_LBCIF_ADDRESS_REGISTER,4,2     ; @LBCIF_ADDRESS_REGISTER
	.comm	_LBCIF_DATA_REGISTER,4,2        ; @LBCIF_DATA_REGISTER
	.comm	_LBCIF_STATUS_GENERAL_ERROR,4,2 ; @LBCIF_STATUS_GENERAL_ERROR
	.comm	_LBCIF_STATUS_ACK_ERROR,4,2     ; @LBCIF_STATUS_ACK_ERROR
	.no_dead_strip	_eeprom_write
.subsections_via_symbols
