	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function build_image
LCPI0_0:
	.long	8                               ## 0x8
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
LCPI0_1:
	.long	8                               ## 0x8
	.long	8                               ## 0x8
	.space	4
	.space	4
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_build_image:                           ## @build_image
	.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
	movq	_im@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	movq	8(%r15), %rcx
	cmpl	$5, %eax
	jae	LBB0_4
## %bb.3:
	movl	$8, %r12d
	xorl	%edx, %edx
	jmp	LBB0_7
LBB0_1:
	movl	$8, %r12d
	jmp	LBB0_9
LBB0_4:
	movl	%eax, %edx
	andl	$3, %edx
	testq	%rdx, %rdx
	movl	$4, %esi
	cmovneq	%rdx, %rsi
	movq	%rax, %rdx
	subq	%rsi, %rdx
	leaq	32(%rcx), %rsi
	pxor	%xmm0, %xmm0
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [8,0,0,0]
	movdqa	LCPI0_1(%rip), %xmm2            ## xmm2 = <8,8,u,u>
	movq	%rdx, %rdi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	-32(%rsi), %xmm3
	movdqu	-16(%rsi), %xmm4
	punpckldq	%xmm4, %xmm3            ## xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
	movdqu	(%rsi), %xmm4
	movdqu	16(%rsi), %xmm5
	punpckldq	%xmm5, %xmm4            ## xmm4 = xmm4[0],xmm5[0],xmm4[1],xmm5[1]
	paddd	%xmm2, %xmm1
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	paddd	%xmm4, %xmm0
	addq	$64, %rsi
	addq	$-4, %rdi
	jne	LBB0_5
## %bb.6:
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %r12d
LBB0_7:
	subq	%rdx, %rax
	shlq	$4, %rdx
	addq	%rdx, %rcx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx), %edx
	addl	%edx, %r12d
	addl	$8, %r12d
	addq	$16, %rcx
	decq	%rax
	jne	LBB0_8
LBB0_9:
	movl	%r12d, %edi
	movl	$1, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_10
## %bb.11:
	movl	16(%r15), %esi
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_write_header
	cmpl	$0, (%r15)
	jle	LBB0_16
## %bb.12:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	addq	$4, %rbx
	xorl	%r14d, %r14d
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r15), %r13
	leaq	(%r14,%r13), %rsi
	movq	%rbx, %rdi
	callq	_write_part
	testl	%eax, %eax
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	(%r13,%r14), %rax
	addq	%rax, %rbx
	addq	$8, %rbx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	incq	%rcx
	movslq	(%r15), %rax
	addq	$16, %r14
	cmpq	%rax, %rcx
	jl	LBB0_13
LBB0_16:
	leal	-4(%r12), %esi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_write_signature
	movl	4(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_17
## %bb.18:
	movq	%rax, %rbx
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	$1, %edx
	movq	%rax, %rcx
	callq	_fwrite
	cmpl	$1, %eax
	jne	LBB0_19
## %bb.20:
	movq	%r14, %rdi
	callq	_free
	movq	%rbx, %rdi
	callq	_fclose
	xorl	%eax, %eax
	jmp	LBB0_21
LBB0_10:
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_ERROR
	movl	$-1, %eax
	jmp	LBB0_21
LBB0_14:
	movl	8(%r13,%r14), %edx
	leaq	L_.str.1(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_ERROR
	movl	$-1, %eax
	jmp	LBB0_21
LBB0_17:
	movl	4(%r15), %esi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_ERROR
	movl	$-10, %eax
	jmp	LBB0_21
LBB0_19:
	movl	4(%r15), %edx
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_ERROR
	movl	$-11, %eax
LBB0_21:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_im,24,3                        ## @im
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot allocate memory chunk of size '%u'\n"

L_.str.1:                               ## @.str.1
	.asciz	"ERROR: failed writing part %u '%s'\n"

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

L_.str.3:                               ## @.str.3
	.asciz	"Can not create output file: '%s'\n"

L_.str.4:                               ## @.str.4
	.asciz	"Could not write %d bytes into file: '%s'\n"

	.no_dead_strip	_build_image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function build_image
lCPI0_0:
	.long	8                               ; 0x8
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_build_image:                           ; @build_image
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
Lloh0:
	adrp	x24, _im@GOTPAGE
Lloh1:
	ldr	x24, [x24, _im@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	ldr	x9, [x24, #8]
	cmp	w8, #9
	b.hs	LBB0_4
; %bb.2:
	mov	x10, #0
	mov	w19, #8
	b	LBB0_7
LBB0_3:
	mov	w19, #8
	b	LBB0_9
LBB0_4:
	ands	x10, x8, #0x7
	mov	w11, #8
	csel	x10, x11, x10, eq
	sub	x10, x8, x10
	movi.2d	v0, #0000000000000000
Lloh2:
	adrp	x11, lCPI0_0@PAGE
Lloh3:
	ldr	d1, [x11, lCPI0_0@PAGEOFF]
	add	x11, x9, #64
	movi.2s	v2, #8
	mov	x12, x10
	movi.2d	v3, #0000000000000000
	movi.2d	v4, #0000000000000000
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	x13, x11, #64
	ld2.2d	{ v5, v6 }, [x13]
	sub	x13, x11, #32
	ld2.2d	{ v16, v17 }, [x13]
	mov	x13, x11
	ld2.2d	{ v18, v19 }, [x13], #32
	ld2.2d	{ v20, v21 }, [x13]
	xtn.2s	v5, v5
	xtn.2s	v6, v16
	xtn.2s	v7, v18
	xtn.2s	v16, v20
	add.2s	v1, v1, v5
	add.2s	v0, v0, v6
	add.2s	v3, v3, v7
	add.2s	v4, v4, v16
	add.2s	v1, v1, v2
	add.2s	v0, v0, v2
	add.2s	v3, v3, v2
	add.2s	v4, v4, v2
	add	x11, x11, #128
	subs	x12, x12, #8
	b.ne	LBB0_5
; %bb.6:
	add.2s	v0, v0, v1
	add.2s	v0, v3, v0
	add.2s	v0, v4, v0
	addp.2s	v0, v0, v0
	fmov	w19, s0
LBB0_7:
	add	x9, x9, x10, lsl #4
	sub	x8, x8, x10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9], #16
	add	w10, w19, w10
	add	w19, w10, #8
	subs	x8, x8, #1
	b.ne	LBB0_8
LBB0_9:
	mov	x0, x19
	mov	w1, #1
	bl	_calloc
	cbz	x0, LBB0_17
; %bb.10:
	mov	x20, x0
	ldr	w1, [x24, #16]
	bl	_write_header
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.11:
	mov	x25, #0
	mov	x21, #0
	add	x22, x20, #4
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x26, [x24, #8]
	add	x23, x26, x25
	mov	x0, x22
	mov	x1, x23
	bl	_write_part
	cbnz	w0, LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [x26, x25]
	add	x8, x8, x22
	add	x22, x8, #8
	add	x21, x21, #1
	ldrsw	x8, [x24]
	add	x25, x25, #16
	cmp	x21, x8
	b.lt	LBB0_12
LBB0_14:
	sub	w1, w19, #4
	mov	x0, x20
	bl	_write_signature
	ldr	w0, [x24, #4]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_20
; %bb.15:
	mov	x21, x0
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	mov	x3, x21
	bl	_fwrite
	cmp	w0, #1
	b.ne	LBB0_21
; %bb.16:
	mov	x0, x20
	bl	_free
	mov	x0, x21
	bl	_fclose
	mov	w0, #0
	b	LBB0_22
LBB0_17:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	b	LBB0_19
LBB0_18:
	ldr	w8, [x23, #8]
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
LBB0_19:
	bl	_ERROR
	mov	w0, #-1
	b	LBB0_22
LBB0_20:
	ldr	w1, [x24, #4]
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_ERROR
	mov	w0, #-10
	b	LBB0_22
LBB0_21:
	ldr	w8, [x24, #4]
	str	x8, [sp]
Lloh12:
	adrp	x0, l_.str.4@PAGE
Lloh13:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x19
	bl	_ERROR
	mov	w0, #-11
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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdr	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_im,24,3                        ; @im
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot allocate memory chunk of size '%u'\n"

l_.str.1:                               ; @.str.1
	.asciz	"ERROR: failed writing part %u '%s'\n"

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

l_.str.3:                               ; @.str.3
	.asciz	"Can not create output file: '%s'\n"

l_.str.4:                               ; @.str.4
	.asciz	"Could not write %d bytes into file: '%s'\n"

	.no_dead_strip	_build_image
.subsections_via_symbols
