	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_firmware
_check_firmware:                        ## @check_firmware
	.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	(%rdi), %r15
	cmpb	$65, (%r15)
	jne	LBB0_4
## %bb.1:
	cmpb	$86, 1(%r15)
	jne	LBB0_4
## %bb.2:
	cmpb	$70, 2(%r15)
	jne	LBB0_4
## %bb.3:
	cmpb	$87, 3(%r15)
	jne	LBB0_4
## %bb.8:
	movq	%rdi, %r14
	leaq	4(%r15), %rdi
	callq	_get_unaligned_be32
	movl	%eax, %r12d
	leaq	8(%r15), %rdi
	callq	_get_unaligned_be32
	cmpl	$512, %eax                      ## imm = 0x200
	jl	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str(%rip), %rdi
LBB0_5:
	xorl	%ebx, %ebx
LBB0_6:
	xorl	%eax, %eax
	callq	_printk
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	%eax, %r13d
	addq	$12, %r15
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_crc32_le
	cmpl	%eax, %r12d
	jne	LBB0_11
## %bb.12:
	movq	%r15, 8(%r14)
	movl	%r13d, 16(%r14)
	movslq	%r13d, %rbx
	leaq	(%r15,%rbx), %rdi
	callq	_get_unaligned_be32
	movl	%eax, %r13d
	leaq	(%r15,%rbx), %rdi
	addq	$4, %rdi
	callq	_get_unaligned_be32
	movl	%eax, %r12d
	leal	-300000(%r12), %eax
	cmpl	$-99999, %eax                   ## imm = 0xFFFE7961
	jb	LBB0_14
## %bb.13:
	addq	%rbx, %r15
	addq	$8, %r15
	movl	%r12d, %eax
	movslq	20(%r14), %rcx
	addq	(%r14), %rcx
	subq	%r15, %rcx
	cmpq	%rax, %rcx
	jge	LBB0_15
LBB0_14:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_printk
	jmp	LBB0_7
LBB0_11:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_6
LBB0_15:
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	_crc32_le
	cmpl	%eax, %r13d
	jne	LBB0_16
## %bb.17:
	movq	%r15, 24(%r14)
	movl	%r12d, 32(%r14)
	jmp	LBB0_18
LBB0_16:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dvb-ttpci: this is not an av7110 firmware\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"dvb-ttpci: dpram file is way too big.\n"

L_.str.2:                               ## @.str.2
	.asciz	"dvb-ttpci: crc32 of dpram file does not match.\n"

L_.str.3:                               ## @.str.3
	.asciz	"dvb-ttpci: root file has strange size (%d). aborting.\n"

L_.str.4:                               ## @.str.4
	.asciz	"dvb-ttpci: crc32 of root file does not match.\n"

	.no_dead_strip	_check_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_firmware
_check_firmware:                        ; @check_firmware
	.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
	ldr	x22, [x0]
	ldrb	w8, [x22]
	cmp	w8, #65
	b.ne	LBB0_6
; %bb.1:
	ldrb	w8, [x22, #1]
	cmp	w8, #86
	b.ne	LBB0_6
; %bb.2:
	ldrb	w8, [x22, #2]
	cmp	w8, #70
	b.ne	LBB0_6
; %bb.3:
	ldrb	w8, [x22, #3]
	cmp	w8, #87
	b.ne	LBB0_6
; %bb.4:
	mov	x19, x0
	add	x0, x22, #4
	bl	_get_unaligned_be32
	mov	x20, x0
	add	x0, x22, #8
	bl	_get_unaligned_be32
	cmp	w0, #512
	b.lt	LBB0_9
; %bb.5:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
LBB0_7:
	bl	_printk
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	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_9:
	mov	x21, x0
	add	x22, x22, #12
	mov	w0, #0
	mov	x1, x22
	mov	x2, x21
	bl	_crc32_le
	cmp	w20, w0
	b.ne	LBB0_13
; %bb.10:
	str	x22, [x19, #8]
	str	w21, [x19, #16]
	add	x22, x22, w21, sxtw
	mov	x0, x22
	bl	_get_unaligned_be32
	mov	x21, x0
	add	x0, x22, #4
	bl	_get_unaligned_be32
	mov	x20, x0
	sub	w8, w0, #73, lsl #12            ; =299008
	sub	w8, w8, #992
	mov	w9, #31073
	movk	w9, #65534, lsl #16
	cmp	w8, w9
	b.lo	LBB0_12
; %bb.11:
	add	x22, x22, #8
	ldr	x8, [x19]
	ldrsw	x9, [x19, #20]
	add	x8, x8, x9
	sub	x8, x8, x22
	cmp	x8, w20, uxtw
	b.ge	LBB0_14
LBB0_12:
	str	x20, [sp]
Lloh7:
	adrp	x0, l_.str.3@PAGE
Lloh8:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_7
LBB0_13:
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_14:
	mov	w0, #0
	mov	x1, x22
	mov	x2, x20
	bl	_crc32_le
	cmp	w21, w0
	b.ne	LBB0_16
; %bb.15:
	mov	w0, #0
	str	x22, [x19, #24]
	str	w20, [x19, #32]
	b	LBB0_8
LBB0_16:
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dvb-ttpci: this is not an av7110 firmware\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"dvb-ttpci: dpram file is way too big.\n"

l_.str.2:                               ; @.str.2
	.asciz	"dvb-ttpci: crc32 of dpram file does not match.\n"

l_.str.3:                               ; @.str.3
	.asciz	"dvb-ttpci: root file has strange size (%d). aborting.\n"

l_.str.4:                               ; @.str.4
	.asciz	"dvb-ttpci: crc32 of root file does not match.\n"

	.no_dead_strip	_check_firmware
.subsections_via_symbols
