	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lodepng_chunk_create           ## -- Begin function lodepng_chunk_create
	.p2align	4, 0x90
_lodepng_chunk_create:                  ## @lodepng_chunk_create
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	(%rsi), %rax
	movl	%edx, %esi
	leaq	12(%rsi), %r13
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	addq	%rax, %r13
	setb	%bl
	leal	12(%r12), %edx
	movl	$77, %eax
	cmpq	%rdx, %r13
	jb	LBB0_15
## %bb.1:
	testb	%bl, %bl
	jne	LBB0_15
## %bb.2:
	movq	%r8, %r14
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	movq	%r13, %rsi
	callq	_lodepng_realloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.3:
	movq	%rax, (%rbx)
	movq	%r13, (%r15)
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	leaq	(%rax,%r15), %rbx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movq	%rax, %r13
	callq	_lodepng_set32bitInt
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movb	(%rcx), %al
	movb	%al, 4(%r13,%r15)
	movb	1(%rcx), %al
	movb	%al, 5(%r13,%r15)
	movb	2(%rcx), %al
	movb	%al, 6(%r13,%r15)
	movb	3(%rcx), %al
	movb	%al, 7(%r13,%r15)
	testl	%r12d, %r12d
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	je	LBB0_13
## %bb.4:
	movq	%r13, %r10
	cmpl	$8, %r12d
	jae	LBB0_16
LBB0_5:
	xorl	%eax, %eax
LBB0_6:
	movq	%rax, %r8
	notq	%r8
	addq	%r9, %r8
	movq	%r9, %rdx
	andq	$3, %rdx
	je	LBB0_10
## %bb.7:
	movq	%rax, %rsi
	negq	%rsi
	leal	8(%rax), %edi
	addq	%rdi, %r15
	addq	%r15, %r10
	addq	%r14, %rax
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%rax,%rdi), %ecx
	movb	%cl, (%r10,%rdi)
	incq	%rdi
	decq	%rsi
	cmpq	%rdi, %rdx
	jne	LBB0_8
## %bb.9:
	negq	%rsi
	movq	%rsi, %rax
LBB0_10:
	cmpq	$3, %r8
	jb	LBB0_13
## %bb.11:
	negq	%r9
	addq	$8, %rax
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movzbl	-8(%r14,%rax), %ecx
	movl	%eax, %edx
	movb	%cl, (%rbx,%rdx)
	movzbl	-7(%r14,%rax), %ecx
	leal	1(%rax), %edx
	movb	%cl, (%rbx,%rdx)
	movzbl	-6(%r14,%rax), %ecx
	leal	2(%rax), %edx
	movb	%cl, (%rbx,%rdx)
	movzbl	-5(%r14,%rax), %ecx
	leal	3(%rax), %edx
	movb	%cl, (%rbx,%rdx)
	leaq	(%r9,%rax), %rcx
	addq	$4, %rcx
	addq	$4, %rax
	cmpq	$8, %rcx
	jne	LBB0_12
LBB0_13:
	movq	%rbx, %rdi
	callq	_lodepng_chunk_generate_crc
	xorl	%eax, %eax
	jmp	LBB0_15
LBB0_14:
	movl	$83, %eax
LBB0_15:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	leaq	-1(%r9), %rcx
	movl	%ecx, %edx
	notl	%edx
	xorl	%eax, %eax
	testl	$-8, %edx
	je	LBB0_6
## %bb.17:
	shrq	$32, %rcx
	jne	LBB0_6
## %bb.18:
	movq	%rbx, %rax
	subq	%r14, %rax
	addq	$8, %rax
	cmpq	$32, %rax
	jb	LBB0_5
## %bb.20:
	cmpl	$32, %r12d
	jae	LBB0_22
## %bb.21:
	xorl	%eax, %eax
	jmp	LBB0_31
LBB0_22:
	movl	%r9d, %eax
	andl	$-32, %eax
	leaq	-32(%rax), %rcx
	movq	%rcx, %rdx
	shrq	$5, %rdx
	incq	%rdx
	testq	%rcx, %rcx
	je	LBB0_26
## %bb.23:
	movq	%rdx, %rsi
	andq	$-2, %rsi
	movl	$32, %ecx
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	leal	-32(%rcx), %edi
	movups	-32(%r14,%rcx), %xmm0
	movups	-16(%r14,%rcx), %xmm1
	andl	$-64, %edi
	movups	%xmm0, 8(%rbx,%rdi)
	movups	%xmm1, 24(%rbx,%rdi)
	movups	(%r14,%rcx), %xmm0
	movups	16(%r14,%rcx), %xmm1
	movl	%ecx, %edi
	andl	$-32, %edi
	movups	%xmm0, 8(%rbx,%rdi)
	movups	%xmm1, 24(%rbx,%rdi)
	addq	$64, %rcx
	addq	$-2, %rsi
	jne	LBB0_24
## %bb.25:
	addq	$-32, %rcx
	jmp	LBB0_27
LBB0_26:
	xorl	%ecx, %ecx
LBB0_27:
	testb	$1, %dl
	je	LBB0_29
## %bb.28:
	movups	(%r14,%rcx), %xmm0
	movups	16(%r14,%rcx), %xmm1
	andl	$-32, %ecx
	movups	%xmm0, 8(%rbx,%rcx)
	movups	%xmm1, 24(%rbx,%rcx)
LBB0_29:
	cmpq	%r9, %rax
	je	LBB0_13
## %bb.30:
	testb	$24, %r9b
	je	LBB0_6
LBB0_31:
	movq	%rax, %rcx
	movl	%r9d, %eax
	andl	$-8, %eax
	addq	$8, %rcx
	movq	%rax, %rdx
	negq	%rdx
	.p2align	4, 0x90
LBB0_32:                                ## =>This Inner Loop Header: Depth=1
	movq	-8(%r14,%rcx), %rsi
	movl	%ecx, %edi
	andl	$-8, %edi
	movq	%rsi, (%rbx,%rdi)
	leaq	(%rdx,%rcx), %rsi
	addq	$8, %rsi
	addq	$8, %rcx
	cmpq	$8, %rsi
	jne	LBB0_32
## %bb.33:
	cmpq	%r9, %rax
	jne	LBB0_6
	jmp	LBB0_13
	.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_create           ; -- Begin function lodepng_chunk_create
	.p2align	2
_lodepng_chunk_create:                  ; @lodepng_chunk_create
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x0
	ldr	x27, [x1]
	mov	w26, w2
	add	x8, x26, #12
	adds	x25, x8, x27
	cset	w8, hs
	add	w9, w2, #12
	mov	w0, #77
	cmp	x25, x9
	b.lo	LBB0_22
; %bb.1:
	tbnz	w8, #0, LBB0_22
; %bb.2:
	mov	x19, x4
	mov	x23, x3
	mov	x21, x2
	mov	x20, x1
	ldr	x0, [x24]
	mov	x1, x25
	bl	_lodepng_realloc
	cbz	x0, LBB0_6
; %bb.3:
	mov	x22, x0
	str	x0, [x24]
	str	x25, [x20]
	add	x20, x0, x27
	mov	x0, x20
	mov	x1, x21
	bl	_lodepng_set32bitInt
	ldrb	w8, [x23]
	strb	w8, [x20, #4]
	ldrb	w8, [x23, #1]
	strb	w8, [x20, #5]
	ldrb	w8, [x23, #2]
	strb	w8, [x20, #6]
	ldrb	w8, [x23, #3]
	strb	w8, [x20, #7]
	cbz	w21, LBB0_21
; %bb.4:
	cmp	w21, #8
	b.hs	LBB0_7
; %bb.5:
	mov	x8, #0
	b	LBB0_20
LBB0_6:
	mov	w0, #83
	b	LBB0_22
LBB0_7:
	mov	x8, #0
	sub	x9, x26, #1
	mvn	w10, w9
	tst	x10, #0xfffffff8
	b.eq	LBB0_20
; %bb.8:
	lsr	x9, x9, #32
	cbnz	x9, LBB0_20
; %bb.9:
	add	x8, x27, x22
	sub	x8, x8, x19
	add	x8, x8, #8
	cmp	x8, #64
	b.hs	LBB0_11
; %bb.10:
	mov	x8, #0
	b	LBB0_20
LBB0_11:
	cmp	w21, #64
	b.hs	LBB0_13
; %bb.12:
	mov	x8, #0
	b	LBB0_17
LBB0_13:
	and	x8, x26, #0xffffffc0
	add	x9, x19, #32
	add	x10, x27, x22
	add	x10, x10, #40
	mov	x11, x8
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x9, #-32]
	ldp	q2, q3, [x9], #64
	stp	q0, q1, [x10, #-32]
	stp	q2, q3, [x10], #64
	subs	x11, x11, #64
	b.ne	LBB0_14
; %bb.15:
	cmp	x8, x26
	b.eq	LBB0_21
; %bb.16:
	tst	x26, #0x38
	b.eq	LBB0_20
LBB0_17:
	mov	x9, x8
	and	x8, x26, #0xfffffff8
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	d0, [x19, x9]
	add	x9, x9, #8
	and	x10, x9, #0xfffffff8
	str	d0, [x20, x10]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.19:
	cmp	x8, x26
	b.eq	LBB0_21
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w9, [x19, x8]
	add	w10, w8, #8
	strb	w9, [x20, w10, uxtw]
	add	x8, x8, #1
	cmp	x26, x8
	b.ne	LBB0_20
LBB0_21:
	mov	x0, x20
	bl	_lodepng_chunk_generate_crc
	mov	w0, #0
LBB0_22:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
