	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hpt366_set_mode
_hpt366_set_mode:                       ## @hpt366_set_mode
	.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, %r13d
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movq	8(%rax), %rbx
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movl	(%r15), %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	(%r12), %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leal	81(,%rax,4), %r15d
	leaq	-44(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_pci_read_config_byte
	movl	-44(%rbp), %edx
	testb	$-128, %dl
	je	LBB0_2
## %bb.1:
	andl	$-129, %edx
	movl	%edx, -44(%rbp)
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_pci_write_config_byte
LBB0_2:
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	addq	$8, %rbx
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%r13d, %eax
	jne	LBB0_3
LBB0_5:
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	xorl	%eax, %eax
	callq	_BUG
LBB0_7:
	cmpl	%r13d, %r12d
	movl	$808976639, %eax                ## imm = 0x303800FF
	movl	$805765120, %ecx                ## imm = 0x30070000
	cmovgl	%eax, %ecx
	cmpl	%r13d, %r15d
	movl	$-1040646145, %r12d             ## imm = 0xC1F8FFFF
	cmovlel	%ecx, %r12d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leal	(%rax,%rcx,2), %eax
	leal	64(,%rax,4), %r15d
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_pci_read_config_dword
	movl	-48(%rbp), %eax
	movl	-4(%rbx), %edx
	xorl	%eax, %edx
	andl	%r12d, %edx
	xorl	%eax, %edx
	andl	$1073741823, %edx               ## imm = 0x3FFFFFFF
	movl	%edx, -48(%rbp)
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_pci_write_config_dword
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_MW_DMA_0,4,2              ## @XFER_MW_DMA_0
	.comm	_XFER_UDMA_0,4,2                ## @XFER_UDMA_0
	.no_dead_strip	_hpt366_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hpt366_set_mode
_hpt366_set_mode:                       ; @hpt366_set_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	ldr	x8, [x0, #8]
	ldr	x23, [x8, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w24, [x21]
	ldr	w22, [x22]
	lsl	w8, w22, #2
	add	w21, w8, #81
	add	x2, sp, #8
	mov	x1, x21
	bl	_pci_read_config_byte
	ldr	w8, [sp, #8]
	tbz	w8, #7, LBB0_2
; %bb.1:
	and	w2, w8, #0xffffff7f
	str	w2, [sp, #8]
	mov	x0, x19
	mov	x1, x21
	bl	_pci_write_config_byte
LBB0_2:
Lloh0:
	adrp	x8, _XFER_MW_DMA_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
Lloh3:
	adrp	x8, _XFER_UDMA_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XFER_UDMA_0@GOTPAGEOFF]
Lloh5:
	ldr	w25, [x8]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23], #8
	cmp	w8, #0
	ccmp	w8, w20, #4, ne
	b.ne	LBB0_3
; %bb.4:
	cbnz	w8, LBB0_6
; %bb.5:
	bl	_BUG
LBB0_6:
	mov	w8, #805765120
	mov	w9, #255
	movk	w9, #12344, lsl #16
	cmp	w25, w20
	csel	w8, w9, w8, gt
	mov	w9, #-1040646145
	cmp	w21, w20
	csel	w21, w9, w8, gt
	add	w8, w24, w22, lsl #1
	lsl	w8, w8, #2
	add	w20, w8, #64
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x20
	bl	_pci_read_config_dword
	ldr	w8, [sp, #12]
	bic	w8, w8, w21
	ldur	w9, [x23, #-4]
	and	w9, w9, w21
	orr	w8, w9, w8
	and	w2, w8, #0x3fffffff
	str	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x20
	bl	_pci_write_config_dword
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_MW_DMA_0,4,2              ; @XFER_MW_DMA_0
	.comm	_XFER_UDMA_0,4,2                ; @XFER_UDMA_0
	.no_dead_strip	_hpt366_set_mode
.subsections_via_symbols
