	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pe_rich_header                 ## -- Begin function pe_rich_header
	.p2align	4, 0x90
_pe_rich_header:                        ## @pe_rich_header
	.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_1
## %bb.2:
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	testq	%rax, %rax
	jne	LBB0_7
## %bb.3:
	movq	_ENOENT@GOTPCREL(%rip), %r14
	cmpq	$0, (%rbx)
	jle	LBB0_6
## %bb.4:
	movl	8(%rbx), %eax
	movq	_LIBPE_F_LOAD_DOS_STUB@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_6
## %bb.5:
	movq	_LIBPE_F_SPECIAL_FILE@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	andl	(%rcx), %eax
	sete	%dil
	callq	_assert
	movq	%rbx, %rdi
	callq	_libpe_read_msdos_stub
	movq	16(%rbx), %rax
	testq	%rax, %rax
	jne	LBB0_7
	jmp	LBB0_6
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %r14
LBB0_6:
	movl	(%r14), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
LBB0_7:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_LIBPE_F_LOAD_DOS_STUB,4,2      ## @LIBPE_F_LOAD_DOS_STUB
	.comm	_LIBPE_F_SPECIAL_FILE,4,2       ## @LIBPE_F_SPECIAL_FILE
	.comm	_ENOENT,4,2                     ## @ENOENT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pe_rich_header                 ; -- Begin function pe_rich_header
	.p2align	2
_pe_rich_header:                        ; @pe_rich_header
	.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_6
; %bb.1:
	mov	x19, x0
	ldr	x0, [x0, #16]
	cbnz	x0, LBB0_8
; %bb.2:
	ldr	x8, [x19]
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.3:
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x9, _LIBPE_F_LOAD_DOS_STUB@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LIBPE_F_LOAD_DOS_STUB@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_5
; %bb.4:
Lloh3:
	adrp	x9, _LIBPE_F_SPECIAL_FILE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LIBPE_F_SPECIAL_FILE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, eq
	bl	_assert
	mov	x0, x19
	bl	_libpe_read_msdos_stub
	ldr	x0, [x19, #16]
	cbnz	x0, LBB0_8
LBB0_5:
Lloh6:
	adrp	x8, _ENOENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	mov	x0, #0
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _errno@GOTPAGE
Lloh11:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh12:
	str	w8, [x9]
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_LIBPE_F_LOAD_DOS_STUB,4,2      ; @LIBPE_F_LOAD_DOS_STUB
	.comm	_LIBPE_F_SPECIAL_FILE,4,2       ; @LIBPE_F_SPECIAL_FILE
	.comm	_ENOENT,4,2                     ; @ENOENT
.subsections_via_symbols
