	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function creative_sb0540_raw_event
_creative_sb0540_raw_event:             ## @creative_sb0540_raw_event
	.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
	movl	%ecx, %ebx
	movq	%rdx, %r12
	movq	%rdi, %r15
	callq	_hid_get_drvdata
	cmpl	$6, %ebx
	jne	LBB0_5
## %bb.1:
	movq	%rax, %r14
	movl	20(%r12), %edi
	movl	$8, %esi
	callq	_reverse
	movzbl	%al, %ebx
	shll	$8, %eax
	movzwl	%ax, %eax
	orl	%eax, %ebx
	xorl	$65280, %ebx                    ## imm = 0xFF00
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_get_key
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r12d
	movq	_KEY_RESERVED@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	je	LBB0_3
## %bb.4:
	movl	(%r14), %edi
	movl	%r12d, %esi
	movl	$1, %edx
	callq	_input_report_key
	movl	(%r14), %edi
	movl	%r12d, %esi
	xorl	%edx, %edx
	callq	_input_report_key
	movl	(%r14), %edi
	callq	_input_sync
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_hid_err
LBB0_5:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KEY_RESERVED,4,2               ## @KEY_RESERVED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not get a key for main_code %llX\n"

	.no_dead_strip	_creative_sb0540_raw_event
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function creative_sb0540_raw_event
_creative_sb0540_raw_event:             ; @creative_sb0540_raw_event
	.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	x22, x3
	mov	x21, x2
	mov	x20, x0
	bl	_hid_get_drvdata
	cmp	w22, #6
	b.ne	LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	w0, [x21, #20]
	mov	w1, #8
	bl	_reverse
	and	w8, w0, #0xff
	bfi	w8, w0, #8, #8
	eor	w22, w8, #0xff00
	mov	x0, x19
	mov	x1, x22
	bl	_get_key
Lloh0:
	adrp	x8, _KEY_RESERVED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KEY_RESERVED@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, #0
	ccmp	w0, w8, #4, ne
	b.ne	LBB0_3
; %bb.2:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	bl	_hid_err
	b	LBB0_4
LBB0_3:
	mov	x21, x0
	ldr	w0, [x19]
	mov	x1, x21
	mov	w2, #1
	bl	_input_report_key
	ldr	w0, [x19]
	mov	x1, x21
	mov	w2, #0
	bl	_input_report_key
	ldr	w0, [x19]
	bl	_input_sync
LBB0_4:
	mov	w0, #0
	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 AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_KEY_RESERVED,4,2               ; @KEY_RESERVED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not get a key for main_code %llX\n"

	.no_dead_strip	_creative_sb0540_raw_event
.subsections_via_symbols
