	.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, %r15
	movq	_ENODEV@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_SMBBA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ali1535_smba@GOTPCREL(%rip), %r14
	movq	%r14, %rdx
	callq	_pci_read_config_word
	movq	_ALI1535_SMB_IOSIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movl	%esi, %eax
	negl	%eax
	movzwl	(%r14), %edi
	andl	%eax, %edi
	movl	%edi, (%r14)
	je	LBB0_1
## %bb.2:
	movq	_ali1535_driver@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	callq	_acpi_check_region
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:
	movl	(%r14), %edi
	movl	(%r12), %esi
	movl	(%r13), %edx
	callq	_request_region
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:
	movq	_SMBCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-41(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_byte
	movq	_ALI1535_SMBIO_EN@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	testb	%al, -41(%rbp)
	je	LBB0_6
## %bb.7:
	movq	_SMBHSTCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-41(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_byte
	testb	$1, -41(%rbp)
	jne	LBB0_11
## %bb.8:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_9
LBB0_1:
	negl	%ebx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_warn
	jmp	LBB0_10
LBB0_4:
	movl	(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_10
LBB0_6:
	leaq	L_.str.2(%rip), %rsi
LBB0_9:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movl	(%r14), %edi
	movl	(%r12), %esi
	callq	_release_region
	jmp	LBB0_10
LBB0_11:
	movq	_SMBCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$32, %edx
	callq	_pci_write_config_byte
	movq	_SMBREV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-41(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_byte
	movzbl	-41(%rbp), %edx
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	movl	(%r14), %edx
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	xorl	%ebx, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_SMBBA,4,2                      ## @SMBBA
	.comm	_ali1535_smba,4,2               ## @ali1535_smba
	.comm	_ALI1535_SMB_IOSIZE,4,2         ## @ALI1535_SMB_IOSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ALI1535_smb region uninitialized - upgrade BIOS?\n"

	.comm	_ali1535_driver,4,2             ## @ali1535_driver
L_.str.1:                               ## @.str.1
	.asciz	"ALI1535_smb region 0x%x already in use!\n"

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

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

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

L_.str.5:                               ## @.str.5
	.asciz	"ALI1535_smba = 0x%X\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
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x8, _SMBBA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SMBBA@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x20, _ali1535_smba@GOTPAGE
Lloh7:
	ldr	x20, [x20, _ali1535_smba@GOTPAGEOFF]
	mov	x2, x20
	bl	_pci_read_config_word
Lloh8:
	adrp	x22, _ALI1535_SMB_IOSIZE@GOTPAGE
Lloh9:
	ldr	x22, [x22, _ALI1535_SMB_IOSIZE@GOTPAGEOFF]
	ldr	w1, [x22]
	neg	w8, w1
	ldrh	w9, [x20]
	ands	w0, w8, w9
	str	w0, [x20]
	b.eq	LBB0_6
; %bb.1:
Lloh10:
	adrp	x23, _ali1535_driver@GOTPAGE
Lloh11:
	ldr	x23, [x23, _ali1535_driver@GOTPAGEOFF]
	ldr	w2, [x23]
	bl	_acpi_check_region
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.2:
	ldr	w0, [x20]
	ldr	w1, [x22]
	ldr	w2, [x23]
	bl	_request_region
	cbz	w0, LBB0_7
; %bb.3:
Lloh12:
	adrp	x8, _SMBCFG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SMBCFG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	x2, sp, #15
	mov	x0, x19
	bl	_pci_read_config_byte
	ldrb	w8, [sp, #15]
Lloh15:
	adrp	x9, _ALI1535_SMBIO_EN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _ALI1535_SMBIO_EN@GOTPAGEOFF]
	ldrb	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.4:
Lloh17:
	adrp	x8, _SMBHSTCFG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SMBHSTCFG@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	add	x2, sp, #15
	mov	x0, x19
	bl	_pci_read_config_byte
	ldrb	w8, [sp, #15]
	tbnz	w8, #0, LBB0_10
; %bb.5:
Lloh20:
	adrp	x1, l_.str.3@PAGE
Lloh21:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_9
LBB0_6:
	neg	w21, w21
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
	b	LBB0_12
LBB0_7:
	ldr	w8, [x20]
	str	x8, [sp]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_11
LBB0_8:
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	mov	x0, x19
	bl	_dev_err
	ldr	w0, [x20]
	ldr	w1, [x22]
	bl	_release_region
	b	LBB0_11
LBB0_10:
Lloh28:
	adrp	x8, _SMBCLK@GOTPAGE
Lloh29:
	ldr	x8, [x8, _SMBCLK@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #32
	bl	_pci_write_config_byte
Lloh31:
	adrp	x8, _SMBREV@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SMBREV@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	add	x2, sp, #15
	mov	x0, x19
	bl	_pci_read_config_byte
	ldrb	w2, [sp, #15]
Lloh34:
	adrp	x1, l_.str.4@PAGE
Lloh35:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	ldr	w2, [x20]
Lloh36:
	adrp	x1, l_.str.5@PAGE
Lloh37:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
LBB0_11:
	mov	w21, #0
LBB0_12:
	mov	x0, x21
	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 AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_SMBBA,4,2                      ; @SMBBA
	.comm	_ali1535_smba,4,2               ; @ali1535_smba
	.comm	_ALI1535_SMB_IOSIZE,4,2         ; @ALI1535_SMB_IOSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ALI1535_smb region uninitialized - upgrade BIOS?\n"

	.comm	_ali1535_driver,4,2             ; @ali1535_driver
l_.str.1:                               ; @.str.1
	.asciz	"ALI1535_smb region 0x%x already in use!\n"

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

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

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

l_.str.5:                               ; @.str.5
	.asciz	"ALI1535_smba = 0x%X\n"

	.no_dead_strip	_ali1535_setup
.subsections_via_symbols
