	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function t4_read_write_register
_t4_read_write_register:                ## @t4_read_write_register
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movl	%esi, %r14d
	movq	%rdi, %r13
	movq	_T4_FEATURE_REPORT_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	_T4_FEATURE_REPORT_ID@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movl	%eax, (%r12)
	movl	%r14d, %edi
	xorl	%r14d, %r14d
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	cmovnel	%r14d, %r15d
	movq	_T4_CMD_REGISTER_READ@GOTPCREL(%rip), %rax
	cmoveq	_T4_CMD_REGISTER_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r12)
	movl	%r15d, 32(%r12)
	movq	%r12, %rsi
	addq	$8, %rsi
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	callq	_put_unaligned_le32
	movq	$1, 24(%r12)
	movq	%r12, %rdi
	movl	$1, %esi
	movl	$8, %edx
	callq	_t4_calc_check_sum
	movl	%eax, 36(%r12)
	sarl	$8, %eax
	movl	%eax, 40(%r12)
	movl	$0, 44(%r12)
	movl	(%rbx), %esi
	movq	_T4_FEATURE_REPORT_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_HID_FEATURE_REPORT@GOTPCREL(%rip), %r15
	movl	(%r15), %r8d
	movq	_HID_REQ_SET_REPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r13, %rdi
	movq	%r12, %rdx
	callq	_hid_hw_raw_request
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_5
## %bb.6:
	movq	%r13, %rbx
	movq	_T4_FEATURE_REPORT_LEN@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r13
	movq	_T4_FEATURE_REPORT_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %ecx
	movl	(%r15), %r8d
	movq	_HID_REQ_GET_REPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%rbx, %rdi
	movq	%r13, %rdx
	callq	_hid_hw_raw_request
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movl	24(%r13), %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	cmpl	%ecx, %edx
	jne	LBB0_11
## %bb.13:
	movl	40(%r13), %edx
	cmpl	$1, %edx
	jne	LBB0_14
## %bb.16:
	movq	%r13, %rdi
	movl	$6, %esi
	movl	$7, %edx
	callq	_t4_calc_check_sum
	movl	52(%r13), %edx
	cmpl	%eax, %edx
	jne	LBB0_17
## %bb.18:
	movl	48(%r13), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%r14d, %r14d
	jmp	LBB0_19
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_21
LBB0_3:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	%ebx, %r14d
	jmp	LBB0_20
LBB0_5:
	xorl	%r13d, %r13d
	jmp	LBB0_19
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_20
LBB0_9:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	jmp	LBB0_15
LBB0_11:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	jmp	LBB0_12
LBB0_14:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
LBB0_15:
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_19
LBB0_17:
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %ecx
LBB0_12:
	xorl	%eax, %eax
	callq	_dev_err
LBB0_19:
	movq	%r13, %rdi
	callq	_kfree
LBB0_20:
	movq	%r12, %rdi
	callq	_kfree
LBB0_21:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_T4_FEATURE_REPORT_LEN,4,2      ## @T4_FEATURE_REPORT_LEN
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_T4_FEATURE_REPORT_ID,4,2       ## @T4_FEATURE_REPORT_ID
	.comm	_T4_CMD_REGISTER_READ,4,2       ## @T4_CMD_REGISTER_READ
	.comm	_T4_CMD_REGISTER_WRITE,4,2      ## @T4_CMD_REGISTER_WRITE
	.comm	_HID_FEATURE_REPORT,4,2         ## @HID_FEATURE_REPORT
	.comm	_HID_REQ_SET_REPORT,4,2         ## @HID_REQ_SET_REPORT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read command (%d)\n"

	.comm	_HID_REQ_GET_REPORT,4,2         ## @HID_REQ_GET_REPORT
L_.str.1:                               ## @.str.1
	.asciz	"failed read register (%d)\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"read register address error (%x,%x)\n"

L_.str.3:                               ## @.str.3
	.asciz	"read register size error (%x)\n"

L_.str.4:                               ## @.str.4
	.asciz	"read register checksum error (%x,%x)\n"

	.no_dead_strip	_t4_read_write_register
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function t4_read_write_register
lCPI0_0:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_t4_read_write_register:                ; @t4_read_write_register
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x4
	mov	x22, x3
	mov	x21, x2
	mov	x24, x1
	mov	x20, x0
Lloh0:
	adrp	x25, _T4_FEATURE_REPORT_LEN@GOTPAGE
Lloh1:
	ldr	x25, [x25, _T4_FEATURE_REPORT_LEN@GOTPAGEOFF]
	ldr	w0, [x25]
Lloh2:
	adrp	x26, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x26, [x26, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x26]
	bl	_kzalloc
	cbz	x0, LBB0_9
; %bb.1:
	mov	x19, x0
Lloh4:
	adrp	x27, _T4_FEATURE_REPORT_ID@GOTPAGE
Lloh5:
	ldr	x27, [x27, _T4_FEATURE_REPORT_ID@GOTPAGEOFF]
	ldr	w8, [x27]
	str	w8, [x0]
Lloh6:
	adrp	x8, _T4_CMD_REGISTER_WRITE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _T4_CMD_REGISTER_WRITE@GOTPAGEOFF]
Lloh8:
	adrp	x9, _T4_CMD_REGISTER_READ@GOTPAGE
Lloh9:
	ldr	x9, [x9, _T4_CMD_REGISTER_READ@GOTPAGEOFF]
	cmp	w23, #0
	csel	w10, w22, wzr, eq
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
	str	w8, [x0, #4]
	str	w10, [x0, #32]
	add	x1, x0, #8
	mov	x0, x24
	bl	_put_unaligned_le32
Lloh10:
	adrp	x8, lCPI0_0@PAGE
Lloh11:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19, #24]
	mov	x0, x19
	mov	w1, #1
	mov	w2, #8
	bl	_t4_calc_check_sum
	asr	w8, w0, #8
	stp	w0, w8, [x19, #36]
	str	wzr, [x19, #44]
	ldr	w1, [x27]
	ldr	w3, [x25]
Lloh12:
	adrp	x28, _HID_FEATURE_REPORT@GOTPAGE
Lloh13:
	ldr	x28, [x28, _HID_FEATURE_REPORT@GOTPAGEOFF]
	ldr	w4, [x28]
Lloh14:
	adrp	x8, _HID_REQ_SET_REPORT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _HID_REQ_SET_REPORT@GOTPAGEOFF]
Lloh16:
	ldr	w5, [x8]
	mov	x0, x20
	mov	x2, x19
	bl	_hid_hw_raw_request
	tbnz	w0, #31, LBB0_10
; %bb.2:
	cbz	w23, LBB0_11
; %bb.3:
	ldr	w0, [x25]
	ldr	w1, [x26]
	bl	_kzalloc
	cbz	x0, LBB0_12
; %bb.4:
	mov	x23, x0
	ldr	w1, [x27]
	ldr	w3, [x25]
	ldr	w4, [x28]
Lloh17:
	adrp	x8, _HID_REQ_GET_REPORT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HID_REQ_GET_REPORT@GOTPAGEOFF]
Lloh19:
	ldr	w5, [x8]
	mov	x0, x20
	mov	x2, x23
	bl	_hid_hw_raw_request
	tbnz	w0, #31, LBB0_13
; %bb.5:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w22, w8
	ldr	w2, [x23, #24]
	cmp	w2, w24
	b.ne	LBB0_14
; %bb.6:
	ldr	w2, [x23, #40]
	cmp	w2, #1
	b.ne	LBB0_15
; %bb.7:
	mov	x0, x23
	mov	w1, #6
	mov	w2, #7
	bl	_t4_calc_check_sum
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w2, [x23, #52]
	cmp	w2, w0
	b.ne	LBB0_16
; %bb.8:
	mov	w22, #0
	ldr	w8, [x23, #48]
	str	w8, [x21]
	b	LBB0_19
LBB0_9:
Lloh23:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_21
LBB0_10:
	mov	x22, x0
Lloh26:
	adrp	x1, l_.str@PAGE
Lloh27:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	bl	_dev_err
	b	LBB0_20
LBB0_11:
	mov	w22, #0
	mov	x23, #0
	b	LBB0_19
LBB0_12:
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_20
LBB0_13:
	mov	x22, x0
Lloh31:
	adrp	x1, l_.str.1@PAGE
Lloh32:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	b	LBB0_18
LBB0_14:
	str	x24, [sp]
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_17
LBB0_15:
Lloh35:
	adrp	x1, l_.str.3@PAGE
Lloh36:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_17
LBB0_16:
	str	x0, [sp]
Lloh37:
	adrp	x1, l_.str.4@PAGE
Lloh38:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_17:
	mov	x0, x20
LBB0_18:
	bl	_dev_err
LBB0_19:
	mov	x0, x23
	bl	_kfree
LBB0_20:
	mov	x0, x19
	bl	_kfree
LBB0_21:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdr	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_T4_FEATURE_REPORT_LEN,4,2      ; @T4_FEATURE_REPORT_LEN
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_T4_FEATURE_REPORT_ID,4,2       ; @T4_FEATURE_REPORT_ID
	.comm	_T4_CMD_REGISTER_READ,4,2       ; @T4_CMD_REGISTER_READ
	.comm	_T4_CMD_REGISTER_WRITE,4,2      ; @T4_CMD_REGISTER_WRITE
	.comm	_HID_FEATURE_REPORT,4,2         ; @HID_FEATURE_REPORT
	.comm	_HID_REQ_SET_REPORT,4,2         ; @HID_REQ_SET_REPORT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read command (%d)\n"

	.comm	_HID_REQ_GET_REPORT,4,2         ; @HID_REQ_GET_REPORT
l_.str.1:                               ; @.str.1
	.asciz	"failed read register (%d)\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"read register address error (%x,%x)\n"

l_.str.3:                               ; @.str.3
	.asciz	"read register size error (%x)\n"

l_.str.4:                               ; @.str.4
	.asciz	"read register checksum error (%x,%x)\n"

	.no_dead_strip	_t4_read_write_register
.subsections_via_symbols
