	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function MakeDMABuffer
_MakeDMABuffer:                         ## @MakeDMABuffer
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_fragsize@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	addl	%eax, %eax
	movq	_format@GOTPCREL(%rip), %rbx
	movb	(%rbx), %cl
	shll	%cl, %eax
	leal	(%rax,%rax), %edi
	addl	$15, %edi
	sarl	$4, %edi
	movq	_LMSelector@GOTPCREL(%rip), %rsi
	callq	___dpmi_allocate_dos_memory
                                        ## kill: def $eax killed $eax def $rax
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	shll	$4, %eax
	movq	_LMBuffer@GOTPCREL(%rip), %rdi
	movl	%eax, (%rdi)
	movl	(%rbx), %ecx
	movl	(%r14), %edx
	testl	%ecx, %ecx
	je	LBB0_5
## %bb.3:
	leal	(%rax,%rdx,4), %ebx
	decl	%ebx
	xorl	%eax, %ebx
	xorl	%esi, %esi
	testl	$131072, %ebx                   ## imm = 0x20000
	je	LBB0_8
## %bb.4:
	leal	(%rax,%rdx,4), %eax
	jmp	LBB0_7
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_5:
	leal	(%rax,%rdx,2), %ebx
	decl	%ebx
	xorl	%eax, %ebx
	movl	$128, %esi
	testl	$65536, %ebx                    ## imm = 0x10000
	je	LBB0_8
## %bb.6:
	leal	(%rax,%rdx,2), %eax
LBB0_7:
	movl	%eax, (%rdi)
LBB0_8:
	addl	%edx, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %edx
	movl	%eax, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_DOSMemSet
	movl	$1, %eax
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fragsize,4,2                   ## @fragsize
	.comm	_format,4,2                     ## @format
	.comm	_LMSelector,4,2                 ## @LMSelector
	.comm	_LMBuffer,4,2                   ## @LMBuffer
	.no_dead_strip	_MakeDMABuffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function MakeDMABuffer
_MakeDMABuffer:                         ; @MakeDMABuffer
	.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
Lloh0:
	adrp	x19, _fragsize@GOTPAGE
Lloh1:
	ldr	x19, [x19, _fragsize@GOTPAGEOFF]
	ldr	w8, [x19]
Lloh2:
	adrp	x20, _format@GOTPAGE
Lloh3:
	ldr	x20, [x20, _format@GOTPAGEOFF]
	lsl	w8, w8, #1
	ldr	w9, [x20]
	lsl	w8, w8, w9
	lsl	w8, w8, #1
	add	w8, w8, #15
	asr	w0, w8, #4
Lloh4:
	adrp	x1, _LMSelector@GOTPAGE
Lloh5:
	ldr	x1, [x1, _LMSelector@GOTPAGEOFF]
	bl	___dpmi_allocate_dos_memory
	tbnz	w0, #31, LBB0_5
; %bb.1:
	lsl	w0, w0, #4
Lloh6:
	adrp	x10, _LMBuffer@GOTPAGE
Lloh7:
	ldr	x10, [x10, _LMBuffer@GOTPAGEOFF]
	str	w0, [x10]
	ldr	w8, [x20]
	ldr	w9, [x19]
	cbz	w8, LBB0_7
; %bb.2:
	mov	w12, #0
	mov	w1, #0
	add	w11, w0, w9, lsl #2
	sub	w13, w11, #1
	eor	w13, w13, w0
	tbz	w13, #17, LBB0_4
LBB0_3:
	str	w11, [x10]
	mov	x0, x11
	mov	x1, x12
LBB0_4:
	lsl	w9, w9, #1
	lsl	w2, w9, w8
	bl	_DOSMemSet
	mov	w0, #1
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_7:
	add	w11, w0, w9, lsl #1
	sub	w12, w11, #1
	eor	w13, w12, w0
	mov	w12, #128
	mov	w1, #128
	tbnz	w13, #16, LBB0_3
	b	LBB0_4
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_fragsize,4,2                   ; @fragsize
	.comm	_format,4,2                     ; @format
	.comm	_LMSelector,4,2                 ; @LMSelector
	.comm	_LMBuffer,4,2                   ; @LMBuffer
	.no_dead_strip	_MakeDMABuffer
.subsections_via_symbols
