	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ali1535_setup
_ali1535_setup:                         ## @ali1535_setup
	.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
	movq	%rdi, %r14
	callq	_pci_enable_device
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_15:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	_SMBBA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ali1535_offset@GOTPCREL(%rip), %r15
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_pci_read_config_word
	movzbl	(%r15), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_dbg
	movq	_ALI1535_SMB_IOSIZE@GOTPCREL(%rip), %r12
	xorl	%eax, %eax
	subl	(%r12), %eax
	xorl	%ebx, %ebx
	movzwl	(%r15), %ecx
	andl	%eax, %ecx
	movl	%ecx, (%r15)
	je	LBB0_3
## %bb.4:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_pci_resource_flags
	movq	_IORESOURCE_IO@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_pci_resource_start
	movzbl	%al, %eax
	addl	(%r15), %eax
	jmp	LBB0_7
LBB0_3:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_warn
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_6:
	movl	(%r15), %eax
LBB0_7:
	movq	_ali1535_smba@GOTPCREL(%rip), %r15
	movb	%al, (%r15)
	movl	(%r12), %esi
	movq	_ali1535_driver@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movzbl	%al, %edi
	callq	_acpi_check_region
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_15
## %bb.8:
	movzbl	(%r15), %edi
	movl	(%r12), %esi
	movl	(%r13), %edx
	callq	_request_region
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movq	_SMBCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-41(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_byte
	movq	_ALI1535_SMBIO_EN@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	testb	%al, -41(%rbp)
	je	LBB0_11
## %bb.12:
	movq	_SMBHSTCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-41(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_byte
	testb	$1, -41(%rbp)
	jne	LBB0_16
## %bb.13:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_14
LBB0_9:
	movzbl	(%r15), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_11:
	leaq	L_.str.4(%rip), %rsi
LBB0_14:
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movzbl	(%r15), %edi
	movl	(%r12), %esi
	callq	_release_region
	jmp	LBB0_15
LBB0_16:
	movq	_SMBCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$32, %edx
	callq	_pci_write_config_byte
	movq	_SMBREV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-41(%rbp), %rdx
	movq	%r14, %rdi
	callq	_pci_read_config_byte
	movzbl	-41(%rbp), %edx
	leaq	L_.str.6(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_dbg
	movzbl	(%r15), %edx
	leaq	L_.str.7(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ALI1535_smb can't enable device\n"

	.comm	_SMBBA,4,2                      ## @SMBBA
	.comm	_ali1535_offset,4,2             ## @ali1535_offset
L_.str.1:                               ## @.str.1
	.asciz	"ALI1535_smb is at offset 0x%04x\n"

	.comm	_ALI1535_SMB_IOSIZE,4,2         ## @ALI1535_SMB_IOSIZE
L_.str.2:                               ## @.str.2
	.asciz	"ALI1535_smb region uninitialized - upgrade BIOS?\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_IORESOURCE_IO,4,2              ## @IORESOURCE_IO
	.comm	_ali1535_smba,1,0               ## @ali1535_smba
	.comm	_ali1535_driver,4,2             ## @ali1535_driver
L_.str.3:                               ## @.str.3
	.asciz	"ALI1535_smb region 0x%lx already in use!\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_SMBCFG,4,2                     ## @SMBCFG
	.comm	_ALI1535_SMBIO_EN,1,0           ## @ALI1535_SMBIO_EN
L_.str.4:                               ## @.str.4
	.asciz	"SMB device not enabled - upgrade BIOS?\n"

	.comm	_SMBHSTCFG,4,2                  ## @SMBHSTCFG
L_.str.5:                               ## @.str.5
	.asciz	"SMBus controller not enabled - upgrade BIOS?\n"

	.comm	_SMBCLK,4,2                     ## @SMBCLK
	.comm	_SMBREV,4,2                     ## @SMBREV
L_.str.6:                               ## @.str.6
	.asciz	"SMBREV = 0x%X\n"

L_.str.7:                               ## @.str.7
	.asciz	"ALI1535_smba = 0x%lx\n"

	.no_dead_strip	_ali1535_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ali1535_setup
_ali1535_setup:                         ; @ali1535_setup
	.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_enable_device
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_17
LBB0_2:
Lloh2:
	adrp	x8, _SMBBA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SMBBA@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x20, _ali1535_offset@GOTPAGE
Lloh6:
	ldr	x20, [x20, _ali1535_offset@GOTPAGEOFF]
	mov	x0, x19
	mov	x2, x20
	bl	_pci_read_config_word
	ldrb	w2, [x20]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh9:
	adrp	x21, _ALI1535_SMB_IOSIZE@GOTPAGE
Lloh10:
	ldr	x21, [x21, _ALI1535_SMB_IOSIZE@GOTPAGEOFF]
	ldr	w8, [x21]
	neg	w8, w8
	ldrh	w9, [x20]
	ands	w8, w8, w9
	str	w8, [x20]
	b.eq	LBB0_5
; %bb.3:
	mov	x0, x19
	mov	w1, #0
	bl	_pci_resource_flags
Lloh11:
	adrp	x8, _IORESOURCE_IO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IORESOURCE_IO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.4:
	mov	x0, x19
	mov	w1, #0
	bl	_pci_resource_start
	ldr	w8, [x20]
	add	w8, w8, w0
	b	LBB0_8
LBB0_5:
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_17
LBB0_7:
	ldr	w8, [x20]
LBB0_8:
Lloh18:
	adrp	x22, _ali1535_smba@GOTPAGE
Lloh19:
	ldr	x22, [x22, _ali1535_smba@GOTPAGEOFF]
	strb	w8, [x22]
	ldr	w1, [x21]
Lloh20:
	adrp	x23, _ali1535_driver@GOTPAGE
Lloh21:
	ldr	x23, [x23, _ali1535_driver@GOTPAGEOFF]
	ldr	w2, [x23]
	and	w0, w8, #0xff
	bl	_acpi_check_region
	mov	x20, x0
	cbnz	w0, LBB0_17
; %bb.9:
	ldrb	w0, [x22]
	ldr	w1, [x21]
	ldr	w2, [x23]
	bl	_request_region
	cbz	w0, LBB0_13
; %bb.10:
Lloh22:
	adrp	x8, _SMBCFG@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SMBCFG@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	add	x2, sp, #15
	mov	x0, x19
	bl	_pci_read_config_byte
	ldrb	w8, [sp, #15]
Lloh25:
	adrp	x9, _ALI1535_SMBIO_EN@GOTPAGE
Lloh26:
	ldr	x9, [x9, _ALI1535_SMBIO_EN@GOTPAGEOFF]
	ldrb	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.11:
Lloh27:
	adrp	x8, _SMBHSTCFG@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SMBHSTCFG@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	add	x2, sp, #15
	mov	x0, x19
	bl	_pci_read_config_byte
	ldrb	w8, [sp, #15]
	tbnz	w8, #0, LBB0_16
; %bb.12:
Lloh30:
	adrp	x1, l_.str.5@PAGE
Lloh31:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_15
LBB0_13:
	ldrb	w8, [x22]
	str	x8, [sp]
Lloh32:
	adrp	x1, l_.str.3@PAGE
Lloh33:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
Lloh34:
	adrp	x8, _EBUSY@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_6
LBB0_14:
Lloh36:
	adrp	x1, l_.str.4@PAGE
Lloh37:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_15:
	mov	x0, x19
	bl	_dev_err
Lloh38:
	adrp	x8, _ENODEV@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	neg	w20, w8
	ldrb	w0, [x22]
	ldr	w1, [x21]
	bl	_release_region
	b	LBB0_17
LBB0_16:
Lloh41:
	adrp	x8, _SMBCLK@GOTPAGE
Lloh42:
	ldr	x8, [x8, _SMBCLK@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #32
	bl	_pci_write_config_byte
Lloh44:
	adrp	x8, _SMBREV@GOTPAGE
Lloh45:
	ldr	x8, [x8, _SMBREV@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	add	x2, sp, #15
	mov	x0, x19
	bl	_pci_read_config_byte
	ldrb	w2, [sp, #15]
Lloh47:
	adrp	x1, l_.str.6@PAGE
Lloh48:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	ldrb	w2, [x22]
Lloh49:
	adrp	x1, l_.str.7@PAGE
Lloh50:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	mov	w20, #0
LBB0_17:
	mov	x0, x20
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ALI1535_smb can't enable device\n"

	.comm	_SMBBA,4,2                      ; @SMBBA
	.comm	_ali1535_offset,4,2             ; @ali1535_offset
l_.str.1:                               ; @.str.1
	.asciz	"ALI1535_smb is at offset 0x%04x\n"

	.comm	_ALI1535_SMB_IOSIZE,4,2         ; @ALI1535_SMB_IOSIZE
l_.str.2:                               ; @.str.2
	.asciz	"ALI1535_smb region uninitialized - upgrade BIOS?\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_IORESOURCE_IO,4,2              ; @IORESOURCE_IO
	.comm	_ali1535_smba,1,0               ; @ali1535_smba
	.comm	_ali1535_driver,4,2             ; @ali1535_driver
l_.str.3:                               ; @.str.3
	.asciz	"ALI1535_smb region 0x%lx already in use!\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_SMBCFG,4,2                     ; @SMBCFG
	.comm	_ALI1535_SMBIO_EN,1,0           ; @ALI1535_SMBIO_EN
l_.str.4:                               ; @.str.4
	.asciz	"SMB device not enabled - upgrade BIOS?\n"

	.comm	_SMBHSTCFG,4,2                  ; @SMBHSTCFG
l_.str.5:                               ; @.str.5
	.asciz	"SMBus controller not enabled - upgrade BIOS?\n"

	.comm	_SMBCLK,4,2                     ; @SMBCLK
	.comm	_SMBREV,4,2                     ; @SMBREV
l_.str.6:                               ; @.str.6
	.asciz	"SMBREV = 0x%X\n"

l_.str.7:                               ; @.str.7
	.asciz	"ALI1535_smba = 0x%lx\n"

	.no_dead_strip	_ali1535_setup
.subsections_via_symbols
