	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fdt_localbus_reg_decode
_fdt_localbus_reg_decode:               ## @fdt_localbus_reg_decode
	.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	$56, %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, %r15
	movl	%edi, %ebx
	callq	_OF_parent
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movl	%eax, %edi
	callq	_fdt_addrsize_cells
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_18
LBB0_2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %r12d
	addl	-48(%rbp), %r12d
	shll	$2, %r12d
	leaq	L_.str(%rip), %rsi
	leaq	-80(%rbp), %rcx
	movl	%ebx, %edi
	movl	%r12d, %edx
	callq	_OF_getprop_alloc_multi
	movl	%eax, %ebx
	movl	-48(%rbp), %esi
	movslq	-44(%rbp), %rdx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_debugf
	movslq	%r12d, %rdx
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_debugf
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jle	LBB0_18
## %bb.3:
	movq	-80(%rbp), %r13
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	$4, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	_MV_LOCALBUS_MAX_BANKS@GOTPCREL(%rip), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	8(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	movl	%r12d, %edx
	callq	_device_printf
	decl	%ebx
	je	LBB0_16
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_fdt_data_get
	movl	%eax, %r12d
	cmpl	(%r14), %eax
	jge	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r15), %rax
	movslq	%r12d, %rcx
	movq	%r15, %r14
	leaq	(%rcx,%rcx,2), %r15
	cmpl	$0, 16(%rax,%r15,8)
	je	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%r12d, (%rax)
	addq	$4, %r13
	movl	-48(%rbp), %esi
	decl	%esi
	movl	-44(%rbp), %edx
	movq	%r13, %rdi
	leaq	-64(%rbp), %rcx
	leaq	-88(%rbp), %r8
	callq	_fdt_data_to_res
	testl	%eax, %eax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r14), %rax
	movq	-88(%rbp), %r8
	cmpq	%r8, (%rax,%r15,8)
	jge	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	8(%r14), %edi
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_8
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	8(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	%r12d, %edx
	callq	_device_printf
	jmp	LBB0_14
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movslq	-48(%rbp), %rcx
	movslq	-44(%rbp), %rdx
	addq	%rcx, %rdx
	leaq	-4(%r13,%rdx,4), %r13
	movq	-64(%rbp), %rdx
	addq	8(%rax,%r15,8), %rdx
	movq	%rdx, -64(%rbp)
	leaq	(%r8,%rdx), %r15
	decq	%r15
	leaq	L_.str.6(%rip), %rdi
	movl	%r12d, %esi
	movq	%r15, %rcx
	xorl	%eax, %eax
	callq	_debugf
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	-64(%rbp), %rcx
	movq	-88(%rbp), %r9
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %r8
	callq	_resource_list_add
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %r15
	movq	_MV_LOCALBUS_MAX_BANKS@GOTPCREL(%rip), %r14
	decl	%ebx
	jne	LBB0_4
LBB0_16:
	xorl	%ebx, %ebx
	jmp	LBB0_17
LBB0_10:
	movl	%eax, %ebx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_resource_list_free
LBB0_17:
	movq	-80(%rbp), %rdi
	callq	_OF_prop_free
	movl	%ebx, %eax
LBB0_18:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENXIO,4,2                      ## @ENXIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg"

L_.str.1:                               ## @.str.1
	.asciz	"addr_cells = %d, size_cells = %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"tuples = %d, tuple size = %d\n"

	.comm	_MV_LOCALBUS_MAX_BANKS,4,2      ## @MV_LOCALBUS_MAX_BANKS
L_.str.3:                               ## @.str.3
	.asciz	"bank number [%d] out of range\n"

L_.str.4:                               ## @.str.4
	.asciz	"device [%d]: missing memory mapping\n"

L_.str.5:                               ## @.str.5
	.asciz	"device [%d]: not enough memory reserved\n"

L_.str.6:                               ## @.str.6
	.asciz	"reg addr bank = %d, start = %lx, end = %lx, count = %lx\n"

	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.no_dead_strip	_fdt_localbus_reg_decode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fdt_localbus_reg_decode
_fdt_localbus_reg_decode:               ; @fdt_localbus_reg_decode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	bl	_OF_parent
	add	x1, sp, #20
	add	x2, sp, #16
	bl	_fdt_addrsize_cells
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENXIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	b	LBB0_17
LBB0_2:
	ldp	w9, w8, [sp, #16]
	add	w8, w9, w8
	lsl	w22, w8, #2
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x3, sp, #24
	mov	x0, x21
	mov	x2, x22
	bl	_OF_getprop_alloc_multi
	mov	x21, x0
	ldp	w2, w1, [sp, #16]
                                        ; kill: def $w2 killed $w2 def $x2
	sxtw	x2, w2
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_debugf
	sxtw	x2, w22
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_debugf
	cmp	w21, #1
	b.lt	LBB0_14
; %bb.3:
	ldr	x22, [sp, #24]
Lloh9:
	adrp	x26, _MV_LOCALBUS_MAX_BANKS@GOTPAGE
Lloh10:
	ldr	x26, [x26, _MV_LOCALBUS_MAX_BANKS@GOTPAGEOFF]
	add	x23, x19, #4
	mov	w24, #24
Lloh11:
	adrp	x27, l_.str.3@PAGE
Lloh12:
	add	x27, x27, l_.str.3@PAGEOFF
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x20, #8]
	mov	x1, x27
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x2, x28
	bl	_device_printf
	subs	w21, w21, #1
	b.eq	LBB0_13
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	w1, #1
	bl	_fdt_data_get
	mov	x28, x0
	ldr	w8, [x26]
	cmp	w0, w8
	b.ge	LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x20]
	smaddl	x8, w28, w24, x8
	ldr	w8, [x8, #16]
	cbz	w8, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	str	w28, [x19]
	add	x22, x22, #4
	ldp	w2, w8, [sp, #16]
	sub	w1, w8, #1
	add	x3, sp, #40
	add	x4, sp, #32
	mov	x0, x22
	bl	_fdt_data_to_res
	cbnz	w0, LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	sxtw	x9, w28
	ldr	x10, [x20]
	mul	x8, x9, x24
	ldr	x11, [x10, x8]
	ldr	x8, [sp, #32]
	cmp	x11, x8
	b.ge	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x20, #8]
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_5
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x20, #8]
Lloh15:
	adrp	x1, l_.str.4@PAGE
Lloh16:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_5
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	ldp	w12, w11, [sp, #16]
	add	w11, w11, w12
	sub	w11, w11, #1
	add	x22, x22, w11, sxtw #2
	madd	x9, x9, x24, x10
	ldr	x9, [x9, #8]
	ldr	x10, [sp, #40]
	add	x2, x10, x9
	add	x9, x8, x2
	str	x2, [sp, #40]
	sub	x25, x9, #1
	stp	x25, x8, [sp]
Lloh17:
	adrp	x0, l_.str.6@PAGE
Lloh18:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x1, x28
	bl	_debugf
Lloh19:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	ldr	w2, [x19]
	ldp	x5, x3, [sp, #32]
	mov	x0, x23
	mov	x4, x25
	bl	_resource_list_add
	subs	w21, w21, #1
	b.ne	LBB0_6
LBB0_13:
	mov	w25, #0
	b	LBB0_16
LBB0_14:
	mov	w25, #0
	b	LBB0_17
LBB0_15:
	mov	x25, x0
	mov	x0, x23
	bl	_resource_list_free
LBB0_16:
	ldr	x0, [sp, #24]
	bl	_OF_prop_free
LBB0_17:
	mov	x0, x25
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ENXIO,4,2                      ; @ENXIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg"

l_.str.1:                               ; @.str.1
	.asciz	"addr_cells = %d, size_cells = %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"tuples = %d, tuple size = %d\n"

	.comm	_MV_LOCALBUS_MAX_BANKS,4,2      ; @MV_LOCALBUS_MAX_BANKS
l_.str.3:                               ; @.str.3
	.asciz	"bank number [%d] out of range\n"

l_.str.4:                               ; @.str.4
	.asciz	"device [%d]: missing memory mapping\n"

l_.str.5:                               ; @.str.5
	.asciz	"device [%d]: not enough memory reserved\n"

l_.str.6:                               ; @.str.6
	.asciz	"reg addr bank = %d, start = %lx, end = %lx, count = %lx\n"

	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.no_dead_strip	_fdt_localbus_reg_decode
.subsections_via_symbols
