	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pe_update                      ## -- Begin function pe_update
	.p2align	4, 0x90
_pe_update:                             ## @pe_update
	.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
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movq	(%rdi), %rcx
	movq	_PE_C_READ@GOTPCREL(%rip), %rdx
	movq	_EACCES@GOTPCREL(%rip), %rax
	cmpq	(%rdx), %rcx
	je	LBB0_18
## %bb.3:
	movl	8(%rbx), %edx
	movq	_LIBPE_F_FD_DONE@GOTPCREL(%rip), %rsi
	testl	%edx, (%rsi)
	jne	LBB0_18
## %bb.4:
	movq	_PE_C_RDWR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_5
LBB0_7:
	movl	24(%rbx), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_lseek
	testq	%rax, %rax
	jns	LBB0_8
LBB0_17:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_PE_C_WRITE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_8
## %bb.6:
	movq	_LIBPE_F_SPECIAL_FILE@GOTPCREL(%rip), %rax
	testl	%edx, (%rax)
	je	LBB0_7
LBB0_8:
	movq	16(%rbx), %rax
	movq	_PE_O_PE32@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_10
## %bb.9:
	xorl	%r15d, %r15d
	movq	_PE_O_PE32P@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
LBB0_10:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_libpe_write_msdos_stub
	movl	$-1, %r14d
	testl	%eax, %eax
	js	LBB0_19
## %bb.11:
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_libpe_write_pe_header
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_19
LBB0_12:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_libpe_resync_sections
	movl	$-1, %r14d
	testq	%rax, %rax
	js	LBB0_19
## %bb.13:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_libpe_write_coff_header
	testl	%eax, %eax
	js	LBB0_19
## %bb.14:
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_libpe_write_section_headers
	testl	%eax, %eax
	js	LBB0_19
## %bb.15:
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_libpe_write_sections
	testl	%eax, %eax
	js	LBB0_19
## %bb.16:
	movl	%eax, %r15d
	movl	24(%rbx), %edi
	movl	%eax, %esi
	callq	_ftruncate
	movl	%r15d, %r14d
	testq	%rax, %rax
	jns	LBB0_19
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_PE_C_READ,8,3                  ## @PE_C_READ
	.comm	_LIBPE_F_FD_DONE,4,2            ## @LIBPE_F_FD_DONE
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_PE_C_RDWR,8,3                  ## @PE_C_RDWR
	.comm	_PE_C_WRITE,8,3                 ## @PE_C_WRITE
	.comm	_LIBPE_F_SPECIAL_FILE,4,2       ## @LIBPE_F_SPECIAL_FILE
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_EIO,4,2                        ## @EIO
	.comm	_PE_O_PE32,8,3                  ## @PE_O_PE32
	.comm	_PE_O_PE32P,8,3                 ## @PE_O_PE32P
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pe_update                      ; -- Begin function pe_update
	.p2align	2
_pe_update:                             ; @pe_update
	.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_4
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _PE_C_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PE_C_READ@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.2:
	ldr	w9, [x19, #8]
Lloh3:
	adrp	x10, _LIBPE_F_FD_DONE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _LIBPE_F_FD_DONE@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_8
LBB0_3:
Lloh6:
	adrp	x8, _EACCES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _errno@GOTPAGE
Lloh11:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh12:
	str	w8, [x9]
LBB0_6:
	mov	w20, #-1
LBB0_7:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
Lloh13:
	adrp	x10, _PE_C_RDWR@GOTPAGE
Lloh14:
	ldr	x10, [x10, _PE_C_RDWR@GOTPAGEOFF]
Lloh15:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_11
LBB0_9:
	ldr	w0, [x19, #24]
Lloh16:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_lseek
	tbz	x0, #63, LBB0_13
LBB0_10:
Lloh19:
	adrp	x8, _EIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_5
LBB0_11:
Lloh21:
	adrp	x10, _PE_C_WRITE@GOTPAGE
Lloh22:
	ldr	x10, [x10, _PE_C_WRITE@GOTPAGEOFF]
Lloh23:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_13
; %bb.12:
Lloh24:
	adrp	x8, _LIBPE_F_SPECIAL_FILE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _LIBPE_F_SPECIAL_FILE@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_9
LBB0_13:
	ldr	x8, [x19, #16]
Lloh27:
	adrp	x9, _PE_O_PE32@GOTPAGE
Lloh28:
	ldr	x9, [x9, _PE_O_PE32@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
Lloh30:
	adrp	x10, _PE_O_PE32P@GOTPAGE
Lloh31:
	ldr	x10, [x10, _PE_O_PE32P@GOTPAGEOFF]
Lloh32:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_16
; %bb.14:
	mov	x0, x19
	mov	w1, #0
	bl	_libpe_write_msdos_stub
	tbnz	w0, #31, LBB0_6
; %bb.15:
	mov	x1, x0
	mov	x0, x19
	bl	_libpe_write_pe_header
	mov	x20, x0
	tbz	w0, #31, LBB0_17
	b	LBB0_6
LBB0_16:
	mov	w20, #0
LBB0_17:
	mov	x0, x19
	mov	x1, x20
	bl	_libpe_resync_sections
	tbnz	x0, #63, LBB0_6
; %bb.18:
	mov	x0, x19
	mov	x1, x20
	bl	_libpe_write_coff_header
	tbnz	w0, #31, LBB0_6
; %bb.19:
	mov	x1, x0
	mov	x0, x19
	bl	_libpe_write_section_headers
	tbnz	w0, #31, LBB0_6
; %bb.20:
	mov	x1, x0
	mov	x0, x19
	bl	_libpe_write_sections
	tbnz	w0, #31, LBB0_6
; %bb.21:
	mov	x20, x0
	ldr	w0, [x19, #24]
	mov	x1, x20
	bl	_ftruncate
	tbz	x0, #63, LBB0_7
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_PE_C_READ,8,3                  ; @PE_C_READ
	.comm	_LIBPE_F_FD_DONE,4,2            ; @LIBPE_F_FD_DONE
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_PE_C_RDWR,8,3                  ; @PE_C_RDWR
	.comm	_PE_C_WRITE,8,3                 ; @PE_C_WRITE
	.comm	_LIBPE_F_SPECIAL_FILE,4,2       ; @LIBPE_F_SPECIAL_FILE
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_EIO,4,2                        ; @EIO
	.comm	_PE_O_PE32,8,3                  ; @PE_O_PE32
	.comm	_PE_O_PE32P,8,3                 ; @PE_O_PE32P
.subsections_via_symbols
