	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libpe_read_msdos_stub          ## -- Begin function libpe_read_msdos_stub
	.p2align	4, 0x90
_libpe_read_msdos_stub:                 ## @libpe_read_msdos_stub
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	cmpq	$0, (%rdi)
	jle	LBB0_1
## %bb.2:
	movq	_LIBPE_F_LOAD_DOS_STUB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	testl	%eax, 8(%rbx)
	sete	%dil
	jmp	LBB0_3
LBB0_1:
	xorl	%edi, %edi
LBB0_3:
	callq	_assert
	movq	_LIBPE_F_SPECIAL_FILE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	jne	LBB0_5
## %bb.4:
	movl	24(%rbx), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %esi
	callq	_lseek
	testq	%rax, %rax
	js	LBB0_8
LBB0_5:
	movq	(%rbx), %rsi
	movq	16(%rbx), %rdi
	addq	$4, %rsi
	callq	_realloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, 16(%rbx)
	movl	24(%rbx), %edi
	addq	$4, %rax
	movq	(%rbx), %rdx
	movq	%rax, %rsi
	callq	_read
	cmpq	(%rbx), %rax
	jne	LBB0_8
## %bb.11:
	movq	_LIBPE_F_LOAD_DOS_STUB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	callq	_libpe_parse_rich_header
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_8:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	$0, (%rbx)
	movl	$-1, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_EIO,4,2                        ## @EIO
	.comm	_errno,4,2                      ## @errno
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_libpe_read_msdos_stub          ; -- Begin function libpe_read_msdos_stub
	.p2align	2
_libpe_read_msdos_stub:                 ; @libpe_read_msdos_stub
	.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
	ldr	x8, [x0]
	cmp	x8, #1
	b.lt	LBB0_2
; %bb.1:
	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
	cset	w0, eq
	b	LBB0_3
LBB0_2:
	mov	w0, #0
LBB0_3:
	bl	_assert
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _LIBPE_F_SPECIAL_FILE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LIBPE_F_SPECIAL_FILE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_5
; %bb.4:
	ldr	w0, [x19, #24]
Lloh6:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_lseek
	tbnz	x0, #63, LBB0_8
LBB0_5:
	ldr	x0, [x19, #16]
	ldr	x8, [x19]
	add	x1, x8, #4
	bl	_realloc
	cbz	x0, LBB0_9
; %bb.6:
	str	x0, [x19, #16]
	ldr	w8, [x19, #24]
	add	x1, x0, #4
	ldr	x2, [x19]
	mov	x0, x8
	bl	_read
	ldr	x8, [x19]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.7:
Lloh9:
	adrp	x8, _LIBPE_F_LOAD_DOS_STUB@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LIBPE_F_LOAD_DOS_STUB@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
	mov	x0, x19
	bl	_libpe_parse_rich_header
	mov	w0, #0
	b	LBB0_11
LBB0_8:
Lloh12:
	adrp	x8, _EIO@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _errno@GOTPAGE
Lloh17:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh18:
	str	w8, [x9]
	str	xzr, [x19]
	mov	w0, #-1
LBB0_11:
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.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	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_EIO,4,2                        ; @EIO
	.comm	_errno,4,2                      ; @errno
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
