	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sky2_vpd_read
_sky2_vpd_read:                         ## @sky2_vpd_read
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%r8, %r8
	je	LBB0_4
## %bb.1:
	movq	%r8, %r14
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movq	%rdi, %r12
	movslq	%esi, %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_PCI_VPD_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r13, %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_sky2_pci_write16
	movq	%r12, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	callq	_sky2_vpd_wait
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_PCI_VPD_DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r13, %rsi
	movq	%r12, %rdi
	callq	_sky2_pci_read32
	movl	%eax, -44(%rbp)
	movl	$4, %edi
	movq	%r14, %rsi
	callq	_min
	movq	%rbx, %rdi
	leaq	-44(%rbp), %rsi
	movl	%eax, %edx
	callq	_memcpy
	addl	$4, %r15d
	addq	$4, %rbx
	addq	$-4, %r14
	jne	LBB0_2
LBB0_4:
	xorl	%eax, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_VPD_ADDR,8,3               ## @PCI_VPD_ADDR
	.comm	_PCI_VPD_DATA,8,3               ## @PCI_VPD_DATA
	.no_dead_strip	_sky2_vpd_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sky2_vpd_read
_sky2_vpd_read:                         ; @sky2_vpd_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	cbz	x4, LBB0_4
; %bb.1:
	mov	x19, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	sxtw	x24, w22
Lloh0:
	adrp	x25, _PCI_VPD_ADDR@GOTPAGE
Lloh1:
	ldr	x25, [x25, _PCI_VPD_ADDR@GOTPAGEOFF]
Lloh2:
	adrp	x26, _PCI_VPD_DATA@GOTPAGE
Lloh3:
	ldr	x26, [x26, _PCI_VPD_DATA@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	add	x1, x8, x24
	mov	x0, x23
	mov	x2, x20
	bl	_sky2_pci_write16
	mov	x0, x23
	mov	x1, x22
	mov	w2, #0
	bl	_sky2_vpd_wait
	cbnz	w0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x26]
	add	x1, x8, x24
	mov	x0, x23
	bl	_sky2_pci_read32
	str	w0, [sp, #12]
	mov	w0, #4
	mov	x1, x19
	bl	_min
	mov	x2, x0
	add	x1, sp, #12
	mov	x0, x21
	bl	_memcpy
	add	w20, w20, #4
	add	x21, x21, #4
	subs	x19, x19, #4
	b.ne	LBB0_2
LBB0_4:
	mov	w0, #0
LBB0_5:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_VPD_ADDR,8,3               ; @PCI_VPD_ADDR
	.comm	_PCI_VPD_DATA,8,3               ; @PCI_VPD_DATA
	.no_dead_strip	_sky2_vpd_read
.subsections_via_symbols
