	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hpt37x_pre_reset
_hpt37x_pre_reset:                      ## @hpt37x_pre_reset
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdi), %r12
	movq	16(%r12), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %rbx
	movq	(%r12), %rax
	shlq	$4, %rax
	leaq	_hpt37x_pre_reset.hpt37x_enable_bits(%rip), %rsi
	addq	%rax, %rsi
	movq	%rbx, %rdi
	callq	_pci_test_config_bits
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	-36(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$91, %esi
	callq	_pci_read_config_byte
	movl	-36(%rbp), %edx
	andl	$-2, %edx
	movq	%rbx, %rdi
	movl	$91, %esi
	callq	_pci_write_config_byte
	leaq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$90, %esi
	callq	_pci_read_config_byte
	movl	-36(%rbp), %edx
	movq	%rbx, %rdi
	movl	$91, %esi
	callq	_pci_write_config_byte
	movl	-40(%rbp), %eax
	movq	(%r12), %rcx
	shll	%cl, %eax
	testb	$2, %al
	jne	LBB0_3
## %bb.4:
	movq	_ATA_CBL_PATA80@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_3:
	movq	_ATA_CBL_PATA40@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, 8(%r12)
	leal	80(,%rcx,4), %esi
	movq	%rbx, %rdi
	movl	$55, %edx
	callq	_pci_write_config_byte
	movl	$100, %edi
	callq	_udelay
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_ata_sff_prereset
LBB0_6:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @hpt37x_pre_reset.hpt37x_enable_bits
_hpt37x_pre_reset.hpt37x_enable_bits:
	.long	80                              ## 0x50
	.long	1                               ## 0x1
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	84                              ## 0x54
	.long	1                               ## 0x1
	.long	4                               ## 0x4
	.long	4                               ## 0x4

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_ATA_CBL_PATA40,4,2             ## @ATA_CBL_PATA40
	.comm	_ATA_CBL_PATA80,4,2             ## @ATA_CBL_PATA80
	.no_dead_strip	_hpt37x_pre_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hpt37x_pre_reset
_hpt37x_pre_reset:                      ; @hpt37x_pre_reset
	.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, x1
	mov	x20, x0
	ldr	x22, [x0]
	ldr	x8, [x22, #16]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x21, x0
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _hpt37x_pre_reset.hpt37x_enable_bits@PAGE
Lloh1:
	add	x9, x9, _hpt37x_pre_reset.hpt37x_enable_bits@PAGEOFF
	add	x1, x9, x8, lsl #4
	bl	_pci_test_config_bits
	cbz	w0, LBB0_2
; %bb.1:
	add	x2, sp, #12
	mov	x0, x21
	mov	w1, #91
	bl	_pci_read_config_byte
	ldr	w8, [sp, #12]
	and	w2, w8, #0xfffffffe
	mov	x0, x21
	mov	w1, #91
	bl	_pci_write_config_byte
	add	x2, sp, #8
	mov	x0, x21
	mov	w1, #90
	bl	_pci_read_config_byte
	ldr	w2, [sp, #12]
	mov	x0, x21
	mov	w1, #91
	bl	_pci_write_config_byte
	ldr	w8, [sp, #8]
	ldr	w9, [x22]
Lloh2:
	adrp	x10, _ATA_CBL_PATA80@GOTPAGE
Lloh3:
	ldr	x10, [x10, _ATA_CBL_PATA80@GOTPAGEOFF]
Lloh4:
	adrp	x11, _ATA_CBL_PATA40@GOTPAGE
Lloh5:
	ldr	x11, [x11, _ATA_CBL_PATA40@GOTPAGEOFF]
	lsl	w8, w8, w9
	tst	w8, #0x2
	csel	x8, x10, x11, eq
	ldr	w8, [x8]
	str	w8, [x22, #8]
	lsl	w8, w9, #2
	add	w1, w8, #80
	mov	x0, x21
	mov	w2, #55
	bl	_pci_write_config_byte
	mov	w0, #100
	bl	_udelay
	mov	x0, x20
	mov	x1, x19
	bl	_ata_sff_prereset
	b	LBB0_3
LBB0_2:
Lloh6:
	adrp	x8, _ENOENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @hpt37x_pre_reset.hpt37x_enable_bits
_hpt37x_pre_reset.hpt37x_enable_bits:
	.long	80                              ; 0x50
	.long	1                               ; 0x1
	.long	4                               ; 0x4
	.long	4                               ; 0x4
	.long	84                              ; 0x54
	.long	1                               ; 0x1
	.long	4                               ; 0x4
	.long	4                               ; 0x4

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_ATA_CBL_PATA40,4,2             ; @ATA_CBL_PATA40
	.comm	_ATA_CBL_PATA80,4,2             ; @ATA_CBL_PATA80
	.no_dead_strip	_hpt37x_pre_reset
.subsections_via_symbols
