	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_full_eeprom_fetch
_pvr2_full_eeprom_fetch:                ## @pvr2_full_eeprom_fetch
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_EEPROM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	movq	%rax, %rcx
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%r15), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_trace_eeprom
	movl	(%r15), %ebx
	movl	%ebx, %ecx
	shrb	$7, %cl
	sarl	%cl, %ebx
	movl	%ebx, %r14d
	movl	$256, %r12d                     ## imm = 0x100
	andl	$1, %r14d
	je	LBB0_4
## %bb.3:
	movq	_EEPROM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_4:
	leal	8(,%r14,8), %ecx
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_trace_eeprom
	movl	%ebx, -96(%rbp)
	movq	$0, -80(%rbp)
	incl	%r14d
	movl	%r14d, -92(%rbp)
	leaq	-104(%rbp), %rax
	movq	%rax, -88(%rbp)
	movl	%ebx, -72(%rbp)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)
	movq	_EEPROM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	je	LBB0_12
## %bb.5:
	movl	%r12d, -116(%rbp)               ## 4-byte Spill
	addq	$4, %r15
	movq	%r15, %r12
	xorl	%r14d, %r14d
	leaq	-96(%rbp), %r13
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	leal	16(%r14), %ecx
	movl	%eax, %r15d
	subl	%r14d, %r15d
	cmpl	%eax, %ecx
	movl	$16, %ecx
	cmovbel	%ecx, %r15d
	movl	-116(%rbp), %ecx                ## 4-byte Reload
	subl	%eax, %ecx
	addl	%r14d, %ecx
	testb	$1, %bl
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%ecx, -104(%rbp)
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	%ecx, %eax
	shrl	$8, %eax
	movl	%eax, -104(%rbp)
	movl	%ecx, -100(%rbp)
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	movl	%r15d, -68(%rbp)
	movl	%r14d, %eax
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	leaq	(%rcx,%rax,4), %rax
	movq	%rax, -64(%rbp)
	movq	%r13, %rdi
	callq	_ARRAY_SIZE
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_i2c_transfer
	cmpl	$2, %eax
	jne	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	addl	%r14d, %r15d
	movq	_EEPROM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%r15d, %r14d
	cmpl	%r15d, %eax
	ja	LBB0_7
	jmp	LBB0_12
LBB0_1:
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	callq	_pvr2_trace
	jmp	LBB0_12
LBB0_11:
	movq	_PVR2_TRACE_ERROR_LEGS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pvr2_trace
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	callq	_kfree
	xorl	%eax, %eax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movq	-112(%rbp), %rax                ## 8-byte Reload
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EEPROM_SIZE,4,2                ## @EEPROM_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_PVR2_TRACE_ERROR_LEGS,4,2      ## @PVR2_TRACE_ERROR_LEGS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate memory required to read eeprom"

L_.str.1:                               ## @.str.1
	.asciz	"Value for eeprom addr from controller was 0x%x"

L_.str.2:                               ## @.str.2
	.asciz	"Examining %d byte eeprom at location 0x%x using %d bit addressing"

	.comm	_I2C_M_RD,8,3                   ## @I2C_M_RD
L_.str.3:                               ## @.str.3
	.asciz	"eeprom fetch set offs err=%d"

	.no_dead_strip	_pvr2_full_eeprom_fetch
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_full_eeprom_fetch
_pvr2_full_eeprom_fetch:                ; @pvr2_full_eeprom_fetch
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	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, #72]
Lloh3:
	adrp	x22, _EEPROM_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _EEPROM_SIZE@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_kzalloc
	mov	x19, x0
	cbz	x0, LBB0_8
; %bb.1:
	ldr	w1, [x21]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_trace_eeprom
	ldr	w8, [x21]
	ubfx	w9, w8, #7, #1
	asr	w23, w8, w9
	ldr	w8, [x22]
	tst	w23, #0x1
	mov	w9, #256
	csel	w20, w9, w8, eq
	mov	w24, #16
	mov	w8, #8
	csel	x8, x8, x24, eq
	stp	x23, x8, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	w8, #1
	cinc	w25, w8, ne
	mov	x1, x20
	bl	_trace_eeprom
	stp	w23, w25, [sp, #24]
	add	x8, sp, #16
	stp	x8, xzr, [sp, #32]
	str	w23, [sp, #48]
Lloh12:
	adrp	x8, _I2C_M_RD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _I2C_M_RD@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	str	x8, [sp, #64]
	ldr	w8, [x22]
	cbz	w8, LBB0_10
; %bb.2:
	mov	w25, #0
	add	x21, x21, #4
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	w9, w25, #16
	sub	w10, w8, w25
	cmp	w9, w8
	csel	w26, w10, w24, hi
	sub	w8, w20, w8
	add	w8, w8, w25
	tbnz	w23, #0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w8, [sp, #16]
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	lsr	w9, w8, #8
	stp	w9, w8, [sp, #16]
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	str	w26, [sp, #52]
	add	x8, x19, w25, uxtw #2
	str	x8, [sp, #56]
	add	x0, sp, #24
	bl	_ARRAY_SIZE
	mov	x2, x0
	add	x1, sp, #24
	mov	x0, x21
	bl	_i2c_transfer
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #2
	b.ne	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x22]
	add	w25, w26, w25
	cmp	w8, w25
	b.hi	LBB0_3
	b	LBB0_10
LBB0_8:
Lloh15:
	adrp	x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_pvr2_trace
	b	LBB0_10
LBB0_9:
Lloh20:
	adrp	x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PVR2_TRACE_ERROR_LEGS@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	str	x0, [sp]
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x8
	bl	_pvr2_trace
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
LBB0_10:
	ldr	x8, [sp, #72]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x19
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_EEPROM_SIZE,4,2                ; @EEPROM_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_PVR2_TRACE_ERROR_LEGS,4,2      ; @PVR2_TRACE_ERROR_LEGS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate memory required to read eeprom"

l_.str.1:                               ; @.str.1
	.asciz	"Value for eeprom addr from controller was 0x%x"

l_.str.2:                               ; @.str.2
	.asciz	"Examining %d byte eeprom at location 0x%x using %d bit addressing"

	.comm	_I2C_M_RD,8,3                   ; @I2C_M_RD
l_.str.3:                               ; @.str.3
	.asciz	"eeprom fetch set offs err=%d"

	.no_dead_strip	_pvr2_full_eeprom_fetch
.subsections_via_symbols
