	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pe_newbuffer                   ## -- Begin function pe_newbuffer
	.p2align	4, 0x90
_pe_newbuffer:                          ## @pe_newbuffer
	.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
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.1:
	movq	%rdi, %rbx
	movq	8(%rdi), %rdi
	movq	_LIBPE_F_FD_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_7
## %bb.2:
	movq	_EACCES@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_5:
	xorl	%r14d, %r14d
LBB0_6:
	movq	%r14, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movq	_LIBPE_F_LOAD_SECTION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	jne	LBB0_9
## %bb.8:
	movq	%rbx, %rsi
	callq	_libpe_load_section
	testq	%rax, %rax
	js	LBB0_5
LBB0_9:
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_libpe_alloc_buffer
	testq	%rax, %rax
	je	LBB0_6
## %bb.10:
	movq	_PE_F_DIRTY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	%edx, (%rax)
	movl	(%rcx), %ecx
	orl	%ecx, (%rbx)
	movq	%rax, %r14
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_LIBPE_F_FD_DONE,4,2            ## @LIBPE_F_FD_DONE
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_LIBPE_F_LOAD_SECTION,4,2       ## @LIBPE_F_LOAD_SECTION
	.comm	_PE_F_DIRTY,4,2                 ## @PE_F_DIRTY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pe_newbuffer                   ; -- Begin function pe_newbuffer
	.p2align	2
_pe_newbuffer:                          ; @pe_newbuffer
	.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
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x0, [x0, #8]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _LIBPE_F_FD_DONE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LIBPE_F_FD_DONE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.2:
	mov	x0, #0
Lloh3:
	adrp	x8, _EACCES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _errno@GOTPAGE
Lloh8:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh9:
	str	w8, [x9]
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w8, [x19]
Lloh10:
	adrp	x9, _LIBPE_F_LOAD_SECTION@GOTPAGE
Lloh11:
	ldr	x9, [x9, _LIBPE_F_LOAD_SECTION@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.7:
	mov	x1, x19
	bl	_libpe_load_section
	tbnz	x0, #63, LBB0_10
LBB0_8:
	mov	x0, x19
	mov	w1, #0
	bl	_libpe_alloc_buffer
	cbz	x0, LBB0_5
; %bb.9:
Lloh13:
	adrp	x8, _PE_F_DIRTY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PE_F_DIRTY@GOTPAGEOFF]
	ldr	w9, [x8]
	ldr	w10, [x0]
	orr	w9, w10, w9
	str	w9, [x0]
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_5
LBB0_10:
	mov	x0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_LIBPE_F_FD_DONE,4,2            ; @LIBPE_F_FD_DONE
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_LIBPE_F_LOAD_SECTION,4,2       ; @LIBPE_F_LOAD_SECTION
	.comm	_PE_F_DIRTY,4,2                 ; @PE_F_DIRTY
.subsections_via_symbols
