	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ht6560b_dev_select
_ht6560b_dev_select:                    ## @ht6560b_dev_select
	.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	24(%rdi), %r12
	callq	_local_irq_save
	movq	%rbx, %rdi
	callq	_HT_CONFIG
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_HT_TIMING
	movl	%eax, %r14d
	movq	(%rbx), %rax
	movq	_ide_disk@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_IDE_DFLAG_PRESENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_2
## %bb.3:
	cmpl	_ht6560b_dev_select.current_select(%rip), %r15d
	je	LBB0_4
	jmp	LBB0_5
LBB0_2:
	movq	_HT_PREFETCH_MODE@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	cmpl	_ht6560b_dev_select.current_select(%rip), %r15d
	jne	LBB0_5
LBB0_4:
	cmpl	_ht6560b_dev_select.current_timing(%rip), %r14d
	je	LBB0_6
LBB0_5:
	movl	%r15d, _ht6560b_dev_select.current_select(%rip)
	movl	%r14d, _ht6560b_dev_select.current_timing(%rip)
	movq	_HT_CONFIG_PORT@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_inb
	movl	(%r13), %edi
	callq	_inb
	movl	(%r13), %edi
	callq	_inb
	movl	(%r13), %edi
	callq	_inb
	movl	(%r13), %esi
	movl	%r15d, %edi
	callq	_outb
	movl	(%r12), %esi
	movl	%r14d, %edi
	callq	_outb
	movl	4(%r12), %edi
	callq	_inb
LBB0_6:
	callq	_local_irq_restore
	movq	_ATA_DEVICE_OBS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	orl	12(%rbx), %edi
	movl	(%r12), %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_outb                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_ht6560b_dev_select.current_select,4,2 ## @ht6560b_dev_select.current_select
.zerofill __DATA,__bss,_ht6560b_dev_select.current_timing,4,2 ## @ht6560b_dev_select.current_timing
	.comm	_ide_disk,8,3                   ## @ide_disk
	.comm	_IDE_DFLAG_PRESENT,4,2          ## @IDE_DFLAG_PRESENT
	.comm	_HT_PREFETCH_MODE,4,2           ## @HT_PREFETCH_MODE
	.comm	_HT_CONFIG_PORT,4,2             ## @HT_CONFIG_PORT
	.comm	_ATA_DEVICE_OBS,4,2             ## @ATA_DEVICE_OBS
	.no_dead_strip	_ht6560b_dev_select
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ht6560b_dev_select
_ht6560b_dev_select:                    ; @ht6560b_dev_select
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	x22, [x0, #24]
	bl	_local_irq_save
	mov	x0, x19
	bl	_HT_CONFIG
	mov	x21, x0
	mov	x0, x19
	bl	_HT_TIMING
	mov	x20, x0
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _ide_disk@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ide_disk@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _IDE_DFLAG_PRESENT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IDE_DFLAG_PRESENT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _HT_PREFETCH_MODE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HT_PREFETCH_MODE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	orr	w21, w8, w21
LBB0_3:
	adrp	x8, _ht6560b_dev_select.current_select@PAGE
	ldr	w10, [x8, _ht6560b_dev_select.current_select@PAGEOFF]
	adrp	x9, _ht6560b_dev_select.current_timing@PAGE
	ldr	w11, [x9, _ht6560b_dev_select.current_timing@PAGEOFF]
	cmp	w21, w10
	ccmp	w20, w11, #0, eq
	b.eq	LBB0_5
; %bb.4:
	str	w21, [x8, _ht6560b_dev_select.current_select@PAGEOFF]
	str	w20, [x9, _ht6560b_dev_select.current_timing@PAGEOFF]
Lloh9:
	adrp	x23, _HT_CONFIG_PORT@GOTPAGE
Lloh10:
	ldr	x23, [x23, _HT_CONFIG_PORT@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_inb
	ldr	w0, [x23]
	bl	_inb
	ldr	w0, [x23]
	bl	_inb
	ldr	w0, [x23]
	bl	_inb
	ldr	w1, [x23]
	mov	x0, x21
	bl	_outb
	ldr	w1, [x22]
	mov	x0, x20
	bl	_outb
	ldr	w0, [x22, #4]
	bl	_inb
LBB0_5:
	bl	_local_irq_restore
Lloh11:
	adrp	x8, _ATA_DEVICE_OBS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ATA_DEVICE_OBS@GOTPAGEOFF]
	ldr	w9, [x19, #12]
Lloh13:
	ldr	w8, [x8]
	orr	w0, w8, w9
	ldr	w1, [x22]
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_outb
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_ht6560b_dev_select.current_select,4,2 ; @ht6560b_dev_select.current_select
.zerofill __DATA,__bss,_ht6560b_dev_select.current_timing,4,2 ; @ht6560b_dev_select.current_timing
	.comm	_ide_disk,8,3                   ; @ide_disk
	.comm	_IDE_DFLAG_PRESENT,4,2          ; @IDE_DFLAG_PRESENT
	.comm	_HT_PREFETCH_MODE,4,2           ; @HT_PREFETCH_MODE
	.comm	_HT_CONFIG_PORT,4,2             ; @HT_CONFIG_PORT
	.comm	_ATA_DEVICE_OBS,4,2             ; @ATA_DEVICE_OBS
	.no_dead_strip	_ht6560b_dev_select
.subsections_via_symbols
