	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lodepng_chunk_append           ## -- Begin function lodepng_chunk_append
	.p2align	4, 0x90
_lodepng_chunk_append:                  ## @lodepng_chunk_append
	.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, %r15
	movq	%rdi, %r12
	movq	%rdx, %rdi
	callq	_lodepng_chunk_length
	movl	%eax, %r14d
	addl	$12, %r14d
	movq	(%r15), %rax
	movq	%rax, %rbx
	movl	$77, %ecx
	addq	%r14, %rbx
	jb	LBB0_29
## %bb.1:
	cmpq	%rax, %rbx
	jb	LBB0_29
## %bb.2:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%r12), %rdi
	movq	%rbx, %rsi
	callq	_lodepng_realloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, (%r12)
	movq	%rbx, (%r15)
	testq	%r14, %r14
	je	LBB0_7
## %bb.4:
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	leaq	(%rax,%r9), %rsi
	cmpl	$8, %r14d
	jb	LBB0_5
## %bb.8:
	movq	%rsi, %rcx
	subq	%r13, %rcx
	cmpq	$32, %rcx
	jae	LBB0_10
LBB0_5:
	xorl	%edx, %edx
LBB0_24:
	movq	%rdx, %rdi
	notq	%rdi
	addq	%r14, %rdi
	movq	%r14, %rcx
	andq	$3, %rcx
	je	LBB0_26
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%r13,%rdx), %ebx
	movb	%bl, (%rsi,%rdx)
	incq	%rdx
	decq	%rcx
	jne	LBB0_25
LBB0_26:
	xorl	%ecx, %ecx
	cmpq	$3, %rdi
	jb	LBB0_29
## %bb.27:
	addq	%r9, %rax
	addq	$3, %rax
	.p2align	4, 0x90
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%r13,%rdx), %ebx
	movb	%bl, -3(%rax,%rdx)
	movzbl	1(%r13,%rdx), %ebx
	movb	%bl, -2(%rax,%rdx)
	movzbl	2(%r13,%rdx), %ebx
	movb	%bl, -1(%rax,%rdx)
	movzbl	3(%r13,%rdx), %ebx
	movb	%bl, (%rax,%rdx)
	addq	$4, %rdx
	cmpq	%rdx, %r14
	jne	LBB0_28
	jmp	LBB0_29
LBB0_6:
	movl	$83, %ecx
	jmp	LBB0_29
LBB0_7:
	xorl	%ecx, %ecx
LBB0_29:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	cmpl	$32, %r14d
	jae	LBB0_12
## %bb.11:
	xorl	%edx, %edx
	jmp	LBB0_21
LBB0_12:
	movl	%r14d, %edx
	andl	$-32, %edx
	leaq	-32(%rdx), %rcx
	movq	%rcx, %rdi
	shrq	$5, %rdi
	incq	%rdi
	movl	%edi, %r8d
	andl	$3, %r8d
	cmpq	$96, %rcx
	jae	LBB0_14
## %bb.13:
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_14:
	andq	$-4, %rdi
	leaq	(%r9,%rax), %rcx
	addq	$112, %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movups	(%r13,%rbx), %xmm0
	movups	16(%r13,%rbx), %xmm1
	movups	%xmm0, -112(%rcx,%rbx)
	movups	%xmm1, -96(%rcx,%rbx)
	movups	32(%r13,%rbx), %xmm0
	movups	48(%r13,%rbx), %xmm1
	movups	%xmm0, -80(%rcx,%rbx)
	movups	%xmm1, -64(%rcx,%rbx)
	movups	64(%r13,%rbx), %xmm0
	movups	80(%r13,%rbx), %xmm1
	movups	%xmm0, -48(%rcx,%rbx)
	movups	%xmm1, -32(%rcx,%rbx)
	movups	96(%r13,%rbx), %xmm0
	movups	112(%r13,%rbx), %xmm1
	movups	%xmm0, -16(%rcx,%rbx)
	movups	%xmm1, (%rcx,%rbx)
	subq	$-128, %rbx
	addq	$-4, %rdi
	jne	LBB0_15
LBB0_16:
	testq	%r8, %r8
	je	LBB0_19
## %bb.17:
	leaq	(%rbx,%r9), %rcx
	addq	%rax, %rcx
	addq	$16, %rcx
	leaq	(%rbx,%r13), %rdi
	addq	$16, %rdi
	shlq	$5, %r8
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rdi,%rbx), %xmm0
	movups	(%rdi,%rbx), %xmm1
	movups	%xmm0, -16(%rcx,%rbx)
	movups	%xmm1, (%rcx,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %r8
	jne	LBB0_18
LBB0_19:
	xorl	%ecx, %ecx
	cmpq	%r14, %rdx
	je	LBB0_29
## %bb.20:
	testb	$24, %r14b
	je	LBB0_24
LBB0_21:
	movq	%rdx, %rcx
	movl	%r14d, %edx
	andl	$-8, %edx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13,%rcx), %rdi
	movq	%rdi, (%rsi,%rcx)
	addq	$8, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_22
## %bb.23:
	xorl	%ecx, %ecx
	cmpq	%r14, %rdx
	je	LBB0_29
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lodepng_chunk_append           ; -- Begin function lodepng_chunk_append
	.p2align	2
_lodepng_chunk_append:                  ; @lodepng_chunk_append
	.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	x20, x1
	mov	x21, x0
	mov	x0, x2
	bl	_lodepng_chunk_length
	add	w23, w0, #12
	ldr	x24, [x20]
	mov	w0, #77
	adds	x22, x24, x23
	b.hs	LBB0_11
; %bb.1:
	cmp	x22, x24
	b.lo	LBB0_11
; %bb.2:
	ldr	x0, [x21]
	mov	x1, x22
	bl	_lodepng_realloc
	cbz	x0, LBB0_10
; %bb.3:
	str	x0, [x21]
	str	x22, [x20]
	cbz	w23, LBB0_9
; %bb.4:
	cmp	w23, #8
	b.lo	LBB0_6
; %bb.5:
	add	x8, x24, x0
	sub	x8, x8, x19
	cmp	x8, #64
	b.hs	LBB0_12
LBB0_6:
	mov	x8, #0
LBB0_7:
	add	x9, x19, x8
	add	x10, x8, x24
	add	x10, x0, x10
	sub	x8, x23, x8
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w11, [x9], #1
	strb	w11, [x10], #1
	subs	x8, x8, #1
	b.ne	LBB0_8
LBB0_9:
	mov	w0, #0
	b	LBB0_11
LBB0_10:
	mov	w0, #83
LBB0_11:
	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_12:
	cmp	w23, #64
	b.hs	LBB0_14
; %bb.13:
	mov	x8, #0
	b	LBB0_18
LBB0_14:
	and	x8, x23, #0xffffffc0
	add	x9, x24, x0
	add	x9, x9, #32
	add	x10, x19, #32
	mov	x11, x8
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x10, #-32]
	ldp	q2, q3, [x10], #64
	stp	q0, q1, [x9, #-32]
	stp	q2, q3, [x9], #64
	subs	x11, x11, #64
	b.ne	LBB0_15
; %bb.16:
	cmp	x8, x23
	b.eq	LBB0_9
; %bb.17:
	tst	x23, #0x38
	b.eq	LBB0_7
LBB0_18:
	mov	x11, x8
	and	x8, x23, #0xfffffff8
	add	x9, x19, x11
	add	x10, x11, x24
	add	x10, x0, x10
	sub	x11, x11, x8
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	d0, [x9], #8
	str	d0, [x10], #8
	adds	x11, x11, #8
	b.ne	LBB0_19
; %bb.20:
	cmp	x8, x23
	b.eq	LBB0_9
	b	LBB0_7
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
