	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libpe_alloc_buffer             ## -- Begin function libpe_alloc_buffer
	.p2align	4, 0x90
_libpe_alloc_buffer:                    ## @libpe_alloc_buffer
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	$48, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%r14, 40(%rax)
	movl	$0, 32(%rax)
	movl	$1, (%rax)
	movq	$0, 24(%rax)
	movq	%r15, 8(%rax)
	testq	%r15, %r15
	je	LBB0_6
## %bb.3:
	movq	%r15, %rdi
	callq	_malloc
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	_LIBPE_F_BUFFER_MALLOCED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	jmp	LBB0_7
LBB0_6:
	movq	$0, 16(%rbx)
LBB0_7:
	movq	_sb_next@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_STAILQ_INSERT_TAIL
	jmp	LBB0_8
LBB0_4:
	movq	%rbx, %rdi
	callq	_free
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%ebx, %ebx
LBB0_8:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_errno,4,2                      ## @errno
	.comm	_LIBPE_F_BUFFER_MALLOCED,4,2    ## @LIBPE_F_BUFFER_MALLOCED
	.comm	_sb_next,4,2                    ## @sb_next
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libpe_alloc_buffer             ; -- Begin function libpe_alloc_buffer
	.p2align	2
_libpe_alloc_buffer:                    ; @libpe_alloc_buffer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x20, x0
	mov	w0, #48
	bl	_malloc
	mov	x19, x0
	cbz	x0, LBB0_7
; %bb.1:
	str	x20, [x19, #40]
	str	wzr, [x19, #32]
	mov	w8, #1
	str	w8, [x19]
	str	xzr, [x19, #24]
	str	x21, [x19, #8]
	cbz	x21, LBB0_4
; %bb.2:
	mov	x0, x21
	bl	_malloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_6
; %bb.3:
Lloh0:
	adrp	x8, _LIBPE_F_BUFFER_MALLOCED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LIBPE_F_BUFFER_MALLOCED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	b	LBB0_5
LBB0_4:
	str	xzr, [x19, #16]
LBB0_5:
Lloh3:
	adrp	x8, _sb_next@GOTPAGE
Lloh4:
	ldr	x8, [x8, _sb_next@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_STAILQ_INSERT_TAIL
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_free
	mov	x19, #0
LBB0_7:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _errno@GOTPAGE
Lloh10:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh11:
	str	w8, [x9]
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_errno,4,2                      ; @errno
	.comm	_LIBPE_F_BUFFER_MALLOCED,4,2    ; @LIBPE_F_BUFFER_MALLOCED
	.comm	_sb_next,4,2                    ; @sb_next
.subsections_via_symbols
