	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lpc_ich_init_spi
_lpc_ich_init_spi:                      ## @lpc_ich_init_spi
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_pci_get_drvdata
	movq	%rax, %rbx
	movq	_intel_spi_res@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$8, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movq	_lpc_chipset_info@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, (%r14)
	cmpl	$128, %eax
	je	LBB0_8
## %bb.4:
	cmpl	$130, %eax
	je	LBB0_10
## %bb.5:
	cmpl	$129, %eax
	jne	LBB0_17
## %bb.6:
	movq	_SPIBASE_BYT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_dword
	movl	-44(%rbp), %eax
	movq	_SPIBASE_BYT_EN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_13
## %bb.7:
	movq	_SPIBASE_BYT_SZ@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	subl	(%rcx), %edx
	andl	%edx, %eax
	movl	%eax, (%r13)
	movl	(%rcx), %ecx
	addl	%ecx, %eax
	decl	%eax
	movl	%eax, 4(%r13)
	jmp	LBB0_13
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_10:
	movl	$13, %edi
	xorl	%esi, %esi
	callq	_PCI_DEVFN
	movl	%eax, %ebx
	movl	$13, %edi
	movl	$2, %esi
	callq	_PCI_DEVFN
	movq	8(%r15), %r12
	movq	%r12, %rdi
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	movl	%eax, %ebx
	movl	$225, %edx
	xorl	%ecx, %ecx
	callq	_pci_bus_write_config_byte
	movq	_PCI_BASE_ADDRESS_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-44(%rbp), %rcx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_pci_bus_read_config_dword
	movl	-44(%rbp), %eax
	cmpl	$-1, %eax
	je	LBB0_12
## %bb.11:
	andl	$-16, %eax
	movl	%eax, (%r13)
	movq	_SPIBASE_APL_SZ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%ecx, %eax
	decl	%eax
	movl	%eax, 4(%r13)
	movq	_BCR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_pci_bus_read_config_dword
	movq	_BCR_WPD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	andl	-48(%rbp), %eax
	setne	%cl
	movl	%ecx, 4(%r14)
LBB0_12:
	movq	%r12, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movl	$225, %edx
	movl	$1, %ecx
	callq	_pci_bus_write_config_byte
	jmp	LBB0_13
LBB0_8:
	movq	_RCBABASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_dword
	movl	-56(%rbp), %edi
	testb	$1, %dil
	je	LBB0_13
## %bb.9:
	movq	_SPIBASE_LPT_SZ@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_round_down
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, -44(%rbp)
	movq	_SPIBASE_LPT@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movl	%eax, (%r13)
	movl	(%rbx), %ecx
	addl	%ecx, %eax
	decl	%eax
	movl	%eax, 4(%r13)
	movq	_BCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_dword
	movq	_BCR_WPD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	andl	-48(%rbp), %eax
	setne	%cl
	movl	%ecx, 4(%r14)
LBB0_13:
	cmpl	$0, (%r13)
	je	LBB0_14
## %bb.15:
	movq	_lpc_ich_spi_cell@GOTPCREL(%rip), %rdx
	movq	%r14, 8(%rdx)
	movl	$8, (%rdx)
	movq	_PLATFORM_DEVID_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	$0, (%rsp)
	movq	%r15, %rdi
	movl	$1, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_mfd_add_devices
	jmp	LBB0_16
LBB0_14:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_17:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_intel_spi_res,8,3              ## @intel_spi_res
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_lpc_chipset_info,8,3           ## @lpc_chipset_info
	.comm	_SPIBASE_BYT,4,2                ## @SPIBASE_BYT
	.comm	_SPIBASE_BYT_EN,4,2             ## @SPIBASE_BYT_EN
	.comm	_SPIBASE_BYT_SZ,4,2             ## @SPIBASE_BYT_SZ
	.comm	_RCBABASE,4,2                   ## @RCBABASE
	.comm	_SPIBASE_LPT_SZ,4,2             ## @SPIBASE_LPT_SZ
	.comm	_SPIBASE_LPT,4,2                ## @SPIBASE_LPT
	.comm	_BCR,4,2                        ## @BCR
	.comm	_BCR_WPD,4,2                    ## @BCR_WPD
	.comm	_PCI_BASE_ADDRESS_0,4,2         ## @PCI_BASE_ADDRESS_0
	.comm	_SPIBASE_APL_SZ,4,2             ## @SPIBASE_APL_SZ
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_lpc_ich_spi_cell,16,3          ## @lpc_ich_spi_cell
	.comm	_PLATFORM_DEVID_NONE,4,2        ## @PLATFORM_DEVID_NONE
	.no_dead_strip	_lpc_ich_init_spi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lpc_ich_init_spi
_lpc_ich_init_spi:                      ; @lpc_ich_init_spi
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x0
	bl	_pci_get_drvdata
	mov	x21, x0
Lloh0:
	adrp	x8, _intel_spi_res@GOTPAGE
Lloh1:
	ldr	x8, [x8, _intel_spi_res@GOTPAGEOFF]
Lloh2:
	ldr	x24, [x8]
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #8
	bl	_devm_kzalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x20, x0
Lloh6:
	adrp	x8, _lpc_chipset_info@GOTPAGE
Lloh7:
	ldr	x8, [x8, _lpc_chipset_info@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	ldr	x9, [x21]
	ldr	w8, [x8, x9, lsl #2]
	str	w8, [x0]
	cmp	w8, #128
	b.eq	LBB0_10
; %bb.2:
	cmp	w8, #130
	b.eq	LBB0_7
; %bb.3:
	cmp	w8, #129
	b.ne	LBB0_15
; %bb.4:
Lloh9:
	adrp	x8, _SPIBASE_BYT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SPIBASE_BYT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
Lloh12:
	adrp	x9, _SPIBASE_BYT_EN@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SPIBASE_BYT_EN@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.5:
Lloh15:
	adrp	x9, _SPIBASE_BYT_SZ@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SPIBASE_BYT_SZ@GOTPAGEOFF]
	ldr	w10, [x9]
	neg	w10, w10
	and	w8, w8, w10
	str	w8, [x24]
	ldr	w9, [x9]
	add	w8, w8, w9
	sub	w8, w8, #1
	str	w8, [x24, #4]
	b	LBB0_12
LBB0_6:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_16
LBB0_7:
	mov	w0, #13
	mov	w1, #0
	bl	_PCI_DEVFN
	mov	x21, x0
	mov	w0, #13
	mov	w1, #2
	bl	_PCI_DEVFN
	mov	x23, x0
	ldr	x22, [x19, #8]
	mov	x0, x22
	mov	x1, x21
	mov	w2, #225
	mov	w3, #0
	bl	_pci_bus_write_config_byte
Lloh19:
	adrp	x8, _PCI_BASE_ADDRESS_0@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PCI_BASE_ADDRESS_0@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	x0, x22
	mov	x1, x23
	bl	_pci_bus_read_config_dword
	ldr	w8, [sp, #12]
	cmn	w8, #1
	b.eq	LBB0_9
; %bb.8:
	and	w8, w8, #0xfffffff0
	str	w8, [x24]
Lloh22:
	adrp	x9, _SPIBASE_APL_SZ@GOTPAGE
Lloh23:
	ldr	x9, [x9, _SPIBASE_APL_SZ@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	add	w8, w8, w9
	sub	w8, w8, #1
	str	w8, [x24, #4]
Lloh25:
	adrp	x8, _BCR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BCR@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	add	x3, sp, #4
	mov	x0, x22
	mov	x1, x23
	bl	_pci_bus_read_config_dword
	ldr	w8, [sp, #4]
Lloh28:
	adrp	x9, _BCR_WPD@GOTPAGE
Lloh29:
	ldr	x9, [x9, _BCR_WPD@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, ne
	str	w8, [x20, #4]
LBB0_9:
	mov	x0, x22
	mov	x1, x21
	mov	w2, #225
	mov	w3, #1
	bl	_pci_bus_write_config_byte
	b	LBB0_12
LBB0_10:
Lloh31:
	adrp	x8, _RCBABASE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _RCBABASE@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w0, [sp, #8]
	tbz	w0, #0, LBB0_12
; %bb.11:
Lloh34:
	adrp	x21, _SPIBASE_LPT_SZ@GOTPAGE
Lloh35:
	ldr	x21, [x21, _SPIBASE_LPT_SZ@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_round_down
	str	w0, [sp, #12]
Lloh36:
	adrp	x8, _SPIBASE_LPT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _SPIBASE_LPT@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	add	w8, w8, w0
	str	w8, [x24]
	ldr	w9, [x21]
	add	w8, w8, w9
	sub	w8, w8, #1
	str	w8, [x24, #4]
Lloh39:
	adrp	x8, _BCR@GOTPAGE
Lloh40:
	ldr	x8, [x8, _BCR@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	add	x2, sp, #4
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #4]
Lloh42:
	adrp	x9, _BCR_WPD@GOTPAGE
Lloh43:
	ldr	x9, [x9, _BCR_WPD@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w8, ne
	str	w8, [x20, #4]
LBB0_12:
	ldr	w8, [x24]
	cbz	w8, LBB0_14
; %bb.13:
Lloh45:
	adrp	x2, _lpc_ich_spi_cell@GOTPAGE
Lloh46:
	ldr	x2, [x2, _lpc_ich_spi_cell@GOTPAGEOFF]
	str	x20, [x2, #8]
	mov	w8, #8
	str	w8, [x2]
Lloh47:
	adrp	x8, _PLATFORM_DEVID_NONE@GOTPAGE
Lloh48:
	ldr	x8, [x8, _PLATFORM_DEVID_NONE@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w3, #1
	mov	x4, #0
	mov	w5, #0
	mov	x6, #0
	bl	_mfd_add_devices
	b	LBB0_17
LBB0_14:
Lloh50:
	adrp	x8, _ENODEV@GOTPAGE
Lloh51:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_16
LBB0_15:
Lloh52:
	adrp	x8, _EINVAL@GOTPAGE
Lloh53:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh52, Lloh53
	.cfi_endproc
                                        ; -- End function
	.comm	_intel_spi_res,8,3              ; @intel_spi_res
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_lpc_chipset_info,8,3           ; @lpc_chipset_info
	.comm	_SPIBASE_BYT,4,2                ; @SPIBASE_BYT
	.comm	_SPIBASE_BYT_EN,4,2             ; @SPIBASE_BYT_EN
	.comm	_SPIBASE_BYT_SZ,4,2             ; @SPIBASE_BYT_SZ
	.comm	_RCBABASE,4,2                   ; @RCBABASE
	.comm	_SPIBASE_LPT_SZ,4,2             ; @SPIBASE_LPT_SZ
	.comm	_SPIBASE_LPT,4,2                ; @SPIBASE_LPT
	.comm	_BCR,4,2                        ; @BCR
	.comm	_BCR_WPD,4,2                    ; @BCR_WPD
	.comm	_PCI_BASE_ADDRESS_0,4,2         ; @PCI_BASE_ADDRESS_0
	.comm	_SPIBASE_APL_SZ,4,2             ; @SPIBASE_APL_SZ
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_lpc_ich_spi_cell,16,3          ; @lpc_ich_spi_cell
	.comm	_PLATFORM_DEVID_NONE,4,2        ; @PLATFORM_DEVID_NONE
	.no_dead_strip	_lpc_ich_init_spi
.subsections_via_symbols
