	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function svwks_udma_filter
_svwks_udma_filter:                     ## @svwks_udma_filter
	.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, %r14
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	_PCI_DEVICE_ID_SERVERWORKS_HT1000IDE@GOTPCREL(%rip), %rcx
	movl	$31, %ebx
	cmpq	(%rcx), %rax
	je	LBB0_18
## %bb.1:
	movq	_PCI_DEVICE_ID_SERVERWORKS_OSB4IDE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.2:
	movl	$0, -32(%rbp)
	movq	_isa_dev@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.4:
	leaq	-32(%rbp), %rdx
	movl	$100, %esi
	callq	_pci_read_config_dword
	testb	$64, -31(%rbp)
	sete	%al
	jmp	LBB0_5
LBB0_6:
	movq	8(%r15), %rax
	movq	_SVWKS_CSB5_REVISION_NEW@GOTPCREL(%rip), %rcx
	movl	$7, %ebx
	cmpq	(%rcx), %rax
	jl	LBB0_18
## %bb.7:
	movl	$0, -28(%rbp)
	leaq	-28(%rbp), %rdx
	movq	%r15, %rdi
	movl	$90, %esi
	callq	_pci_read_config_byte
	movl	-28(%rbp), %eax
	andl	$3, %eax
	cmpl	$1, %eax
	je	LBB0_8
## %bb.9:
	cmpl	$2, %eax
	je	LBB0_13
## %bb.10:
	cmpl	$3, %eax
	jne	LBB0_14
## %bb.11:
	movq	_svwks_bad_ata100@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_check_in_drive_lists
	testq	%rax, %rax
	je	LBB0_12
LBB0_13:
	movl	$31, %ebx
	jmp	LBB0_15
LBB0_3:
	movb	$1, %al
LBB0_5:
	movq	(%r14), %rcx
	movq	_ide_disk@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	testb	%al, %al
	movl	$7, %ebx
	cmovnel	%esi, %ebx
	cmpq	(%rdx), %rcx
	cmovel	%esi, %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	$7, %ebx
	jmp	LBB0_15
LBB0_14:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_12:
	movl	$63, %ebx
LBB0_15:
	movq	(%r15), %rax
	movq	_PCI_DEVICE_ID_SERVERWORKS_CSB6IDE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_17
## %bb.16:
	movq	_PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
LBB0_17:
	movl	16(%r15), %edi
	callq	_PCI_FUNC
	testb	$1, %al
	movl	$31, %eax
	cmovel	%eax, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_DEVICE_ID_SERVERWORKS_HT1000IDE,8,3 ## @PCI_DEVICE_ID_SERVERWORKS_HT1000IDE
	.comm	_PCI_DEVICE_ID_SERVERWORKS_OSB4IDE,8,3 ## @PCI_DEVICE_ID_SERVERWORKS_OSB4IDE
	.comm	_isa_dev,8,3                    ## @isa_dev
	.comm	_ide_disk,8,3                   ## @ide_disk
	.comm	_SVWKS_CSB5_REVISION_NEW,8,3    ## @SVWKS_CSB5_REVISION_NEW
	.comm	_svwks_bad_ata100,4,2           ## @svwks_bad_ata100
	.comm	_PCI_DEVICE_ID_SERVERWORKS_CSB6IDE,8,3 ## @PCI_DEVICE_ID_SERVERWORKS_CSB6IDE
	.comm	_PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2,8,3 ## @PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2
	.no_dead_strip	_svwks_udma_filter
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function svwks_udma_filter
_svwks_udma_filter:                     ; @svwks_udma_filter
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PCI_DEVICE_ID_SERVERWORKS_HT1000IDE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_DEVICE_ID_SERVERWORKS_HT1000IDE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #31
	b	LBB0_14
LBB0_2:
Lloh3:
	adrp	x9, _PCI_DEVICE_ID_SERVERWORKS_OSB4IDE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PCI_DEVICE_ID_SERVERWORKS_OSB4IDE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	str	wzr, [sp, #12]
Lloh6:
	adrp	x8, _isa_dev@GOTPAGE
Lloh7:
	ldr	x8, [x8, _isa_dev@GOTPAGEOFF]
Lloh8:
	ldr	x0, [x8]
	cbz	x0, LBB0_12
; %bb.4:
	add	x2, sp, #12
	mov	w1, #100
	bl	_pci_read_config_dword
	ldrb	w8, [sp, #13]
	tst	w8, #0x40
	cset	w8, eq
	b	LBB0_13
LBB0_5:
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh9:
	adrp	x9, _SVWKS_CSB5_REVISION_NEW@GOTPAGE
Lloh10:
	ldr	x9, [x9, _SVWKS_CSB5_REVISION_NEW@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_7
; %bb.6:
	mov	w20, #7
	b	LBB0_14
LBB0_7:
	str	wzr, [sp, #8]
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #90
	bl	_pci_read_config_byte
	ldr	w8, [sp, #8]
	and	w8, w8, #0x3
	cmp	w8, #1
	b.eq	LBB0_15
; %bb.8:
	cmp	w8, #2
	b.eq	LBB0_11
; %bb.9:
	cmp	w8, #3
	b.ne	LBB0_16
; %bb.10:
Lloh12:
	adrp	x8, _svwks_bad_ata100@GOTPAGE
Lloh13:
	ldr	x8, [x8, _svwks_bad_ata100@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_check_in_drive_lists
	cbz	x0, LBB0_17
LBB0_11:
	mov	w20, #31
	b	LBB0_18
LBB0_12:
	mov	w8, #1
LBB0_13:
	ldr	x9, [x20]
Lloh15:
	adrp	x10, _ide_disk@GOTPAGE
Lloh16:
	ldr	x10, [x10, _ide_disk@GOTPAGEOFF]
Lloh17:
	ldr	x10, [x10]
	cmp	x9, x10
	cset	w9, eq
	orr	w8, w9, w8
	mov	w9, #7
	cmp	w8, #0
	csel	w20, wzr, w9, ne
LBB0_14:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_15:
	mov	w20, #7
	b	LBB0_18
LBB0_16:
	mov	w20, #0
	b	LBB0_18
LBB0_17:
	mov	w20, #63
LBB0_18:
	ldr	x8, [x19]
Lloh18:
	adrp	x9, _PCI_DEVICE_ID_SERVERWORKS_CSB6IDE@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PCI_DEVICE_ID_SERVERWORKS_CSB6IDE@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
Lloh21:
	adrp	x10, _PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2@GOTPAGE
Lloh22:
	ldr	x10, [x10, _PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2@GOTPAGEOFF]
Lloh23:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_14
; %bb.19:
	ldr	w0, [x19, #16]
	bl	_PCI_FUNC
	tst	w0, #0x1
	mov	w8, #31
	csel	w20, w8, w20, eq
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_DEVICE_ID_SERVERWORKS_HT1000IDE,8,3 ; @PCI_DEVICE_ID_SERVERWORKS_HT1000IDE
	.comm	_PCI_DEVICE_ID_SERVERWORKS_OSB4IDE,8,3 ; @PCI_DEVICE_ID_SERVERWORKS_OSB4IDE
	.comm	_isa_dev,8,3                    ; @isa_dev
	.comm	_ide_disk,8,3                   ; @ide_disk
	.comm	_SVWKS_CSB5_REVISION_NEW,8,3    ; @SVWKS_CSB5_REVISION_NEW
	.comm	_svwks_bad_ata100,4,2           ; @svwks_bad_ata100
	.comm	_PCI_DEVICE_ID_SERVERWORKS_CSB6IDE,8,3 ; @PCI_DEVICE_ID_SERVERWORKS_CSB6IDE
	.comm	_PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2,8,3 ; @PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2
	.no_dead_strip	_svwks_udma_filter
.subsections_via_symbols
