	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bd_realstrategy
_bd_realstrategy:                       ## @bd_realstrategy
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %rbx
	movq	%r8, -112(%rbp)                 ## 8-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %r15
	movl	%esi, -116(%rbp)                ## 4-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	leaq	8(%rdi), %r12
	movq	%r12, %rdi
	callq	_bd_get_bdinfo
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %r14
	movl	(%rax), %eax
	movq	_BD_NO_MEDIA@GOTPCREL(%rip), %rcx
	notl	%eax
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.2:
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	movq	_BIOSDISK_SECSIZE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movq	%r13, %rsi
	testq	%r13, %r13
	je	LBB0_5
## %bb.3:
	movq	%rsi, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_8
## %bb.4:
	movq	%rsi, %rax
	xorl	%edx, %edx
	divq	%rcx
	testq	%rdx, %rdx
	je	LBB0_9
LBB0_5:
	leaq	L_.str(%rip), %rdi
	movq	%rcx, %rdx
	callq	_printf
LBB0_6:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	testq	%rdx, %rdx
	jne	LBB0_5
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_DPRINTF
	imulq	(%rbx), %r15
	movq	8(%r14), %rcx
	movq	%r15, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_11
## %bb.10:
	movq	%r15, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_12
LBB0_11:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
                                        ## kill: def $eax killed $eax def $rax
LBB0_12:
	movq	%r13, %rsi
	movq	-104(%rbp), %r8                 ## 8-byte Reload
	movq	_INT_MAX@GOTPCREL(%rip), %rbx
	cmpq	%r13, (%rbx)
	jae	LBB0_14
## %bb.13:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DPRINTF
	jmp	LBB0_6
LBB0_14:
	movq	%rsi, %rbx
	orq	%rcx, %rbx
	shrq	$32, %rbx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, %rbx
	je	LBB0_16
## %bb.15:
	movq	%rsi, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rdi
	jmp	LBB0_17
LBB0_16:
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	movl	%eax, %edi
LBB0_17:
	leaq	1(%rdi), %rax
	testq	%rdx, %rdx
	cmovneq	%rax, %rdi
	cmpq	%rsi, %rcx
	cmovaq	%rax, %rdi
	movq	%rdi, %rdx
	addq	%rbx, %rdx
	jb	LBB0_6
## %bb.18:
	testq	%r8, %r8
	je	LBB0_20
## %bb.19:
	movq	$0, (%r8)
LBB0_20:
	movq	$0, -88(%rbp)
	movq	(%r12), %rax
	movq	(%rax), %rax
	movq	_DEVT_DISK@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.21:
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_DIOCGMEDIASIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-88(%rbp), %rdx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_disk_ioctl
	testq	%rax, %rax
	je	LBB0_24
## %bb.22:
	movq	-88(%rbp), %rax
	movq	%r13, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_28
LBB0_23:
	xorl	%ecx, %ecx
	jmp	LBB0_29
LBB0_24:
	movq	8(%r14), %rcx
	movq	-88(%rbp), %rax
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_26
## %bb.25:
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_27
LBB0_26:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_27:
	movq	%r13, %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rax, -88(%rbp)
LBB0_28:
	movq	(%r12), %rcx
	testq	%rax, %rax
	jne	LBB0_30
LBB0_29:
	movq	16(%r14), %rax
	subq	%rcx, %rax
	movq	%rax, -88(%rbp)
LBB0_30:
	cmpq	%rcx, %rbx
	jb	LBB0_6
## %bb.31:
	addq	%rcx, %rax
	movq	%rax, %r12
	subq	%rbx, %r12
	jbe	LBB0_6
## %bb.32:
	cmpq	%rax, %rdx
	jb	LBB0_34
## %bb.33:
	movq	8(%r14), %r13
	imulq	%r12, %r13
	leaq	L_.str.3(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_DPRINTF
	movq	%r13, %rsi
	movq	%r12, %rdi
LBB0_34:
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_BIO_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rsi, -128(%rbp)                ## 8-byte Spill
	callq	_min
	movq	%rax, %r12
	movq	8(%r14), %rax
	cmpq	%r12, %rax
	jae	LBB0_37
LBB0_35:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_bio_alloc
	testq	%rax, %rax
	jne	LBB0_40
## %bb.36:                              ##   in Loop: Header=BB0_35 Depth=1
	movq	8(%r14), %rax
	subq	%rax, %r12
	cmpq	%rax, %r12
	ja	LBB0_35
LBB0_37:
	movq	_V86_IO_BUFFER_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	cmpq	%rcx, %rax
	jbe	LBB0_39
## %bb.38:
	leaq	L_.str.4(%rip), %rdi
	callq	_panic
LBB0_39:
	movq	_V86_IO_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PTOV
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_41
LBB0_40:
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
LBB0_41:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	movq	-128(%rbp), %rdx                ## 8-byte Reload
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_57
## %bb.42:
	movq	%rdx, %r13
	jmp	LBB0_47
LBB0_43:                                ##   in Loop: Header=BB0_47 Depth=1
	leaq	L_.str.6(%rip), %rdi
	movl	%r15d, %esi
	movq	%rbx, %rdx
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	xorl	%eax, %eax
	callq	_DPRINTF
	movq	8(%r14), %r12
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_54
## %bb.44:                              ##   in Loop: Header=BB0_47 Depth=1
	subq	%rax, %r12
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%rax, %r15
	callq	_min
	movq	%rax, %r12
	movq	_BD_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	$1, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %r8
	callq	_bd_io
LBB0_45:                                ##   in Loop: Header=BB0_47 Depth=1
	addq	%r13, %r15
	movq	%r15, %rdi
	movq	-112(%rbp), %rsi                ## 8-byte Reload
	movq	%r12, %rdx
	callq	_memmove
	movq	_BD_WR@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	%r13, %r8
	callq	_bd_io
	testl	%eax, %eax
	movq	-136(%rbp), %r13                ## 8-byte Reload
	jne	LBB0_59
LBB0_46:                                ##   in Loop: Header=BB0_47 Depth=1
	addq	%r12, -112(%rbp)                ## 8-byte Folded Spill
	subq	%r12, %r13
	movslq	-48(%rbp), %rax                 ## 4-byte Folded Reload
	addq	%rax, %rbx
	movl	$0, %ecx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	subq	%rax, %rdi
	movq	-128(%rbp), %rdx                ## 8-byte Reload
	movq	-104(%rbp), %rcx                ## 8-byte Reload
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	je	LBB0_57
LBB0_47:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_49
## %bb.48:                              ##   in Loop: Header=BB0_47 Depth=1
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_50
LBB0_49:                                ##   in Loop: Header=BB0_47 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_50:                                ##   in Loop: Header=BB0_47 Depth=1
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, %rsi
	callq	_min
	movq	%rax, %r15
	movq	_F_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	-116(%rbp), %eax                ## 4-byte Folded Reload
	cmpl	$128, %eax
	movq	%r13, -136(%rbp)                ## 8-byte Spill
	je	LBB0_43
## %bb.51:                              ##   in Loop: Header=BB0_47 Depth=1
	cmpl	$129, %eax
	jne	LBB0_60
## %bb.52:                              ##   in Loop: Header=BB0_47 Depth=1
	leaq	L_.str.5(%rip), %rdi
	movl	%r15d, %esi
	movq	%rbx, %rdx
	movq	-112(%rbp), %r13                ## 8-byte Reload
	movq	%r13, %rcx
	xorl	%eax, %eax
	callq	_DPRINTF
	movq	8(%r14), %r12
	movq	_BD_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%rbx, -144(%rbp)                ## 8-byte Spill
	movq	%rbx, %rdx
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	%r15d, %ecx
	movq	%r13, %rbx
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %r8
	callq	_bd_io
	testl	%eax, %eax
	jne	LBB0_59
## %bb.53:                              ##   in Loop: Header=BB0_47 Depth=1
	movslq	-48(%rbp), %rax                 ## 4-byte Folded Reload
	imulq	%rax, %r12
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	subq	%rsi, %r12
	movq	-136(%rbp), %r13                ## 8-byte Reload
	cmpq	%r12, %r13
	cmovbq	%r13, %r12
	addq	%r15, %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	_memmove
	movq	-144(%rbp), %rbx                ## 8-byte Reload
	jmp	LBB0_46
LBB0_54:                                ##   in Loop: Header=BB0_47 Depth=1
	cmpq	%r12, %r13
	jae	LBB0_56
## %bb.55:                              ##   in Loop: Header=BB0_47 Depth=1
	movq	%r13, %r15
	movq	_BD_RD@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	$1, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movq	%rbx, %rdx
	movl	$1, %ecx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %r8
	callq	_bd_io
	movq	%r15, %r12
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_45
LBB0_56:                                ##   in Loop: Header=BB0_47 Depth=1
	movq	%r15, %rax
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	cltq
	imulq	%rax, %r12
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_45
LBB0_57:
	xorl	%ebx, %ebx
	testq	%rcx, %rcx
	je	LBB0_62
## %bb.58:
	movq	%rdx, (%rcx)
	jmp	LBB0_62
LBB0_59:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_61
LBB0_60:
	movq	_EROFS@GOTPCREL(%rip), %rax
LBB0_61:
	movl	(%rax), %ebx
LBB0_62:
	movq	_V86_IO_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PTOV
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	cmpq	%rax, %rdi
	je	LBB0_7
## %bb.63:
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	callq	_bio_free
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_BD_NO_MEDIA,4,2                ## @BD_NO_MEDIA
	.comm	_EIO,4,2                        ## @EIO
	.comm	_BIOSDISK_SECSIZE,8,3           ## @BIOSDISK_SECSIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bd_strategy: %d bytes I/O not multiple of %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"open_disk %p"

	.comm	_INT_MAX,8,3                    ## @INT_MAX
L_.str.2:                               ## @.str.2
	.asciz	"too large I/O: %zu bytes"

	.comm	_DEVT_DISK,8,3                  ## @DEVT_DISK
	.comm	_DIOCGMEDIASIZE,4,2             ## @DIOCGMEDIASIZE
L_.str.3:                               ## @.str.3
	.asciz	"short I/O %d"

	.comm	_BIO_BUFFER_SIZE,8,3            ## @BIO_BUFFER_SIZE
	.comm	_V86_IO_BUFFER_SIZE,8,3         ## @V86_IO_BUFFER_SIZE
L_.str.4:                               ## @.str.4
	.asciz	"BUG: Real mode buffer is too small"

	.comm	_V86_IO_BUFFER,4,2              ## @V86_IO_BUFFER
	.comm	_F_MASK,4,2                     ## @F_MASK
L_.str.5:                               ## @.str.5
	.asciz	"read %d from %lld to %p"

	.comm	_BD_RD,4,2                      ## @BD_RD
L_.str.6:                               ## @.str.6
	.asciz	"write %d from %lld to %p"

	.comm	_BD_WR,4,2                      ## @BD_WR
	.comm	_EROFS,4,2                      ## @EROFS
	.no_dead_strip	_bd_realstrategy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bd_realstrategy
_bd_realstrategy:                       ; @bd_realstrategy
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x5
	mov	x21, x4
	mov	x19, x3
	mov	x26, x2
	mov	x22, x1
	mov	x23, x0
	add	x25, x0, #8
	mov	x0, x25
	bl	_bd_get_bdinfo
	cbz	x0, LBB0_5
; %bb.1:
	mov	x24, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _BD_NO_MEDIA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BD_NO_MEDIA@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	bics	wzr, w9, w8
	b.eq	LBB0_5
; %bb.2:
Lloh3:
	adrp	x27, _BIOSDISK_SECSIZE@GOTPAGE
Lloh4:
	ldr	x27, [x27, _BIOSDISK_SECSIZE@GOTPAGEOFF]
	ldr	x2, [x27]
	cbz	x19, LBB0_4
; %bb.3:
	udiv	x8, x19, x2
	msub	x8, x8, x2, x19
	cbz	x8, LBB0_7
LBB0_4:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_printf
LBB0_5:
Lloh7:
	adrp	x8, _EIO@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh9:
	ldr	w21, [x8]
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_7:
	str	x23, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPRINTF
Lloh12:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x8, x19
	b.hs	LBB0_9
; %bb.8:
	str	x19, [sp]
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DPRINTF
	b	LBB0_5
LBB0_9:
	ldr	x8, [x27]
	mul	x26, x8, x26
	ldr	x28, [x24, #8]
	udiv	x11, x26, x28
	udiv	x9, x19, x28
	cmp	x28, x19
	b.hi	LBB0_11
; %bb.10:
	msub	x8, x9, x28, x19
	cbz	x8, LBB0_12
LBB0_11:
	add	x9, x9, #1
LBB0_12:
	adds	x27, x9, x11
	b.hs	LBB0_5
; %bb.13:
	str	x9, [sp, #56]                   ; 8-byte Folded Spill
	cbz	x20, LBB0_15
; %bb.14:
	str	xzr, [x20]
LBB0_15:
	mov	x8, #0
	str	xzr, [sp, #72]
	ldr	x9, [x25]
	ldr	x9, [x9]
Lloh17:
	adrp	x10, _DEVT_DISK@GOTPAGE
Lloh18:
	ldr	x10, [x10, _DEVT_DISK@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_20
; %bb.16:
	mov	x25, x11
Lloh20:
	adrp	x8, _DIOCGMEDIASIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _DIOCGMEDIASIZE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	add	x2, sp, #72
	mov	x0, x23
	bl	_disk_ioctl
	cbz	x0, LBB0_18
; %bb.17:
	ldr	x9, [sp, #72]
	b	LBB0_19
LBB0_18:
	ldr	x8, [x24, #8]
	ldr	x9, [sp, #72]
	udiv	x9, x9, x8
	str	x9, [sp, #72]
LBB0_19:
	ldr	x8, [x23]
	mov	x11, x25
	cbnz	x9, LBB0_21
LBB0_20:
	ldr	x9, [x24, #16]
	sub	x9, x9, x8
	str	x9, [sp, #72]
LBB0_21:
	cmp	x11, x8
	b.lo	LBB0_5
; %bb.22:
	add	x8, x9, x8
	subs	x25, x8, x11
	b.ls	LBB0_5
; %bb.23:
	str	x11, [sp, #64]                  ; 8-byte Folded Spill
	cmp	x27, x8
	b.lo	LBB0_25
; %bb.24:
	ldr	x8, [x24, #8]
	mul	x19, x8, x25
	str	x25, [sp]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DPRINTF
	str	x25, [sp, #56]                  ; 8-byte Folded Spill
LBB0_25:
Lloh25:
	adrp	x8, _BIO_BUFFER_SIZE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BIO_BUFFER_SIZE@GOTPAGEOFF]
Lloh27:
	ldr	x0, [x8]
	mov	x1, x19
	bl	_min
	ldr	x8, [x24, #8]
Lloh28:
	adrp	x27, _V86_IO_BUFFER@GOTPAGE
Lloh29:
	ldr	x27, [x27, _V86_IO_BUFFER@GOTPAGEOFF]
	cmp	x8, x0
	b.hs	LBB0_29
; %bb.26:
	mov	x25, x0
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	bl	_bio_alloc
	cbnz	x0, LBB0_32
; %bb.28:                               ;   in Loop: Header=BB0_27 Depth=1
	ldr	x8, [x24, #8]
	sub	x25, x25, x8
	cmp	x25, x8
	b.hi	LBB0_27
LBB0_29:
Lloh30:
	adrp	x9, _V86_IO_BUFFER_SIZE@GOTPAGE
Lloh31:
	ldr	x9, [x9, _V86_IO_BUFFER_SIZE@GOTPAGEOFF]
Lloh32:
	ldr	x25, [x9]
	cmp	x8, x25
	b.ls	LBB0_31
; %bb.30:
Lloh33:
	adrp	x0, l_.str.4@PAGE
Lloh34:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_panic
LBB0_31:
	ldr	w0, [x27]
	bl	_PTOV
LBB0_32:
	str	x0, [sp, #40]                   ; 8-byte Folded Spill
	ldp	x0, x27, [sp, #56]              ; 16-byte Folded Reload
	cbz	x0, LBB0_46
; %bb.33:
	msub	x9, x27, x28, x26
	mov	x26, x19
	str	x25, [sp, #32]                  ; 8-byte Folded Spill
	b	LBB0_37
LBB0_34:                                ;   in Loop: Header=BB0_37 Depth=1
	sxtw	x9, w25
	mul	x28, x8, x9
	ldr	x27, [sp, #64]                  ; 8-byte Folded Reload
	ldr	x26, [sp, #40]                  ; 8-byte Folded Reload
LBB0_35:                                ;   in Loop: Header=BB0_37 Depth=1
	add	x0, x26, x10
	mov	x1, x21
	mov	x2, x28
	bl	_memmove
Lloh35:
	adrp	x8, _BD_WR@GOTPAGE
Lloh36:
	ldr	x8, [x8, _BD_WR@GOTPAGEOFF]
Lloh37:
	ldr	w5, [x8]
	mov	x0, x23
	mov	x1, x24
	mov	x2, x27
	mov	x3, x25
	mov	x4, x26
	bl	_bd_io
	ldr	x26, [sp, #24]                  ; 8-byte Folded Reload
	cbnz	w0, LBB0_48
LBB0_36:                                ;   in Loop: Header=BB0_37 Depth=1
	mov	x9, #0
	add	x21, x21, x28
	sub	x26, x26, x28
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	sxtw	x8, w25
	add	x27, x27, x8
	ldr	x0, [sp, #56]                   ; 8-byte Folded Reload
	subs	x0, x0, x8
	ldr	x25, [sp, #32]                  ; 8-byte Folded Reload
	b.eq	LBB0_46
LBB0_37:                                ; =>This Inner Loop Header: Depth=1
	stp	x9, x0, [sp, #48]               ; 16-byte Folded Spill
	str	x27, [sp, #64]                  ; 8-byte Folded Spill
	ldr	x8, [x24, #8]
	udiv	x1, x25, x8
	bl	_min
	mov	x25, x0
Lloh38:
	adrp	x8, _F_MASK@GOTPAGE
Lloh39:
	ldr	x8, [x8, _F_MASK@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	and	w8, w8, w22
	cmp	w8, #128
	b.eq	LBB0_41
; %bb.38:                               ;   in Loop: Header=BB0_37 Depth=1
	cmp	w8, #129
	ldr	x27, [sp, #64]                  ; 8-byte Folded Reload
	b.ne	LBB0_49
; %bb.39:                               ;   in Loop: Header=BB0_37 Depth=1
	stp	x27, x21, [sp, #8]
	mov	x8, x25
	str	x8, [sp]
Lloh41:
	adrp	x0, l_.str.5@PAGE
Lloh42:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DPRINTF
	ldr	x28, [x24, #8]
Lloh43:
	adrp	x8, _BD_RD@GOTPAGE
Lloh44:
	ldr	x8, [x8, _BD_RD@GOTPAGEOFF]
Lloh45:
	ldr	w5, [x8]
	mov	x0, x23
	mov	x1, x24
	mov	x2, x27
	mov	x3, x25
	ldr	x27, [sp, #40]                  ; 8-byte Folded Reload
	mov	x4, x27
	bl	_bd_io
	cbnz	w0, LBB0_54
; %bb.40:                               ;   in Loop: Header=BB0_37 Depth=1
	sxtw	x8, w25
	ldr	x10, [sp, #48]                  ; 8-byte Folded Reload
	neg	x9, x10
	madd	x8, x28, x8, x9
	cmp	x26, x8
	csel	x28, x26, x8, lo
	add	x1, x27, x10
	mov	x0, x21
	mov	x2, x28
	bl	_memmove
	ldr	x27, [sp, #64]                  ; 8-byte Folded Reload
	b	LBB0_36
LBB0_41:                                ;   in Loop: Header=BB0_37 Depth=1
	mov	x8, x25
	ldr	x27, [sp, #64]                  ; 8-byte Folded Reload
	stp	x27, x21, [sp, #8]
	str	x8, [sp]
Lloh46:
	adrp	x0, l_.str.6@PAGE
Lloh47:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_DPRINTF
	ldr	x8, [x24, #8]
	ldr	x10, [sp, #48]                  ; 8-byte Folded Reload
	str	x26, [sp, #24]                  ; 8-byte Folded Spill
	cbz	x10, LBB0_43
; %bb.42:                               ;   in Loop: Header=BB0_37 Depth=1
	sub	x0, x8, x10
	mov	x1, x26
	bl	_min
	mov	x28, x0
Lloh48:
	adrp	x8, _BD_RD@GOTPAGE
Lloh49:
	ldr	x8, [x8, _BD_RD@GOTPAGEOFF]
Lloh50:
	ldr	w5, [x8]
	mov	w25, #1
	mov	x0, x23
	mov	x1, x24
	b	LBB0_45
LBB0_43:                                ;   in Loop: Header=BB0_37 Depth=1
	cmp	x26, x8
	b.hs	LBB0_34
; %bb.44:                               ;   in Loop: Header=BB0_37 Depth=1
	mov	x28, x26
Lloh51:
	adrp	x8, _BD_RD@GOTPAGE
Lloh52:
	ldr	x8, [x8, _BD_RD@GOTPAGEOFF]
Lloh53:
	ldr	w5, [x8]
	mov	w25, #1
	mov	x0, x23
	mov	x1, x24
	ldr	x27, [sp, #64]                  ; 8-byte Folded Reload
LBB0_45:                                ;   in Loop: Header=BB0_37 Depth=1
	mov	x2, x27
	mov	w3, #1
	ldr	x4, [sp, #40]                   ; 8-byte Folded Reload
	mov	x26, x4
	bl	_bd_io
	ldr	x10, [sp, #48]                  ; 8-byte Folded Reload
	b	LBB0_35
LBB0_46:
	mov	w21, #0
	cbz	x20, LBB0_51
; %bb.47:
	str	x19, [x20]
	b	LBB0_51
LBB0_48:
Lloh54:
	adrp	x8, _EIO@GOTPAGE
Lloh55:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_50
LBB0_49:
Lloh56:
	adrp	x8, _EROFS@GOTPAGE
Lloh57:
	ldr	x8, [x8, _EROFS@GOTPAGEOFF]
LBB0_50:
	ldr	w21, [x8]
	ldr	x25, [sp, #32]                  ; 8-byte Folded Reload
LBB0_51:
Lloh58:
	adrp	x8, _V86_IO_BUFFER@GOTPAGE
Lloh59:
	ldr	x8, [x8, _V86_IO_BUFFER@GOTPAGEOFF]
	ldr	x27, [sp, #40]                  ; 8-byte Folded Reload
LBB0_52:
	ldr	w0, [x8]
	bl	_PTOV
	cmp	x27, x0
	b.eq	LBB0_6
; %bb.53:
	mov	x0, x27
	mov	x1, x25
	bl	_bio_free
	b	LBB0_6
LBB0_54:
Lloh60:
	adrp	x8, _EIO@GOTPAGE
Lloh61:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh62:
	ldr	w21, [x8]
	ldr	x25, [sp, #32]                  ; 8-byte Folded Reload
Lloh63:
	adrp	x8, _V86_IO_BUFFER@GOTPAGE
Lloh64:
	ldr	x8, [x8, _V86_IO_BUFFER@GOTPAGEOFF]
	b	LBB0_52
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh54, Lloh55
	.loh AdrpLdrGot	Lloh56, Lloh57
	.loh AdrpLdrGot	Lloh58, Lloh59
	.loh AdrpLdrGot	Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.cfi_endproc
                                        ; -- End function
	.comm	_BD_NO_MEDIA,4,2                ; @BD_NO_MEDIA
	.comm	_EIO,4,2                        ; @EIO
	.comm	_BIOSDISK_SECSIZE,8,3           ; @BIOSDISK_SECSIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bd_strategy: %d bytes I/O not multiple of %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"open_disk %p"

	.comm	_INT_MAX,8,3                    ; @INT_MAX
l_.str.2:                               ; @.str.2
	.asciz	"too large I/O: %zu bytes"

	.comm	_DEVT_DISK,8,3                  ; @DEVT_DISK
	.comm	_DIOCGMEDIASIZE,4,2             ; @DIOCGMEDIASIZE
l_.str.3:                               ; @.str.3
	.asciz	"short I/O %d"

	.comm	_BIO_BUFFER_SIZE,8,3            ; @BIO_BUFFER_SIZE
	.comm	_V86_IO_BUFFER_SIZE,8,3         ; @V86_IO_BUFFER_SIZE
l_.str.4:                               ; @.str.4
	.asciz	"BUG: Real mode buffer is too small"

	.comm	_V86_IO_BUFFER,4,2              ; @V86_IO_BUFFER
	.comm	_F_MASK,4,2                     ; @F_MASK
l_.str.5:                               ; @.str.5
	.asciz	"read %d from %lld to %p"

	.comm	_BD_RD,4,2                      ; @BD_RD
l_.str.6:                               ; @.str.6
	.asciz	"write %d from %lld to %p"

	.comm	_BD_WR,4,2                      ; @BD_WR
	.comm	_EROFS,4,2                      ; @EROFS
	.no_dead_strip	_bd_realstrategy
.subsections_via_symbols
