	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sgi_buttons_probe
_sgi_buttons_probe:                     ## @sgi_buttons_probe
	.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, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	movq	%rax, %r12
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_input_allocate_polled_device
	movq	%rax, %r14
	testq	%r12, %r12
	je	LBB0_2
## %bb.1:
	testq	%r14, %r14
	je	LBB0_2
## %bb.4:
	movq	8(%r12), %rdi
	movq	_sgi_map@GOTPCREL(%rip), %r13
	movq	(%r13), %rsi
	movl	$8, %edx
	callq	_memcpy
	movq	%r12, 16(%r14)
	movq	_handle_buttons@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
	movq	_BUTTONS_POLL_INTERVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movq	(%r14), %rbx
	leaq	L_.str(%rip), %rax
	movq	%rax, (%rbx)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 8(%rbx)
	movq	_BUS_HOST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, 40(%rbx)
	movq	8(%r12), %rdi
	movq	%rdi, 32(%rbx)
	callq	_ARRAY_SIZE
	movl	%eax, 16(%rbx)
	movl	$2, 20(%rbx)
	movq	_EV_MSC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MSC_SCAN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_input_set_capability
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	28(%rbx), %esi
	callq	___set_bit
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_7
## %bb.5:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%r15,4), %edi
	movl	24(%rbx), %esi
	callq	___set_bit
	incq	%r15
	movq	(%r13), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r15
	jl	LBB0_6
LBB0_7:
	movq	_KEY_RESERVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%rbx), %esi
	callq	___clear_bit
	movq	%r14, (%r12)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_platform_set_drvdata
	movq	%r14, %rdi
	callq	_input_register_polled_device
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
## %bb.8:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_3:
	movq	%r14, %rdi
	callq	_input_free_polled_device
	movq	%r12, %rdi
	callq	_kfree
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_sgi_map,8,3                    ## @sgi_map
	.comm	_handle_buttons,4,2             ## @handle_buttons
	.comm	_BUTTONS_POLL_INTERVAL,4,2      ## @BUTTONS_POLL_INTERVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SGI buttons"

L_.str.1:                               ## @.str.1
	.asciz	"sgi/input0"

	.comm	_BUS_HOST,4,2                   ## @BUS_HOST
	.comm	_EV_MSC,4,2                     ## @EV_MSC
	.comm	_MSC_SCAN,4,2                   ## @MSC_SCAN
	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_KEY_RESERVED,4,2               ## @KEY_RESERVED
	.no_dead_strip	_sgi_buttons_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sgi_buttons_probe
_sgi_buttons_probe:                     ; @sgi_buttons_probe
	.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	x21, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	mov	x19, x0
	bl	_input_allocate_polled_device
	mov	x20, x0
	cmp	x19, #0
	ccmp	x0, #0, #4, ne
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_6
LBB0_2:
	ldr	x0, [x19, #8]
Lloh6:
	adrp	x23, _sgi_map@GOTPAGE
Lloh7:
	ldr	x23, [x23, _sgi_map@GOTPAGEOFF]
	ldr	x1, [x23]
	mov	w2, #8
	bl	_memcpy
Lloh8:
	adrp	x8, _handle_buttons@GOTPAGE
Lloh9:
	ldr	x8, [x8, _handle_buttons@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _BUTTONS_POLL_INTERVAL@GOTPAGE
Lloh12:
	ldr	x9, [x9, _BUTTONS_POLL_INTERVAL@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #8]
	ldr	x22, [x20]
Lloh14:
	adrp	x8, l_.str@PAGE
Lloh15:
	add	x8, x8, l_.str@PAGEOFF
Lloh16:
	adrp	x9, l_.str.1@PAGE
Lloh17:
	add	x9, x9, l_.str.1@PAGEOFF
	stp	x8, x9, [x22]
Lloh18:
	adrp	x8, _BUS_HOST@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BUS_HOST@GOTPAGEOFF]
	str	x19, [x20, #16]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x22, #48]
	ldr	x0, [x19, #8]
	stp	x0, x21, [x22, #32]
	bl	_ARRAY_SIZE
	mov	w8, #2
	stp	w0, w8, [x22, #16]
Lloh21:
	adrp	x8, _EV_MSC@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EV_MSC@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _MSC_SCAN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MSC_SCAN@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_input_set_capability
Lloh27:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	ldr	w1, [x22, #28]
	bl	___set_bit
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x24, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	w0, [x8, x24, lsl #2]
	ldr	w1, [x22, #24]
	bl	___set_bit
	add	x24, x24, #1
	ldr	x0, [x23]
	bl	_ARRAY_SIZE
	cmp	x24, w0, sxtw
	b.lt	LBB0_4
LBB0_5:
Lloh30:
	adrp	x8, _KEY_RESERVED@GOTPAGE
Lloh31:
	ldr	x8, [x8, _KEY_RESERVED@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	ldr	w1, [x22, #24]
	bl	___clear_bit
	str	x20, [x19]
	mov	x0, x21
	mov	x1, x19
	bl	_platform_set_drvdata
	mov	x0, x20
	bl	_input_register_polled_device
	mov	x21, x0
	cbz	w0, LBB0_7
LBB0_6:
	mov	x0, x20
	bl	_input_free_polled_device
	mov	x0, x19
	bl	_kfree
LBB0_7:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_sgi_map,8,3                    ; @sgi_map
	.comm	_handle_buttons,4,2             ; @handle_buttons
	.comm	_BUTTONS_POLL_INTERVAL,4,2      ; @BUTTONS_POLL_INTERVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SGI buttons"

l_.str.1:                               ; @.str.1
	.asciz	"sgi/input0"

	.comm	_BUS_HOST,4,2                   ; @BUS_HOST
	.comm	_EV_MSC,4,2                     ; @EV_MSC
	.comm	_MSC_SCAN,4,2                   ; @MSC_SCAN
	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_KEY_RESERVED,4,2               ; @KEY_RESERVED
	.no_dead_strip	_sgi_buttons_probe
.subsections_via_symbols
