	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_memory_region
_read_memory_region:                    ## @read_memory_region
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	__dos_ds@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___dpmi_get_segment_limit
	subq	%r14, %rax
	cmpq	%rbx, %rax
	jae	LBB0_1
## %bb.2:
	movl	$1, %edi
	callq	___dpmi_allocate_ldt_descriptors
	testl	%eax, %eax
	jle	LBB0_3
## %bb.4:
	movl	%eax, %r15d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, %edi
	callq	___dpmi_get_descriptor_access_rights
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	-1(%r14), %rax
	movq	%rax, %r13
	orq	$4095, %r13                     ## imm = 0xFFF
	cmpq	$1048577, %r14                  ## imm = 0x100001
	cmovbq	%rax, %r13
	movl	%r15d, %edi
	movq	%rbx, %rsi
	callq	___dpmi_set_segment_base_address
	xorl	%r12d, %r12d
	cmpl	$-1, %eax
	je	LBB0_9
## %bb.5:
	xorl	%esi, %esi
	cmpq	$1048577, %r14                  ## imm = 0x100001
	setae	%sil
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	andl	$-32769, %eax                   ## imm = 0xFFFF7FFF
	shll	$15, %esi
	orl	%eax, %esi
	movl	%r15d, %edi
	callq	___dpmi_set_descriptor_access_rights
	cmpl	$-1, %eax
	je	LBB0_9
## %bb.6:
	movl	%r15d, %edi
	movq	%r13, %rsi
	callq	___dpmi_set_segment_limit
	cmpl	$-1, %eax
	je	LBB0_9
## %bb.7:
	movl	%r15d, %edi
	callq	___dpmi_get_segment_limit
	cmpq	%r13, %rax
	jb	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	callq	__my_ds
	movl	%r15d, %edi
	xorl	%esi, %esi
	movl	%eax, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movq	%r14, %r8
	callq	_movedata
	movl	$1, %r12d
LBB0_9:
	movl	%r15d, %edi
	callq	___dpmi_free_ldt_descriptor
	jmp	LBB0_10
LBB0_1:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_dosmemget
	movl	$1, %r12d
	jmp	LBB0_10
LBB0_3:
	xorl	%r12d, %r12d
LBB0_10:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	__dos_ds,4,2                    ## @_dos_ds
	.no_dead_strip	_read_memory_region
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_memory_region
_read_memory_region:                    ; @read_memory_region
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x1
	mov	x23, x0
Lloh0:
	adrp	x8, __dos_ds@GOTPAGE
Lloh1:
	ldr	x8, [x8, __dos_ds@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	___dpmi_get_segment_limit
	sub	x8, x0, x20
	cmp	x8, x23
	b.hs	LBB0_8
; %bb.1:
	mov	w0, #1
	bl	___dpmi_allocate_ldt_descriptors
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.2:
	mov	x19, x0
	bl	___dpmi_get_descriptor_access_rights
	mov	x24, x0
	sub	x8, x20, #1
	orr	x9, x8, #0xfff
	cmp	x20, #256, lsl #12              ; =1048576
	csel	x22, x9, x8, hi
	mov	x0, x19
	mov	x1, x23
	bl	___dpmi_set_segment_base_address
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.3:
	cmp	x20, #256, lsl #12              ; =1048576
	cset	w8, hi
	bfi	w24, w8, #15, #1
	mov	x0, x19
	mov	x1, x24
	bl	___dpmi_set_descriptor_access_rights
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.4:
	mov	x0, x19
	mov	x1, x22
	bl	___dpmi_set_segment_limit
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x19
	bl	___dpmi_get_segment_limit
	cmp	x0, x22
	b.hs	LBB0_11
LBB0_6:
	mov	w20, #0
LBB0_7:
	mov	x0, x19
	bl	___dpmi_free_ldt_descriptor
	b	LBB0_10
LBB0_8:
	mov	x0, x23
	mov	x1, x20
	mov	x2, x21
	bl	_dosmemget
	mov	w20, #1
	b	LBB0_10
LBB0_9:
	mov	w20, #0
LBB0_10:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
	bl	__my_ds
	mov	x2, x0
	mov	x0, x19
	mov	w1, #0
	mov	x3, x21
	mov	x4, x20
	bl	_movedata
	mov	w20, #1
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	__dos_ds,4,2                    ; @_dos_ds
	.no_dead_strip	_read_memory_region
.subsections_via_symbols
