	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function idefloppy_create_rw_cmd
_idefloppy_create_rw_cmd:               ## @idefloppy_create_rw_cmd
	.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	%rcx, %rax
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	(%rdi), %r12
	movq	(%r12), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_1
## %bb.2:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r15
	jmp	LBB0_3
LBB0_1:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r15d
LBB0_3:
	movq	%r14, %rdi
	callq	_blk_rq_sectors
	movslq	%eax, %rcx
	movq	(%r12), %rsi
	movq	%rcx, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_4
## %bb.5:
	movq	%rcx, %rax
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %r12
	jmp	LBB0_6
LBB0_4:
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %r12d
LBB0_6:
	movq	%r14, %rdi
	callq	_rq_data_dir
	movl	%eax, %r13d
	movq	_IDE_DBG_FUNC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	movl	%r12d, %ecx
	callq	_ide_debug_log
	movq	%rbx, %rdi
	callq	_ide_init_pc
	movq	_READ@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_7
## %bb.8:
	movq	_GPCMD_READ_10@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_GPCMD_WRITE_10@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movq	16(%rbx), %rcx
	movl	%eax, (%rcx)
	movl	%r12d, %edi
	callq	_cpu_to_be16
	movq	16(%rbx), %rsi
	addq	$28, %rsi
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_put_unaligned
	movl	%r15d, %edi
	callq	_cpu_to_be32
	movq	16(%rbx), %rsi
	addq	$8, %rsi
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_put_unaligned
	movl	4(%r14), %edi
	movq	16(%rbx), %rsi
	movl	$12, %edx
	callq	_memcpy
	movq	%r14, 8(%rbx)
	movq	_REQ_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_10
## %bb.11:
	movq	_PC_FLAG_WRITING@GOTPCREL(%rip), %rcx
	movl	(%rbx), %eax
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_12
LBB0_10:
	movl	(%rbx), %eax
LBB0_12:
	movq	_PC_FLAG_DMA_OK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IDE_DBG_FUNC,4,2               ## @IDE_DBG_FUNC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"block: %d, blocks: %d"

	.comm	_READ,4,2                       ## @READ
	.comm	_GPCMD_READ_10,4,2              ## @GPCMD_READ_10
	.comm	_GPCMD_WRITE_10,4,2             ## @GPCMD_WRITE_10
	.comm	_REQ_WRITE,4,2                  ## @REQ_WRITE
	.comm	_PC_FLAG_WRITING,4,2            ## @PC_FLAG_WRITING
	.comm	_PC_FLAG_DMA_OK,4,2             ## @PC_FLAG_DMA_OK
	.no_dead_strip	_idefloppy_create_rw_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function idefloppy_create_rw_cmd
_idefloppy_create_rw_cmd:               ; @idefloppy_create_rw_cmd
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x2
	mov	x19, x1
	ldr	x22, [x0]
	ldr	x8, [x22]
	udiv	x21, x3, x8
	mov	x0, x2
	bl	_blk_rq_sectors
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	ldr	x9, [x22]
	udiv	x22, x8, x9
	mov	x0, x20
	bl	_rq_data_dir
	mov	x23, x0
Lloh0:
	adrp	x8, _IDE_DBG_FUNC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IDE_DBG_FUNC@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x3, x22
	bl	_ide_debug_log
	mov	x0, x19
	bl	_ide_init_pc
Lloh5:
	adrp	x8, _READ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _READ@GOTPAGEOFF]
Lloh7:
	adrp	x9, _GPCMD_READ_10@GOTPAGE
Lloh8:
	ldr	x9, [x9, _GPCMD_READ_10@GOTPAGEOFF]
Lloh9:
	adrp	x10, _GPCMD_WRITE_10@GOTPAGE
Lloh10:
	ldr	x10, [x10, _GPCMD_WRITE_10@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w23, w8
	csel	x8, x9, x10, eq
	ldr	w8, [x8]
	ldr	x9, [x19, #16]
	str	w8, [x9]
	mov	x0, x22
	bl	_cpu_to_be16
	ldr	x8, [x19, #16]
	add	x8, x8, #28
	str	x8, [sp]
	bl	_put_unaligned
	mov	x0, x21
	bl	_cpu_to_be32
	ldr	x8, [x19, #16]
	add	x8, x8, #8
	str	x8, [sp]
	bl	_put_unaligned
	ldr	w0, [x20, #4]
	ldr	x1, [x19, #16]
	mov	w2, #12
	bl	_memcpy
	str	x20, [x19, #8]
	ldr	w8, [x20]
Lloh12:
	adrp	x9, _REQ_WRITE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _REQ_WRITE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh15:
	adrp	x8, _PC_FLAG_WRITING@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PC_FLAG_WRITING@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_3
LBB0_2:
	ldr	w8, [x19]
LBB0_3:
Lloh18:
	adrp	x9, _PC_FLAG_DMA_OK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PC_FLAG_DMA_OK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x19]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh11
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_IDE_DBG_FUNC,4,2               ; @IDE_DBG_FUNC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"block: %d, blocks: %d"

	.comm	_READ,4,2                       ; @READ
	.comm	_GPCMD_READ_10,4,2              ; @GPCMD_READ_10
	.comm	_GPCMD_WRITE_10,4,2             ; @GPCMD_WRITE_10
	.comm	_REQ_WRITE,4,2                  ; @REQ_WRITE
	.comm	_PC_FLAG_WRITING,4,2            ; @PC_FLAG_WRITING
	.comm	_PC_FLAG_DMA_OK,4,2             ; @PC_FLAG_DMA_OK
	.no_dead_strip	_idefloppy_create_rw_cmd
.subsections_via_symbols
