	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rmi_f30_map_gpios
_rmi_f30_map_gpios:                     ## @rmi_f30_map_gpios
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r13
	movl	4(%rdi), %edi
	callq	_rmi_get_platform_data
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	16(%r12), %r14
	movq	_BTN_LEFT@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_u8@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r12), %esi
	movq	_TRACKSTICK_RANGE_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_min_t
	movl	%eax, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	$4, %edx
	callq	_devm_kcalloc
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	testl	%ebx, %ebx
	jle	LBB0_14
## %bb.2:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movl	%ebx, %r13d
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	movl	-44(%rbp), %eax                 ## 4-byte Reload
                                        ## kill: def $eax killed $eax def $rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r12), %rax
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax,%rbx,4)
	incl	%ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
LBB0_3:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	%r15d, %r14d
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	movl	%r14d, %r15d
	cmpq	%rbx, %r13
	je	LBB0_13
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	12(%r12), %esi
	movl	%ebx, %edi
	callq	_rmi_f30_is_valid_button
	testl	%eax, %eax
	je	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 8(%rax)
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_TRACKSTICK_RANGE_START@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_TRACKSTICK_RANGE_END@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jl	LBB0_9
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	movl	$1, %r14d
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	testl	%r15d, %r15d
	jne	LBB0_4
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r12), %rax
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%edx, (%rax,%rbx,4)
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leal	1(%rdx), %r15d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_input_set_capability
	movl	%r15d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
LBB0_13:
	movq	(%r12), %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	_BTN_LEFT@GOTPCREL(%rip), %r15
LBB0_14:
	movq	%rax, (%r14)
	movl	$4, 8(%r14)
	movl	8(%r12), %eax
	movl	%eax, 16(%r14)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	jne	LBB0_16
## %bb.15:
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	subl	(%r15), %ecx
	xorl	%eax, %eax
	cmpl	$1, %ecx
	jne	LBB0_18
LBB0_16:
	movq	_INPUT_PROP_BUTTONPAD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%r14), %esi
	callq	___set_bit
	xorl	%eax, %eax
	jmp	LBB0_18
LBB0_17:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_18:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BTN_LEFT,4,2                   ## @BTN_LEFT
	.comm	_u8,4,2                         ## @u8
	.comm	_TRACKSTICK_RANGE_END,4,2       ## @TRACKSTICK_RANGE_END
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate gpioled map memory.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_TRACKSTICK_RANGE_START,4,2     ## @TRACKSTICK_RANGE_START
	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_INPUT_PROP_BUTTONPAD,4,2       ## @INPUT_PROP_BUTTONPAD
	.no_dead_strip	_rmi_f30_map_gpios
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rmi_f30_map_gpios
_rmi_f30_map_gpios:                     ; @rmi_f30_map_gpios
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x22, x0
	ldr	w0, [x0, #4]
	bl	_rmi_get_platform_data
	mov	x21, x0
	ldr	x19, [x20, #16]
Lloh0:
	adrp	x23, _BTN_LEFT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _BTN_LEFT@GOTPAGEOFF]
Lloh2:
	adrp	x8, _u8@GOTPAGE
Lloh3:
	ldr	x8, [x8, _u8@GOTPAGEOFF]
	ldr	w26, [x23]
Lloh4:
	ldr	w0, [x8]
	ldr	w1, [x20, #8]
Lloh5:
	adrp	x27, _TRACKSTICK_RANGE_END@GOTPAGE
Lloh6:
	ldr	x27, [x27, _TRACKSTICK_RANGE_END@GOTPAGEOFF]
	ldr	w2, [x27]
	bl	_min_t
	mov	x24, x0
Lloh7:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh9:
	ldr	w3, [x8]
	mov	x0, x22
	mov	x1, x24
	mov	w2, #4
	bl	_devm_kcalloc
	str	x0, [x20]
	cbz	x0, LBB0_16
; %bb.1:
	cmp	w24, #1
	b.lt	LBB0_12
; %bb.2:
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	mov	x22, #0
	mov	w25, #0
Lloh10:
	adrp	x28, _TRACKSTICK_RANGE_START@GOTPAGE
Lloh11:
	ldr	x28, [x28, _TRACKSTICK_RANGE_START@GOTPAGEOFF]
	mov	x19, x26
	mov	w24, w24
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20]
	str	w26, [x8, x22, lsl #2]
	add	w26, w26, #1
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	cmp	x24, x22
	b.eq	LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20, #12]
	mov	x0, x22
	bl	_rmi_f30_is_valid_button
	cbz	w0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x21, #8]
	ldrsw	x9, [x28]
	ldrsw	x10, [x27]
	cmp	x8, #0
	ccmp	x22, x9, #8, ne
	ccmp	x22, x10, #0, ge
	b.lt	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x21]
	cbz	x8, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	cbz	w25, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w25, #1
	b	LBB0_4
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x20]
	str	w19, [x8, x22, lsl #2]
Lloh12:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	add	w23, w19, #1
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x2, x19
	bl	_input_set_capability
	mov	w25, #1
	mov	x19, x23
	b	LBB0_4
LBB0_11:
	ldr	x0, [x20]
	mov	x26, x19
	ldr	x19, [sp, #8]                   ; 8-byte Folded Reload
Lloh15:
	adrp	x23, _BTN_LEFT@GOTPAGE
Lloh16:
	ldr	x23, [x23, _BTN_LEFT@GOTPAGEOFF]
LBB0_12:
	str	x0, [x19]
	mov	w8, #4
	str	w8, [x19, #8]
	ldr	w8, [x20, #8]
	str	w8, [x19, #16]
	ldr	x8, [x21]
	cbnz	x8, LBB0_14
; %bb.13:
	ldr	w8, [x23]
	sub	w8, w26, w8
	cmp	w8, #1
	b.ne	LBB0_15
LBB0_14:
Lloh17:
	adrp	x8, _INPUT_PROP_BUTTONPAD@GOTPAGE
Lloh18:
	ldr	x8, [x8, _INPUT_PROP_BUTTONPAD@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	ldr	w1, [x19, #12]
	bl	___set_bit
LBB0_15:
	mov	w0, #0
	b	LBB0_17
LBB0_16:
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_dev_err
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_BTN_LEFT,4,2                   ; @BTN_LEFT
	.comm	_u8,4,2                         ; @u8
	.comm	_TRACKSTICK_RANGE_END,4,2       ; @TRACKSTICK_RANGE_END
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate gpioled map memory.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_TRACKSTICK_RANGE_START,4,2     ; @TRACKSTICK_RANGE_START
	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_INPUT_PROP_BUTTONPAD,4,2       ; @INPUT_PROP_BUTTONPAD
	.no_dead_strip	_rmi_f30_map_gpios
.subsections_via_symbols
