	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_generate_board_header_checksum ## -- Begin function generate_board_header_checksum
	.p2align	4, 0x90
_generate_board_header_checksum:        ## @generate_board_header_checksum
	.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
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	_HEADER_PARTITION_CALC_LENGTH@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movl	(%r13), %edx
	movq	%rax, %rdi
	movl	$255, %esi
	callq	_memset
	movq	_ROOTFS_HEADER_LEN@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_memcpy
	movq	(%r13), %r13
	leaq	(%rbx,%r13), %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_memcpy
	leaq	(%rbx,%r13), %r12
	addq	$4, %r12
	movq	%r15, %rdi
	callq	_strlen
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_memcpy
	movq	%r15, %rdi
	callq	_strlen
	addq	%r13, %rax
	addq	$4, %rax
	movb	$0, (%rbx,%rax)
	testq	%r14, %r14
	je	LBB0_3
## %bb.2:
	movq	_ROOTFS_HEADER_LEN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_BOARD_NAME_LEN@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	leaq	(%rbx,%rax), %rdi
	addq	$4, %rdi
	movq	%r14, %rsi
	movl	$8, %edx
	callq	_memcpy
LBB0_3:
	movq	_HEADER_PARTITION_CALC_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_zyxel_chksm
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_free
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_ERR
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_HEADER_PARTITION_CALC_LENGTH,4,2 ## @HEADER_PARTITION_CALC_LENGTH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't allocate memory for temporary board header!"

	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.comm	_ROOTFS_HEADER_LEN,8,3          ## @ROOTFS_HEADER_LEN
	.comm	_BOARD_NAME_LEN,8,3             ## @BOARD_NAME_LEN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_generate_board_header_checksum ; -- Begin function generate_board_header_checksum
	.p2align	2
_generate_board_header_checksum:        ; @generate_board_header_checksum
	.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	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x23, _HEADER_PARTITION_CALC_LENGTH@GOTPAGE
Lloh1:
	ldr	x23, [x23, _HEADER_PARTITION_CALC_LENGTH@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_malloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	w2, [x23]
	mov	w1, #255
	bl	_memset
Lloh2:
	adrp	x24, _ROOTFS_HEADER_LEN@GOTPAGE
Lloh3:
	ldr	x24, [x24, _ROOTFS_HEADER_LEN@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x0, x19
	mov	x1, x22
	bl	_memcpy
	ldr	x25, [x24]
	add	x0, x19, x25
	mov	x1, x22
	mov	w2, #4
	bl	_memcpy
	add	x25, x25, #4
	add	x22, x19, x25
	mov	x0, x21
	bl	_strlen
	mov	x2, x0
	mov	x0, x22
	mov	x1, x21
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
	mov	x0, x21
	bl	_strlen
	add	x8, x0, x25
	strb	wzr, [x19, x8]
	cbz	x20, LBB0_3
; %bb.2:
	ldr	x8, [x24]
Lloh4:
	adrp	x9, _BOARD_NAME_LEN@GOTPAGE
Lloh5:
	ldr	x9, [x9, _BOARD_NAME_LEN@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	add	x8, x8, x9
	add	x8, x8, x19
	add	x0, x8, #4
	mov	x1, x20
	mov	w2, #8
	bl	_memcpy
LBB0_3:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_zyxel_chksm
	mov	x20, x0
	mov	x0, x19
	bl	_free
	mov	x0, x20
	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
LBB0_4:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
Lloh9:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_exit
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_HEADER_PARTITION_CALC_LENGTH,4,2 ; @HEADER_PARTITION_CALC_LENGTH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't allocate memory for temporary board header!"

	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.comm	_ROOTFS_HEADER_LEN,8,3          ; @ROOTFS_HEADER_LEN
	.comm	_BOARD_NAME_LEN,8,3             ; @BOARD_NAME_LEN
.subsections_via_symbols
