	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_aml8726_identify_soc           ## -- Begin function aml8726_identify_soc
	.p2align	4, 0x90
_aml8726_identify_soc:                  ## @aml8726_identify_soc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	leaq	-16(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_fdtbus_bs_tag@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%edi, -12(%rbp)
	movq	_AML_SOC_CBUS_BASE_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1048576, %edx                  ## imm = 0x100000
	xorl	%ecx, %ecx
	movq	%rbx, %r8
	callq	_bus_space_map
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_panic
LBB0_2:
	movq	_AML_SOC_HW_REV_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-16(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_bus_read_4
	movq	_aml8726_soc_hw_rev@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_AML_SOC_METAL_REV_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_bus_read_4
	movq	_aml8726_soc_metal_rev@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movl	-16(%rbp), %esi
	movl	-12(%rbp), %edi
	movl	$1048576, %edx                  ## imm = 0x100000
	callq	_bus_space_unmap
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fdtbus_bs_tag,4,2              ## @fdtbus_bs_tag
	.comm	_AML_SOC_CBUS_BASE_ADDR,4,2     ## @AML_SOC_CBUS_BASE_ADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not allocate resource for SoC identification\n"

	.comm	_AML_SOC_HW_REV_REG,4,2         ## @AML_SOC_HW_REV_REG
	.comm	_aml8726_soc_hw_rev,8,3         ## @aml8726_soc_hw_rev
	.comm	_AML_SOC_METAL_REV_REG,4,2      ## @AML_SOC_METAL_REV_REG
	.comm	_aml8726_soc_metal_rev,8,3      ## @aml8726_soc_metal_rev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_aml8726_identify_soc           ; -- Begin function aml8726_identify_soc
	.p2align	2
_aml8726_identify_soc:                  ; @aml8726_identify_soc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #32
	.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
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh0:
	adrp	x8, _fdtbus_bs_tag@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fdtbus_bs_tag@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	str	w0, [sp, #12]
Lloh3:
	adrp	x8, _AML_SOC_CBUS_BASE_ADDR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AML_SOC_CBUS_BASE_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x4, sp, #8
	mov	w2, #1048576
	mov	w3, #0
	bl	_bus_space_map
	cbz	w0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_panic
LBB0_2:
Lloh8:
	adrp	x8, _AML_SOC_HW_REV_REG@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AML_SOC_HW_REV_REG@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_bus_read_4
Lloh11:
	adrp	x8, _aml8726_soc_hw_rev@GOTPAGE
Lloh12:
	ldr	x8, [x8, _aml8726_soc_hw_rev@GOTPAGEOFF]
Lloh13:
	str	x0, [x8]
Lloh14:
	adrp	x8, _AML_SOC_METAL_REV_REG@GOTPAGE
Lloh15:
	ldr	x8, [x8, _AML_SOC_METAL_REV_REG@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_bus_read_4
Lloh17:
	adrp	x8, _aml8726_soc_metal_rev@GOTPAGE
Lloh18:
	ldr	x8, [x8, _aml8726_soc_metal_rev@GOTPAGEOFF]
Lloh19:
	str	x0, [x8]
	ldp	w1, w0, [sp, #8]
	mov	w2, #1048576
	bl	_bus_space_unmap
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #32
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_fdtbus_bs_tag,4,2              ; @fdtbus_bs_tag
	.comm	_AML_SOC_CBUS_BASE_ADDR,4,2     ; @AML_SOC_CBUS_BASE_ADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not allocate resource for SoC identification\n"

	.comm	_AML_SOC_HW_REV_REG,4,2         ; @AML_SOC_HW_REV_REG
	.comm	_aml8726_soc_hw_rev,8,3         ; @aml8726_soc_hw_rev
	.comm	_AML_SOC_METAL_REV_REG,4,2      ; @AML_SOC_METAL_REV_REG
	.comm	_aml8726_soc_metal_rev,8,3      ; @aml8726_soc_metal_rev
.subsections_via_symbols
