	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cobalt_buttons_probe
_cobalt_buttons_probe:                  ## @cobalt_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	$24, %edi
	callq	_kzalloc
	movq	%rax, %r13
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_input_allocate_polled_device
	movq	%rax, %r14
	testq	%r13, %r13
	je	LBB0_8
## %bb.1:
	testq	%r14, %r14
	je	LBB0_8
## %bb.2:
	movq	16(%r13), %rdi
	movq	_cobalt_map@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movl	$8, %edx
	callq	_memcpy
	movq	%r13, 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	16(%r13), %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	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_5
## %bb.3:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r13), %rax
	movl	(%rax,%r15,4), %edi
	movl	24(%rbx), %esi
	callq	___set_bit
	incq	%r15
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %r15
	jl	LBB0_4
LBB0_5:
	movq	_KEY_RESERVED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%rbx), %esi
	callq	___clear_bit
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r12d, %r12d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_platform_get_resource
	testq	%rax, %rax
	je	LBB0_9
## %bb.6:
	movq	%r14, 8(%r13)
	movl	(%rax), %r15d
	movq	%rax, %rdi
	callq	_resource_size
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_ioremap
	movl	%eax, (%r13)
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_dev_set_drvdata
	movq	%r14, %rdi
	callq	_input_register_polled_device
	testl	%eax, %eax
	je	LBB0_12
## %bb.7:
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_iounmap
	movl	%ebx, %r12d
	jmp	LBB0_11
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_9:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
LBB0_10:
	subl	(%rax), %r12d
LBB0_11:
	movq	%r14, %rdi
	callq	_input_free_polled_device
	movq	%r13, %rdi
	callq	_kfree
LBB0_12:
	movl	%r12d, %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	_cobalt_map,8,3                 ## @cobalt_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	"Cobalt buttons"

L_.str.1:                               ## @.str.1
	.asciz	"cobalt/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
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_cobalt_buttons_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cobalt_buttons_probe
_cobalt_buttons_probe:                  ; @cobalt_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, #24
	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]
	b	LBB0_9
LBB0_2:
	ldr	x0, [x19, #16]
Lloh5:
	adrp	x23, _cobalt_map@GOTPAGE
Lloh6:
	ldr	x23, [x23, _cobalt_map@GOTPAGEOFF]
	ldr	x1, [x23]
	mov	w2, #8
	bl	_memcpy
Lloh7:
	adrp	x8, _handle_buttons@GOTPAGE
Lloh8:
	ldr	x8, [x8, _handle_buttons@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _BUTTONS_POLL_INTERVAL@GOTPAGE
Lloh11:
	ldr	x9, [x9, _BUTTONS_POLL_INTERVAL@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #8]
	ldr	x22, [x20]
Lloh13:
	adrp	x8, l_.str@PAGE
Lloh14:
	add	x8, x8, l_.str@PAGEOFF
Lloh15:
	adrp	x9, l_.str.1@PAGE
Lloh16:
	add	x9, x9, l_.str.1@PAGEOFF
	stp	x8, x9, [x22]
Lloh17:
	adrp	x8, _BUS_HOST@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BUS_HOST@GOTPAGEOFF]
	str	x19, [x20, #16]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x22, #48]
	ldr	x0, [x19, #16]
	stp	x0, x21, [x22, #32]
	bl	_ARRAY_SIZE
	mov	w8, #2
	stp	w0, w8, [x22, #16]
Lloh20:
	adrp	x8, _EV_MSC@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EV_MSC@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
Lloh23:
	adrp	x8, _MSC_SCAN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MSC_SCAN@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_input_set_capability
Lloh26:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh28:
	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, #16]
	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:
Lloh29:
	adrp	x8, _KEY_RESERVED@GOTPAGE
Lloh30:
	ldr	x8, [x8, _KEY_RESERVED@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	ldr	w1, [x22, #24]
	bl	___clear_bit
Lloh32:
	adrp	x8, _IORESOURCE_MEM@GOTPAGE
Lloh33:
	ldr	x8, [x8, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	mov	x0, x21
	mov	w2, #0
	bl	_platform_get_resource
	cbz	x0, LBB0_8
; %bb.6:
	str	x20, [x19, #8]
	ldr	w22, [x0]
	bl	_resource_size
	mov	x1, x0
	mov	x0, x22
	bl	_ioremap
	str	w0, [x19]
	mov	x0, x21
	mov	x1, x19
	bl	_dev_set_drvdata
	mov	x0, x20
	bl	_input_register_polled_device
	mov	x21, x0
	cbz	w0, LBB0_11
; %bb.7:
	ldr	w0, [x19]
	bl	_iounmap
	b	LBB0_10
LBB0_8:
Lloh35:
	adrp	x8, _EBUSY@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x20
	bl	_input_free_polled_device
	mov	x0, x19
	bl	_kfree
LBB0_11:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_cobalt_map,8,3                 ; @cobalt_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	"Cobalt buttons"

l_.str.1:                               ; @.str.1
	.asciz	"cobalt/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
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_cobalt_buttons_probe
.subsections_via_symbols
