	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atlas_acpi_button_add
_atlas_acpi_button_add:                 ## @atlas_acpi_button_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
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_input_allocate_device
	movq	_input_dev@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	leaq	L_.str.1(%rip), %rcx
	movq	%rcx, (%rax)
	movq	(%r15), %rax
	leaq	L_.str.2(%rip), %rcx
	movq	%rcx, 8(%rax)
	movq	_BUS_HOST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 40(%rax)
	movq	_atlas_keymap@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	movq	%rdi, 32(%rax)
	movl	$2, 16(%rax)
	callq	_ARRAY_SIZE
	movq	(%r15), %rdi
	movl	%eax, 20(%rdi)
	movq	_EV_MSC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSC_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_input_set_capability
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	(%r15), %rax
	movl	28(%rax), %esi
	callq	___set_bit
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_8
## %bb.3:
	xorl	%ebx, %ebx
	movq	_KEY_F1@GOTPCREL(%rip), %r13
	movq	_KEY_RESERVED@GOTPCREL(%rip), %r14
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r14), %rax
	movq	(%r12), %rdi
	movq	%rax, (%rdi,%rbx,8)
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_8
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$8, %rbx
	ja	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r13), %rax
	addq	%rbx, %rax
	movq	(%r12), %rcx
	movq	%rax, (%rcx,%rbx,8)
	movq	(%r13), %rdi
	addq	%rbx, %rdi
	movq	(%r15), %rax
	movl	24(%rax), %esi
	callq	___set_bit
	movq	(%r12), %rdi
	jmp	LBB0_7
LBB0_8:
	movq	(%r15), %rdi
	callq	_input_register_device
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	callq	_pr_err
	movq	(%r15), %rdi
	callq	_input_free_device
	jmp	LBB0_14
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_10:
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	movl	(%r8), %edi
	movq	_acpi_atlas_button_handler@GOTPCREL(%rip), %rdx
	movq	_acpi_atlas_button_setup@GOTPCREL(%rip), %rcx
	movl	$129, %esi
	callq	_acpi_install_address_space_handler
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	leaq	L_.str.4(%rip), %rdi
	callq	_pr_err
	movq	(%r15), %rdi
	callq	_input_unregister_device
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_13:
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_input_dev,8,3                  ## @input_dev
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to allocate input device\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Atlas ACPI button driver"

L_.str.2:                               ## @.str.2
	.asciz	"ASIM0000/atlas/input0"

	.comm	_BUS_HOST,4,2                   ## @BUS_HOST
	.comm	_atlas_keymap,8,3               ## @atlas_keymap
	.comm	_EV_MSC,4,2                     ## @EV_MSC
	.comm	_MSC_SCAN,4,2                   ## @MSC_SCAN
	.comm	_EV_KEY,8,3                     ## @EV_KEY
	.comm	_KEY_F1,8,3                     ## @KEY_F1
	.comm	_KEY_RESERVED,8,3               ## @KEY_RESERVED
L_.str.3:                               ## @.str.3
	.asciz	"couldn't register input device\n"

	.comm	_acpi_atlas_button_handler,4,2  ## @acpi_atlas_button_handler
	.comm	_acpi_atlas_button_setup,4,2    ## @acpi_atlas_button_setup
L_.str.4:                               ## @.str.4
	.asciz	"error installing addr spc handler\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atlas_acpi_button_add
_atlas_acpi_button_add:                 ; @atlas_acpi_button_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	x19, x0
	bl	_input_allocate_device
Lloh0:
	adrp	x21, _input_dev@GOTPAGE
Lloh1:
	ldr	x21, [x21, _input_dev@GOTPAGEOFF]
	str	x0, [x21]
	cbz	x0, LBB0_9
; %bb.1:
Lloh2:
	adrp	x8, l_.str.1@PAGE
Lloh3:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x0]
Lloh4:
	adrp	x8, l_.str.2@PAGE
Lloh5:
	add	x8, x8, l_.str.2@PAGEOFF
	ldr	x9, [x21]
	str	x8, [x9, #8]
Lloh6:
	adrp	x8, _BUS_HOST@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BUS_HOST@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x9, #40]
Lloh9:
	adrp	x20, _atlas_keymap@GOTPAGE
Lloh10:
	ldr	x20, [x20, _atlas_keymap@GOTPAGEOFF]
	ldr	x0, [x20]
	str	x0, [x9, #32]
	mov	w8, #2
	str	w8, [x9, #16]
	bl	_ARRAY_SIZE
	ldr	x8, [x21]
	str	w0, [x8, #20]
Lloh11:
	adrp	x9, _EV_MSC@GOTPAGE
Lloh12:
	ldr	x9, [x9, _EV_MSC@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x9]
Lloh14:
	adrp	x9, _MSC_SCAN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MSC_SCAN@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x9]
	mov	x0, x8
	bl	_input_set_capability
Lloh17:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh19:
	ldr	x0, [x8]
	ldr	x8, [x21]
	ldr	w1, [x8, #28]
	bl	___set_bit
	ldr	x0, [x20]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x22, #0
Lloh20:
	adrp	x23, _KEY_F1@GOTPAGE
Lloh21:
	ldr	x23, [x23, _KEY_F1@GOTPAGEOFF]
Lloh22:
	adrp	x24, _KEY_RESERVED@GOTPAGE
Lloh23:
	ldr	x24, [x24, _KEY_RESERVED@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x24]
	ldr	x0, [x20]
	str	x8, [x0, x22, lsl #3]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	bl	_ARRAY_SIZE
	cmp	x22, w0, sxtw
	b.ge	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x22, #8
	b.hi	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x23]
	add	x8, x22, x8
	ldr	x9, [x20]
	str	x8, [x9, x22, lsl #3]
	ldr	x8, [x23]
	add	x0, x22, x8
	ldr	x8, [x21]
	ldr	w1, [x8, #24]
	bl	___set_bit
	ldr	x0, [x20]
	b	LBB0_4
LBB0_7:
	ldr	x0, [x21]
	bl	_input_register_device
	cbz	w0, LBB0_10
; %bb.8:
	mov	x20, x0
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_err
	ldr	x0, [x21]
	bl	_input_free_device
	b	LBB0_13
LBB0_9:
Lloh26:
	adrp	x0, l_.str@PAGE
Lloh27:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
	ldr	w0, [x19]
Lloh30:
	adrp	x2, _acpi_atlas_button_handler@GOTPAGE
Lloh31:
	ldr	x2, [x2, _acpi_atlas_button_handler@GOTPAGEOFF]
Lloh32:
	adrp	x3, _acpi_atlas_button_setup@GOTPAGE
Lloh33:
	ldr	x3, [x3, _acpi_atlas_button_setup@GOTPAGEOFF]
	mov	w1, #129
	mov	x4, x19
	bl	_acpi_install_address_space_handler
	bl	_ACPI_FAILURE
	cbz	x0, LBB0_14
; %bb.11:
Lloh34:
	adrp	x0, l_.str.4@PAGE
Lloh35:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_err
	ldr	x0, [x21]
	bl	_input_unregister_device
Lloh36:
	adrp	x8, _EINVAL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_13:
	mov	x0, x20
	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_14:
	mov	w20, #0
	b	LBB0_13
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_input_dev,8,3                  ; @input_dev
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to allocate input device\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Atlas ACPI button driver"

l_.str.2:                               ; @.str.2
	.asciz	"ASIM0000/atlas/input0"

	.comm	_BUS_HOST,4,2                   ; @BUS_HOST
	.comm	_atlas_keymap,8,3               ; @atlas_keymap
	.comm	_EV_MSC,4,2                     ; @EV_MSC
	.comm	_MSC_SCAN,4,2                   ; @MSC_SCAN
	.comm	_EV_KEY,8,3                     ; @EV_KEY
	.comm	_KEY_F1,8,3                     ; @KEY_F1
	.comm	_KEY_RESERVED,8,3               ; @KEY_RESERVED
l_.str.3:                               ; @.str.3
	.asciz	"couldn't register input device\n"

	.comm	_acpi_atlas_button_handler,4,2  ; @acpi_atlas_button_handler
	.comm	_acpi_atlas_button_setup,4,2    ; @acpi_atlas_button_setup
l_.str.4:                               ; @.str.4
	.asciz	"error installing addr spc handler\n"

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