	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movl	%edi, %r15d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movups	l___const.main.sign+44(%rip), %xmm0
	movups	%xmm0, -68(%rbp)
	movups	l___const.main.sign+32(%rip), %xmm0
	movaps	%xmm0, -80(%rbp)
	movups	l___const.main.sign+16(%rip), %xmm0
	movaps	%xmm0, -96(%rbp)
	movups	l___const.main.sign(%rip), %xmm0
	movaps	%xmm0, -112(%rbp)
	testl	%edi, %edi
	jg	LBB0_2
## %bb.1:
	movq	(%r12), %rdi
	callq	_usage
LBB0_2:
	leaq	L_.str(%rip), %rdx
	movq	%rdx, _main.optString(%rip)
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_getopt
	leaq	-104(%rbp), %r14
	movq	_optarg@GOTPCREL(%rip), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %rdi
	callq	_usage
LBB0_18:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_main.optString(%rip), %rdx
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_getopt
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$103, %eax
	jg	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$63, %eax
	je	LBB0_17
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$100, %eax
	jne	LBB0_6
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r13), %rbx
	movq	%rbx, %rdi
	callq	_atoi
	movl	%eax, -108(%rbp)
	testl	%eax, %eax
	jne	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_strtol
	movl	%eax, -108(%rbp)
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$104, %eax
	je	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$118, %eax
	jne	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r13), %rsi
	testq	%rsi, %rsi
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r12), %rdi
	callq	_usage
	movq	(%r13), %rsi
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movl	$47, %edx
	callq	_strncpy
	movb	$0, -57(%rbp)
	jmp	LBB0_18
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$-1, %eax
	jne	LBB0_18
## %bb.7:
	xorl	%eax, %eax
	callq	_chksum_crc32gentab
	movq	_optind@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%r12,%rax,8), %r15
	movq	_W_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_access
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:
	movq	_R_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_access
	testq	%rax, %rax
	jne	LBB0_9
## %bb.19:
	movq	(%rbx), %rax
	movq	(%r12,%rax,8), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_22
## %bb.20:
	movq	%rax, %rbx
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$-60, %esi
	callq	_fseek
	leaq	-176(%rbp), %r15
	movq	%r15, %rdi
	movl	$60, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	_fread
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movl	$4, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_24
## %bb.21:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_fseek
	movq	%rbx, %rdi
	callq	_chksum_crc32
	movl	%eax, -56(%rbp)
	leaq	-112(%rbp), %rdi
	movl	$60, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	_fwrite
	movq	%rbx, %rdi
	callq	_fclose
	movl	-108(%rbp), %esi
	movl	-56(%rbp), %ecx
	leaq	L_.str.5(%rip), %rdi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_printf
LBB0_22:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_25
## %bb.23:
	xorl	%eax, %eax
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_printf
	movl	$1, %edi
	callq	_exit
LBB0_25:
	callq	___stack_chk_fail
LBB0_24:
	leaq	-168(%rbp), %rdx
	movl	-172(%rbp), %esi
	movl	-120(%rbp), %ecx
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	xorl	%edi, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	2                               ## @__const.main.sign
l___const.main.sign:
	.ascii	"ZNBG"
	.long	1                               ## 0x1
	.asciz	"V.1.0.0(1.0.0)\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
	.long	0                               ## 0x0

.zerofill __DATA,__bss,_main.optString,8,3 ## @main.optString
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"v:d:h"

	.comm	_optarg,8,3                     ## @optarg
	.comm	_optind,8,3                     ## @optind
	.comm	_W_OK,4,2                       ## @W_OK
	.comm	_R_OK,4,2                       ## @R_OK
L_.str.1:                               ## @.str.1
	.asciz	"Not open input file %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"r+"

	.comm	_SEEK_END,4,2                   ## @SEEK_END
L_.str.3:                               ## @.str.3
	.asciz	"ZNBG"

L_.str.4:                               ## @.str.4
	.asciz	"Image is already signed as:\nDevice ID: 0x%08x\nFirmware version: %s\nImage CRC32: 0x%x\n"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.5:                               ## @.str.5
	.asciz	"Image signed as:\nDevice ID: 0x%08x\nFirmware version: %s\nImage CRC32: 0x%x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #240
	.cfi_def_cfa_offset 240
	stp	x24, x23, [sp, #176]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #192]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #208]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #224]            ; 16-byte Folded Spill
	add	x29, sp, #224
	.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
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, l___const.main.sign@PAGE
Lloh4:
	add	x8, x8, l___const.main.sign@PAGEOFF
	ldp	q0, q1, [x8]
	stp	q0, q1, [sp, #96]
	ldr	q0, [x8, #32]
	str	q0, [sp, #128]
	ldur	q0, [x8, #44]
	stur	q0, [sp, #140]
	cmp	w0, #0
	b.gt	LBB0_2
; %bb.1:
	ldr	x0, [x20]
	bl	_usage
LBB0_2:
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	adrp	x23, _main.optString@PAGE
	str	x2, [x23, _main.optString@PAGEOFF]
	mov	x0, x21
	mov	x1, x20
	bl	_getopt
	add	x8, sp, #96
	orr	x19, x8, #0x8
Lloh7:
	adrp	x24, _optarg@GOTPAGE
Lloh8:
	ldr	x24, [x24, _optarg@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x20]
	bl	_usage
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x2, [x23, _main.optString@PAGEOFF]
	mov	x0, x21
	mov	x1, x20
	bl	_getopt
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w0, #103
	b.gt	LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w0, #63
	b.eq	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w0, #100
	b.ne	LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x22, [x24]
	mov	x0, x22
	bl	_atoi
	str	w0, [sp, #100]
	cbnz	w0, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	mov	x1, #0
	mov	w2, #16
	bl	_strtol
	str	w0, [sp, #100]
	b	LBB0_4
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w0, #104
	b.eq	LBB0_3
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	cmp	w0, #118
	b.ne	LBB0_4
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [x24]
	cbnz	x1, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x20]
	bl	_usage
	ldr	x1, [x24]
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	w2, #47
	bl	_strncpy
	strb	wzr, [sp, #151]
	b	LBB0_4
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.16:
	bl	_chksum_crc32gentab
Lloh9:
	adrp	x22, _optind@GOTPAGE
Lloh10:
	ldr	x22, [x22, _optind@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	x21, [x20, x8, lsl #3]
Lloh11:
	adrp	x8, _W_OK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _W_OK@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_access
	cbnz	x0, LBB0_23
; %bb.17:
Lloh14:
	adrp	x8, _R_OK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _R_OK@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_access
	cbnz	x0, LBB0_23
; %bb.18:
	ldr	x8, [x22]
	ldr	x0, [x20, x8, lsl #3]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_21
; %bb.19:
	mov	x20, x0
Lloh19:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	w1, #-60
	bl	_fseek
	add	x21, sp, #32
	add	x0, sp, #32
	mov	w1, #60
	mov	w2, #1
	mov	x3, x20
	bl	_fread
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x0, sp, #32
	mov	w2, #4
	bl	_strncmp
	cbz	x0, LBB0_25
; %bb.20:
Lloh24:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_fseek
	mov	x0, x20
	bl	_chksum_crc32
	str	w0, [sp, #152]
	add	x0, sp, #96
	mov	w1, #60
	mov	w2, #1
	mov	x3, x20
	bl	_fwrite
	mov	x0, x20
	bl	_fclose
	ldr	w8, [sp, #100]
	ldr	w9, [sp, #152]
	stp	x19, x9, [sp, #8]
	str	x8, [sp]
Lloh27:
	adrp	x0, l_.str.5@PAGE
Lloh28:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_printf
LBB0_21:
	ldur	x8, [x29, #-56]
Lloh29:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh30:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.22:
	mov	w0, #0
	ldp	x29, x30, [sp, #224]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #208]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #192]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #176]            ; 16-byte Folded Reload
	add	sp, sp, #240
	ret
LBB0_23:
	str	x21, [sp]
Lloh32:
	adrp	x0, l_.str.1@PAGE
Lloh33:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	mov	w0, #1
	bl	_exit
LBB0_24:
	bl	___stack_chk_fail
LBB0_25:
	add	x8, x21, #8
	ldr	w9, [sp, #36]
	ldr	w10, [sp, #88]
	stp	x8, x10, [sp, #8]
	str	x9, [sp]
Lloh34:
	adrp	x0, l_.str.4@PAGE
Lloh35:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
	mov	w0, #0
	bl	_exit
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @__const.main.sign
l___const.main.sign:
	.ascii	"ZNBG"
	.long	1                               ; 0x1
	.asciz	"V.1.0.0(1.0.0)\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
	.long	0                               ; 0x0

.zerofill __DATA,__bss,_main.optString,8,3 ; @main.optString
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"v:d:h"

	.comm	_optarg,8,3                     ; @optarg
	.comm	_optind,8,3                     ; @optind
	.comm	_W_OK,4,2                       ; @W_OK
	.comm	_R_OK,4,2                       ; @R_OK
l_.str.1:                               ; @.str.1
	.asciz	"Not open input file %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"r+"

	.comm	_SEEK_END,4,2                   ; @SEEK_END
l_.str.3:                               ; @.str.3
	.asciz	"ZNBG"

l_.str.4:                               ; @.str.4
	.asciz	"Image is already signed as:\nDevice ID: 0x%08x\nFirmware version: %s\nImage CRC32: 0x%x\n"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.5:                               ; @.str.5
	.asciz	"Image signed as:\nDevice ID: 0x%08x\nFirmware version: %s\nImage CRC32: 0x%x\n"

.subsections_via_symbols
