	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function build_image
_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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r14d
	movl	%ecx, -156(%rbp)                ## 4-byte Spill
	movq	%rdx, %rbx
	movq	%rsi, -152(%rbp)                ## 8-byte Spill
	movq	%rdi, %r12
	movq	16(%rbp), %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -80(%rbp)
	movq	$0, -64(%rbp)
	movq	16(%r15), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	movl	%r9d, -132(%rbp)                ## 4-byte Spill
	je	LBB0_1
## %bb.2:
	movq	%rbx, -168(%rbp)                ## 8-byte Spill
	movl	%r14d, -136(%rbp)               ## 4-byte Spill
	movq	%r12, -176(%rbp)                ## 8-byte Spill
	xorl	%r13d, %r13d
	leaq	L_.str(%rip), %rbx
	movq	%rax, -144(%rbp)                ## 8-byte Spill
	movq	%rax, %r15
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rsi
	callq	_strcmp
	testl	%eax, %eax
	cmoveq	%r13, %r14
	cmoveq	%r15, %r12
	incq	%r13
	movq	24(%r15), %rdi
	addq	$24, %r15
	testq	%rdi, %rdi
	jne	LBB0_3
## %bb.4:
	testq	%r12, %r12
	je	LBB0_5
## %bb.6:
	leaq	1(%r14), %rbx
	leaq	-128(%rbp), %rsi
	movq	-152(%rbp), %rdi                ## 8-byte Reload
	callq	_stat
	testq	%rax, %rax
	jns	LBB0_8
## %bb.7:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movl	$1, %edi
	movq	-152(%rbp), %rcx                ## 8-byte Reload
	xorl	%eax, %eax
	callq	_error
LBB0_8:
	leaq	(%rbx,%rbx,2), %r9
	movq	-128(%rbp), %rax
	cmpq	8(%r12), %rax
	movq	16(%rbp), %r15
	jle	LBB0_10
## %bb.9:
	leaq	L_.str.2(%rip), %rdx
	movl	$1, %edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	movq	%r9, %r13
	callq	_error
	movq	%r13, %r9
LBB0_10:
	movq	-144(%rbp), %r8                 ## 8-byte Reload
	leaq	(%r8,%r9,8), %rdi
	movq	_MAX_PARTITIONS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	decq	%rax
	cmpq	%rax, %rbx
	ja	LBB0_13
## %bb.11:
	leaq	(,%rax,8), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rdx
	movq	16(%rdx,%rcx), %rsi
	movq	%rsi, 40(%rdx,%rcx)
	movups	(%rdx,%rcx), %xmm0
	movups	%xmm0, 24(%rdx,%rcx)
	decq	%rax
	addq	$-24, %rcx
	cmpq	%rbx, %rax
	jae	LBB0_12
LBB0_13:
	leaq	L_.str.3(%rip), %rax
	movq	%rdi, %r13
	movq	%rax, (%rdi)
	movq	-128(%rbp), %rdi
	movq	16(%r12), %rax
	addq	%rdi, %rax
	movq	%rax, 16(%r8,%r9,8)
	cmpl	$0, -132(%rbp)                  ## 4-byte Folded Reload
	jne	LBB0_15
## %bb.14:
	leaq	(%r8,%r9,8), %rax
	addq	$16, %rax
	movq	%rax, -184(%rbp)                ## 8-byte Spill
	addq	16(%r12), %rdi
	movl	$65536, %esi                    ## imm = 0x10000
	movq	%r9, %rbx
	callq	_ALIGN
	movq	%rbx, %r9
	movq	-144(%rbp), %r8                 ## 8-byte Reload
	movq	-184(%rbp), %rcx                ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	-128(%rbp), %rdi
LBB0_15:
	movq	8(%r12), %rcx
	subq	%rax, %rcx
	movq	%rcx, 8(%r8,%r9,8)
	leaq	(%r14,%r14,2), %rax
	leaq	L_.str.4(%rip), %rcx
	movq	%rcx, (%r8,%rax,8)
	movq	%rdi, 8(%r8,%rax,8)
	movq	16(%r15), %rax
	movq	-176(%rbp), %r12                ## 8-byte Reload
	movl	-136(%rbp), %r14d               ## 4-byte Reload
	movq	-168(%rbp), %rbx                ## 8-byte Reload
	jmp	LBB0_16
LBB0_1:
	xorl	%r13d, %r13d
	jmp	LBB0_16
LBB0_5:
	xorl	%r13d, %r13d
	movq	-176(%rbp), %r12                ## 8-byte Reload
	movq	16(%rbp), %r15
	movl	-136(%rbp), %r14d               ## 4-byte Reload
	movq	-168(%rbp), %rbx                ## 8-byte Reload
	movq	-144(%rbp), %rax                ## 8-byte Reload
LBB0_16:
	movq	%rax, %rdi
	callq	_make_partition_table
	movq	%rax, -112(%rbp)
	movq	8(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.17:
	callq	_make_soft_version_from_string
	jmp	LBB0_19
LBB0_18:
	movl	-156(%rbp), %edi                ## 4-byte Reload
	callq	_make_soft_version
LBB0_19:
	movq	%rax, -104(%rbp)
	movq	%r15, %rdi
	callq	_make_support_list
	movq	%rax, -96(%rbp)
	leaq	L_.str.4(%rip), %rdi
	movq	-152(%rbp), %rsi                ## 8-byte Reload
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_read_file
	movq	%rax, -88(%rbp)
	leaq	L_.str.3(%rip), %rdi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	movq	%r13, %rcx
	callq	_read_file
	movq	%rax, -80(%rbp)
	movl	(%r15), %edi
	leaq	L_.str.5(%rip), %rsi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_24
## %bb.20:
	movl	(%r15), %edi
	leaq	L_.str.6(%rip), %rsi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_24
## %bb.21:
	movl	(%r15), %edi
	leaq	L_.str.7(%rip), %rsi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_24
## %bb.22:
	movl	(%r15), %edi
	leaq	L_.str.8(%rip), %rsi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_24
## %bb.23:
	movl	(%r15), %edi
	leaq	L_.str.9(%rip), %rsi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_24
## %bb.25:
	movl	(%r15), %edi
	leaq	L_.str.11(%rip), %rsi
	callq	_strcasecmp
	testq	%rax, %rax
	movl	-132(%rbp), %ebx                ## 4-byte Reload
	je	LBB0_28
## %bb.26:
	movl	(%r15), %edi
	leaq	L_.str.12(%rip), %rsi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_28
## %bb.27:
	movl	(%r15), %edi
	leaq	L_.str.13(%rip), %rsi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_28
## %bb.29:
	movl	(%r15), %edi
	leaq	L_.str.15(%rip), %rsi
	callq	_strcasecmp
	testq	%rax, %rax
	jne	LBB0_32
## %bb.30:
	movl	$65536, -121(%rbp)              ## imm = 0x10000
	movq	$33554432, -128(%rbp)           ## imm = 0x2000000
	jmp	LBB0_31
LBB0_24:
	movl	$256, -121(%rbp)                ## imm = 0x100
	movq	$33554432, -128(%rbp)           ## imm = 0x2000000
	leaq	L_.str.10(%rip), %rdi
	leaq	-128(%rbp), %rsi
	movl	$11, %edx
	callq	_put_data
	movq	%rax, -72(%rbp)
	movl	-132(%rbp), %ebx                ## 4-byte Reload
LBB0_32:
	leaq	-112(%rbp), %rsi
	leaq	-128(%rbp), %rdx
	movq	%r15, %rdi
	testl	%ebx, %ebx
	je	LBB0_34
## %bb.33:
	callq	_generate_sysupgrade_image
	jmp	LBB0_35
LBB0_34:
	callq	_generate_factory_image
LBB0_35:
	movq	%rax, %r14
	leaq	L_.str.17(%rip), %rsi
	movq	%r12, %rdi
	callq	_fopen
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_37
## %bb.36:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.18(%rip), %rdx
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_error
LBB0_37:
	movq	-128(%rbp), %rsi
	movq	%r14, %rdi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	_fwrite
	cmpl	$1, %eax
	je	LBB0_39
## %bb.38:
	leaq	L_.str.19(%rip), %rdx
	movl	$1, %edi
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_error
LBB0_39:
	movq	%rbx, %rdi
	callq	_fclose
	movq	%r14, %rdi
	callq	_free
	movq	-112(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_42
## %bb.40:
	leaq	-104(%rbp), %rbx
	.p2align	4, 0x90
LBB0_41:                                ## =>This Inner Loop Header: Depth=1
	callq	_free_image_partition
	movq	(%rbx), %rdi
	addq	$8, %rbx
	testq	%rdi, %rdi
	jne	LBB0_41
LBB0_42:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_44
## %bb.43:
	addq	$152, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	movabsq	$56857945329106945, %rax        ## imm = 0xCA000002000001
	movq	%rax, -128(%rbp)
	movl	$256, -121(%rbp)                ## imm = 0x100
LBB0_31:
	leaq	L_.str.10(%rip), %rdi
	leaq	-128(%rbp), %rsi
	movl	$11, %edx
	callq	_put_data
	movq	%rax, -72(%rbp)
	jmp	LBB0_32
LBB0_44:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"firmware"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"unable to stat file `%s'"

L_.str.2:                               ## @.str.2
	.asciz	"kernel overflowed firmware partition\n"

	.comm	_MAX_PARTITIONS,4,2             ## @MAX_PARTITIONS
L_.str.3:                               ## @.str.3
	.asciz	"file-system"

L_.str.4:                               ## @.str.4
	.asciz	"os-image"

L_.str.5:                               ## @.str.5
	.asciz	"ARCHER-C2-V3"

L_.str.6:                               ## @.str.6
	.asciz	"ARCHER-C25-V1"

L_.str.7:                               ## @.str.7
	.asciz	"ARCHER-C59-V2"

L_.str.8:                               ## @.str.8
	.asciz	"ARCHER-C60-V2"

L_.str.9:                               ## @.str.9
	.asciz	"TLWR1043NV5"

	.section	__TEXT,__const
l___const.build_image.mdat:             ## @__const.build_image.mdat
	.asciz	"\000\000\000\002\000\000\000\000\001\000"

	.section	__TEXT,__cstring,cstring_literals
L_.str.10:                              ## @.str.10
	.asciz	"extra-para"

L_.str.11:                              ## @.str.11
	.asciz	"ARCHER-A7-V5"

L_.str.12:                              ## @.str.12
	.asciz	"ARCHER-C7-V4"

L_.str.13:                              ## @.str.13
	.asciz	"ARCHER-C7-V5"

	.section	__TEXT,__const
l___const.build_image.mdat.14:          ## @__const.build_image.mdat.14
	.asciz	"\001\000\000\002\000\000\312\000\001\000"

	.section	__TEXT,__cstring,cstring_literals
L_.str.15:                              ## @.str.15
	.asciz	"ARCHER-C6-V2"

	.section	__TEXT,__const
l___const.build_image.mdat.16:          ## @__const.build_image.mdat.16
	.asciz	"\000\000\000\002\000\000\000\000\000\001"

	.section	__TEXT,__cstring,cstring_literals
L_.str.17:                              ## @.str.17
	.asciz	"wb"

L_.str.18:                              ## @.str.18
	.asciz	"unable to open output file"

L_.str.19:                              ## @.str.19
	.asciz	"unable to write output file"

	.no_dead_strip	_build_image
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function build_image
_build_image:                           ; @build_image
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x28, x27, [sp, #112]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #128]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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	x20, x6
	mov	x21, x5
	mov	x22, x4
	mov	x26, x3
	mov	x23, x2
	mov	x24, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	stp	xzr, xzr, [sp, #88]
	ldr	x25, [x6, #16]
	ldr	x0, [x25]
	cbz	x0, LBB0_14
; %bb.1:
	stp	w26, w22, [sp, #16]             ; 8-byte Folded Spill
	mov	x22, x21
	str	x19, [sp, #24]                  ; 8-byte Folded Spill
	mov	x21, #0
	mov	x19, #0
	mov	x28, #0
	mov	x26, x25
Lloh3:
	adrp	x27, l_.str@PAGE
Lloh4:
	add	x27, x27, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x1, x27
	bl	_strcmp
	cmp	w0, #0
	csel	x28, x21, x28, eq
	csel	x19, x26, x19, eq
	add	x21, x21, #1
	ldr	x0, [x26, #24]!
	cbnz	x0, LBB0_2
; %bb.3:
	cbz	x19, LBB0_15
; %bb.4:
	add	x21, x28, #1
	mov	w26, #24
	add	x1, sp, #32
	mov	x0, x24
	bl	_stat
	tbz	x0, #63, LBB0_6
; %bb.5:
Lloh5:
	adrp	x8, _errno@GOTPAGE
Lloh6:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	str	x24, [sp]
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_error
LBB0_6:
	madd	x27, x21, x26, x25
	ldr	x8, [sp, #32]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.le	LBB0_8
; %bb.7:
Lloh10:
	adrp	x2, l_.str.2@PAGE
Lloh11:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w0, #1
	mov	w1, #0
	bl	_error
LBB0_8:
Lloh12:
	adrp	x8, _MAX_PARTITIONS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAX_PARTITIONS@GOTPAGEOFF]
Lloh14:
	ldrsw	x8, [x8]
	sub	x8, x8, #1
	cmp	x21, x8
	b.hi	LBB0_11
; %bb.9:
	add	x9, x8, x8, lsl #1
	lsl	x9, x9, #3
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x20, #16]
	add	x10, x10, x9
	ldr	q0, [x10]
	stur	q0, [x10, #24]
	ldr	x11, [x10, #16]
	str	x11, [x10, #40]
	sub	x8, x8, #1
	sub	x9, x9, #24
	cmp	x8, x21
	b.hs	LBB0_10
LBB0_11:
Lloh15:
	adrp	x8, l_.str.3@PAGE
Lloh16:
	add	x8, x8, l_.str.3@PAGEOFF
	str	x8, [x27]
	ldr	x9, [x19, #16]
	ldr	x8, [sp, #32]
	add	x0, x8, x9
	mov	w9, #24
	madd	x26, x21, x9, x25
	str	x0, [x26, #16]!
	cbnz	w22, LBB0_13
; %bb.12:
	ldr	x9, [x19, #16]
	add	x0, x9, x8
	mov	w1, #65536
	bl	_ALIGN
	str	x0, [x26]
	ldr	x8, [sp, #32]
LBB0_13:
	ldr	x9, [x19, #8]
	sub	x9, x9, x0
	mov	w10, #24
	madd	x11, x21, x10, x25
	str	x9, [x11, #8]
	madd	x9, x28, x10, x25
Lloh17:
	adrp	x10, l_.str.4@PAGE
Lloh18:
	add	x10, x10, l_.str.4@PAGEOFF
	stp	x10, x8, [x9]
	ldr	x25, [x20, #16]
	b	LBB0_16
LBB0_14:
	mov	x27, #0
	b	LBB0_17
LBB0_15:
	mov	x27, #0
LBB0_16:
	ldr	x19, [sp, #24]                  ; 8-byte Folded Reload
	mov	x21, x22
	ldp	w26, w22, [sp, #16]             ; 16-byte Folded Reload
LBB0_17:
	mov	x0, x25
	bl	_make_partition_table
	str	x0, [sp, #48]
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_19
; %bb.18:
	bl	_make_soft_version_from_string
	b	LBB0_20
LBB0_19:
	mov	x0, x26
	bl	_make_soft_version
LBB0_20:
	str	x0, [sp, #56]
	mov	x0, x20
	bl	_make_support_list
	str	x0, [sp, #64]
Lloh19:
	adrp	x0, l_.str.4@PAGE
Lloh20:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x24
	mov	w2, #0
	mov	x3, #0
	bl	_read_file
	str	x0, [sp, #72]
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x23
	mov	x2, x22
	mov	x3, x27
	bl	_read_file
	str	x0, [sp, #80]
	ldr	w0, [x20]
Lloh23:
	adrp	x1, l_.str.5@PAGE
Lloh24:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_strcasecmp
	cbz	x0, LBB0_30
; %bb.21:
	ldr	w0, [x20]
Lloh25:
	adrp	x1, l_.str.6@PAGE
Lloh26:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_strcasecmp
	cbz	x0, LBB0_30
; %bb.22:
	ldr	w0, [x20]
Lloh27:
	adrp	x1, l_.str.7@PAGE
Lloh28:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_strcasecmp
	cbz	x0, LBB0_30
; %bb.23:
	ldr	w0, [x20]
Lloh29:
	adrp	x1, l_.str.8@PAGE
Lloh30:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_strcasecmp
	cbz	x0, LBB0_30
; %bb.24:
	ldr	w0, [x20]
Lloh31:
	adrp	x1, l_.str.9@PAGE
Lloh32:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_strcasecmp
	cbz	x0, LBB0_30
; %bb.25:
	ldr	w0, [x20]
Lloh33:
	adrp	x1, l_.str.11@PAGE
Lloh34:
	add	x1, x1, l_.str.11@PAGEOFF
	bl	_strcasecmp
	cbz	x0, LBB0_45
; %bb.26:
	ldr	w0, [x20]
Lloh35:
	adrp	x1, l_.str.12@PAGE
Lloh36:
	add	x1, x1, l_.str.12@PAGEOFF
	bl	_strcasecmp
	cbz	x0, LBB0_45
; %bb.27:
	ldr	w0, [x20]
Lloh37:
	adrp	x1, l_.str.13@PAGE
Lloh38:
	add	x1, x1, l_.str.13@PAGEOFF
	bl	_strcasecmp
	cbz	x0, LBB0_45
; %bb.28:
	ldr	w0, [x20]
Lloh39:
	adrp	x1, l_.str.15@PAGE
Lloh40:
	add	x1, x1, l_.str.15@PAGEOFF
	bl	_strcasecmp
	cbnz	x0, LBB0_33
; %bb.29:
	mov	w8, #65536
	b	LBB0_31
LBB0_30:
	mov	w8, #256
LBB0_31:
	stur	w8, [sp, #39]
	mov	w8, #33554432
LBB0_32:
	str	x8, [sp, #32]
Lloh41:
	adrp	x0, l_.str.10@PAGE
Lloh42:
	add	x0, x0, l_.str.10@PAGEOFF
	add	x1, sp, #32
	mov	w2, #11
	bl	_put_data
	str	x0, [sp, #88]
LBB0_33:
	add	x1, sp, #48
	add	x2, sp, #32
	mov	x0, x20
	cbz	w21, LBB0_35
; %bb.34:
	bl	_generate_sysupgrade_image
	b	LBB0_36
LBB0_35:
	bl	_generate_factory_image
LBB0_36:
	mov	x20, x0
Lloh43:
	adrp	x1, l_.str.17@PAGE
Lloh44:
	add	x1, x1, l_.str.17@PAGEOFF
	mov	x0, x19
	bl	_fopen
	mov	x19, x0
	cbnz	x0, LBB0_38
; %bb.37:
Lloh45:
	adrp	x8, _errno@GOTPAGE
Lloh46:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh47:
	ldr	w1, [x8]
Lloh48:
	adrp	x2, l_.str.18@PAGE
Lloh49:
	add	x2, x2, l_.str.18@PAGEOFF
	mov	w0, #1
	bl	_error
LBB0_38:
	ldr	x1, [sp, #32]
	mov	x0, x20
	mov	w2, #1
	mov	x3, x19
	bl	_fwrite
	cmp	w0, #1
	b.eq	LBB0_40
; %bb.39:
Lloh50:
	adrp	x2, l_.str.19@PAGE
Lloh51:
	add	x2, x2, l_.str.19@PAGEOFF
	mov	w0, #1
	mov	w1, #0
	bl	_error
LBB0_40:
	mov	x0, x19
	bl	_fclose
	mov	x0, x20
	bl	_free
	ldr	x0, [sp, #48]
	cbz	x0, LBB0_43
; %bb.41:
	add	x8, sp, #48
	add	x19, x8, #8
LBB0_42:                                ; =>This Inner Loop Header: Depth=1
	bl	_free_image_partition
	ldr	x0, [x19], #8
	cbnz	x0, LBB0_42
LBB0_43:
	ldur	x8, [x29, #-88]
Lloh52:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh53:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh54:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_46
; %bb.44:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #128]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_45:
	mov	w8, #256
	stur	w8, [sp, #39]
Lloh55:
	adrp	x8, l___const.build_image.mdat.14@PAGE
Lloh56:
	add	x8, x8, l___const.build_image.mdat.14@PAGEOFF
Lloh57:
	ldr	x8, [x8]
	b	LBB0_32
LBB0_46:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpAddLdr	Lloh55, Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"firmware"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"unable to stat file `%s'"

l_.str.2:                               ; @.str.2
	.asciz	"kernel overflowed firmware partition\n"

	.comm	_MAX_PARTITIONS,4,2             ; @MAX_PARTITIONS
l_.str.3:                               ; @.str.3
	.asciz	"file-system"

l_.str.4:                               ; @.str.4
	.asciz	"os-image"

l_.str.5:                               ; @.str.5
	.asciz	"ARCHER-C2-V3"

l_.str.6:                               ; @.str.6
	.asciz	"ARCHER-C25-V1"

l_.str.7:                               ; @.str.7
	.asciz	"ARCHER-C59-V2"

l_.str.8:                               ; @.str.8
	.asciz	"ARCHER-C60-V2"

l_.str.9:                               ; @.str.9
	.asciz	"TLWR1043NV5"

	.section	__TEXT,__const
l___const.build_image.mdat:             ; @__const.build_image.mdat
	.asciz	"\000\000\000\002\000\000\000\000\001\000"

	.section	__TEXT,__cstring,cstring_literals
l_.str.10:                              ; @.str.10
	.asciz	"extra-para"

l_.str.11:                              ; @.str.11
	.asciz	"ARCHER-A7-V5"

l_.str.12:                              ; @.str.12
	.asciz	"ARCHER-C7-V4"

l_.str.13:                              ; @.str.13
	.asciz	"ARCHER-C7-V5"

	.section	__TEXT,__const
l___const.build_image.mdat.14:          ; @__const.build_image.mdat.14
	.asciz	"\001\000\000\002\000\000\312\000\001\000"

	.section	__TEXT,__cstring,cstring_literals
l_.str.15:                              ; @.str.15
	.asciz	"ARCHER-C6-V2"

	.section	__TEXT,__const
l___const.build_image.mdat.16:          ; @__const.build_image.mdat.16
	.asciz	"\000\000\000\002\000\000\000\000\000\001"

	.section	__TEXT,__cstring,cstring_literals
l_.str.17:                              ; @.str.17
	.asciz	"wb"

l_.str.18:                              ; @.str.18
	.asciz	"unable to open output file"

l_.str.19:                              ; @.str.19
	.asciz	"unable to write output file"

	.no_dead_strip	_build_image
.subsections_via_symbols
