	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chromeos_tbmc_add
_chromeos_tbmc_add:                     ## @chromeos_tbmc_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_devm_input_allocate_device
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rax
	movq	%rax, (%rbx)
	movq	%r15, %rdi
	callq	_acpi_device_hid
	movl	%eax, 40(%rbx)
	movq	_BUS_HOST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%rbx)
	movl	$1, 16(%rbx)
	movq	$0, 24(%rbx)
	movq	_chromeos_tbmc_open@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_input_set_drvdata
	movq	%rbx, (%r15)
	movq	_EV_SW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SW_TABLET_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_input_set_capability
	movq	%rbx, %rdi
	callq	_input_register_device
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_err
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_4:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_device_init_wakeup
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Tablet Mode Switch"

	.comm	_BUS_HOST,4,2                   ## @BUS_HOST
	.comm	_chromeos_tbmc_open,4,2         ## @chromeos_tbmc_open
	.comm	_EV_SW,4,2                      ## @EV_SW
	.comm	_SW_TABLET_MODE,4,2             ## @SW_TABLET_MODE
L_.str.1:                               ## @.str.1
	.asciz	"cannot register input device\n"

	.no_dead_strip	_chromeos_tbmc_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chromeos_tbmc_add
_chromeos_tbmc_add:                     ; @chromeos_tbmc_add
	.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	x21, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_devm_input_allocate_device
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x0]
	mov	x0, x21
	bl	_acpi_device_hid
	str	w0, [x20, #40]
Lloh2:
	adrp	x8, _BUS_HOST@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BUS_HOST@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x20, #32]
	mov	w8, #1
	str	w8, [x20, #16]
	str	xzr, [x20, #24]
Lloh5:
	adrp	x8, _chromeos_tbmc_open@GOTPAGE
Lloh6:
	ldr	x8, [x8, _chromeos_tbmc_open@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x20, #8]
	mov	x0, x20
	mov	x1, x21
	bl	_input_set_drvdata
	str	x20, [x21]
Lloh8:
	adrp	x8, _EV_SW@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EV_SW@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _SW_TABLET_MODE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SW_TABLET_MODE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_input_set_capability
	mov	x0, x20
	bl	_input_register_device
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.2:
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_5
LBB0_3:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	mov	w1, #1
	bl	_device_init_wakeup
LBB0_5:
	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	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Tablet Mode Switch"

	.comm	_BUS_HOST,4,2                   ; @BUS_HOST
	.comm	_chromeos_tbmc_open,4,2         ; @chromeos_tbmc_open
	.comm	_EV_SW,4,2                      ; @EV_SW
	.comm	_SW_TABLET_MODE,4,2             ; @SW_TABLET_MODE
l_.str.1:                               ; @.str.1
	.asciz	"cannot register input device\n"

	.no_dead_strip	_chromeos_tbmc_add
.subsections_via_symbols
