	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function piix4_add_adapters_sb800
_piix4_add_adapters_sb800:              ## @piix4_add_adapters_sb800
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rcx
	movq	_PCI_DEVICE_ID_AMD_KERNCZ_SMBUS@GOTPCREL(%rip), %rdx
	movq	_HUDSON2_MAIN_PORTS@GOTPCREL(%rip), %rax
	cmpq	(%rdx), %rcx
	je	LBB0_4
## %bb.1:
	movq	_PCI_DEVICE_ID_AMD_HUDSON2_SMBUS@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_3
## %bb.2:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$30, 8(%rcx)
	jg	LBB0_4
LBB0_3:
	movq	_PIIX4_MAX_ADAPTERS@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movq	_piix4_adapter_count@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	testl	%eax, %eax
	jle	LBB0_5
## %bb.6:
	movzwl	%si, %r13d
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	leaq	1(%rbx), %r14
	testq	%rbx, %rbx
	movl	%r14d, %r9d
	movl	$0, %eax
	cmovel	%eax, %r9d
	movq	_piix4_main_port_names_sb800@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax,%rbx,4), %r10d
	movq	_piix4_main_adapters@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%r15, %rax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %esi
	movl	$1, %edx
	movl	%ebx, %ecx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	pushq	%rax
	pushq	%r10
	callq	_piix4_add_adapter
	addq	$16, %rsp
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	_piix4_adapter_count@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$8, %r15
	movq	%r14, %rbx
	cmpq	%rax, %r14
	jl	LBB0_8
	jmp	LBB0_14
LBB0_5:
                                        ## implicit-def: $r12d
	jmp	LBB0_14
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$12, %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	testl	%ebx, %ebx
	je	LBB0_14
## %bb.10:
	incq	%rbx
	movq	_piix4_main_adapters@GOTPCREL(%rip), %r15
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	decq	%rbx
	cmpq	$1, %rbx
	jle	LBB0_14
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	-16(%rax,%rbx,8), %rdi
	callq	_i2c_get_adapdata
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%rax, %r14
	movq	(%r15), %rax
	movq	-16(%rax,%rbx,8), %rdi
	callq	_i2c_del_adapter
	movq	%r14, %rdi
	callq	_kfree
	movq	(%r15), %rax
	movq	-16(%rax,%rbx,8), %rdi
	callq	_kfree
	movq	(%r15), %rax
	movq	$0, -16(%rax,%rbx,8)
	jmp	LBB0_13
LBB0_14:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_DEVICE_ID_AMD_KERNCZ_SMBUS,8,3 ## @PCI_DEVICE_ID_AMD_KERNCZ_SMBUS
	.comm	_PCI_DEVICE_ID_AMD_HUDSON2_SMBUS,8,3 ## @PCI_DEVICE_ID_AMD_HUDSON2_SMBUS
	.comm	_HUDSON2_MAIN_PORTS,4,2         ## @HUDSON2_MAIN_PORTS
	.comm	_piix4_adapter_count,4,2        ## @piix4_adapter_count
	.comm	_PIIX4_MAX_ADAPTERS,4,2         ## @PIIX4_MAX_ADAPTERS
	.comm	_piix4_main_port_names_sb800,8,3 ## @piix4_main_port_names_sb800
	.comm	_piix4_main_adapters,8,3        ## @piix4_main_adapters
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error setting up SB800 adapters. Unregistering!\n"

	.no_dead_strip	_piix4_add_adapters_sb800
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function piix4_add_adapters_sb800
_piix4_add_adapters_sb800:              ; @piix4_add_adapters_sb800
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PCI_DEVICE_ID_AMD_KERNCZ_SMBUS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_DEVICE_ID_AMD_KERNCZ_SMBUS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
LBB0_1:
Lloh3:
	adrp	x8, _HUDSON2_MAIN_PORTS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HUDSON2_MAIN_PORTS@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
Lloh5:
	adrp	x9, _PCI_DEVICE_ID_AMD_HUDSON2_SMBUS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PCI_DEVICE_ID_AMD_HUDSON2_SMBUS@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	ldr	w8, [x20, #8]
	cmp	w8, #30
	b.gt	LBB0_1
LBB0_4:
Lloh8:
	adrp	x8, _PIIX4_MAX_ADAPTERS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PIIX4_MAX_ADAPTERS@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
Lloh10:
	adrp	x25, _piix4_adapter_count@GOTPAGE
Lloh11:
	ldr	x25, [x25, _piix4_adapter_count@GOTPAGEOFF]
	str	w8, [x25]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.6:
	mov	x26, #0
	mov	x23, #0
Lloh12:
	adrp	x27, _piix4_main_port_names_sb800@GOTPAGE
Lloh13:
	ldr	x27, [x27, _piix4_main_port_names_sb800@GOTPAGEOFF]
Lloh14:
	adrp	x24, _piix4_main_adapters@GOTPAGE
Lloh15:
	ldr	x24, [x24, _piix4_main_adapters@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	add	x28, x23, #1
	cmp	x23, #0
	csel	w5, wzr, w28, eq
	ldr	x8, [x27]
	ldr	w6, [x8, x23, lsl #2]
	ldr	x8, [x24]
	add	x7, x8, x26
	mov	x0, x20
	mov	x1, x21
	mov	w2, #1
	mov	x3, x23
	mov	x4, x19
	bl	_piix4_add_adapter
	mov	x22, x0
	tbnz	w0, #31, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldrsw	x8, [x25]
	add	x26, x26, #8
	mov	x23, x28
	cmp	x28, x8
	b.lt	LBB0_7
	b	LBB0_15
LBB0_9:
                                        ; implicit-def: $w22
	b	LBB0_15
LBB0_10:
	add	x0, x20, #12
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	cbz	w23, LBB0_15
; %bb.11:
	sub	x20, x23, #1
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x20, #1
	sub	x20, x20, #1
	cmp	x8, #1
	b.le	LBB0_15
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	ldr	x0, [x8, x20, lsl #3]
	bl	_i2c_get_adapdata
	ldr	x8, [x0]
	cbz	x8, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x19, x0
	ldr	x8, [x24]
	lsl	x21, x20, #3
	ldr	x0, [x8, x21]
	bl	_i2c_del_adapter
	mov	x0, x19
	bl	_kfree
	ldr	x8, [x24]
	ldr	x0, [x8, x21]
	bl	_kfree
	ldr	x8, [x24]
	str	xzr, [x8, x21]
	b	LBB0_12
LBB0_15:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_DEVICE_ID_AMD_KERNCZ_SMBUS,8,3 ; @PCI_DEVICE_ID_AMD_KERNCZ_SMBUS
	.comm	_PCI_DEVICE_ID_AMD_HUDSON2_SMBUS,8,3 ; @PCI_DEVICE_ID_AMD_HUDSON2_SMBUS
	.comm	_HUDSON2_MAIN_PORTS,4,2         ; @HUDSON2_MAIN_PORTS
	.comm	_piix4_adapter_count,4,2        ; @piix4_adapter_count
	.comm	_PIIX4_MAX_ADAPTERS,4,2         ; @PIIX4_MAX_ADAPTERS
	.comm	_piix4_main_port_names_sb800,8,3 ; @piix4_main_port_names_sb800
	.comm	_piix4_main_adapters,8,3        ; @piix4_main_adapters
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error setting up SB800 adapters. Unregistering!\n"

	.no_dead_strip	_piix4_add_adapters_sb800
.subsections_via_symbols
