	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function picolcd_check_version
_picolcd_check_version:                 ## @picolcd_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_hid_get_drvdata
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	_REPORT_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_picolcd_send_and_wait
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r14
	cmpl	$2, (%rax)
	jne	LBB0_9
## %bb.5:
	movq	8(%r14), %rax
	movl	4(%rax), %ecx
	movq	8(%r12), %rdx
	movl	%ecx, (%rdx)
	movl	(%rax), %ecx
	movl	%ecx, 4(%rdx)
	movq	_PICOLCD_BOOTLOADER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	testl	%esi, (%r12)
	je	LBB0_8
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_7
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_hid_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_9:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_hid_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.2(%rip), %rsi
LBB0_7:
	movq	%r15, %rdi
	callq	_hid_info
	xorl	%ebx, %ebx
LBB0_10:
	movq	%r14, %rdi
	callq	_kfree
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_REPORT_VERSION,4,2             ## @REPORT_VERSION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no version response from PicoLCD\n"

	.comm	_PICOLCD_BOOTLOADER,4,2         ## @PICOLCD_BOOTLOADER
L_.str.1:                               ## @.str.1
	.asciz	"PicoLCD, bootloader version %d.%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"PicoLCD, firmware version %d.%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"confused, got unexpected version response from PicoLCD\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_picolcd_check_version
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function picolcd_check_version
_picolcd_check_version:                 ; @picolcd_check_version
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	bl	_hid_get_drvdata
	cbz	x0, LBB0_6
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x8, _REPORT_VERSION@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REPORT_VERSION@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, #0
	mov	w3, #0
	bl	_picolcd_send_and_wait
	cbz	x0, LBB0_5
; %bb.2:
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #2
	b.ne	LBB0_7
; %bb.3:
	ldr	x8, [x19, #8]
	ldr	w9, [x8, #4]
	ldr	x10, [x21, #8]
	str	w9, [x10]
	ldr	w9, [x8]
	str	w9, [x10, #4]
	ldr	w9, [x21]
Lloh3:
	adrp	x10, _PICOLCD_BOOTLOADER@GOTPAGE
Lloh4:
	ldr	x10, [x10, _PICOLCD_BOOTLOADER@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	ldp	w3, w2, [x8]
	tst	w10, w9
	b.eq	LBB0_8
; %bb.4:
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_5:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_hid_err
LBB0_6:
Lloh10:
	adrp	x8, _ENODEV@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_7:
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_hid_err
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_8:
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	mov	x0, x20
	bl	_hid_info
	mov	w20, #0
LBB0_10:
	mov	x0, x19
	bl	_kfree
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_REPORT_VERSION,4,2             ; @REPORT_VERSION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no version response from PicoLCD\n"

	.comm	_PICOLCD_BOOTLOADER,4,2         ; @PICOLCD_BOOTLOADER
l_.str.1:                               ; @.str.1
	.asciz	"PicoLCD, bootloader version %d.%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"PicoLCD, firmware version %d.%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"confused, got unexpected version response from PicoLCD\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_picolcd_check_version
.subsections_via_symbols
