	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pe_update_coff_header          ## -- Begin function pe_update_coff_header
	.p2align	4, 0x90
_pe_update_coff_header:                 ## @pe_update_coff_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_2
## %bb.1:
	movq	%rsi, %r14
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.4:
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_PE_C_READ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_6
## %bb.5:
	movl	8(%rbx), %ecx
	movq	_LIBPE_F_FD_DONE@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_7
LBB0_6:
	movq	_EACCES@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %eax
LBB0_15:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movq	16(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.11:
	movq	(%rax), %rsi
	movq	(%r14), %rdx
	cmpq	%rdx, %rsi
	jne	LBB0_13
## %bb.12:
	movq	%rsi, %rdx
	jmp	LBB0_14
LBB0_8:
	movl	$8, %edi
	callq	_malloc
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	(%r14), %rdx
	movl	8(%rbx), %ecx
	jmp	LBB0_14
LBB0_13:
	movq	_LIBPE_F_DIRTY_OPT_HEADER@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
LBB0_14:
	movq	%rdx, (%rax)
	movq	_LIBPE_F_DIRTY_COFF_HEADER@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 8(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
	.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	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_LIBPE_F_DIRTY_OPT_HEADER,4,2   ## @LIBPE_F_DIRTY_OPT_HEADER
	.comm	_LIBPE_F_DIRTY_COFF_HEADER,4,2  ## @LIBPE_F_DIRTY_COFF_HEADER
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pe_update_coff_header          ; -- Begin function pe_update_coff_header
	.p2align	2
_pe_update_coff_header:                 ; @pe_update_coff_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_5
; %bb.1:
	mov	x20, x1
	cbz	x1, LBB0_5
; %bb.2:
	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_4
; %bb.3:
	ldr	w9, [x19, #8]
Lloh3:
	adrp	x8, _LIBPE_F_FD_DONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LIBPE_F_FD_DONE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_8
LBB0_4:
Lloh6:
	adrp	x8, _EACCES@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _errno@GOTPAGE
Lloh11:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh12:
	str	w8, [x9]
	mov	w8, #-1
LBB0_7:
	mov	x0, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_11
; %bb.9:
	ldr	x10, [x0]
	ldr	x8, [x20]
	cmp	x10, x8
	b.eq	LBB0_13
; %bb.10:
Lloh13:
	adrp	x10, _LIBPE_F_DIRTY_OPT_HEADER@GOTPAGE
Lloh14:
	ldr	x10, [x10, _LIBPE_F_DIRTY_OPT_HEADER@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	orr	w9, w10, w9
	mov	x10, x8
	b	LBB0_13
LBB0_11:
	mov	w0, #8
	bl	_malloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_14
; %bb.12:
	ldr	x10, [x20]
	ldr	w9, [x19, #8]
LBB0_13:
	mov	w8, #0
	str	x10, [x0]
Lloh16:
	adrp	x10, _LIBPE_F_DIRTY_COFF_HEADER@GOTPAGE
Lloh17:
	ldr	x10, [x10, _LIBPE_F_DIRTY_COFF_HEADER@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	orr	w9, w9, w10
	str	w9, [x19, #8]
	b	LBB0_7
LBB0_14:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
	.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
	.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	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_LIBPE_F_DIRTY_OPT_HEADER,4,2   ; @LIBPE_F_DIRTY_OPT_HEADER
	.comm	_LIBPE_F_DIRTY_COFF_HEADER,4,2  ; @LIBPE_F_DIRTY_COFF_HEADER
.subsections_via_symbols
