	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_fw_get_eeprom_data          ## -- Begin function hl_fw_get_eeprom_data
	.p2align	4, 0x90
_hl_fw_get_eeprom_data:                 ## @hl_fw_get_eeprom_data
	.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
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	$0, -72(%rbp)
	movq	(%rdi), %rax
	leaq	-44(%rbp), %rdx
	movq	%r14, %rsi
	callq	*16(%rax)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%rax, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_memset
	movq	_ARMCP_PACKET_EEPROM_DATA_GET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_ARMCP_PKT_CTL_OPCODE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %rdi
	callq	_cpu_to_le32
	movq	%rax, -64(%rbp)
	movl	-44(%rbp), %edi
	callq	_cpu_to_le64
	movl	%eax, -72(%rbp)
	movq	%r14, %rdi
	callq	_cpu_to_le32
	movq	%rax, -80(%rbp)
	movq	(%rbx), %rax
	movq	_HL_ARMCP_EEPROM_TIMEOUT_USEC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	-80(%rbp), %rsi
	leaq	-56(%rbp), %r8
	movq	%rbx, %rdi
	movl	$24, %edx
	callq	*(%rax)
	movl	%eax, %r13d
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	8(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_5
LBB0_1:
	movl	8(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_6
LBB0_4:
	movq	-56(%rbp), %rdi
	movq	%r14, %rsi
	callq	_min
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_memcpy
LBB0_5:
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	*8(%rax)
LBB0_6:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate DMA memory for ArmCP EEPROM packet\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ARMCP_PACKET_EEPROM_DATA_GET,8,3 ## @ARMCP_PACKET_EEPROM_DATA_GET
	.comm	_ARMCP_PKT_CTL_OPCODE_SHIFT,8,3 ## @ARMCP_PKT_CTL_OPCODE_SHIFT
	.comm	_HL_ARMCP_EEPROM_TIMEOUT_USEC,4,2 ## @HL_ARMCP_EEPROM_TIMEOUT_USEC
L_.str.1:                               ## @.str.1
	.asciz	"Failed to send ArmCP EEPROM packet, error %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_fw_get_eeprom_data          ; -- Begin function hl_fw_get_eeprom_data
	.p2align	2
_hl_fw_get_eeprom_data:                 ; @hl_fw_get_eeprom_data
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	str	xzr, [sp, #32]
	ldr	x8, [x0]
	ldr	x8, [x8, #16]
	add	x2, sp, #20
	mov	x1, x19
	blr	x8
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	mov	w1, #0
	mov	x2, x19
	bl	_memset
Lloh0:
	adrp	x8, _ARMCP_PACKET_EEPROM_DATA_GET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ARMCP_PACKET_EEPROM_DATA_GET@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _ARMCP_PKT_CTL_OPCODE_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ARMCP_PKT_CTL_OPCODE_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	lsl	x0, x8, x9
	bl	_cpu_to_le32
	str	x0, [sp, #40]
	ldr	w0, [sp, #20]
	bl	_cpu_to_le64
	str	w0, [sp, #32]
	mov	x0, x19
	bl	_cpu_to_le32
	str	x0, [sp, #24]
	ldr	x8, [x20]
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _HL_ARMCP_EEPROM_TIMEOUT_USEC@GOTPAGE
Lloh7:
	ldr	x9, [x9, _HL_ARMCP_EEPROM_TIMEOUT_USEC@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x9]
	add	x1, sp, #24
	add	x4, sp, #8
	mov	x0, x20
	mov	w2, #24
	blr	x8
	mov	x23, x0
	cbz	w0, LBB0_4
; %bb.2:
	ldr	w0, [x20, #8]
	str	x23, [sp]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_5
LBB0_3:
	ldr	w0, [x20, #8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_6
LBB0_4:
	ldr	x0, [sp, #8]
	mov	x1, x19
	bl	_min
	mov	x2, x0
	mov	x0, x22
	mov	x1, x21
	bl	_memcpy
LBB0_5:
	ldr	x8, [x20]
	ldr	x8, [x8, #8]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	blr	x8
LBB0_6:
	mov	x0, x23
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate DMA memory for ArmCP EEPROM packet\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ARMCP_PACKET_EEPROM_DATA_GET,8,3 ; @ARMCP_PACKET_EEPROM_DATA_GET
	.comm	_ARMCP_PKT_CTL_OPCODE_SHIFT,8,3 ; @ARMCP_PKT_CTL_OPCODE_SHIFT
	.comm	_HL_ARMCP_EEPROM_TIMEOUT_USEC,4,2 ; @HL_ARMCP_EEPROM_TIMEOUT_USEC
l_.str.1:                               ; @.str.1
	.asciz	"Failed to send ArmCP EEPROM packet, error %d\n"

.subsections_via_symbols
