	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function faraday_res_to_memcfg
_faraday_res_to_memcfg:                 ## @faraday_res_to_memcfg
	.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
	movl	%edi, -48(%rbp)
	movl	%esi, -44(%rbp)
	addl	$-128, %esi
	cmpl	$12, %esi
	jae	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movl	%edi, %r15d
	movslq	%esi, %rax
	leaq	l_switch.table.faraday_res_to_memcfg(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %r12d
	movq	_FARADAY_PCI_MEMSIZE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r12d
	movq	_FARADAY_PCI_MEMBASE_MASK@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	movl	%ebx, %eax
	notl	%eax
	testl	%edi, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
	movl	(%r13), %ebx
LBB0_4:
	andl	%r15d, %ebx
	orl	%r12d, %ebx
	leaq	L_.str.1(%rip), %rdi
	leaq	-48(%rbp), %rsi
	leaq	-44(%rbp), %rdx
	movl	%ebx, %ecx
	callq	_pr_debug
	movl	%ebx, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FARADAY_PCI_MEMSIZE_1MB,4,2    ## @FARADAY_PCI_MEMSIZE_1MB
	.comm	_FARADAY_PCI_MEMSIZE_2MB,4,2    ## @FARADAY_PCI_MEMSIZE_2MB
	.comm	_FARADAY_PCI_MEMSIZE_4MB,4,2    ## @FARADAY_PCI_MEMSIZE_4MB
	.comm	_FARADAY_PCI_MEMSIZE_8MB,4,2    ## @FARADAY_PCI_MEMSIZE_8MB
	.comm	_FARADAY_PCI_MEMSIZE_16MB,4,2   ## @FARADAY_PCI_MEMSIZE_16MB
	.comm	_FARADAY_PCI_MEMSIZE_32MB,4,2   ## @FARADAY_PCI_MEMSIZE_32MB
	.comm	_FARADAY_PCI_MEMSIZE_64MB,4,2   ## @FARADAY_PCI_MEMSIZE_64MB
	.comm	_FARADAY_PCI_MEMSIZE_128MB,4,2  ## @FARADAY_PCI_MEMSIZE_128MB
	.comm	_FARADAY_PCI_MEMSIZE_256MB,4,2  ## @FARADAY_PCI_MEMSIZE_256MB
	.comm	_FARADAY_PCI_MEMSIZE_512MB,4,2  ## @FARADAY_PCI_MEMSIZE_512MB
	.comm	_FARADAY_PCI_MEMSIZE_1GB,4,2    ## @FARADAY_PCI_MEMSIZE_1GB
	.comm	_FARADAY_PCI_MEMSIZE_2GB,4,2    ## @FARADAY_PCI_MEMSIZE_2GB
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_FARADAY_PCI_MEMSIZE_SHIFT,4,2  ## @FARADAY_PCI_MEMSIZE_SHIFT
	.comm	_FARADAY_PCI_MEMBASE_MASK,4,2   ## @FARADAY_PCI_MEMBASE_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"truncated PCI memory base\n"

L_.str.1:                               ## @.str.1
	.asciz	"Translated pci base @%pap, size %pap to config %08x\n"

	.no_dead_strip	_faraday_res_to_memcfg
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.faraday_res_to_memcfg
l_switch.table.faraday_res_to_memcfg:
	.quad	_FARADAY_PCI_MEMSIZE_8MB
	.quad	_FARADAY_PCI_MEMSIZE_64MB
	.quad	_FARADAY_PCI_MEMSIZE_512MB
	.quad	_FARADAY_PCI_MEMSIZE_4MB
	.quad	_FARADAY_PCI_MEMSIZE_32MB
	.quad	_FARADAY_PCI_MEMSIZE_2MB
	.quad	_FARADAY_PCI_MEMSIZE_2GB
	.quad	_FARADAY_PCI_MEMSIZE_256MB
	.quad	_FARADAY_PCI_MEMSIZE_1MB
	.quad	_FARADAY_PCI_MEMSIZE_1GB
	.quad	_FARADAY_PCI_MEMSIZE_16MB
	.quad	_FARADAY_PCI_MEMSIZE_128MB

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function faraday_res_to_memcfg
_faraday_res_to_memcfg:                 ; @faraday_res_to_memcfg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	stp	w1, w0, [sp, #8]
	sub	w8, w1, #128
	cmp	w8, #12
	b.hs	LBB0_4
; %bb.1:
	mov	x19, x2
	mov	x20, x0
Lloh0:
	adrp	x9, l_switch.table.faraday_res_to_memcfg@PAGE
Lloh1:
	add	x9, x9, l_switch.table.faraday_res_to_memcfg@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w8, [x8]
Lloh2:
	adrp	x9, _FARADAY_PCI_MEMSIZE_SHIFT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _FARADAY_PCI_MEMSIZE_SHIFT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	lsl	w21, w8, w9
Lloh5:
	adrp	x22, _FARADAY_PCI_MEMBASE_MASK@GOTPAGE
Lloh6:
	ldr	x22, [x22, _FARADAY_PCI_MEMBASE_MASK@GOTPAGEOFF]
	ldr	w8, [x22]
	bics	wzr, w0, w8
	b.eq	LBB0_3
; %bb.2:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
	ldr	w8, [x22]
LBB0_3:
	and	w8, w8, w20
	orr	w20, w8, w21
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x3, x20
	bl	_pr_debug
	mov	w0, #0
	str	w20, [x19]
	b	LBB0_5
LBB0_4:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_FARADAY_PCI_MEMSIZE_1MB,4,2    ; @FARADAY_PCI_MEMSIZE_1MB
	.comm	_FARADAY_PCI_MEMSIZE_2MB,4,2    ; @FARADAY_PCI_MEMSIZE_2MB
	.comm	_FARADAY_PCI_MEMSIZE_4MB,4,2    ; @FARADAY_PCI_MEMSIZE_4MB
	.comm	_FARADAY_PCI_MEMSIZE_8MB,4,2    ; @FARADAY_PCI_MEMSIZE_8MB
	.comm	_FARADAY_PCI_MEMSIZE_16MB,4,2   ; @FARADAY_PCI_MEMSIZE_16MB
	.comm	_FARADAY_PCI_MEMSIZE_32MB,4,2   ; @FARADAY_PCI_MEMSIZE_32MB
	.comm	_FARADAY_PCI_MEMSIZE_64MB,4,2   ; @FARADAY_PCI_MEMSIZE_64MB
	.comm	_FARADAY_PCI_MEMSIZE_128MB,4,2  ; @FARADAY_PCI_MEMSIZE_128MB
	.comm	_FARADAY_PCI_MEMSIZE_256MB,4,2  ; @FARADAY_PCI_MEMSIZE_256MB
	.comm	_FARADAY_PCI_MEMSIZE_512MB,4,2  ; @FARADAY_PCI_MEMSIZE_512MB
	.comm	_FARADAY_PCI_MEMSIZE_1GB,4,2    ; @FARADAY_PCI_MEMSIZE_1GB
	.comm	_FARADAY_PCI_MEMSIZE_2GB,4,2    ; @FARADAY_PCI_MEMSIZE_2GB
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_FARADAY_PCI_MEMSIZE_SHIFT,4,2  ; @FARADAY_PCI_MEMSIZE_SHIFT
	.comm	_FARADAY_PCI_MEMBASE_MASK,4,2   ; @FARADAY_PCI_MEMBASE_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"truncated PCI memory base\n"

l_.str.1:                               ; @.str.1
	.asciz	"Translated pci base @%pap, size %pap to config %08x\n"

	.no_dead_strip	_faraday_res_to_memcfg
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.faraday_res_to_memcfg
l_switch.table.faraday_res_to_memcfg:
	.quad	_FARADAY_PCI_MEMSIZE_8MB
	.quad	_FARADAY_PCI_MEMSIZE_64MB
	.quad	_FARADAY_PCI_MEMSIZE_512MB
	.quad	_FARADAY_PCI_MEMSIZE_4MB
	.quad	_FARADAY_PCI_MEMSIZE_32MB
	.quad	_FARADAY_PCI_MEMSIZE_2MB
	.quad	_FARADAY_PCI_MEMSIZE_2GB
	.quad	_FARADAY_PCI_MEMSIZE_256MB
	.quad	_FARADAY_PCI_MEMSIZE_1MB
	.quad	_FARADAY_PCI_MEMSIZE_1GB
	.quad	_FARADAY_PCI_MEMSIZE_16MB
	.quad	_FARADAY_PCI_MEMSIZE_128MB

.subsections_via_symbols
