	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function trm290_prepare_drive
_trm290_prepare_drive:                  ## @trm290_prepare_drive
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	testl	%esi, %esi
	movl	$33, %eax
	movl	$163, %ebx
	cmovel	%eax, %ebx
	callq	_local_irq_save
	cmpl	(%r15), %ebx
	je	LBB0_2
## %bb.1:
	movl	%ebx, (%r15)
	movl	4(%r15), %edi
	shll	$3, %edi
	orl	$81, %edi
	movq	8(%r15), %rsi
	incq	%rsi
	callq	_outb
	movq	8(%r15), %rsi
	movl	%ebx, %edi
	callq	_outw
LBB0_2:
	movq	_IDE_DFLAG_PRESENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_4
## %bb.3:
	movq	8(%r15), %rdi
	addq	$3, %rdi
	callq	_inw
	movb	4(%r15), %cl
	btrl	%ecx, %eax
	andl	$19, %eax
	movq	8(%r15), %rsi
	addq	$3, %rsi
	movl	%eax, %edi
	callq	_outw
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_local_irq_restore              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_IDE_DFLAG_PRESENT,4,2          ## @IDE_DFLAG_PRESENT
	.no_dead_strip	_trm290_prepare_drive
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function trm290_prepare_drive
_trm290_prepare_drive:                  ; @trm290_prepare_drive
	.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
	mov	x19, x0
	ldr	x21, [x0, #8]
	mov	w8, #163
	mov	w9, #33
	cmp	w1, #0
	csel	w20, w9, w8, eq
	bl	_local_irq_save
	ldr	w8, [x21]
	cmp	w20, w8
	b.eq	LBB0_2
; %bb.1:
	str	w20, [x21]
	ldr	w8, [x21, #4]
	mov	w9, #81
	orr	w0, w9, w8, lsl #3
	ldr	x8, [x21, #8]
	add	x1, x8, #1
	bl	_outb
	ldr	x1, [x21, #8]
	mov	x0, x20
	bl	_outw
LBB0_2:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _IDE_DFLAG_PRESENT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _IDE_DFLAG_PRESENT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	x8, [x21, #8]
	add	x0, x8, #3
	bl	_inw
	ldr	w8, [x21, #4]
	mov	w9, #1
	lsl	w8, w9, w8
	bic	w8, w0, w8
	mov	w9, #19
	and	w0, w8, w9
	ldr	x8, [x21, #8]
	add	x1, x8, #3
	bl	_outw
LBB0_4:
	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
	b	_local_irq_restore
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_IDE_DFLAG_PRESENT,4,2          ; @IDE_DFLAG_PRESENT
	.no_dead_strip	_trm290_prepare_drive
.subsections_via_symbols
