	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function append_buf
_append_buf:                            ## @append_buf
	.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
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	%rdx, %rdi
	callq	_strlen
	movl	%eax, %r14d
	movq	(%r15), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.2:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_strlen
	movl	%eax, %r13d
	leal	2(%r13), %eax
	xorl	%ecx, %ecx
	testl	%r13d, %r13d
	cmovgl	%eax, %ecx
	leal	(%r14,%rcx), %esi
	incl	%esi
	cmpl	(%r12), %esi
	jle	LBB0_5
## %bb.3:
	leal	255(%rsi), %eax
	addl	$510, %esi                      ## imm = 0x1FE
	testl	%eax, %eax
	cmovnsl	%eax, %esi
	andl	$-256, %esi
	movl	%esi, (%r12)
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_OPENSSL_realloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:
	movq	%rax, %rbx
	movq	%rax, (%r15)
LBB0_5:
	testl	%r13d, %r13d
	jle	LBB0_7
## %bb.6:
	movl	%r13d, %eax
	movw	$8236, (%rbx,%rax)              ## imm = 0x202C
	addq	%rax, %rbx
	addq	$2, %rbx
LBB0_7:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_8
LBB0_1:
	leal	256(%r14), %eax
	addl	$511, %r14d                     ## imm = 0x1FF
	testl	%eax, %eax
	cmovnsl	%eax, %r14d
	andl	$-256, %r14d
	movl	%r14d, (%r12)
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	callq	_app_malloc
	movq	%rax, %rbx
	movq	%rax, (%r15)
LBB0_8:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_strcpy
	movl	$1, %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	(%r15), %rdi
	callq	_OPENSSL_free
	movq	$0, (%r15)
	xorl	%eax, %eax
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"engine buffer"

	.no_dead_strip	_append_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function append_buf
_append_buf:                            ; @append_buf
	.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	x19, x2
	mov	x22, x1
	mov	x20, x0
	mov	x0, x2
	bl	_strlen
	mov	x24, x0
	ldr	x21, [x20]
	cbz	x21, LBB0_6
; %bb.1:
	mov	x0, x21
	bl	_strlen
	mov	x23, x0
	add	w8, w0, #2
	cmp	w0, #0
	csel	w8, w8, wzr, gt
	add	w8, w24, w8
	add	w8, w8, #1
	ldr	w9, [x22]
	cmp	w8, w9
	b.le	LBB0_4
; %bb.2:
	add	w9, w8, #255
	add	w8, w8, #510
	cmp	w9, #0
	csel	w8, w8, w9, lt
	and	w1, w8, #0xffffff00
	str	w1, [x22]
	mov	x0, x21
	bl	_OPENSSL_realloc
	cbz	x0, LBB0_9
; %bb.3:
	mov	x21, x0
	str	x0, [x20]
LBB0_4:
	cmp	w23, #1
	b.lt	LBB0_7
; %bb.5:
	add	x21, x21, w23, uxtw
	mov	w8, #8236
	strh	w8, [x21], #2
	b	LBB0_7
LBB0_6:
	add	w8, w24, #256
	add	w9, w24, #511
	cmp	w8, #0
	csel	w8, w9, w8, lt
	and	w0, w8, #0xffffff00
	str	w0, [x22]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_app_malloc
	mov	x21, x0
	str	x0, [x20]
LBB0_7:
	mov	x0, x21
	mov	x1, x19
	bl	_strcpy
	mov	w0, #1
LBB0_8:
	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
LBB0_9:
	ldr	x0, [x20]
	bl	_OPENSSL_free
	mov	w0, #0
	str	xzr, [x20]
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"engine buffer"

	.no_dead_strip	_append_buf
.subsections_via_symbols
