	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ali15x3_setup
_ali15x3_setup:                         ## @ali15x3_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	_SMBATPC@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-41(%rbp), %rdx
	callq	_pci_read_config_byte
	movb	-41(%rbp), %al
	movq	_ALI15X3_LOCK@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	testb	%al, %cl
	je	LBB0_2
## %bb.1:
	notb	%cl
	andb	%cl, %al
	movb	%al, -41(%rbp)
	movl	(%rbx), %esi
	movzbl	%al, %edx
	movq	%r15, %rdi
	callq	_pci_write_config_byte
LBB0_2:
	movq	_SMBBA@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_ali15x3_smba@GOTPCREL(%rip), %r14
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_pci_read_config_word
	movq	_ALI15X3_SMB_IOSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%esi, %eax
	negl	%eax
	movl	(%r14), %ecx
	andl	%eax, %ecx
	movzwl	%cx, %edi
	movl	%edi, (%r14)
	movq	_force_addr@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ecx
	movl	%edi, %edx
	orl	%ecx, %edx
	jne	LBB0_5
## %bb.3:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_5:
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.6:
	andl	%eax, %ecx
	movl	%ecx, (%r14)
	movl	%ecx, %edi
LBB0_7:
	movq	_ali15x3_driver@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	callq	_acpi_check_region
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_9:
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	(%r14), %edi
	movq	_ALI15X3_SMB_IOSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	callq	_request_region
	testl	%eax, %eax
	je	LBB0_21
## %bb.12:
	cmpl	$0, (%rbx)
	je	LBB0_16
## %bb.13:
	movl	(%r14), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_info
	movq	_PCIBIOS_SUCCESSFUL@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	(%r13), %esi
	movl	(%r14), %edx
	movq	%r15, %rdi
	callq	_pci_write_config_word
	cmpq	%rax, %r12
	jne	LBB0_23
## %bb.14:
	movq	_PCIBIOS_SUCCESSFUL@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	(%r13), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_word
	cmpq	%rax, %r12
	jne	LBB0_23
## %bb.15:
	xorl	%eax, %eax
	movq	_ALI15X3_SMB_IOSIZE@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	andl	-48(%rbp), %eax
	cmpl	(%r14), %eax
	jne	LBB0_22
LBB0_16:
	movq	_SMBCOM@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-41(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_byte
	testb	$1, -41(%rbp)
	jne	LBB0_18
## %bb.17:
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_info
	movl	(%rbx), %esi
	movzbl	-41(%rbp), %edx
	orl	$1, %edx
	movq	%r15, %rdi
	callq	_pci_write_config_byte
LBB0_18:
	movq	_SMBHSTCFG@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-41(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_byte
	testb	$1, -41(%rbp)
	jne	LBB0_20
## %bb.19:
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_info
	movl	(%rbx), %esi
	movzbl	-41(%rbp), %edx
	orl	$1, %edx
	movq	%r15, %rdi
	callq	_pci_write_config_byte
LBB0_20:
	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.6(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	movl	(%r14), %edx
	leaq	L_.str.7(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_21:
	movl	(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_4
LBB0_22:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
LBB0_23:
	movl	(%r14), %edi
	movq	_ALI15X3_SMB_IOSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_release_region
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_SMBATPC,4,2                    ## @SMBATPC
	.comm	_ALI15X3_LOCK,1,0               ## @ALI15X3_LOCK
	.comm	_SMBBA,4,2                      ## @SMBBA
	.comm	_ali15x3_smba,4,2               ## @ali15x3_smba
	.comm	_ALI15X3_SMB_IOSIZE,4,2         ## @ALI15X3_SMB_IOSIZE
	.comm	_force_addr,4,2                 ## @force_addr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ALI15X3_smb region uninitialized - upgrade BIOS or use force_addr=0xaddr\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ali15x3_driver,4,2             ## @ali15x3_driver
	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.1:                               ## @.str.1
	.asciz	"ALI15X3_smb region 0x%x already in use!\n"

L_.str.2:                               ## @.str.2
	.asciz	"forcing ISA address 0x%04X\n"

	.comm	_PCIBIOS_SUCCESSFUL,8,3         ## @PCIBIOS_SUCCESSFUL
L_.str.3:                               ## @.str.3
	.asciz	"force address failed - not supported?\n"

	.comm	_SMBCOM,4,2                     ## @SMBCOM
L_.str.4:                               ## @.str.4
	.asciz	"enabling SMBus device\n"

	.comm	_SMBHSTCFG,4,2                  ## @SMBHSTCFG
L_.str.5:                               ## @.str.5
	.asciz	"enabling SMBus controller\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	"iALI15X3_smba = 0x%X\n"

	.no_dead_strip	_ali15x3_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ali15x3_setup
_ali15x3_setup:                         ; @ali15x3_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	x20, _SMBATPC@GOTPAGE
Lloh1:
	ldr	x20, [x20, _SMBATPC@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #11
	bl	_pci_read_config_byte
	ldrb	w8, [sp, #11]
Lloh2:
	adrp	x9, _ALI15X3_LOCK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ALI15X3_LOCK@GOTPAGEOFF]
	ldrb	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	eor	w9, w9, #0xff
	and	w2, w8, w9
	strb	w2, [sp, #11]
	ldr	w1, [x20]
	mov	x0, x19
	bl	_pci_write_config_byte
LBB0_2:
Lloh4:
	adrp	x22, _SMBBA@GOTPAGE
Lloh5:
	ldr	x22, [x22, _SMBBA@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh6:
	adrp	x20, _ali15x3_smba@GOTPAGE
Lloh7:
	ldr	x20, [x20, _ali15x3_smba@GOTPAGEOFF]
	mov	x0, x19
	mov	x2, x20
	bl	_pci_read_config_word
Lloh8:
	adrp	x21, _ALI15X3_SMB_IOSIZE@GOTPAGE
Lloh9:
	ldr	x21, [x21, _ALI15X3_SMB_IOSIZE@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	w9, [x20]
	neg	w8, w1
	and	w9, w8, w9
	and	w0, w9, #0xffff
	str	w0, [x20]
Lloh10:
	adrp	x23, _force_addr@GOTPAGE
Lloh11:
	ldr	x23, [x23, _force_addr@GOTPAGEOFF]
	ldr	w9, [x23]
	orr	w10, w0, w9
	cbnz	w10, LBB0_6
; %bb.3:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
LBB0_4:
	mov	x0, x19
	bl	_dev_err
LBB0_5:
Lloh14:
	adrp	x8, _ENODEV@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
	cbz	w9, LBB0_8
; %bb.7:
	and	w0, w9, w8
	str	w0, [x20]
LBB0_8:
Lloh16:
	adrp	x24, _ali15x3_driver@GOTPAGE
Lloh17:
	ldr	x24, [x24, _ali15x3_driver@GOTPAGEOFF]
	ldr	w2, [x24]
	bl	_acpi_check_region
	cbz	x0, LBB0_12
; %bb.9:
Lloh18:
	adrp	x8, _EBUSY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	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
LBB0_12:
	ldr	w0, [x20]
	ldr	w1, [x21]
	ldr	w2, [x24]
	bl	_request_region
	cbz	w0, LBB0_22
; %bb.13:
	ldr	w8, [x23]
	cbz	w8, LBB0_17
; %bb.14:
	ldr	w8, [x20]
	str	x8, [sp]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_dev_info
Lloh22:
	adrp	x23, _PCIBIOS_SUCCESSFUL@GOTPAGE
Lloh23:
	ldr	x23, [x23, _PCIBIOS_SUCCESSFUL@GOTPAGEOFF]
	ldr	x24, [x23]
	ldr	w1, [x22]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_pci_write_config_word
	cmp	x24, x0
	b.ne	LBB0_24
; %bb.15:
	ldr	x23, [x23]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_word
	cmp	x23, x0
	b.ne	LBB0_24
; %bb.16:
	ldr	w8, [sp, #12]
	ldr	w9, [x21]
	neg	w9, w9
	and	w8, w8, w9
	ldr	w9, [x20]
	cmp	w8, w9
	b.ne	LBB0_23
LBB0_17:
Lloh24:
	adrp	x21, _SMBCOM@GOTPAGE
Lloh25:
	ldr	x21, [x21, _SMBCOM@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #11
	mov	x0, x19
	bl	_pci_read_config_byte
	ldrb	w8, [sp, #11]
	tbnz	w8, #0, LBB0_19
; %bb.18:
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	ldr	w1, [x21]
	ldrb	w8, [sp, #11]
	orr	w2, w8, #0x1
	mov	x0, x19
	bl	_pci_write_config_byte
LBB0_19:
Lloh28:
	adrp	x21, _SMBHSTCFG@GOTPAGE
Lloh29:
	ldr	x21, [x21, _SMBHSTCFG@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #11
	mov	x0, x19
	bl	_pci_read_config_byte
	ldrb	w8, [sp, #11]
	tbnz	w8, #0, LBB0_21
; %bb.20:
Lloh30:
	adrp	x1, l_.str.5@PAGE
Lloh31:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	ldr	w1, [x21]
	ldrb	w8, [sp, #11]
	orr	w2, w8, #0x1
	mov	x0, x19
	bl	_pci_write_config_byte
LBB0_21:
Lloh32:
	adrp	x8, _SMBCLK@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SMBCLK@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #32
	bl	_pci_write_config_byte
Lloh35:
	adrp	x8, _SMBREV@GOTPAGE
Lloh36:
	ldr	x8, [x8, _SMBREV@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	add	x2, sp, #11
	mov	x0, x19
	bl	_pci_read_config_byte
	ldrb	w2, [sp, #11]
Lloh38:
	adrp	x1, l_.str.6@PAGE
Lloh39:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	ldr	w2, [x20]
Lloh40:
	adrp	x1, l_.str.7@PAGE
Lloh41:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	mov	w0, #0
	b	LBB0_11
LBB0_22:
	ldr	w8, [x20]
	str	x8, [sp]
Lloh42:
	adrp	x1, l_.str.1@PAGE
Lloh43:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_23:
Lloh44:
	adrp	x1, l_.str.3@PAGE
Lloh45:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_24:
	ldr	w0, [x20]
	ldr	w1, [x21]
	bl	_release_region
	b	LBB0_5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_SMBATPC,4,2                    ; @SMBATPC
	.comm	_ALI15X3_LOCK,1,0               ; @ALI15X3_LOCK
	.comm	_SMBBA,4,2                      ; @SMBBA
	.comm	_ali15x3_smba,4,2               ; @ali15x3_smba
	.comm	_ALI15X3_SMB_IOSIZE,4,2         ; @ALI15X3_SMB_IOSIZE
	.comm	_force_addr,4,2                 ; @force_addr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ALI15X3_smb region uninitialized - upgrade BIOS or use force_addr=0xaddr\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ali15x3_driver,4,2             ; @ali15x3_driver
	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.1:                               ; @.str.1
	.asciz	"ALI15X3_smb region 0x%x already in use!\n"

l_.str.2:                               ; @.str.2
	.asciz	"forcing ISA address 0x%04X\n"

	.comm	_PCIBIOS_SUCCESSFUL,8,3         ; @PCIBIOS_SUCCESSFUL
l_.str.3:                               ; @.str.3
	.asciz	"force address failed - not supported?\n"

	.comm	_SMBCOM,4,2                     ; @SMBCOM
l_.str.4:                               ; @.str.4
	.asciz	"enabling SMBus device\n"

	.comm	_SMBHSTCFG,4,2                  ; @SMBHSTCFG
l_.str.5:                               ; @.str.5
	.asciz	"enabling SMBus controller\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	"iALI15X3_smba = 0x%X\n"

	.no_dead_strip	_ali15x3_setup
.subsections_via_symbols
