	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function meraki_build_hdr
_meraki_build_hdr:                      ## @meraki_build_hdr
	.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	%rcx, %r14
	movq	%rsi, %r15
	movq	(%rdi), %rax
	movq	_HDR_LENGTH@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r12
	movq	%rax, %rsi
	subq	%r12, %rsi
	cmpq	%r15, %rsi
	jae	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_ERR
	jmp	LBB0_6
LBB0_2:
	movq	%rdi, %r13
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	_strip_padding@GOTPCREL(%rip), %rcx
	addq	%r15, %r12
	cmpq	$0, (%rcx)
	cmoveq	%rax, %r12
	movq	%r12, %rdi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%rax, %rbx
	movq	_PADDING_BYTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	callq	_memset
	movq	_HDR_LENGTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%rbx, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	movq	%r14, %rcx
	callq	_fread
	movq	_HDR_OFF_MAGIC1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r13), %rdx
	movq	%rbx, %rdi
	callq	_writel
	movq	_HDR_OFF_FILLER0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_writel
	movq	_HDR_OFF_FILLER1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_writel
	movq	_HDR_OFF_FILLER2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_writel
	movq	_HDR_OFF_LOAD_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%r13), %rdx
	movq	%rbx, %rdi
	callq	_writel
	movq	_HDR_OFF_ENTRY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	24(%r13), %rdx
	movq	%rbx, %rdi
	callq	_writel
	movq	_HDR_OFF_IMAGELEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_writel
	movq	_HDR_OFF_CHECKSUM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_writel
	movq	_HDR_LENGTH@GOTPCREL(%rip), %rax
	addq	(%rax), %r15
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_crc32_csum
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_fwrite
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_free
	cmpq	$1, %r14
	jne	LBB0_6
## %bb.4:
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_ERRS
LBB0_6:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HDR_LENGTH,8,3                 ## @HDR_LENGTH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"kernel file is too big - max size: 0x%08lX\n"

	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.comm	_strip_padding,8,3              ## @strip_padding
L_.str.1:                               ## @.str.1
	.asciz	"no memory for buffer: %s\n"

	.comm	_PADDING_BYTE,4,2               ## @PADDING_BYTE
	.comm	_HDR_OFF_MAGIC1,4,2             ## @HDR_OFF_MAGIC1
	.comm	_HDR_OFF_FILLER0,4,2            ## @HDR_OFF_FILLER0
	.comm	_HDR_OFF_FILLER1,4,2            ## @HDR_OFF_FILLER1
	.comm	_HDR_OFF_FILLER2,4,2            ## @HDR_OFF_FILLER2
	.comm	_HDR_OFF_LOAD_ADDR,4,2          ## @HDR_OFF_LOAD_ADDR
	.comm	_HDR_OFF_ENTRY,4,2              ## @HDR_OFF_ENTRY
	.comm	_HDR_OFF_IMAGELEN,4,2           ## @HDR_OFF_IMAGELEN
	.comm	_HDR_OFF_CHECKSUM,4,2           ## @HDR_OFF_CHECKSUM
	.comm	_EXIT_SUCCESS,4,2               ## @EXIT_SUCCESS
	.no_dead_strip	_meraki_build_hdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function meraki_build_hdr
_meraki_build_hdr:                      ; @meraki_build_hdr
	.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	x20, x1
	ldr	x8, [x0]
Lloh0:
	adrp	x25, _HDR_LENGTH@GOTPAGE
Lloh1:
	ldr	x25, [x25, _HDR_LENGTH@GOTPAGEOFF]
	ldr	x9, [x25]
	sub	x1, x8, x9
	cmp	x1, x20
	b.hs	LBB0_2
; %bb.1:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
	b	LBB0_5
LBB0_2:
	mov	x24, x3
	mov	x19, x2
	mov	x23, x0
Lloh4:
	adrp	x10, _strip_padding@GOTPAGE
Lloh5:
	ldr	x10, [x10, _strip_padding@GOTPAGEOFF]
Lloh6:
	ldr	x10, [x10]
	add	x9, x9, x20
	cmp	x10, #0
	csel	x22, x8, x9, eq
	mov	x0, x22
	bl	_malloc
	cbz	x0, LBB0_4
; %bb.3:
	mov	x21, x0
Lloh7:
	adrp	x8, _PADDING_BYTE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PADDING_BYTE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x2, x22
	bl	_memset
	ldr	x8, [x25]
	add	x0, x21, x8
	mov	x1, x20
	mov	w2, #1
	mov	x3, x24
	bl	_fread
Lloh10:
	adrp	x8, _HDR_OFF_MAGIC1@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HDR_OFF_MAGIC1@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	ldr	x2, [x23, #8]
	mov	x0, x21
	bl	_writel
Lloh13:
	adrp	x8, _HDR_OFF_FILLER0@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HDR_OFF_FILLER0@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, #0
	bl	_writel
Lloh16:
	adrp	x8, _HDR_OFF_FILLER1@GOTPAGE
Lloh17:
	ldr	x8, [x8, _HDR_OFF_FILLER1@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, #0
	bl	_writel
Lloh19:
	adrp	x8, _HDR_OFF_FILLER2@GOTPAGE
Lloh20:
	ldr	x8, [x8, _HDR_OFF_FILLER2@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, #0
	bl	_writel
Lloh22:
	adrp	x8, _HDR_OFF_LOAD_ADDR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _HDR_OFF_LOAD_ADDR@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	ldr	x2, [x23, #16]
	mov	x0, x21
	bl	_writel
Lloh25:
	adrp	x8, _HDR_OFF_ENTRY@GOTPAGE
Lloh26:
	ldr	x8, [x8, _HDR_OFF_ENTRY@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	ldr	x2, [x23, #24]
	mov	x0, x21
	bl	_writel
Lloh28:
	adrp	x8, _HDR_OFF_IMAGELEN@GOTPAGE
Lloh29:
	ldr	x8, [x8, _HDR_OFF_IMAGELEN@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, x20
	bl	_writel
Lloh31:
	adrp	x8, _HDR_OFF_CHECKSUM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _HDR_OFF_CHECKSUM@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x21
	mov	x2, #0
	bl	_writel
	ldr	x8, [x25]
	add	x1, x8, x20
	mov	x0, x21
	bl	_crc32_csum
	mov	x0, x21
	mov	x1, x22
	mov	w2, #1
	mov	x3, x19
	bl	_fwrite
	mov	x19, x0
	mov	x0, x21
	bl	_free
Lloh34:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
Lloh36:
	adrp	x9, _EXIT_FAILURE@GOTPAGE
Lloh37:
	ldr	x9, [x9, _EXIT_FAILURE@GOTPAGEOFF]
	cmp	x19, #1
	csel	x8, x8, x9, eq
	b	LBB0_6
LBB0_4:
Lloh38:
	adrp	x0, l_.str.1@PAGE
Lloh39:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERRS
LBB0_5:
Lloh40:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
LBB0_6:
	ldr	w0, [x8]
	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	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_HDR_LENGTH,8,3                 ; @HDR_LENGTH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"kernel file is too big - max size: 0x%08lX\n"

	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.comm	_strip_padding,8,3              ; @strip_padding
l_.str.1:                               ; @.str.1
	.asciz	"no memory for buffer: %s\n"

	.comm	_PADDING_BYTE,4,2               ; @PADDING_BYTE
	.comm	_HDR_OFF_MAGIC1,4,2             ; @HDR_OFF_MAGIC1
	.comm	_HDR_OFF_FILLER0,4,2            ; @HDR_OFF_FILLER0
	.comm	_HDR_OFF_FILLER1,4,2            ; @HDR_OFF_FILLER1
	.comm	_HDR_OFF_FILLER2,4,2            ; @HDR_OFF_FILLER2
	.comm	_HDR_OFF_LOAD_ADDR,4,2          ; @HDR_OFF_LOAD_ADDR
	.comm	_HDR_OFF_ENTRY,4,2              ; @HDR_OFF_ENTRY
	.comm	_HDR_OFF_IMAGELEN,4,2           ; @HDR_OFF_IMAGELEN
	.comm	_HDR_OFF_CHECKSUM,4,2           ; @HDR_OFF_CHECKSUM
	.comm	_EXIT_SUCCESS,4,2               ; @EXIT_SUCCESS
	.no_dead_strip	_meraki_build_hdr
.subsections_via_symbols
