	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libpe_parse_msdos_header       ## -- Begin function libpe_parse_msdos_header
	.p2align	4, 0x90
_libpe_parse_msdos_header:              ## @libpe_parse_msdos_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	$96, %edi
	callq	_malloc
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movl	$96, %edx
	callq	_memcpy
	movl	$96, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r15
	movq	%rax, 16(%r14)
	movq	88(%rax), %rdi
	movq	%rbx, %rsi
	movl	$2, %edx
	callq	_memcpy
	addq	$2, %rbx
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	4(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	8(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	12(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	16(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	20(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	24(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	28(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	32(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	36(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	40(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	44(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	48(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	cmpl	$64, 44(%r15)
	jne	LBB0_5
## %bb.4:
	movq	56(%r15), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	56(%r15), %rax
	movl	4(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	56(%r15), %rax
	movl	8(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	56(%r15), %rax
	movl	12(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	64(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	68(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	72(%r15), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	72(%r15), %rax
	movl	4(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	72(%r15), %rax
	movl	8(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	72(%r15), %rax
	movl	12(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	72(%r15), %rax
	movl	16(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	72(%r15), %rax
	movl	20(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	72(%r15), %rax
	movl	24(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	72(%r15), %rax
	movl	28(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	72(%r15), %rax
	movl	32(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movq	72(%r15), %rax
	movl	36(%rax), %esi
	movq	%rbx, %rdi
	callq	_PE_READ16
	movl	80(%r15), %esi
	movq	%rbx, %rdi
	callq	_PE_READ32
	movl	80(%r15), %eax
	movl	4(%r14), %ecx
	addl	$-4, %ecx
	cmpl	%ecx, %eax
	jle	LBB0_7
LBB0_5:
	movq	_LIBPE_F_BAD_DOS_HEADER@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %eax
	orl	%eax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_21
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %eax
LBB0_21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	cmpl	$95, %eax
	ja	LBB0_10
## %bb.8:
	movl	(%r14), %eax
	movq	_LIBPE_F_SPECIAL_FILE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_13
## %bb.9:
	movq	_LIBPE_F_BAD_DOS_HEADER@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
	jmp	LBB0_21
LBB0_10:
	cmpl	$96, %eax
	je	LBB0_13
## %bb.11:
	addl	$-96, %eax
	movl	%eax, 8(%r14)
	movq	_LIBPE_F_SPECIAL_FILE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	callq	_libpe_read_msdos_stub
	testq	%rax, %rax
	js	LBB0_5
LBB0_13:
	movq	_LIBPE_F_SPECIAL_FILE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	jne	LBB0_16
## %bb.14:
	movl	12(%r14), %edi
	movl	80(%r15), %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_lseek
	testq	%rax, %rax
	js	LBB0_15
LBB0_16:
	movl	12(%r14), %edi
	leaq	-25(%rbp), %rsi
	movl	$4, %edx
	callq	_read
	cmpl	$4, %eax
	jne	LBB0_15
## %bb.17:
	movsbl	-25(%rbp), %edi
	callq	_htole32
	movq	_PE_SIGNATURE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.18:
	movl	12(%r14), %edi
	leaq	-29(%rbp), %rsi
	movl	$4, %edx
	callq	_read
	cmpl	$4, %eax
	jne	LBB0_19
## %bb.20:
	leaq	-29(%rbp), %rsi
	movq	%r14, %rdi
	callq	_libpe_parse_coff_header
	jmp	LBB0_21
LBB0_15:
	movq	_LIBPE_F_BAD_PE_HEADER@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_19:
	movq	_LIBPE_F_BAD_COFF_HEADER@GOTPCREL(%rip), %rax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_errno,4,2                      ## @errno
	.comm	_LIBPE_F_BAD_DOS_HEADER,4,2     ## @LIBPE_F_BAD_DOS_HEADER
	.comm	_LIBPE_F_SPECIAL_FILE,4,2       ## @LIBPE_F_SPECIAL_FILE
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_LIBPE_F_BAD_PE_HEADER,4,2      ## @LIBPE_F_BAD_PE_HEADER
	.comm	_PE_SIGNATURE,8,3               ## @PE_SIGNATURE
	.comm	_LIBPE_F_BAD_COFF_HEADER,4,2    ## @LIBPE_F_BAD_COFF_HEADER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libpe_parse_msdos_header       ; -- Begin function libpe_parse_msdos_header
	.p2align	2
_libpe_parse_msdos_header:              ; @libpe_parse_msdos_header
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	mov	w0, #96
	bl	_malloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_7
; %bb.1:
	mov	x1, x21
	mov	w2, #96
	bl	_memcpy
	mov	w0, #96
	bl	_malloc
	cbz	x0, LBB0_7
; %bb.2:
	mov	x20, x0
	str	x0, [x19, #16]
	ldr	x0, [x0, #88]
	mov	x1, x21
	mov	w2, #2
	bl	_memcpy
	add	x21, x21, #2
	ldr	w1, [x20]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #4]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #8]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #12]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #16]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #20]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #24]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #28]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #32]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #36]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #40]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #44]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #48]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w8, [x20, #44]
	cmp	w8, #64
	b.ne	LBB0_4
; %bb.3:
	ldr	x8, [x20, #56]
	ldr	w1, [x8]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #56]
	ldr	w1, [x8, #4]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #56]
	ldr	w1, [x8, #8]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #56]
	ldr	w1, [x8, #12]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #64]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #68]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #72]
	ldr	w1, [x8]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #72]
	ldr	w1, [x8, #4]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #72]
	ldr	w1, [x8, #8]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #72]
	ldr	w1, [x8, #12]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #72]
	ldr	w1, [x8, #16]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #72]
	ldr	w1, [x8, #20]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #72]
	ldr	w1, [x8, #24]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #72]
	ldr	w1, [x8, #28]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #72]
	ldr	w1, [x8, #32]
	mov	x0, x21
	bl	_PE_READ16
	ldr	x8, [x20, #72]
	ldr	w1, [x8, #36]
	mov	x0, x21
	bl	_PE_READ16
	ldr	w1, [x20, #80]
	mov	x0, x21
	bl	_PE_READ32
	ldr	w8, [x20, #80]
	ldr	w9, [x19, #4]
	sub	w9, w9, #4
	cmp	w8, w9
	b.le	LBB0_9
LBB0_4:
	mov	w0, #0
Lloh0:
	adrp	x8, _LIBPE_F_BAD_DOS_HEADER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LIBPE_F_BAD_DOS_HEADER@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	ldr	w9, [x19]
LBB0_6:
	orr	w8, w9, w8
	str	w8, [x19]
	b	LBB0_8
LBB0_7:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _errno@GOTPAGE
Lloh6:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh7:
	str	w8, [x9]
	mov	w0, #-1
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_9:
	cmp	w8, #95
	b.hi	LBB0_12
; %bb.10:
	ldr	w8, [x19]
Lloh8:
	adrp	x9, _LIBPE_F_SPECIAL_FILE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _LIBPE_F_SPECIAL_FILE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.11:
	mov	w0, #0
Lloh11:
	adrp	x9, _LIBPE_F_BAD_DOS_HEADER@GOTPAGE
Lloh12:
	ldr	x9, [x9, _LIBPE_F_BAD_DOS_HEADER@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	b	LBB0_6
LBB0_12:
	subs	w8, w8, #96
	b.eq	LBB0_15
; %bb.13:
	str	w8, [x19, #8]
	ldr	w8, [x19]
Lloh14:
	adrp	x9, _LIBPE_F_SPECIAL_FILE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _LIBPE_F_SPECIAL_FILE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:
	mov	x0, x19
	bl	_libpe_read_msdos_stub
	tbnz	x0, #63, LBB0_4
LBB0_15:
	ldr	w8, [x19]
Lloh17:
	adrp	x9, _LIBPE_F_SPECIAL_FILE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _LIBPE_F_SPECIAL_FILE@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_17
; %bb.16:
	ldr	w0, [x19, #12]
	ldr	w1, [x20, #80]
Lloh20:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	bl	_lseek
	tbnz	x0, #63, LBB0_21
LBB0_17:
	ldr	w0, [x19, #12]
	add	x1, sp, #11
	mov	w2, #4
	bl	_read
	cmp	w0, #4
	b.ne	LBB0_21
; %bb.18:
	ldrsb	w0, [sp, #11]
	bl	_htole32
Lloh23:
	adrp	x8, _PE_SIGNATURE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _PE_SIGNATURE@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_21
; %bb.19:
	ldr	w0, [x19, #12]
	add	x1, sp, #12
	mov	w2, #4
	bl	_read
	cmp	w0, #4
	b.ne	LBB0_22
; %bb.20:
	add	x1, sp, #12
	mov	x0, x19
	bl	_libpe_parse_coff_header
	b	LBB0_8
LBB0_21:
	mov	w0, #0
Lloh26:
	adrp	x8, _LIBPE_F_BAD_PE_HEADER@GOTPAGE
Lloh27:
	ldr	x8, [x8, _LIBPE_F_BAD_PE_HEADER@GOTPAGEOFF]
	b	LBB0_5
LBB0_22:
	mov	w0, #0
Lloh28:
	adrp	x8, _LIBPE_F_BAD_COFF_HEADER@GOTPAGE
Lloh29:
	ldr	x8, [x8, _LIBPE_F_BAD_COFF_HEADER@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_errno,4,2                      ; @errno
	.comm	_LIBPE_F_BAD_DOS_HEADER,4,2     ; @LIBPE_F_BAD_DOS_HEADER
	.comm	_LIBPE_F_SPECIAL_FILE,4,2       ; @LIBPE_F_SPECIAL_FILE
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_LIBPE_F_BAD_PE_HEADER,4,2      ; @LIBPE_F_BAD_PE_HEADER
	.comm	_PE_SIGNATURE,8,3               ; @PE_SIGNATURE
	.comm	_LIBPE_F_BAD_COFF_HEADER,4,2    ; @LIBPE_F_BAD_COFF_HEADER
.subsections_via_symbols
