	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bd_chs_io
_bd_chs_io:                             ## @bd_chs_io
	.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
	movl	%ecx, %r14d
	movl	%edx, %r9d
	movl	%esi, %eax
	movl	(%rdi), %esi
	movl	4(%rdi), %ecx
	imull	%esi, %ecx
	cltd
	idivl	%ecx
	movl	$1, %ebx
	cmpl	$1023, %eax                     ## imm = 0x3FF
	jg	LBB0_3
## %bb.1:
	movl	%eax, %ecx
	movl	%edx, %eax
	cltd
	idivl	%esi
	incl	%edx
	movq	_V86_FLAGS@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movq	_v86@GOTPCREL(%rip), %r15
	movl	%esi, 28(%r15)
	movl	$19, (%r15)
	movq	_BD_WR@GOTPCREL(%rip), %rsi
	xorl	%ebx, %ebx
	cmpl	%r8d, (%rsi)
	sete	%bl
	shll	$8, %ebx
	orl	%r9d, %ebx
	orl	$512, %ebx                      ## imm = 0x200
	movl	%ebx, 4(%r15)
	movl	%ecx, %esi
	shll	$8, %esi
	movzwl	%si, %esi
	shrl	$2, %ecx
	andl	$192, %ecx
	orl	%esi, %ecx
	orl	%edx, %ecx
	movl	%ecx, 8(%r15)
	shll	$8, %eax
	orl	8(%rdi), %eax
	movl	%eax, 12(%r15)
	movl	%r14d, %edi
	callq	_VTOPSEG
	movl	%eax, 24(%r15)
	movl	%r14d, %edi
	callq	_VTOPOFF
	movl	%eax, 20(%r15)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_v86int
	movl	16(%r15), %edi
	callq	_V86_CY
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	4(%r15), %ebx
	sarl	$8, %ebx
LBB0_3:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V86_FLAGS,4,2                  ## @V86_FLAGS
	.comm	_v86,32,2                       ## @v86
	.comm	_BD_WR,4,2                      ## @BD_WR
	.no_dead_strip	_bd_chs_io
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bd_chs_io
_bd_chs_io:                             ; @bd_chs_io
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldp	w9, w8, [x0]
	mul	w10, w8, w9
	sdiv	w8, w1, w10
	cmp	w8, #1023
	b.le	LBB0_2
; %bb.1:
	mov	w0, #1
	b	LBB0_4
LBB0_2:
	mov	x19, x3
	msub	w10, w8, w10, w1
	sdiv	w11, w10, w9
	msub	w9, w11, w9, w10
Lloh0:
	adrp	x10, _V86_FLAGS@GOTPAGE
Lloh1:
	ldr	x10, [x10, _V86_FLAGS@GOTPAGEOFF]
	add	w9, w9, #1
Lloh2:
	ldr	w10, [x10]
Lloh3:
	adrp	x20, _v86@GOTPAGE
Lloh4:
	ldr	x20, [x20, _v86@GOTPAGEOFF]
Lloh5:
	adrp	x12, _BD_WR@GOTPAGE
Lloh6:
	ldr	x12, [x12, _BD_WR@GOTPAGEOFF]
	str	w10, [x20, #28]
Lloh7:
	ldr	w10, [x12]
	mov	w12, #512
	mov	w13, #768
	cmp	w10, w4
	csel	w10, w13, w12, eq
	mov	w12, #19
	orr	w10, w10, w2
	stp	w12, w10, [x20]
	lsr	w10, w8, #2
	and	w10, w10, #0xc0
	bfi	w10, w8, #8, #8
	orr	w8, w10, w9
	ldr	w9, [x0, #8]
	orr	w9, w9, w11, lsl #8
	stp	w8, w9, [x20, #8]
	mov	x0, x3
	bl	_VTOPSEG
	str	w0, [x20, #24]
	mov	x0, x19
	bl	_VTOPOFF
	str	w0, [x20, #20]
	bl	_v86int
	ldr	w0, [x20, #16]
	bl	_V86_CY
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w8, [x20, #4]
	asr	w0, w8, #8
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_V86_FLAGS,4,2                  ; @V86_FLAGS
	.comm	_v86,32,2                       ; @v86
	.comm	_BD_WR,4,2                      ; @BD_WR
	.no_dead_strip	_bd_chs_io
.subsections_via_symbols
