	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function METAFILE_WriteHeader
_METAFILE_WriteHeader:                  ## @METAFILE_WriteHeader
	.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
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	_MetafileTypeEmfPlusOnly@GOTPCREL(%rip), %rcx
	movq	_MetafileTypeEmfPlusDual@GOTPCREL(%rip), %r15
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	cmpq	(%r15), %rax
	jne	LBB0_4
LBB0_2:
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$40, %esi
	callq	_METAFILE_AllocateRecord
	movq	_Ok@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.3:
	movq	_EmfPlusRecordTypeHeader@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-32(%rbp), %rcx
	movl	%eax, 32(%rcx)
	movq	(%rbx), %rax
	xorl	%edx, %edx
	cmpq	(%r15), %rax
	sete	%dl
	movl	%edx, 28(%rcx)
	movq	_VERSION_MAGIC2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rcx)
	movq	_TECHNOLOGY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_GetDeviceCaps
	movq	_DT_RASDISPLAY@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	movq	-32(%rbp), %rax
	movl	%edx, (%rax)
	movq	_LOGPIXELSX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_GetDeviceCaps
	movq	-32(%rbp), %rcx
	movq	%rax, 16(%rcx)
	movq	_LOGPIXELSY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_GetDeviceCaps
	movq	-32(%rbp), %rcx
	movq	%rax, 8(%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	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MetafileTypeEmfPlusOnly,8,3    ## @MetafileTypeEmfPlusOnly
	.comm	_MetafileTypeEmfPlusDual,8,3    ## @MetafileTypeEmfPlusDual
	.comm	_Ok,4,2                         ## @Ok
	.comm	_EmfPlusRecordTypeHeader,4,2    ## @EmfPlusRecordTypeHeader
	.comm	_VERSION_MAGIC2,4,2             ## @VERSION_MAGIC2
	.comm	_TECHNOLOGY,4,2                 ## @TECHNOLOGY
	.comm	_DT_RASDISPLAY,8,3              ## @DT_RASDISPLAY
	.comm	_LOGPIXELSX,4,2                 ## @LOGPIXELSX
	.comm	_LOGPIXELSY,4,2                 ## @LOGPIXELSY
	.no_dead_strip	_METAFILE_WriteHeader
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function METAFILE_WriteHeader
_METAFILE_WriteHeader:                  ; @METAFILE_WriteHeader
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _MetafileTypeEmfPlusOnly@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MetafileTypeEmfPlusOnly@GOTPAGEOFF]
Lloh2:
	adrp	x22, _MetafileTypeEmfPlusDual@GOTPAGE
Lloh3:
	ldr	x22, [x22, _MetafileTypeEmfPlusDual@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	ldr	x10, [x22]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
Lloh5:
	adrp	x21, _Ok@GOTPAGE
Lloh6:
	ldr	x21, [x21, _Ok@GOTPAGEOFF]
	b.ne	LBB0_3
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	add	x2, sp, #8
	mov	w1, #40
	bl	_METAFILE_AllocateRecord
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_4
; %bb.2:
Lloh7:
	adrp	x8, _EmfPlusRecordTypeHeader@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EmfPlusRecordTypeHeader@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	ldr	x9, [sp, #8]
	str	w8, [x9, #32]
	ldr	x8, [x19]
	ldr	x10, [x22]
	cmp	x8, x10
	cset	w8, eq
Lloh10:
	adrp	x10, _VERSION_MAGIC2@GOTPAGE
Lloh11:
	ldr	x10, [x10, _VERSION_MAGIC2@GOTPAGEOFF]
Lloh12:
	ldr	w10, [x10]
	stp	w10, w8, [x9, #24]
Lloh13:
	adrp	x8, _TECHNOLOGY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TECHNOLOGY@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_GetDeviceCaps
Lloh16:
	adrp	x8, _DT_RASDISPLAY@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DT_RASDISPLAY@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	cmp	x0, x8
	cset	w8, eq
	ldr	x9, [sp, #8]
	str	w8, [x9]
Lloh19:
	adrp	x8, _LOGPIXELSX@GOTPAGE
Lloh20:
	ldr	x8, [x8, _LOGPIXELSX@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_GetDeviceCaps
	ldr	x8, [sp, #8]
	str	x0, [x8, #16]
Lloh22:
	adrp	x8, _LOGPIXELSY@GOTPAGE
Lloh23:
	ldr	x8, [x8, _LOGPIXELSY@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_GetDeviceCaps
	ldr	x8, [sp, #8]
	str	x0, [x8, #8]
	mov	x0, x19
	bl	_METAFILE_WriteRecords
LBB0_3:
	ldr	w0, [x21]
LBB0_4:
	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
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MetafileTypeEmfPlusOnly,8,3    ; @MetafileTypeEmfPlusOnly
	.comm	_MetafileTypeEmfPlusDual,8,3    ; @MetafileTypeEmfPlusDual
	.comm	_Ok,4,2                         ; @Ok
	.comm	_EmfPlusRecordTypeHeader,4,2    ; @EmfPlusRecordTypeHeader
	.comm	_VERSION_MAGIC2,4,2             ; @VERSION_MAGIC2
	.comm	_TECHNOLOGY,4,2                 ; @TECHNOLOGY
	.comm	_DT_RASDISPLAY,8,3              ; @DT_RASDISPLAY
	.comm	_LOGPIXELSX,4,2                 ; @LOGPIXELSX
	.comm	_LOGPIXELSY,4,2                 ; @LOGPIXELSY
	.no_dead_strip	_METAFILE_WriteHeader
.subsections_via_symbols
