	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ebook_switch_add
_ebook_switch_add:                      ## @ebook_switch_add
	.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, %r14
	callq	_acpi_device_hid
	movq	%rax, %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	%rax, 24(%r14)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_input_allocate_device
	movq	%rax, 8(%r13)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_acpi_device_name
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_acpi_device_class
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_XO15_EBOOK_HID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_8:
	movq	_XO15_EBOOK_DEVICE_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_strcpy
	movq	_XO15_EBOOK_CLASS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_XO15_EBOOK_SUBCLASS@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_sprintf
	movl	(%r13), %edi
	leaq	L_.str.2(%rip), %rdx
	movl	$4, %esi
	movq	%r12, %rcx
	callq	_snprintf
	movq	%rbx, (%r15)
	movl	(%r13), %eax
	movl	%eax, 36(%r15)
	movq	_BUS_HOST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r15)
	movq	%r14, 24(%r15)
	movq	_EV_SW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_BIT_MASK
	movq	16(%r15), %rcx
	movl	%eax, (%rcx)
	movq	_SW_TABLET_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r15), %esi
	callq	_set_bit
	movq	%r15, %rdi
	callq	_input_register_device
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_9
LBB0_6:
	movq	%r15, %rdi
	callq	_input_free_device
LBB0_7:
	movq	%r13, %rdi
	callq	_kfree
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r14, %rdi
	callq	_ebook_send_state
	xorl	%ebx, %ebx
	cmpq	$0, 16(%r14)
	je	LBB0_11
## %bb.10:
	movl	8(%r14), %esi
	movl	12(%r14), %edi
	callq	_acpi_enable_gpe
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_device_set_wakeup_enable
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_XO15_EBOOK_HID,4,2             ## @XO15_EBOOK_HID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported hid [%s]\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_XO15_EBOOK_DEVICE_NAME,4,2     ## @XO15_EBOOK_DEVICE_NAME
L_.str.1:                               ## @.str.1
	.asciz	"%s/%s"

	.comm	_XO15_EBOOK_CLASS,8,3           ## @XO15_EBOOK_CLASS
	.comm	_XO15_EBOOK_SUBCLASS,8,3        ## @XO15_EBOOK_SUBCLASS
L_.str.2:                               ## @.str.2
	.asciz	"%s/button/input0"

	.comm	_BUS_HOST,4,2                   ## @BUS_HOST
	.comm	_EV_SW,4,2                      ## @EV_SW
	.comm	_SW_TABLET_MODE,4,2             ## @SW_TABLET_MODE
	.no_dead_strip	_ebook_switch_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ebook_switch_add
_ebook_switch_add:                      ; @ebook_switch_add
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x0
	bl	_acpi_device_hid
	mov	x22, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	str	x0, [x20, #24]
	bl	_input_allocate_device
	str	x0, [x19, #8]
	cbz	x0, LBB0_5
; %bb.2:
	mov	x21, x0
	mov	x0, x20
	bl	_acpi_device_name
	mov	x23, x0
	mov	x0, x20
	bl	_acpi_device_class
	mov	x24, x0
Lloh3:
	adrp	x8, _XO15_EBOOK_HID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XO15_EBOOK_HID@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_strcmp
	cbz	x0, LBB0_6
; %bb.3:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_pr_err
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_7
LBB0_4:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_9
LBB0_5:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_8
LBB0_6:
Lloh17:
	adrp	x8, _XO15_EBOOK_DEVICE_NAME@GOTPAGE
Lloh18:
	ldr	x8, [x8, _XO15_EBOOK_DEVICE_NAME@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_strcpy
Lloh20:
	adrp	x8, _XO15_EBOOK_CLASS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _XO15_EBOOK_CLASS@GOTPAGEOFF]
Lloh22:
	ldr	x2, [x8]
Lloh23:
	adrp	x8, _XO15_EBOOK_SUBCLASS@GOTPAGE
Lloh24:
	ldr	x8, [x8, _XO15_EBOOK_SUBCLASS@GOTPAGEOFF]
Lloh25:
	ldr	x3, [x8]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x24
	bl	_sprintf
	ldr	w0, [x19]
Lloh28:
	adrp	x2, l_.str.2@PAGE
Lloh29:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w1, #4
	mov	x3, x22
	bl	_snprintf
	str	x23, [x21]
	ldr	w8, [x19]
Lloh30:
	adrp	x9, _BUS_HOST@GOTPAGE
Lloh31:
	ldr	x9, [x9, _BUS_HOST@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #32]
	str	x20, [x21, #24]
Lloh33:
	adrp	x8, _EV_SW@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EV_SW@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	bl	_BIT_MASK
	ldr	x8, [x21, #16]
	str	w0, [x8]
Lloh36:
	adrp	x8, _SW_TABLET_MODE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _SW_TABLET_MODE@GOTPAGEOFF]
Lloh38:
	ldr	w0, [x8]
	ldr	w1, [x21, #8]
	bl	_set_bit
	mov	x0, x21
	bl	_input_register_device
	mov	x22, x0
	cbz	w0, LBB0_10
LBB0_7:
	mov	x0, x21
	bl	_input_free_device
LBB0_8:
	mov	x0, x19
	bl	_kfree
LBB0_9:
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x20
	bl	_ebook_send_state
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_12
; %bb.11:
	ldp	w1, w0, [x20, #8]
	bl	_acpi_enable_gpe
	mov	x0, x20
	mov	w1, #1
	bl	_device_set_wakeup_enable
LBB0_12:
	mov	w22, #0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_XO15_EBOOK_HID,4,2             ; @XO15_EBOOK_HID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported hid [%s]\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_XO15_EBOOK_DEVICE_NAME,4,2     ; @XO15_EBOOK_DEVICE_NAME
l_.str.1:                               ; @.str.1
	.asciz	"%s/%s"

	.comm	_XO15_EBOOK_CLASS,8,3           ; @XO15_EBOOK_CLASS
	.comm	_XO15_EBOOK_SUBCLASS,8,3        ; @XO15_EBOOK_SUBCLASS
l_.str.2:                               ; @.str.2
	.asciz	"%s/button/input0"

	.comm	_BUS_HOST,4,2                   ; @BUS_HOST
	.comm	_EV_SW,4,2                      ; @EV_SW
	.comm	_SW_TABLET_MODE,4,2             ; @SW_TABLET_MODE
	.no_dead_strip	_ebook_switch_add
.subsections_via_symbols
