	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipath_eeprom_internal_write
_ipath_eeprom_internal_write:           ## @ipath_eeprom_internal_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	%rdx, %r13
	movl	%esi, %r15d
	movq	%rdi, %r12
	callq	_ipath_i2c_type
	movq	%rax, %rcx
	movl	$1, %eax
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	testq	%rcx, %rcx
	je	LBB0_23
## %bb.1:
	testl	%ebx, %ebx
	jle	LBB0_2
## %bb.3:
	movq	_IPATH_NO_DEV@GOTPCREL(%rip), %rcx
	movq	_WRITE_CMD@GOTPCREL(%rip), %rdx
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
                                        ##     Child Loop BB0_19 Depth 2
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	cmpl	(%rcx), %esi
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	(%r15,%r15), %esi
	orl	(%rdx), %esi
	movq	%r12, %rdi
	callq	_i2c_startcmd
	testq	%rax, %rax
	je	LBB0_13
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	orl	(%rdx), %esi
	movq	%r12, %rdi
	callq	_i2c_startcmd
	testq	%rax, %rax
	jne	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_wr_byte
	testl	%eax, %eax
	jne	LBB0_11
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%ebx, %edi
	movl	$4, %esi
	callq	_min
	testl	%eax, %eax
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jle	LBB0_18
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %r15d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r13), %esi
	movq	%r12, %rdi
	callq	_wr_byte
	testl	%eax, %eax
	jne	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=2
	addq	$4, %r13
	incq	%r14
	cmpl	%r14d, %r15d
	jne	LBB0_15
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addl	%eax, %r15d
	subl	%eax, %ebx
	movl	%ebx, %r14d
	movq	%r12, %rdi
	callq	_stop_cmd
	movl	$-100, %ebx
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_READ_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	orl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_startcmd
	movq	%r12, %rdi
	testq	%rax, %rax
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=2
	callq	_stop_cmd
	incl	%ebx
	jne	LBB0_19
	jmp	LBB0_21
LBB0_22:                                ##   in Loop: Header=BB0_4 Depth=1
	callq	_rd_byte
	movq	%r12, %rdi
	callq	_stop_cmd
	xorl	%eax, %eax
	movl	%r14d, %ebx
	testl	%r14d, %r14d
	movq	_IPATH_NO_DEV@GOTPCREL(%rip), %rcx
	movq	_WRITE_CMD@GOTPCREL(%rip), %rdx
	jg	LBB0_4
	jmp	LBB0_23
LBB0_2:
	xorl	%eax, %eax
	jmp	LBB0_23
LBB0_21:
	leaq	L_.str.4(%rip), %rdi
LBB0_9:
	xorl	%eax, %eax
	callq	_ipath_dbg
	jmp	LBB0_12
LBB0_16:
	subl	%r14d, %ebx
	leaq	L_.str.3(%rip), %rdi
	movl	%r14d, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_ipath_dbg
LBB0_12:
	movq	%r12, %rdi
	callq	_stop_cmd
	movl	$1, %eax
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_ipath_dbg
	jmp	LBB0_12
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_9
LBB0_11:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_ipath_dev_err
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_IPATH_NO_DEV,4,2               ## @IPATH_NO_DEV
	.comm	_WRITE_CMD,4,2                  ## @WRITE_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to start cmd offset %u\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed EEPROM startcmd\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to write EEPROM address\n"

L_.str.3:                               ## @.str.3
	.asciz	"no ack after byte %u/%u (%u total remain)\n"

	.comm	_READ_CMD,4,2                   ## @READ_CMD
L_.str.4:                               ## @.str.4
	.asciz	"Did not get successful read to complete write\n"

	.no_dead_strip	_ipath_eeprom_internal_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipath_eeprom_internal_write
_ipath_eeprom_internal_write:           ; @ipath_eeprom_internal_write
	.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	x21, x3
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	bl	_ipath_i2c_type
	cbz	x0, LBB0_20
; %bb.1:
	cmp	w21, #1
	b.lt	LBB0_15
; %bb.2:
	mov	x23, x0
Lloh0:
	adrp	x26, _IPATH_NO_DEV@GOTPAGE
Lloh1:
	ldr	x26, [x26, _IPATH_NO_DEV@GOTPAGEOFF]
Lloh2:
	adrp	x10, _WRITE_CMD@GOTPAGE
Lloh3:
	ldr	x10, [x10, _WRITE_CMD@GOTPAGEOFF]
Lloh4:
	adrp	x27, _READ_CMD@GOTPAGE
Lloh5:
	ldr	x27, [x27, _READ_CMD@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
	ldr	w8, [x23]
	ldr	w9, [x26]
	cmp	w8, w9
	b.ne	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x10]
	orr	w1, w8, w20, lsl #1
	mov	x0, x19
	bl	_i2c_startcmd
	cbz	x0, LBB0_7
	b	LBB0_22
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x10]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_i2c_startcmd
	cbnz	x0, LBB0_23
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_wr_byte
	cbnz	w0, LBB0_24
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	w1, #4
	bl	_min
	mov	x24, x0
	cmp	w0, #1
	b.lt	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x28, #0
	mov	w25, w24
LBB0_9:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x22]
	mov	x0, x19
	bl	_wr_byte
	cbnz	w0, LBB0_17
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	add	x22, x22, #4
	add	x28, x28, #1
	cmp	w25, w28
	b.ne	LBB0_9
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w20, w24, w20
	sub	w21, w21, w24
	mov	x0, x19
	bl	_stop_cmd
	mov	w24, #-100
LBB0_12:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x23]
	ldr	w9, [x27]
	orr	w1, w9, w8
	mov	x0, x19
	bl	_i2c_startcmd
	cbz	x0, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	mov	x0, x19
	bl	_stop_cmd
	adds	w24, w24, #1
	b.lo	LBB0_12
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_rd_byte
	mov	x0, x19
	bl	_stop_cmd
	mov	w0, #0
	cmp	w21, #0
Lloh6:
	adrp	x10, _WRITE_CMD@GOTPAGE
Lloh7:
	ldr	x10, [x10, _WRITE_CMD@GOTPAGEOFF]
	b.gt	LBB0_3
	b	LBB0_21
LBB0_15:
	mov	w0, #0
	b	LBB0_21
LBB0_16:
Lloh8:
	adrp	x0, l_.str.4@PAGE
Lloh9:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_18
LBB0_17:
	mov	w8, w21
	sub	x8, x8, x28
	stp	x28, x24, [sp]
	str	x8, [sp, #16]
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_18:
	bl	_ipath_dbg
LBB0_19:
	mov	x0, x19
	bl	_stop_cmd
LBB0_20:
	mov	w0, #1
LBB0_21:
	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
LBB0_22:
	str	x20, [sp]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_18
LBB0_23:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_18
LBB0_24:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_ipath_dev_err
	b	LBB0_19
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_IPATH_NO_DEV,4,2               ; @IPATH_NO_DEV
	.comm	_WRITE_CMD,4,2                  ; @WRITE_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to start cmd offset %u\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed EEPROM startcmd\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to write EEPROM address\n"

l_.str.3:                               ; @.str.3
	.asciz	"no ack after byte %u/%u (%u total remain)\n"

	.comm	_READ_CMD,4,2                   ; @READ_CMD
l_.str.4:                               ; @.str.4
	.asciz	"Did not get successful read to complete write\n"

	.no_dead_strip	_ipath_eeprom_internal_write
.subsections_via_symbols
