	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function DPLAYX_PrivHeapAlloc
_DPLAYX_PrivHeapAlloc:                  ## @DPLAYX_PrivHeapAlloc
	.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
	movl	%edi, %r14d
	movslq	%esi, %rax
	movq	_dwBlockSize@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %rcx
	addq	$-4, %rcx
	cmpq	%rax, %rcx
	jae	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_FIXME
	movl	(%rbx), %esi
	addl	$-4, %esi
LBB0_2:
	movq	_dwMaxBlock@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	_lpMemArea@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	$8, %rcx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx)
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	addq	$16, %rcx
	decq	%rax
	jne	LBB0_4
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	callq	_ERR
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_7:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%rcx)
	movq	-8(%rcx), %rbx
	movq	_HEAP_ZERO_MEMORY@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	_ZeroMemory
LBB0_9:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dwBlockSize,4,2                ## @dwBlockSize
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Size exceeded. Request of 0x%08x\n"

	.comm	_dwMaxBlock,8,3                 ## @dwMaxBlock
	.comm	_lpMemArea,8,3                  ## @lpMemArea
	.comm	_TRUE,8,3                       ## @TRUE
L_.str.1:                               ## @.str.1
	.asciz	"No free block found\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ## @HEAP_ZERO_MEMORY
	.no_dead_strip	_DPLAYX_PrivHeapAlloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function DPLAYX_PrivHeapAlloc
_DPLAYX_PrivHeapAlloc:                  ; @DPLAYX_PrivHeapAlloc
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _dwBlockSize@GOTPAGE
Lloh1:
	ldr	x20, [x20, _dwBlockSize@GOTPAGEOFF]
	ldrsw	x8, [x20]
	sub	x8, x8, #4
	cmp	x8, w1, sxtw
	b.hs	LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_FIXME
	ldr	w8, [x20]
	sub	w1, w8, #4
LBB0_2:
Lloh4:
	adrp	x8, _dwMaxBlock@GOTPAGE
Lloh5:
	ldr	x8, [x8, _dwMaxBlock@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.3:
Lloh7:
	adrp	x9, _lpMemArea@GOTPAGE
Lloh8:
	ldr	x9, [x9, _lpMemArea@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	add	x9, x9, #8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9]
	cbz	x10, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, #16
	subs	x8, x8, #1
	b.ne	LBB0_4
LBB0_6:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERR
	mov	x20, #0
	b	LBB0_9
LBB0_7:
Lloh12:
	adrp	x8, _TRUE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	str	x8, [x9]
	ldur	x20, [x9, #-8]
Lloh15:
	adrp	x8, _HEAP_ZERO_MEMORY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _HEAP_ZERO_MEMORY@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w19
	b.eq	LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_ZeroMemory
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_dwBlockSize,4,2                ; @dwBlockSize
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Size exceeded. Request of 0x%08x\n"

	.comm	_dwMaxBlock,8,3                 ; @dwMaxBlock
	.comm	_lpMemArea,8,3                  ; @lpMemArea
	.comm	_TRUE,8,3                       ; @TRUE
l_.str.1:                               ; @.str.1
	.asciz	"No free block found\n"

	.comm	_HEAP_ZERO_MEMORY,4,2           ; @HEAP_ZERO_MEMORY
	.no_dead_strip	_DPLAYX_PrivHeapAlloc
.subsections_via_symbols
