	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	cmpl	$1, %edi
	jle	LBB0_10
## %bb.1:
	movl	%edi, %ebx
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	movq	8(%r15), %r14
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_stat
	testq	%rax, %rax
	js	LBB0_11
## %bb.2:
	cmpl	$3, %ebx
	ja	LBB0_5
## %bb.3:
	leaq	L_.str.6(%rip), %rsi
	leaq	-40(%rbp), %rdx
	leaq	-32(%rbp), %rcx
	movq	%r14, %rdi
	callq	_appimage_get_elf_section_offset_and_length
	movq	-32(%rbp), %r8
	testq	%r8, %r8
	je	LBB0_7
## %bb.4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_segment_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	-40(%rbp), %rcx
	leaq	L_.str.7(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	-32(%rbp), %rcx
	jmp	LBB0_8
LBB0_5:
	cmpl	$4, %ebx
	jne	LBB0_14
## %bb.6:
	movq	16(%r15), %rdi
	callq	_atoi
	movq	%rax, -40(%rbp)
	movq	24(%r15), %rdi
	callq	_atoi
	movq	%rax, %rcx
	movq	%rax, -32(%rbp)
	jmp	LBB0_8
LBB0_7:
	xorl	%ecx, %ecx
LBB0_8:
	movslq	-48(%rbp), %rax
	movq	-40(%rbp), %rdx
	leaq	(%rcx,%rdx), %rsi
	cmpq	%rax, %rsi
	ja	LBB0_12
## %bb.9:
	leaq	_main.buffer(%rip), %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_sha256_file
	movl	%eax, %ebx
	leaq	L_.str.9(%rip), %rdi
	movq	%r15, %rsi
	callq	_printf
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_stderr@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	(%r15), %rdx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	(%rbx), %edi
	movq	_segment_name@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	(%rbx), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_13
LBB0_11:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
LBB0_12:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.8(%rip), %rsi
LBB0_13:
	xorl	%eax, %eax
	callq	_fprintf
LBB0_14:
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Usage: %s file offset length\n"

L_.str.1:                               ## @.str.1
	.asciz	"If no offset and length are provided, the ELF section '%s' is skipped\n\n"

	.comm	_segment_name,8,3               ## @segment_name
L_.str.2:                               ## @.str.2
	.asciz	"Calculate a sha256 of a file except a skipped area from offset to offset+length bytes\n"

L_.str.3:                               ## @.str.3
	.asciz	"which is replaced with 0x00 during checksum calculation.\n"

L_.str.4:                               ## @.str.4
	.asciz	"This is useful when a signature is placed in the skipped area.\n"

L_.str.5:                               ## @.str.5
	.asciz	"not existing file: %s\n"

L_.str.6:                               ## @.str.6
	.asciz	".sha256_sig"

L_.str.7:                               ## @.str.7
	.asciz	"Skipping ELF section %s with offset %lu, length %lu\n"

L_.str.8:                               ## @.str.8
	.asciz	"offset+length cannot be less than the file size\n"

.zerofill __DATA,__bss,_main.buffer,65,4 ## @main.buffer
L_.str.9:                               ## @.str.9
	.asciz	"%s\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, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x1
	cmp	w0, #1
	b.le	LBB0_10
; %bb.1:
	mov	x21, x0
	stp	xzr, xzr, [sp, #32]
	ldr	x19, [x20, #8]
	add	x1, sp, #24
	mov	x0, x19
	bl	_stat
	tbnz	x0, #63, LBB0_11
; %bb.2:
	cmp	w21, #3
	b.hi	LBB0_5
; %bb.3:
Lloh0:
	adrp	x1, l_.str.6@PAGE
Lloh1:
	add	x1, x1, l_.str.6@PAGEOFF
	add	x2, sp, #40
	add	x3, sp, #32
	mov	x0, x19
	bl	_appimage_get_elf_section_offset_and_length
	ldr	x8, [sp, #32]
	cbz	x8, LBB0_7
; %bb.4:
Lloh2:
	adrp	x9, _stderr@GOTPAGE
Lloh3:
	ldr	x9, [x9, _stderr@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x9]
Lloh5:
	adrp	x9, _segment_name@GOTPAGE
Lloh6:
	ldr	x9, [x9, _segment_name@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	ldr	x10, [sp, #40]
	stp	x10, x8, [sp, #8]
	str	x9, [sp]
Lloh8:
	adrp	x1, l_.str.7@PAGE
Lloh9:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_fprintf
	ldr	x3, [sp, #32]
	b	LBB0_8
LBB0_5:
	cmp	w21, #4
	b.ne	LBB0_14
; %bb.6:
	ldr	x0, [x20, #16]
	bl	_atoi
	str	x0, [sp, #40]
	ldr	x0, [x20, #24]
	bl	_atoi
	mov	x3, x0
	str	x0, [sp, #32]
	b	LBB0_8
LBB0_7:
	mov	x3, #0
LBB0_8:
	ldrsw	x8, [sp, #24]
	ldr	x2, [sp, #40]
	add	x9, x3, x2
	cmp	x9, x8
	b.hi	LBB0_12
; %bb.9:
Lloh10:
	adrp	x20, _main.buffer@PAGE
Lloh11:
	add	x20, x20, _main.buffer@PAGEOFF
	mov	x0, x19
	mov	x1, x20
	bl	_sha256_file
	mov	x19, x0
Lloh12:
	adrp	x0, l_.str.9@PAGE
Lloh13:
	add	x0, x0, l_.str.9@PAGEOFF
	mov	x1, x20
	bl	_printf
	mov	x0, x19
	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
	add	sp, sp, #96
	ret
LBB0_10:
Lloh14:
	adrp	x19, _stderr@GOTPAGE
Lloh15:
	ldr	x19, [x19, _stderr@GOTPAGEOFF]
	ldr	w0, [x19]
	ldr	x8, [x20]
	str	x8, [sp]
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	ldr	w0, [x19]
Lloh18:
	adrp	x8, _segment_name@GOTPAGE
Lloh19:
	ldr	x8, [x8, _segment_name@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	str	x8, [sp]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	ldr	w0, [x19]
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
	ldr	w0, [x19]
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fprintf
	ldr	w0, [x19]
Lloh27:
	adrp	x1, l_.str.4@PAGE
Lloh28:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_13
LBB0_11:
Lloh29:
	adrp	x8, _stderr@GOTPAGE
Lloh30:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	str	x19, [sp]
Lloh32:
	adrp	x1, l_.str.5@PAGE
Lloh33:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_13
LBB0_12:
Lloh34:
	adrp	x8, _stderr@GOTPAGE
Lloh35:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
Lloh37:
	adrp	x1, l_.str.8@PAGE
Lloh38:
	add	x1, x1, l_.str.8@PAGEOFF
LBB0_13:
	bl	_fprintf
LBB0_14:
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Usage: %s file offset length\n"

l_.str.1:                               ; @.str.1
	.asciz	"If no offset and length are provided, the ELF section '%s' is skipped\n\n"

	.comm	_segment_name,8,3               ; @segment_name
l_.str.2:                               ; @.str.2
	.asciz	"Calculate a sha256 of a file except a skipped area from offset to offset+length bytes\n"

l_.str.3:                               ; @.str.3
	.asciz	"which is replaced with 0x00 during checksum calculation.\n"

l_.str.4:                               ; @.str.4
	.asciz	"This is useful when a signature is placed in the skipped area.\n"

l_.str.5:                               ; @.str.5
	.asciz	"not existing file: %s\n"

l_.str.6:                               ; @.str.6
	.asciz	".sha256_sig"

l_.str.7:                               ; @.str.7
	.asciz	"Skipping ELF section %s with offset %lu, length %lu\n"

l_.str.8:                               ; @.str.8
	.asciz	"offset+length cannot be less than the file size\n"

.zerofill __DATA,__bss,_main.buffer,65,0 ; @main.buffer
l_.str.9:                               ; @.str.9
	.asciz	"%s\n"

.subsections_via_symbols
