	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function append_msgs_to_imap
_append_msgs_to_imap:                   ## @append_msgs_to_imap
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movq	_STRBUF_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movl	$0, -52(%rbp)
	movl	8(%rdi), %esi
	callq	_imap_open_store
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	8(%r12), %ecx
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	%ecx, (%rax)
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	cmpl	$1, %ebx
	leaq	L_.str.3(%rip), %rax
	leaq	L_.str.2(%rip), %rcx
	cmoveq	%rax, %rcx
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_fprintf
	leaq	-48(%rbp), %r13
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_imap_store_msg
	incl	%r14d
	addl	$100, %r15d
	movq	_DRV_OK@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %eax
	cltd
	idivl	%ebx
	movq	_stderr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edx
	movl	%r14d, %ecx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_fprintf
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	leaq	-52(%rbp), %rdx
	callq	_split_msg
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, (%r12)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	_wrap_in_html
	jmp	LBB0_6
LBB0_7:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_fprintf
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_imap_close_store
	jmp	LBB0_8
LBB0_1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	$1, %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STRBUF_INIT,4,2                ## @STRBUF_INIT
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to open store\n"

L_.str.1:                               ## @.str.1
	.asciz	"sending %d message%s\n"

L_.str.2:                               ## @.str.2
	.asciz	"s"

L_.str.3:                               ## @.str.3
	.space	1

L_.str.4:                               ## @.str.4
	.asciz	"%4u%% (%d/%d) done\r"

	.comm	_DRV_OK,4,2                     ## @DRV_OK
L_.str.5:                               ## @.str.5
	.asciz	"\n"

	.no_dead_strip	_append_msgs_to_imap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function append_msgs_to_imap
_append_msgs_to_imap:                   ; @append_msgs_to_imap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _STRBUF_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STRBUF_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	stp	wzr, w8, [sp, #36]
	ldr	w1, [x0, #8]
	bl	_imap_open_store
	cbz	x0, LBB0_7
; %bb.1:
	mov	x22, x0
	ldr	w8, [x21, #8]
	str	w8, [x0]
Lloh3:
	adrp	x24, _stderr@GOTPAGE
Lloh4:
	ldr	x24, [x24, _stderr@GOTPAGEOFF]
	ldr	w0, [x24]
Lloh5:
	adrp	x8, l_.str.2@PAGE
Lloh6:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh7:
	adrp	x9, l_.str.3@PAGE
Lloh8:
	add	x9, x9, l_.str.3@PAGEOFF
	cmp	w19, #1
	csel	x8, x9, x8, eq
	mov	x9, x19
	stp	x9, x8, [sp]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	mov	w25, #0
	mov	w26, #0
Lloh11:
	adrp	x27, _DRV_OK@GOTPAGE
Lloh12:
	ldr	x27, [x27, _DRV_OK@GOTPAGEOFF]
Lloh13:
	adrp	x23, l_.str.4@PAGE
Lloh14:
	add	x23, x23, l_.str.4@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x1, sp, #40
	mov	x0, x22
	bl	_imap_store_msg
	ldr	w8, [x27]
	add	w26, w26, #1
	add	w25, w25, #100
	cmp	w0, w8
	b.ne	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x24]
	sdiv	w8, w25, w19
	stp	x26, x19, [sp, #8]
	str	x8, [sp]
	mov	x1, x23
	bl	_fprintf
	add	x1, sp, #40
	add	x2, sp, #36
	mov	x0, x20
	bl	_split_msg
	cbz	w0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x21]
	cbz	x8, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x0, sp, #40
	bl	_wrap_in_html
	b	LBB0_2
LBB0_6:
	ldr	w0, [x24]
Lloh15:
	adrp	x1, l_.str.5@PAGE
Lloh16:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_fprintf
	mov	x0, x22
	bl	_imap_close_store
	mov	w0, #0
	b	LBB0_8
LBB0_7:
Lloh17:
	adrp	x8, _stderr@GOTPAGE
Lloh18:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #1
LBB0_8:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_STRBUF_INIT,4,2                ; @STRBUF_INIT
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to open store\n"

l_.str.1:                               ; @.str.1
	.asciz	"sending %d message%s\n"

l_.str.2:                               ; @.str.2
	.asciz	"s"

l_.str.3:                               ; @.str.3
	.space	1

l_.str.4:                               ; @.str.4
	.asciz	"%4u%% (%d/%d) done\r"

	.comm	_DRV_OK,4,2                     ; @DRV_OK
l_.str.5:                               ; @.str.5
	.asciz	"\n"

	.no_dead_strip	_append_msgs_to_imap
.subsections_via_symbols
