	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trx_check                      ## -- Begin function trx_check
	.p2align	4, 0x90
_trx_check:                             ## @trx_check
	.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, %rbx
	movq	%rdx, %r15
	movq	%rsi, %r12
	movl	%edi, %r13d
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_strcmp
	movl	$1, %r14d
	testq	%rax, %rax
	je	LBB0_1
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movslq	(%rbx), %rax
	cmpq	$31, %rax
	jg	LBB0_4
## %bb.2:
	movq	%rax, %rsi
	addq	%r15, %rsi
	movl	$32, %edx
	subl	%eax, %edx
	movl	%r13d, %edi
	callq	_read
	addl	(%rbx), %eax
	movl	%eax, (%rbx)
	cmpl	$31, %eax
	jg	LBB0_4
## %bb.3:
	movq	_stdout@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%r14d, %r14d
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_12
LBB0_4:
	movq	(%r15), %rax
	movq	_TRX_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	cmpl	$15, 8(%r15)
	ja	LBB0_8
LBB0_6:
	movq	_quiet@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	cmpl	$1, (%rax)
	jg	LBB0_12
## %bb.7:
	movq	_stderr@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_fprintf
	movl	(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_12
LBB0_8:
	movq	%r12, %rdi
	callq	_mtd_check_open
	testl	%eax, %eax
	js	LBB0_13
## %bb.9:
	movl	%eax, %ebx
	movq	_mtdsize@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	8(%r15), %eax
	jge	LBB0_11
## %bb.10:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_11:
	movl	%ebx, %edi
	callq	_close
	jmp	LBB0_12
LBB0_13:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"firmware"

	.comm	_stdout,4,2                     ## @stdout
L_.str.1:                               ## @.str.1
	.asciz	"Could not get image header, file too small (%d bytes)\n"

	.comm	_TRX_MAGIC,8,3                  ## @TRX_MAGIC
	.comm	_quiet,4,2                      ## @quiet
	.comm	_stderr,4,2                     ## @stderr
L_.str.2:                               ## @.str.2
	.asciz	"Bad trx header\n"

L_.str.3:                               ## @.str.3
	.asciz	"This is not the correct file format; refusing to flash.\nPlease specify the correct file or use -f to force.\n"

L_.str.4:                               ## @.str.4
	.asciz	"Could not open mtd device: %s\n"

	.comm	_mtdsize,4,2                    ## @mtdsize
L_.str.5:                               ## @.str.5
	.asciz	"Image too big for partition: %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trx_check                      ; -- Begin function trx_check
	.p2align	2
_trx_check:                             ; @trx_check
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x21, x3
	mov	x20, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_strcmp
	cbz	x0, LBB0_2
LBB0_1:
	mov	w0, #1
	b	LBB0_11
LBB0_2:
	ldrsw	x8, [x21]
	cmp	w8, #31
	b.gt	LBB0_5
; %bb.3:
	add	x1, x20, x8
	mov	w9, #32
	sub	w2, w9, w8
	mov	x0, x22
	bl	_read
	ldr	w8, [x21]
	add	w8, w8, w0
	str	w8, [x21]
	cmp	w8, #31
	b.gt	LBB0_5
; %bb.4:
Lloh2:
	adrp	x9, _stdout@GOTPAGE
Lloh3:
	ldr	x9, [x9, _stdout@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x9]
	str	x8, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_5:
	ldr	x8, [x20]
Lloh7:
	adrp	x9, _TRX_MAGIC@GOTPAGE
Lloh8:
	ldr	x9, [x9, _TRX_MAGIC@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	ldr	w8, [x20, #8]
	cmp	w8, #15
	b.hi	LBB0_12
LBB0_7:
Lloh10:
	adrp	x8, _quiet@GOTPAGE
Lloh11:
	ldr	x8, [x8, _quiet@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w8, #1
	b.gt	LBB0_10
; %bb.8:
Lloh13:
	adrp	x19, _stderr@GOTPAGE
Lloh14:
	ldr	x19, [x19, _stderr@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
	ldr	w0, [x19]
Lloh17:
	adrp	x1, l_.str.3@PAGE
Lloh18:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_9:
	bl	_fprintf
LBB0_10:
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_12:
	mov	x0, x19
	bl	_mtd_check_open
	tbnz	w0, #31, LBB0_16
; %bb.13:
	mov	x21, x0
Lloh19:
	adrp	x8, _mtdsize@GOTPAGE
Lloh20:
	ldr	x8, [x8, _mtdsize@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	w9, [x20, #8]
	cmp	w8, w9
	b.ge	LBB0_15
; %bb.14:
Lloh22:
	adrp	x8, _stderr@GOTPAGE
Lloh23:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	str	x19, [sp]
Lloh25:
	adrp	x1, l_.str.5@PAGE
Lloh26:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_fprintf
	mov	x0, x21
	bl	_close
	b	LBB0_10
LBB0_15:
	mov	x0, x21
	bl	_close
	b	LBB0_1
LBB0_16:
Lloh27:
	adrp	x8, _stderr@GOTPAGE
Lloh28:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	str	x19, [sp]
Lloh30:
	adrp	x1, l_.str.4@PAGE
Lloh31:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fprintf
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"firmware"

	.comm	_stdout,4,2                     ; @stdout
l_.str.1:                               ; @.str.1
	.asciz	"Could not get image header, file too small (%d bytes)\n"

	.comm	_TRX_MAGIC,8,3                  ; @TRX_MAGIC
	.comm	_quiet,4,2                      ; @quiet
	.comm	_stderr,4,2                     ; @stderr
l_.str.2:                               ; @.str.2
	.asciz	"Bad trx header\n"

l_.str.3:                               ; @.str.3
	.asciz	"This is not the correct file format; refusing to flash.\nPlease specify the correct file or use -f to force.\n"

l_.str.4:                               ; @.str.4
	.asciz	"Could not open mtd device: %s\n"

	.comm	_mtdsize,4,2                    ; @mtdsize
l_.str.5:                               ; @.str.5
	.asciz	"Image too big for partition: %s\n"

.subsections_via_symbols
