	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib9000_risc_check_version
_dib9000_risc_check_version:            ## @dib9000_risc_check_version
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -16(%rbp)
	movl	$0, -36(%rbp)
	movq	_OUT_MSG_REQ_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movl	$1, %ecx
	callq	_dib9000_mbx_send
	testq	%rax, %rax
	je	LBB0_5
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_2:
	subl	(%rax), %ebx
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-16(%rbp), %rax
	jne	LBB0_12
## %bb.4:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_5:
	movq	_IN_MSG_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	leaq	-40(%rbp), %rcx
	movq	%rbx, %rdi
	callq	_dib9000_mbx_get_message
	testq	%rax, %rax
	js	LBB0_1
## %bb.6:
	movl	-32(%rbp), %edx
	movl	-24(%rbp), %ecx
	shll	$8, %edx
	orl	-28(%rbp), %edx
	movl	%edx, -36(%rbp)
	movl	%edx, %esi
	sarl	$10, %esi
	andl	$1023, %edx                     ## imm = 0x3FF
	shll	$8, %ecx
	orl	-20(%rbp), %ecx
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dprintk
	movl	-36(%rbp), %eax
	movl	%eax, %ecx
	andl	$-1024, %ecx                    ## imm = 0xFC00
	cmpl	$7168, %ecx                     ## imm = 0x1C00
	jne	LBB0_11
## %bb.7:
	andl	$1023, %eax                     ## imm = 0x3FF
	cmpl	$17, %eax
	ja	LBB0_10
## %bb.8:
	movl	$251904, %ecx                   ## imm = 0x3D800
	btl	%eax, %ecx
	jae	LBB0_10
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_3
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dprintk
LBB0_11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_OUT_MSG_REQ_VERSION,4,2        ## @OUT_MSG_REQ_VERSION
	.comm	_EIO,4,2                        ## @EIO
	.comm	_IN_MSG_VERSION,4,2             ## @IN_MSG_VERSION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RISC: ver: %d.%02d (IC: %d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"RISC: invalid firmware version"

L_.str.2:                               ## @.str.2
	.asciz	"RISC: valid firmware version"

	.no_dead_strip	_dib9000_risc_check_version
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib9000_risc_check_version
_dib9000_risc_check_version:            ; @dib9000_risc_check_version
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	str	wzr, [sp, #32]
Lloh3:
	adrp	x8, _OUT_MSG_REQ_VERSION@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OUT_MSG_REQ_VERSION@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #32
	mov	w3, #1
	bl	_dib9000_mbx_send
	cbz	x0, LBB0_5
LBB0_1:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldur	x8, [x29, #-24]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.4:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_5:
Lloh11:
	adrp	x8, _IN_MSG_VERSION@GOTPAGE
Lloh12:
	ldr	x8, [x8, _IN_MSG_VERSION@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x2, sp, #40
	add	x3, sp, #36
	mov	x0, x19
	bl	_dib9000_mbx_get_message
	tbnz	x0, #63, LBB0_1
; %bb.6:
	ldp	w8, w9, [sp, #40]
	orr	w8, w9, w8, lsl #8
	str	w8, [sp, #32]
	asr	w9, w8, #10
	and	w8, w8, #0x3ff
	ldp	w10, w11, [sp, #48]
	orr	w10, w11, w10, lsl #8
	stp	x8, x10, [sp, #8]
	str	x9, [sp]
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
	ldr	w8, [sp, #32]
	lsr	w9, w8, #10
	cmp	w9, #7
	b.ne	LBB0_11
; %bb.7:
	and	w8, w8, #0x3ff
	cmp	w8, #17
	b.hi	LBB0_10
; %bb.8:
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #55296
	movk	w9, #3, lsl #16
	tst	w8, w9
	b.eq	LBB0_10
; %bb.9:
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dprintk
	mov	w0, #0
	b	LBB0_3
LBB0_10:
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dprintk
LBB0_11:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_2
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_OUT_MSG_REQ_VERSION,4,2        ; @OUT_MSG_REQ_VERSION
	.comm	_EIO,4,2                        ; @EIO
	.comm	_IN_MSG_VERSION,4,2             ; @IN_MSG_VERSION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RISC: ver: %d.%02d (IC: %d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"RISC: invalid firmware version"

l_.str.2:                               ; @.str.2
	.asciz	"RISC: valid firmware version"

	.no_dead_strip	_dib9000_risc_check_version
.subsections_via_symbols
