	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ali_init_chipset
_ali_init_chipset:                      ## @ali_init_chipset
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	cmpl	$32, (%rdi)
	jg	LBB0_2
## %bb.1:
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$83, %esi
	callq	_pci_read_config_byte
	movl	-28(%rbp), %edx
	orl	$3, %edx
	jmp	LBB0_3
LBB0_2:
	leaq	-28(%rbp), %r14
	movq	%rbx, %rdi
	movl	$74, %esi
	movq	%r14, %rdx
	callq	_pci_read_config_byte
	movl	-28(%rbp), %edx
	orl	$32, %edx
	movq	%rbx, %rdi
	movl	$74, %esi
	callq	_pci_write_config_byte
	movq	%rbx, %rdi
	movl	$75, %esi
	movq	%r14, %rdx
	callq	_pci_read_config_byte
	movl	-28(%rbp), %edx
	movl	%edx, %eax
	orl	$1, %eax
	andl	$127, %edx
	cmpl	$194, (%rbx)
	cmovgel	%eax, %edx
	movl	%edx, -28(%rbp)
	orl	$8, %edx
	movq	%rbx, %rdi
	movl	$75, %esi
	callq	_pci_write_config_byte
	movq	%rbx, %rdi
	movl	$83, %esi
	movq	%r14, %rdx
	callq	_pci_read_config_byte
	xorl	%edx, %edx
	cmpl	$199, (%rbx)
	setge	%dl
	addl	%edx, %edx
	orl	-28(%rbp), %edx
	orl	$1, %edx
LBB0_3:
	movl	%edx, -28(%rbp)
	movq	%rbx, %rdi
	movl	$83, %esi
	callq	_pci_write_config_byte
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_PCI_DEVFN
	xorl	%edi, %edi
	movl	%eax, %esi
	callq	_pci_get_bus_and_slot
	movq	%rax, %r14
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:
	movq	8(%r14), %rax
	movq	_PCI_VENDOR_ID_AL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.5:
	movq	_ali_isa_bridge@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.6:
	leaq	-28(%rbp), %rdx
	movl	$121, %esi
	callq	_pci_read_config_byte
	movl	(%rbx), %eax
	cmpl	$194, %eax
	jne	LBB0_8
## %bb.7:
	movq	(%r15), %rdi
	movl	-28(%rbp), %edx
	orl	$4, %edx
	jmp	LBB0_10
LBB0_8:
	addl	$-195, %eax
	cmpl	$1, %eax
	ja	LBB0_11
## %bb.9:
	movq	(%r15), %rdi
	movl	-28(%rbp), %edx
	orl	$2, %edx
LBB0_10:
	movl	$121, %esi
	callq	_pci_write_config_byte
LBB0_11:
	movq	%r14, %rdi
	callq	_pci_dev_put
	movq	%rbx, %rdi
	callq	_ata_pci_bmdma_clear_simplex
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_VENDOR_ID_AL,8,3           ## @PCI_VENDOR_ID_AL
	.comm	_ali_isa_bridge,8,3             ## @ali_isa_bridge
	.no_dead_strip	_ali_init_chipset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ali_init_chipset
_ali_init_chipset:                      ; @ali_init_chipset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldr	w8, [x0]
	add	x2, sp, #12
	cmp	w8, #32
	b.gt	LBB0_2
; %bb.1:
	mov	w1, #83
	bl	_pci_read_config_byte
	ldr	w8, [sp, #12]
	orr	w2, w8, #0x3
	b	LBB0_3
LBB0_2:
	mov	w1, #74
	bl	_pci_read_config_byte
	ldr	w8, [sp, #12]
	orr	w2, w8, #0x20
	mov	x0, x19
	mov	w1, #74
	bl	_pci_write_config_byte
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #75
	bl	_pci_read_config_byte
	ldr	w8, [x19]
	ldr	w9, [sp, #12]
	orr	w10, w9, #0x1
	and	w9, w9, #0x7f
	cmp	w8, #194
	csel	w8, w9, w10, lt
	str	w8, [sp, #12]
	orr	w2, w8, #0x8
	mov	x0, x19
	mov	w1, #75
	bl	_pci_write_config_byte
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #83
	bl	_pci_read_config_byte
	ldr	w8, [x19]
	ldr	w9, [sp, #12]
	cmp	w8, #198
	mov	w8, #3
	csinc	w8, w8, wzr, gt
	orr	w2, w8, w9
LBB0_3:
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #83
	bl	_pci_write_config_byte
	mov	w0, #0
	mov	w1, #0
	bl	_PCI_DEVFN
	mov	x1, x0
	mov	w0, #0
	bl	_pci_get_bus_and_slot
	mov	x20, x0
	cbz	x0, LBB0_10
; %bb.4:
	ldr	x8, [x20, #8]
Lloh0:
	adrp	x9, _PCI_VENDOR_ID_AL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_VENDOR_ID_AL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x21, _ali_isa_bridge@GOTPAGE
Lloh4:
	ldr	x21, [x21, _ali_isa_bridge@GOTPAGEOFF]
	ldr	x0, [x21]
	cmp	x8, x9
	ccmp	x0, #0, #4, eq
	b.eq	LBB0_10
; %bb.5:
	add	x2, sp, #12
	mov	w1, #121
	bl	_pci_read_config_byte
	ldr	w8, [x19]
	cmp	w8, #194
	b.ne	LBB0_7
; %bb.6:
	ldr	x0, [x21]
	ldr	w8, [sp, #12]
	orr	w2, w8, #0x4
	b	LBB0_9
LBB0_7:
	sub	w8, w8, #195
	cmp	w8, #1
	b.hi	LBB0_10
; %bb.8:
	ldr	x0, [x21]
	ldr	w8, [sp, #12]
	orr	w2, w8, #0x2
LBB0_9:
	mov	w1, #121
	bl	_pci_write_config_byte
LBB0_10:
	mov	x0, x20
	bl	_pci_dev_put
	mov	x0, x19
	bl	_ata_pci_bmdma_clear_simplex
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_VENDOR_ID_AL,8,3           ; @PCI_VENDOR_ID_AL
	.comm	_ali_isa_bridge,8,3             ; @ali_isa_bridge
	.no_dead_strip	_ali_init_chipset
.subsections_via_symbols
