	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function image_chunk_append
_image_chunk_append:                    ## @image_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
	movl	%ecx, %r15d
	movq	%rdx, %r12
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	_chunk_head@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_image_chunks@GOTPCREL(%rip), %rdi
	callq	_TAILQ_LAST
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movq	_CH_TYPE_FILE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.2:
	cmpl	%r15d, 24(%rbx)
	jne	LBB0_8
## %bb.3:
	movslq	16(%rbx), %rcx
	movq	_secsz@GOTPCREL(%rip), %r14
	movl	%ecx, %eax
	cltd
	idivl	(%r14)
	cltq
	addq	8(%rbx), %rax
	cmpq	%r13, %rax
	jne	LBB0_8
## %bb.4:
	addq	32(%rbx), %rcx
	cmpq	%r12, %rcx
	jne	LBB0_8
## %bb.5:
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_image_chunk_grow
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movslq	16(%rbx), %r12
	movl	%r12d, %eax
	cltd
	idivl	(%r14)
	movslq	%eax, %r13
	addq	8(%rbx), %r13
	addq	32(%rbx), %r12
LBB0_8:
	movl	$40, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, %r14
	xorl	%ebx, %ebx
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	%r13, 8(%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, 16(%r14)
	movq	_CH_TYPE_FILE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	%r12, 32(%r14)
	movl	%r15d, 24(%r14)
	movq	_ch_list@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_image_chunks@GOTPCREL(%rip), %rdi
	movq	%r14, %rsi
	callq	_TAILQ_INSERT_TAIL
	movq	_image_nchunks@GOTPCREL(%rip), %rax
	incl	(%rax)
	jmp	LBB0_11
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_image_chunks,4,2               ## @image_chunks
	.comm	_chunk_head,4,2                 ## @chunk_head
	.comm	_CH_TYPE_FILE,8,3               ## @CH_TYPE_FILE
	.comm	_secsz,4,2                      ## @secsz
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ch_list,4,2                    ## @ch_list
	.comm	_image_nchunks,4,2              ## @image_nchunks
	.no_dead_strip	_image_chunk_append
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function image_chunk_append
_image_chunk_append:                    ; @image_chunk_append
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _chunk_head@GOTPAGE
Lloh1:
	ldr	x8, [x8, _chunk_head@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, _image_chunks@GOTPAGE
Lloh4:
	ldr	x0, [x0, _image_chunks@GOTPAGEOFF]
	bl	_TAILQ_LAST
Lloh5:
	adrp	x24, _CH_TYPE_FILE@GOTPAGE
Lloh6:
	ldr	x24, [x24, _CH_TYPE_FILE@GOTPAGEOFF]
	cbz	x0, LBB0_7
; %bb.1:
	mov	x23, x0
	ldr	x8, [x0]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.2:
	ldr	w8, [x23, #24]
	cmp	w8, w19
	b.ne	LBB0_7
; %bb.3:
	ldr	x9, [x23, #8]
	ldrsw	x8, [x23, #16]
Lloh7:
	adrp	x25, _secsz@GOTPAGE
Lloh8:
	ldr	x25, [x25, _secsz@GOTPAGEOFF]
	ldr	w10, [x25]
	sdiv	w10, w8, w10
	add	x9, x9, w10, sxtw
	cmp	x9, x22
	b.ne	LBB0_7
; %bb.4:
	ldr	x9, [x23, #32]
	add	x8, x9, x8
	cmp	x8, x21
	b.ne	LBB0_7
; %bb.5:
	mov	x0, x23
	mov	x1, x20
	bl	_image_chunk_grow
	cbz	x0, LBB0_10
; %bb.6:
	mov	x20, x0
	ldr	x8, [x23, #8]
	ldrsw	x9, [x23, #16]
	ldr	w10, [x25]
	sdiv	w10, w9, w10
	add	x22, x8, w10, sxtw
	ldr	x8, [x23, #32]
	add	x21, x8, x9
LBB0_7:
	mov	w0, #40
	bl	_malloc
	cbz	x0, LBB0_9
; %bb.8:
	mov	x23, x0
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	str	w20, [x23, #16]
	ldr	x8, [x24]
	stp	x8, x22, [x23]
	str	x21, [x23, #32]
	str	w19, [x23, #24]
Lloh9:
	adrp	x8, _ch_list@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ch_list@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x0, _image_chunks@GOTPAGE
Lloh13:
	ldr	x0, [x0, _image_chunks@GOTPAGEOFF]
	mov	x1, x23
	bl	_TAILQ_INSERT_TAIL
	mov	w0, #0
Lloh14:
	adrp	x8, _image_nchunks@GOTPAGE
Lloh15:
	ldr	x8, [x8, _image_nchunks@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	b	LBB0_10
LBB0_9:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
LBB0_10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_image_chunks,4,2               ; @image_chunks
	.comm	_chunk_head,4,2                 ; @chunk_head
	.comm	_CH_TYPE_FILE,8,3               ; @CH_TYPE_FILE
	.comm	_secsz,4,2                      ; @secsz
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ch_list,4,2                    ; @ch_list
	.comm	_image_nchunks,4,2              ; @image_nchunks
	.no_dead_strip	_image_chunk_append
.subsections_via_symbols
