	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function METAFILE_WriteEndOfFile
_METAFILE_WriteEndOfFile:               ## @METAFILE_WriteEndOfFile
	.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
	movq	(%rdi), %rax
	movq	_MetafileTypeEmfPlusOnly@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movq	_MetafileTypeEmfPlusDual@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
LBB0_2:
	leaq	-16(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$16, %esi
	callq	_METAFILE_AllocateRecord
	movq	_Ok@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.3:
	movq	_EmfPlusRecordTypeEndOfFile@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-16(%rbp), %rcx
	movl	%eax, 8(%rcx)
	movq	$0, (%rcx)
	movq	%rbx, %rdi
	callq	_METAFILE_WriteRecords
LBB0_4:
	movq	_Ok@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MetafileTypeEmfPlusOnly,8,3    ## @MetafileTypeEmfPlusOnly
	.comm	_MetafileTypeEmfPlusDual,8,3    ## @MetafileTypeEmfPlusDual
	.comm	_Ok,4,2                         ## @Ok
	.comm	_EmfPlusRecordTypeEndOfFile,4,2 ## @EmfPlusRecordTypeEndOfFile
	.no_dead_strip	_METAFILE_WriteEndOfFile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function METAFILE_WriteEndOfFile
_METAFILE_WriteEndOfFile:               ; @METAFILE_WriteEndOfFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _MetafileTypeEmfPlusOnly@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MetafileTypeEmfPlusOnly@GOTPAGEOFF]
Lloh2:
	adrp	x10, _MetafileTypeEmfPlusDual@GOTPAGE
Lloh3:
	ldr	x10, [x10, _MetafileTypeEmfPlusDual@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
Lloh6:
	adrp	x20, _Ok@GOTPAGE
Lloh7:
	ldr	x20, [x20, _Ok@GOTPAGEOFF]
	b.ne	LBB0_3
; %bb.1:
	mov	x19, x0
	add	x2, sp, #8
	mov	w1, #16
	bl	_METAFILE_AllocateRecord
	ldr	w8, [x20]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.2:
Lloh8:
	adrp	x8, _EmfPlusRecordTypeEndOfFile@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EmfPlusRecordTypeEndOfFile@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	x9, [sp, #8]
	str	w8, [x9, #8]
	str	xzr, [x9]
	mov	x0, x19
	bl	_METAFILE_WriteRecords
LBB0_3:
	ldr	w0, [x20]
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_MetafileTypeEmfPlusOnly,8,3    ; @MetafileTypeEmfPlusOnly
	.comm	_MetafileTypeEmfPlusDual,8,3    ; @MetafileTypeEmfPlusDual
	.comm	_Ok,4,2                         ; @Ok
	.comm	_EmfPlusRecordTypeEndOfFile,4,2 ; @EmfPlusRecordTypeEndOfFile
	.no_dead_strip	_METAFILE_WriteEndOfFile
.subsections_via_symbols
