	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function METAFILE_AllocateRecord
_METAFILE_AllocateRecord:               ## @METAFILE_AllocateRecord
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r12
	movl	(%rdi), %r13d
	testl	%r13d, %r13d
	je	LBB0_2
## %bb.1:
	movl	16(%r12), %r14d
	jmp	LBB0_4
LBB0_2:
	movq	%rdx, %rbx
	leal	(%r15,%r15), %esi
	addl	$4, %esi
	movl	$256, %edi                      ## imm = 0x100
	callq	_max
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_heap_alloc_zero
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_10
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movl	$4, %r14d
	movq	%rax, %rdi
	movl	$4, %edx
	callq	_memcpy
	movl	%r13d, (%r12)
	movl	$4, 16(%r12)
	movq	%rbx, %rdx
LBB0_4:
	leal	(%r14,%r15), %ebx
	cmpl	%r13d, %ebx
	jle	LBB0_7
## %bb.5:
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	addl	%ebx, %ebx
	movl	%ebx, %edi
	callq	_heap_alloc_zero
	testq	%rax, %rax
	je	LBB0_10
## %bb.6:
	movq	%rax, %r13
	movq	8(%r12), %rsi
	movl	16(%r12), %edx
	movq	%rax, %rdi
	callq	_memcpy
	movl	%ebx, (%r12)
	movq	8(%r12), %rdi
	callq	_heap_free
	movq	%r13, 8(%r12)
	movl	16(%r12), %r14d
	leal	(%r14,%r15), %ebx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_8
LBB0_7:
	movq	8(%r12), %r13
LBB0_8:
	movslq	%r14d, %rax
	leaq	(%rax,%r13), %rcx
	movq	%rcx, (%rdx)
	movl	%ebx, 16(%r12)
	movl	%r15d, (%r13,%rax)
	addl	$-8, %r15d
	movl	%r15d, 4(%r13,%rax)
	movq	_Ok@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movq	_OutOfMemory@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OutOfMemory,4,2                ## @OutOfMemory
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"EMF+"

	.comm	_Ok,4,2                         ## @Ok
	.no_dead_strip	_METAFILE_AllocateRecord
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function METAFILE_AllocateRecord
_METAFILE_AllocateRecord:               ; @METAFILE_AllocateRecord
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldr	w22, [x0]
	cbz	w22, LBB0_2
; %bb.1:
	ldr	w23, [x21, #16]
	b	LBB0_4
LBB0_2:
	lsl	w8, w19, #1
	add	w1, w8, #4
	mov	w0, #256
	bl	_max
	mov	x22, x0
	bl	_heap_alloc_zero
	str	x0, [x21, #8]
	cbz	x0, LBB0_9
; %bb.3:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w23, #4
	mov	w2, #4
	bl	_memcpy
	str	w22, [x21]
	str	w23, [x21, #16]
LBB0_4:
	add	w8, w23, w19
	cmp	w8, w22
	b.le	LBB0_7
; %bb.5:
	lsl	w23, w8, #1
	mov	x0, x23
	bl	_heap_alloc_zero
	cbz	x0, LBB0_9
; %bb.6:
	mov	x22, x0
	ldr	x1, [x21, #8]
	ldr	w2, [x21, #16]
	bl	_memcpy
	str	w23, [x21]
	ldr	x0, [x21, #8]
	bl	_heap_free
	str	x22, [x21, #8]
	ldr	w23, [x21, #16]
	add	w8, w23, w19
	b	LBB0_8
LBB0_7:
	ldr	x22, [x21, #8]
LBB0_8:
	add	x9, x22, w23, sxtw
	str	x9, [x20]
	str	w8, [x21, #16]
	sub	w8, w19, #8
	stp	w19, w8, [x9]
Lloh2:
	adrp	x8, _Ok@GOTPAGE
Lloh3:
	ldr	x8, [x8, _Ok@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh4:
	adrp	x8, _OutOfMemory@GOTPAGE
Lloh5:
	ldr	x8, [x8, _OutOfMemory@GOTPAGEOFF]
LBB0_10:
	ldr	w0, [x8]
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_OutOfMemory,4,2                ; @OutOfMemory
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"EMF+"

	.comm	_Ok,4,2                         ; @Ok
	.no_dead_strip	_METAFILE_AllocateRecord
.subsections_via_symbols
