	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_pio_mode
_set_pio_mode:                          ## @set_pio_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$256, %esi                      ## imm = 0x100
	jb	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_3:
	movq	%rdi, %r15
	movq	8(%rdi), %r14
	movq	8(%r14), %r12
	testq	%r12, %r12
	je	LBB0_6
## %bb.4:
	cmpq	$0, (%r12)
	je	LBB0_6
## %bb.5:
	movq	_IDE_HFLAG_NO_SET_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_7
LBB0_6:
	movq	_ENOSYS@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%esi, %ebx
	movq	%r14, %rdi
	callq	_set_pio_mode_abuse
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	movl	%ebx, %eax
	andl	$-2, %eax
	cmpl	$8, %eax
	jne	LBB0_10
## %bb.9:
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	*(%r12)
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_11:
	movq	_IDE_DFLAG_USING_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	(%r15), %r12d
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_ide_set_pio
	movq	_IDE_HFLAG_SET_PIO_MODE_KEEP_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%ebx, %ebx
	testl	%eax, (%r14)
	je	LBB0_14
## %bb.12:
	testl	%r12d, %r12d
	je	LBB0_14
## %bb.13:
	movq	%r15, %rdi
	callq	_ide_dma_on
	jmp	LBB0_14
LBB0_10:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	*(%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IDE_HFLAG_NO_SET_MODE,4,2      ## @IDE_HFLAG_NO_SET_MODE
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_IDE_DFLAG_USING_DMA,4,2        ## @IDE_DFLAG_USING_DMA
	.comm	_IDE_HFLAG_SET_PIO_MODE_KEEP_DMA,4,2 ## @IDE_HFLAG_SET_PIO_MODE_KEEP_DMA
	.no_dead_strip	_set_pio_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_pio_mode
_set_pio_mode:                          ; @set_pio_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	cmp	w1, #256
	b.lo	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_2:
	mov	x19, x0
	ldr	x21, [x0, #8]
	ldr	x22, [x21, #8]
	cbz	x22, LBB0_5
; %bb.3:
	ldr	x8, [x22]
	cbz	x8, LBB0_5
; %bb.4:
	ldr	w8, [x21]
Lloh2:
	adrp	x9, _IDE_HFLAG_NO_SET_MODE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _IDE_HFLAG_NO_SET_MODE@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
LBB0_5:
Lloh5:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_8:
	mov	x20, x1
	mov	x0, x21
	bl	_set_pio_mode_abuse
	cbz	x0, LBB0_11
; %bb.9:
	and	w8, w20, #0xfffffffe
	cmp	w8, #8
	b.ne	LBB0_13
; %bb.10:
	add	x21, x21, #4
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	x8, [x22]
	mov	x0, x19
	mov	x1, x20
	blr	x8
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	b	LBB0_14
LBB0_11:
	ldr	w8, [x19]
Lloh7:
	adrp	x9, _IDE_DFLAG_USING_DMA@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IDE_DFLAG_USING_DMA@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	and	w22, w9, w8
	mov	x0, x19
	mov	x1, x20
	bl	_ide_set_pio
	ldr	w8, [x21]
Lloh10:
	adrp	x9, _IDE_HFLAG_SET_PIO_MODE_KEEP_DMA@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IDE_HFLAG_SET_PIO_MODE_KEEP_DMA@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	and	w8, w9, w8
	cmp	w8, #0
	ccmp	w22, #0, #4, ne
	b.eq	LBB0_14
; %bb.12:
	mov	x0, x19
	bl	_ide_dma_on
	b	LBB0_14
LBB0_13:
	ldr	x8, [x22]
	mov	x0, x19
	mov	x1, x20
	blr	x8
LBB0_14:
	mov	w0, #0
	b	LBB0_7
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IDE_HFLAG_NO_SET_MODE,4,2      ; @IDE_HFLAG_NO_SET_MODE
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_IDE_DFLAG_USING_DMA,4,2        ; @IDE_DFLAG_USING_DMA
	.comm	_IDE_HFLAG_SET_PIO_MODE_KEEP_DMA,4,2 ; @IDE_HFLAG_SET_PIO_MODE_KEEP_DMA
	.no_dead_strip	_set_pio_mode
.subsections_via_symbols
