	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ide_config
_ide_config:                            ## @ide_config
	.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, %rbx
	movq	48(%rdi), %r13
	leaq	20(%rdi), %r14
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movq	%rbx, %rdx
	callq	_dev_dbg
	movq	(%rbx), %rcx
	movq	_MANFID_KME@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_3
## %bb.1:
	movq	8(%rbx), %rcx
	movq	_PRODID_KME_KXLC005_A@GOTPCREL(%rip), %rdx
	movl	$1, %eax
	cmpq	(%rdx), %rcx
	je	LBB0_3
## %bb.2:
	movq	_PRODID_KME_KXLC005_B@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	sete	%al
LBB0_3:
	movl	%eax, -44(%rbp)
	movq	_pcmcia_check_one_config@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_pcmcia_loop_config
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_CONF_AUTO_CHECK_VCC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 40(%rbx)
	movl	(%r15), %esi
	leaq	-44(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_pcmcia_loop_config
	testq	%rax, %rax
	jne	LBB0_16
LBB0_5:
	movq	32(%rbx), %rax
	movq	(%rax), %rcx
	movq	8(%rax), %rax
	movq	(%rcx), %r15
	cmpq	$0, 8(%rax)
	je	LBB0_7
## %bb.6:
	movq	(%rax), %r12
	cmpl	$0, 24(%rbx)
	jne	LBB0_9
	jmp	LBB0_16
LBB0_7:
	leaq	14(%r15), %r12
	cmpl	$0, 24(%rbx)
	je	LBB0_16
LBB0_9:
	movq	%rbx, %rdi
	callq	_pcmcia_enable_device
	testl	%eax, %eax
	je	LBB0_10
LBB0_16:
	movq	%rbx, %rdi
	callq	_ide_release
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	$2, %edi
	movq	%r12, %rsi
	callq	_outb
	cmpl	$0, -44(%rbp)
	je	LBB0_12
## %bb.11:
	leaq	1(%r12), %rsi
	movl	$129, %edi
	callq	_outb
LBB0_12:
	movl	24(%rbx), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rcx
	callq	_idecs_register
	testq	%rax, %rax
	je	LBB0_13
LBB0_15:
	movl	$1, (%r13)
	movq	%rax, 8(%r13)
	movq	(%rax), %rax
	movq	(%rax), %rax
	movb	(%rax), %al
	addb	%al, %al
	addb	$97, %al
	movslq	16(%rbx), %r8
	imulq	$1717986919, %r8, %rcx          ## imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$34, %rcx
	addl	%edx, %ecx
	leal	(%rcx,%rcx), %edx
	leal	(%rdx,%rdx,4), %edx
	subl	%edx, %r8d
	movsbl	%al, %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
                                        ## kill: def $ecx killed $ecx killed $rcx
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_dev_info
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_13:
	movq	32(%rbx), %rax
	movq	(%rax), %rdi
	callq	_resource_size
	cmpl	$32, %eax
	jne	LBB0_16
## %bb.14:
	addq	$16, %r12
	movl	$2, %edi
	movq	%r12, %rsi
	callq	_outb
	addq	$16, %r15
	movl	24(%rbx), %edx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rbx, %rcx
	callq	_idecs_register
	testq	%rax, %rax
	jne	LBB0_15
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ide_config(0x%p)\n"

	.comm	_MANFID_KME,8,3                 ## @MANFID_KME
	.comm	_PRODID_KME_KXLC005_A,8,3       ## @PRODID_KME_KXLC005_A
	.comm	_PRODID_KME_KXLC005_B,8,3       ## @PRODID_KME_KXLC005_B
	.comm	_pcmcia_check_one_config,4,2    ## @pcmcia_check_one_config
	.comm	_CONF_AUTO_CHECK_VCC,4,2        ## @CONF_AUTO_CHECK_VCC
L_.str.1:                               ## @.str.1
	.asciz	"ide-cs: hd%c: Vpp = %d.%d\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_ide_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ide_config
_ide_config:                            ; @ide_config
	.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	x20, x0
	ldr	x23, [x0, #48]
	add	x19, x0, #20
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_dbg
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _MANFID_KME@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MANFID_KME@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x20, #8]
Lloh5:
	adrp	x9, _PRODID_KME_KXLC005_A@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PRODID_KME_KXLC005_A@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	mov	w8, #1
	b	LBB0_5
LBB0_3:
	mov	w8, #0
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x9, _PRODID_KME_KXLC005_B@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PRODID_KME_KXLC005_B@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w8, eq
LBB0_5:
	str	w8, [sp, #12]
Lloh11:
	adrp	x21, _pcmcia_check_one_config@GOTPAGE
Lloh12:
	ldr	x21, [x21, _pcmcia_check_one_config@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x20
	bl	_pcmcia_loop_config
	cbz	x0, LBB0_7
; %bb.6:
Lloh13:
	adrp	x8, _CONF_AUTO_CHECK_VCC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CONF_AUTO_CHECK_VCC@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x20, #40]
	bic	w8, w9, w8
	str	w8, [x20, #40]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x20
	bl	_pcmcia_loop_config
	cbnz	x0, LBB0_11
LBB0_7:
	ldr	x8, [x20, #32]
	ldp	x9, x8, [x8]
	ldr	x21, [x9]
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_9
; %bb.8:
	ldr	x22, [x8]
	ldr	w8, [x20, #24]
	cbnz	w8, LBB0_10
	b	LBB0_11
LBB0_9:
	add	x22, x21, #14
	ldr	w8, [x20, #24]
	cbz	w8, LBB0_11
LBB0_10:
	mov	x0, x20
	bl	_pcmcia_enable_device
	cbz	w0, LBB0_13
LBB0_11:
	mov	x0, x20
	bl	_ide_release
Lloh16:
	adrp	x8, _ENODEV@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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_13:
	mov	w0, #2
	mov	x1, x22
	bl	_outb
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_15
; %bb.14:
	add	x1, x22, #1
	mov	w0, #129
	bl	_outb
LBB0_15:
	ldr	w2, [x20, #24]
	mov	x0, x21
	mov	x1, x22
	mov	x3, x20
	bl	_idecs_register
	cbz	x0, LBB0_17
LBB0_16:
	mov	w8, #1
	str	w8, [x23]
	str	x0, [x23, #8]
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldrb	w8, [x8]
	lsl	w8, w8, #1
	add	w8, w8, #97
	ldr	w9, [x20, #16]
	mov	w10, #26215
	movk	w10, #26214, lsl #16
	smull	x10, w9, w10
	lsr	x11, x10, #63
	asr	x10, x10, #34
	add	w3, w10, w11
	mov	w10, #10
	msub	w4, w3, w10, w9
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	sxtb	w2, w8
	mov	x0, x19
	bl	_dev_info
	mov	w0, #0
	b	LBB0_12
LBB0_17:
	ldr	x8, [x20, #32]
	ldr	x0, [x8]
	bl	_resource_size
	cmp	w0, #32
	b.ne	LBB0_11
; %bb.18:
	add	x22, x22, #16
	mov	w0, #2
	mov	x1, x22
	bl	_outb
	add	x0, x21, #16
	ldr	w2, [x20, #24]
	mov	x1, x22
	mov	x3, x20
	bl	_idecs_register
	cbnz	x0, LBB0_16
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ide_config(0x%p)\n"

	.comm	_MANFID_KME,8,3                 ; @MANFID_KME
	.comm	_PRODID_KME_KXLC005_A,8,3       ; @PRODID_KME_KXLC005_A
	.comm	_PRODID_KME_KXLC005_B,8,3       ; @PRODID_KME_KXLC005_B
	.comm	_pcmcia_check_one_config,4,2    ; @pcmcia_check_one_config
	.comm	_CONF_AUTO_CHECK_VCC,4,2        ; @CONF_AUTO_CHECK_VCC
l_.str.1:                               ; @.str.1
	.asciz	"ide-cs: hd%c: Vpp = %d.%d\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_ide_config
.subsections_via_symbols
