	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_read_device_fw_version
_goya_read_device_fw_version:           ## @goya_read_device_fw_version
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	cmpl	$129, %esi
	je	LBB0_4
## %bb.1:
	movl	%esi, %edx
	cmpl	$128, %esi
	jne	LBB0_3
## %bb.2:
	movq	_mmUBOOT_VER_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	leaq	16(%rbx), %rcx
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_5
LBB0_4:
	movq	_mmPREBOOT_VER_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	leaq	24(%rbx), %rcx
	leaq	L_.str.1(%rip), %rdx
LBB0_5:
	movq	(%rcx), %r14
	movq	_SRAM_BASE_ADDR@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	notq	%rcx
	andq	%rax, %rcx
	movq	_SRAM_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_VERSION_MAX_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	subq	%rax, %rsi
	cmpq	%rsi, %rcx
	jge	LBB0_7
## %bb.6:
	movq	8(%rbx), %rdx
	movq	_SRAM_CFG_BAR_ID@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	addq	(%rdx,%rsi,8), %rcx
	movq	%r14, %rdi
	movq	%rcx, %rsi
	movq	%rax, %rdx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_memcpy_fromio                  ## TAILCALL
LBB0_3:
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_dev_warn                       ## TAILCALL
LBB0_7:
	movl	(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_strcpy                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_mmUBOOT_VER_OFFSET,4,2         ## @mmUBOOT_VER_OFFSET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"U-Boot"

	.comm	_mmPREBOOT_VER_OFFSET,4,2       ## @mmPREBOOT_VER_OFFSET
L_.str.1:                               ## @.str.1
	.asciz	"Preboot"

L_.str.2:                               ## @.str.2
	.asciz	"Undefined FW component: %d\n"

	.comm	_SRAM_BASE_ADDR,8,3             ## @SRAM_BASE_ADDR
	.comm	_SRAM_SIZE,8,3                  ## @SRAM_SIZE
	.comm	_VERSION_MAX_LEN,8,3            ## @VERSION_MAX_LEN
	.comm	_SRAM_CFG_BAR_ID,8,3            ## @SRAM_CFG_BAR_ID
L_.str.3:                               ## @.str.3
	.asciz	"%s version offset (0x%x) is above SRAM\n"

L_.str.4:                               ## @.str.4
	.asciz	"unavailable"

	.no_dead_strip	_goya_read_device_fw_version
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_read_device_fw_version
_goya_read_device_fw_version:           ; @goya_read_device_fw_version
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	cmp	w1, #129
	b.eq	LBB0_3
; %bb.1:
	mov	x2, x1
	cmp	w1, #128
	b.ne	LBB0_6
; %bb.2:
Lloh0:
	adrp	x8, _mmUBOOT_VER_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mmUBOOT_VER_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_RREG32
	add	x8, x19, #16
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _mmPREBOOT_VER_OFFSET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _mmPREBOOT_VER_OFFSET@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_RREG32
	add	x8, x19, #24
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_4:
	ldr	x20, [x8]
Lloh10:
	adrp	x8, _SRAM_BASE_ADDR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SRAM_BASE_ADDR@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	bic	x3, x0, x8
Lloh13:
	adrp	x8, _SRAM_SIZE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SRAM_SIZE@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x8]
Lloh16:
	adrp	x8, _VERSION_MAX_LEN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _VERSION_MAX_LEN@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	sub	x9, x9, x8
	cmp	x3, x9
	b.ge	LBB0_7
; %bb.5:
	ldr	x9, [x19, #8]
Lloh19:
	adrp	x10, _SRAM_CFG_BAR_ID@GOTPAGE
Lloh20:
	ldr	x10, [x10, _SRAM_CFG_BAR_ID@GOTPAGEOFF]
Lloh21:
	ldr	x10, [x10]
	ldr	x9, [x9, x10, lsl #3]
	add	x1, x9, x3
	mov	x0, x20
	mov	x2, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_memcpy_fromio
LBB0_6:
	ldr	w0, [x19]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_dev_warn
LBB0_7:
	ldr	w0, [x19]
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_strcpy
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_mmUBOOT_VER_OFFSET,4,2         ; @mmUBOOT_VER_OFFSET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"U-Boot"

	.comm	_mmPREBOOT_VER_OFFSET,4,2       ; @mmPREBOOT_VER_OFFSET
l_.str.1:                               ; @.str.1
	.asciz	"Preboot"

l_.str.2:                               ; @.str.2
	.asciz	"Undefined FW component: %d\n"

	.comm	_SRAM_BASE_ADDR,8,3             ; @SRAM_BASE_ADDR
	.comm	_SRAM_SIZE,8,3                  ; @SRAM_SIZE
	.comm	_VERSION_MAX_LEN,8,3            ; @VERSION_MAX_LEN
	.comm	_SRAM_CFG_BAR_ID,8,3            ; @SRAM_CFG_BAR_ID
l_.str.3:                               ; @.str.3
	.asciz	"%s version offset (0x%x) is above SRAM\n"

l_.str.4:                               ; @.str.4
	.asciz	"unavailable"

	.no_dead_strip	_goya_read_device_fw_version
.subsections_via_symbols
