	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i801_add_tco
_i801_add_tco:                          ## @i801_add_tco
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r14
	xorl	%eax, %eax
	callq	_acpi_has_watchdog
	testq	%rax, %rax
	je	LBB0_1
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_FEATURE_TCO_SPT@GOTPCREL(%rip), %rax
	movq	_FEATURE_TCO_CNL@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	orl	(%rax), %ecx
	testl	%ecx, (%rbx)
	je	LBB0_8
## %bb.2:
	movq	_TCOBASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-108(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_dword
	movq	_TCOCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-104(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_dword
	movq	_TCOCTL_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -104(%rbp)
	je	LBB0_8
## %bb.3:
	leaq	-96(%rbp), %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movq	_ICH_RES_IO_TCO@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	-108(%rbp), %ecx
	andl	$-2, %ecx
	shlq	$4, %rax
	movl	%ecx, -96(%rbp,%rax)
	addl	$31, %ecx
	movl	%ecx, -92(%rbp,%rax)
	movq	_IORESOURCE_IO@GOTPCREL(%rip), %r13
	movq	(%r13), %rcx
	movq	%rcx, -88(%rbp,%rax)
	movl	8(%r14), %edi
	callq	_PCI_SLOT
	movl	%eax, %edi
	movl	$2, %esi
	callq	_PCI_DEVFN
	movl	%eax, %r15d
	movl	4(%r14), %edi
	movq	_ACPIBASE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-112(%rbp), %rcx
	movl	%r15d, %esi
	callq	_pci_bus_read_config_dword
	movq	_ICH_RES_IO_SMI@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	-112(%rbp), %ecx
	andl	$-2, %ecx
	movq	_ACPIBASE_SMI_OFF@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	leal	(%rcx,%rdx), %esi
	shlq	$4, %rax
	movl	%esi, -96(%rbp,%rax)
	addl	%edx, %ecx
	addl	$3, %ecx
	movl	%ecx, -92(%rbp,%rax)
	movq	(%r13), %rcx
	movq	%rcx, -88(%rbp,%rax)
	movl	4(%r14), %edi
	movq	_ACPICTRL@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	leaq	-100(%rbp), %rcx
	movl	%r15d, %esi
	callq	_pci_bus_read_config_dword
	movq	_ACPICTRL_EN@GOTPCREL(%rip), %rax
	movl	-100(%rbp), %ecx
	orl	(%rax), %ecx
	movl	%ecx, -100(%rbp)
	movl	4(%r14), %edi
	movl	(%r13), %edx
	movl	%r15d, %esi
	callq	_pci_bus_write_config_dword
	movl	(%r12), %eax
	testl	%eax, (%rbx)
	je	LBB0_5
## %bb.4:
	leaq	-96(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_i801_add_tco_cnl
	jmp	LBB0_6
LBB0_5:
	leaq	-96(%rbp), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_i801_add_tco_spt
LBB0_6:
	movl	%eax, 4(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_warn
	jmp	LBB0_8
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FEATURE_TCO_SPT,4,2            ## @FEATURE_TCO_SPT
	.comm	_FEATURE_TCO_CNL,4,2            ## @FEATURE_TCO_CNL
	.comm	_TCOBASE,4,2                    ## @TCOBASE
	.comm	_TCOCTL,4,2                     ## @TCOCTL
	.comm	_TCOCTL_EN,4,2                  ## @TCOCTL_EN
	.comm	_ICH_RES_IO_TCO,8,3             ## @ICH_RES_IO_TCO
	.comm	_IORESOURCE_IO,8,3              ## @IORESOURCE_IO
	.comm	_ACPIBASE,4,2                   ## @ACPIBASE
	.comm	_ICH_RES_IO_SMI,8,3             ## @ICH_RES_IO_SMI
	.comm	_ACPIBASE_SMI_OFF,4,2           ## @ACPIBASE_SMI_OFF
	.comm	_ACPICTRL,4,2                   ## @ACPICTRL
	.comm	_ACPICTRL_EN,4,2                ## @ACPICTRL_EN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to create iTCO device\n"

	.no_dead_strip	_i801_add_tco
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i801_add_tco
_i801_add_tco:                          ; @i801_add_tco
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	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
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	x19, [x0, #8]
	bl	_acpi_has_watchdog
	cbz	x0, LBB0_3
LBB0_1:
	ldur	x8, [x29, #-56]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.2:
	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
	add	sp, sp, #144
	ret
LBB0_3:
	ldr	w8, [x20]
Lloh6:
	adrp	x9, _FEATURE_TCO_SPT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _FEATURE_TCO_SPT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x22, _FEATURE_TCO_CNL@GOTPAGE
Lloh10:
	ldr	x22, [x22, _FEATURE_TCO_CNL@GOTPAGEOFF]
	ldr	w10, [x22]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_1
; %bb.4:
Lloh11:
	adrp	x8, _TCOBASE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TCOBASE@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	x0, x19
	bl	_pci_read_config_dword
Lloh14:
	adrp	x8, _TCOCTL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TCOCTL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
Lloh17:
	adrp	x9, _TCOCTL_EN@GOTPAGE
Lloh18:
	ldr	x9, [x9, _TCOCTL_EN@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_1
; %bb.5:
	add	x23, sp, #24
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #48
	bl	_memset
Lloh20:
	adrp	x8, _ICH_RES_IO_TCO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ICH_RES_IO_TCO@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	ldr	w9, [sp, #16]
	and	w9, w9, #0xfffffffe
	add	x8, x23, x8, lsl #4
	add	w10, w9, #31
	stp	w9, w10, [x8]
Lloh23:
	adrp	x24, _IORESOURCE_IO@GOTPAGE
Lloh24:
	ldr	x24, [x24, _IORESOURCE_IO@GOTPAGEOFF]
	ldr	x9, [x24]
	str	x9, [x8, #8]
	ldr	w0, [x19, #8]
	bl	_PCI_SLOT
	mov	w1, #2
	bl	_PCI_DEVFN
	mov	x21, x0
	ldr	w0, [x19, #4]
Lloh25:
	adrp	x8, _ACPIBASE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ACPIBASE@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	add	x3, sp, #20
	mov	x1, x21
	bl	_pci_bus_read_config_dword
Lloh28:
	adrp	x8, _ICH_RES_IO_SMI@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ICH_RES_IO_SMI@GOTPAGEOFF]
Lloh30:
	ldr	x8, [x8]
	ldr	w9, [sp, #20]
	and	w9, w9, #0xfffffffe
Lloh31:
	adrp	x10, _ACPIBASE_SMI_OFF@GOTPAGE
Lloh32:
	ldr	x10, [x10, _ACPIBASE_SMI_OFF@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
	add	w9, w9, w10
	add	x8, x23, x8, lsl #4
	add	w10, w9, #3
	stp	w9, w10, [x8]
	ldr	x9, [x24]
	str	x9, [x8, #8]
	ldr	w0, [x19, #4]
Lloh34:
	adrp	x23, _ACPICTRL@GOTPAGE
Lloh35:
	ldr	x23, [x23, _ACPICTRL@GOTPAGEOFF]
	ldr	w2, [x23]
	add	x3, sp, #8
	mov	x1, x21
	bl	_pci_bus_read_config_dword
Lloh36:
	adrp	x8, _ACPICTRL_EN@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ACPICTRL_EN@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	ldr	w9, [sp, #8]
	orr	w3, w9, w8
	str	w3, [sp, #8]
	ldr	w0, [x19, #4]
	ldr	w2, [x23]
	mov	x1, x21
	bl	_pci_bus_write_config_dword
	ldr	w8, [x20]
	ldr	w9, [x22]
	add	x2, sp, #24
	mov	x0, x20
	mov	x1, x19
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	bl	_i801_add_tco_cnl
	b	LBB0_8
LBB0_7:
	bl	_i801_add_tco_spt
LBB0_8:
	str	w0, [x20, #4]
	bl	_IS_ERR
	cbz	x0, LBB0_1
; %bb.9:
Lloh39:
	adrp	x1, l_.str@PAGE
Lloh40:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
	b	LBB0_1
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_FEATURE_TCO_SPT,4,2            ; @FEATURE_TCO_SPT
	.comm	_FEATURE_TCO_CNL,4,2            ; @FEATURE_TCO_CNL
	.comm	_TCOBASE,4,2                    ; @TCOBASE
	.comm	_TCOCTL,4,2                     ; @TCOCTL
	.comm	_TCOCTL_EN,4,2                  ; @TCOCTL_EN
	.comm	_ICH_RES_IO_TCO,8,3             ; @ICH_RES_IO_TCO
	.comm	_IORESOURCE_IO,8,3              ; @IORESOURCE_IO
	.comm	_ACPIBASE,4,2                   ; @ACPIBASE
	.comm	_ICH_RES_IO_SMI,8,3             ; @ICH_RES_IO_SMI
	.comm	_ACPIBASE_SMI_OFF,4,2           ; @ACPIBASE_SMI_OFF
	.comm	_ACPICTRL,4,2                   ; @ACPICTRL
	.comm	_ACPICTRL_EN,4,2                ; @ACPICTRL_EN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to create iTCO device\n"

	.no_dead_strip	_i801_add_tco
.subsections_via_symbols
