	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rn42_task                      ## -- Begin function rn42_task
	.p2align	4, 0x90
_rn42_task:                             ## @rn42_task
	.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
	xorl	%eax, %eax
	callq	_rn42_getc
	cmpl	$-1, %eax
	je	LBB0_17
## %bb.1:
	leaq	LJTI0_0(%rip), %r13
	leaq	L_.str(%rip), %r14
	leaq	L_.str.1(%rip), %r15
	leaq	L_.str.2(%rip), %r12
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	movslq	%eax, %rbx
	movq	%r12, %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_dprintf
	movl	%ebx, %edi
	callq	_rn42_set_leds
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	$0, _rn42_task.state(%rip)
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_rn42_getc
	cmpl	$-1, %eax
	je	LBB0_17
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	_rn42_task.state(%rip), %ecx
	cmpq	$3, %rcx
	ja	LBB0_15
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	(%r13,%rcx,4), %rcx
	addq	%r13, %rcx
	jmpq	*%rcx
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$254, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, _rn42_task.state(%rip)
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$2, %eax
	jne	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	$2, _rn42_task.state(%rip)
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$1, %eax
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	$3, _rn42_task.state(%rip)
	jmp	LBB0_16
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$127, %eax
	ja	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	jmp	LBB0_8
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %esi
	callq	_xprintf
	jmp	LBB0_16
LBB0_17:
	movq	_config_mode@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_24
## %bb.18:
	movq	_force_usb@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_21
## %bb.19:
	xorl	%eax, %eax
	callq	_rn42_rts
	testl	%eax, %eax
	je	LBB0_20
LBB0_21:
	xorl	%eax, %eax
	callq	_host_get_driver
	movq	_lufa_driver@GOTPCREL(%rip), %rbx
	cmpq	%rbx, %rax
	je	LBB0_24
LBB0_23:
	xorl	%eax, %eax
	callq	_clear_keyboard
	movq	%rbx, %rdi
	callq	_host_set_driver
LBB0_24:
	movl	_rn42_task.prev_timer(%rip), %edi
	callq	_timer_elapsed
	cmpl	$1001, %eax                     ## imm = 0x3E9
	jl	LBB0_30
## %bb.25:
	movl	%eax, %eax
	imulq	$274877907, %rax, %rax          ## imm = 0x10624DD3
	shrq	$38, %rax
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	addl	%eax, _rn42_task.prev_timer(%rip)
	xorl	%eax, %eax
	callq	_battery_status
	movq	_LOW_VOLTAGE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_26
## %bb.27:
	movq	_LED_ON@GOTPCREL(%rip), %rax
	jmp	LBB0_28
LBB0_26:
	movq	_LED_CHARGER@GOTPCREL(%rip), %rax
LBB0_28:
	movl	(%rax), %edi
	callq	_battery_led
	xorl	%eax, %eax
	callq	_timer_read32
	movslq	%eax, %r14
	imulq	$274877907, %r14, %rbx          ## imm = 0x10624DD3
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$38, %rbx
	addl	%eax, %ebx
	imull	$-286331153, %ebx, %eax         ## imm = 0xEEEEEEEF
	addl	$143165576, %eax                ## imm = 0x8888888
	rorl	$2, %eax
	cmpl	$71582788, %eax                 ## imm = 0x4444444
	ja	LBB0_30
## %bb.29:
	xorl	%eax, %eax
	callq	_battery_voltage
	imulq	$1250999897, %r14, %rcx         ## imm = 0x4A90BE59
	movq	%rcx, %rdx
	shrq	$63, %rdx
	shrq	$32, %rcx
	sarl	$20, %ecx
	addl	%edx, %ecx
	movslq	%ecx, %rsi
	movslq	%ebx, %rcx
	imulq	$-1851608123, %rcx, %rcx        ## imm = 0x91A2B3C5
	shrq	$32, %rcx
	addl	%ebx, %ecx
	movl	%ecx, %edx
	shrl	$31, %edx
	sarl	$11, %ecx
	addl	%edx, %ecx
	imull	$3600, %ecx, %ecx               ## imm = 0xE10
	subl	%ecx, %ebx
	movswl	%bx, %ecx
	imull	$-30583, %ecx, %ecx             ## imm = 0x8889
	shrl	$16, %ecx
	addl	%ebx, %ecx
	movzwl	%cx, %ecx
	movswl	%cx, %edx
	shrl	$15, %ecx
	sarl	$5, %edx
	addl	%ecx, %edx
	movswq	%dx, %rdx
	leaq	L_.str.3(%rip), %rdi
	xorl	%ecx, %ecx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_dprintf
LBB0_30:
	xorl	%eax, %eax
	callq	_rn42_rts
	testl	%eax, %eax
	je	LBB0_31
LBB0_32:
	xorl	%edi, %edi
	jmp	LBB0_33
LBB0_31:
	xorl	%eax, %eax
	callq	_rn42_linked
	movl	$1, %edi
	testq	%rax, %rax
	je	LBB0_32
LBB0_33:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_status_led                     ## TAILCALL
LBB0_20:
	xorl	%eax, %eax
	callq	_host_get_driver
	movq	_rn42_driver@GOTPCREL(%rip), %rbx
	cmpq	%rbx, %rax
	jne	LBB0_23
	jmp	LBB0_24
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
LJTI0_0:
	.long	L0_0_set_4
	.long	L0_0_set_10
	.long	L0_0_set_12
	.long	L0_0_set_14
	.end_data_region
                                        ## -- End function
.zerofill __DATA,__bss,_rn42_task.state,4,2 ## @rn42_task.state
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%c"

L_.str.1:                               ## @.str.1
	.asciz	" %02X"

L_.str.2:                               ## @.str.2
	.asciz	"LED status: %02X\n"

	.comm	_config_mode,4,2                ## @config_mode
	.comm	_force_usb,4,2                  ## @force_usb
	.comm	_rn42_driver,4,2                ## @rn42_driver
	.comm	_lufa_driver,4,2                ## @lufa_driver
.zerofill __DATA,__bss,_rn42_task.prev_timer,4,2 ## @rn42_task.prev_timer
	.comm	_LOW_VOLTAGE,8,3                ## @LOW_VOLTAGE
	.comm	_LED_ON,4,2                     ## @LED_ON
	.comm	_LED_CHARGER,4,2                ## @LED_CHARGER
L_.str.3:                               ## @.str.3
	.asciz	"%02u:%02u:%02u\t%umV\n"

	.comm	_keymap_config,4,2              ## @keymap_config
	.comm	_rn42_nkro_last,4,2             ## @rn42_nkro_last
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rn42_task                      ; -- Begin function rn42_task
	.p2align	2
_rn42_task:                             ; @rn42_task
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	bl	_rn42_getc
	cmn	w0, #1
	b.eq	LBB0_17
; %bb.1:
	mov	x22, x0
	adrp	x23, _rn42_task.state@PAGE
Lloh0:
	adrp	x24, lJTI0_0@PAGE
Lloh1:
	add	x24, x24, lJTI0_0@PAGEOFF
	mov	w25, #1
Lloh2:
	adrp	x19, l_.str@PAGE
Lloh3:
	add	x19, x19, l_.str@PAGEOFF
Lloh4:
	adrp	x20, l_.str.1@PAGE
Lloh5:
	add	x20, x20, l_.str.1@PAGEOFF
	mov	w26, #2
	mov	w27, #3
Lloh6:
	adrp	x21, l_.str.2@PAGE
Lloh7:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	sxtw	x1, w22
	mov	x0, x21
	bl	_dprintf
	mov	x0, x22
	bl	_rn42_set_leds
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	wzr, [x23, _rn42_task.state@PAGEOFF]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_rn42_getc
	mov	x22, x0
	cmn	w0, #1
	b.eq	LBB0_17
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23, _rn42_task.state@PAGEOFF]
	cmp	w8, #3
	b.hi	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	adr	x9, LBB0_2
	ldrb	w10, [x24, x8]
	add	x9, x9, x10, lsl #2
	br	x9
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmp	w22, #254
	b.ne	LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	str	w25, [x23, _rn42_task.state@PAGEOFF]
	b	LBB0_4
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmp	w22, #2
	b.ne	LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	str	w26, [x23, _rn42_task.state@PAGEOFF]
	b	LBB0_4
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w22, #1
	b.ne	LBB0_3
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	str	w27, [x23, _rn42_task.state@PAGEOFF]
	b	LBB0_4
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	w22, #127
	b.hi	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x20
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x22
	bl	_xprintf
	b	LBB0_4
LBB0_17:
Lloh8:
	adrp	x8, _config_mode@GOTPAGE
Lloh9:
	ldr	x8, [x8, _config_mode@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cbnz	w8, LBB0_22
; %bb.18:
Lloh11:
	adrp	x8, _force_usb@GOTPAGE
Lloh12:
	ldr	x8, [x8, _force_usb@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	cbnz	w8, LBB0_20
; %bb.19:
	bl	_rn42_rts
	cbz	w0, LBB0_30
LBB0_20:
	bl	_host_get_driver
Lloh14:
	adrp	x19, _lufa_driver@GOTPAGE
Lloh15:
	ldr	x19, [x19, _lufa_driver@GOTPAGEOFF]
	cmp	x0, x19
	b.eq	LBB0_22
LBB0_21:
	bl	_clear_keyboard
	mov	x0, x19
	bl	_host_set_driver
LBB0_22:
	adrp	x19, _rn42_task.prev_timer@PAGE
	ldr	w0, [x19, _rn42_task.prev_timer@PAGEOFF]
	bl	_timer_elapsed
	cmp	w0, #1001
	b.lt	LBB0_24
; %bb.23:
	mov	w20, #19923
	movk	w20, #4194, lsl #16
	umull	x8, w0, w20
	lsr	x8, x8, #38
	mov	w9, #1000
	ldr	w10, [x19, _rn42_task.prev_timer@PAGEOFF]
	madd	w8, w8, w9, w10
	str	w8, [x19, _rn42_task.prev_timer@PAGEOFF]
	bl	_battery_status
Lloh16:
	adrp	x8, _LOW_VOLTAGE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LOW_VOLTAGE@GOTPAGEOFF]
Lloh18:
	adrp	x9, _LED_ON@GOTPAGE
Lloh19:
	ldr	x9, [x9, _LED_ON@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
Lloh21:
	adrp	x10, _LED_CHARGER@GOTPAGE
Lloh22:
	ldr	x10, [x10, _LED_CHARGER@GOTPAGEOFF]
	cmp	x0, x8
	csel	x8, x9, x10, eq
	ldr	w0, [x8]
	bl	_battery_led
	bl	_timer_read32
	smull	x8, w0, w20
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w20, w8, w9
	mov	w8, #61167
	movk	w8, #61166, lsl #16
	mov	w9, #34952
	movk	w9, #2184, lsl #16
	madd	w8, w20, w8, w9
	ror	w8, w8, #2
	mov	w9, #17476
	movk	w9, #1092, lsl #16
	cmp	w8, w9
	b.ls	LBB0_26
LBB0_24:
	bl	_rn42_rts
	cbz	w0, LBB0_27
LBB0_25:
	mov	w0, #0
	b	LBB0_29
LBB0_26:
	mov	x19, x0
	bl	_battery_voltage
                                        ; kill: def $w0 killed $w0 def $x0
	mov	w8, #48729
	movk	w8, #19088, lsl #16
	smull	x8, w19, w8
	lsr	x9, x8, #32
	lsr	x8, x8, #63
	add	w8, w8, w9, asr #20
	sxtw	x1, w8
	mov	w8, #46021
	movk	w8, #37282, lsl #16
	smull	x8, w20, w8
	lsr	x8, x8, #32
	add	w8, w8, w20
	asr	w9, w8, #11
	add	w8, w9, w8, lsr #31
	mov	w9, #3600
	msub	w8, w8, w9, w20
	sxth	w9, w8
	mov	w10, #-30583
	mul	w9, w9, w10
	add	w8, w8, w9, lsr #16
	and	w9, w8, #0x8000
	sbfx	w8, w8, #5, #11
	add	w8, w8, w9, lsr #15
	sxtw	x8, w8
	stp	xzr, x0, [sp, #8]
	str	x8, [sp]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_dprintf
	bl	_rn42_rts
	cbnz	w0, LBB0_25
LBB0_27:
	bl	_rn42_linked
	cbz	x0, LBB0_25
; %bb.28:
	mov	w0, #1
LBB0_29:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_status_led
LBB0_30:
	bl	_host_get_driver
Lloh25:
	adrp	x19, _rn42_driver@GOTPAGE
Lloh26:
	ldr	x19, [x19, _rn42_driver@GOTPAGEOFF]
	cmp	x0, x19
	b.ne	LBB0_21
	b	LBB0_22
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh20
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
                                        ; -- End function
.zerofill __DATA,__bss,_rn42_task.state,4,2 ; @rn42_task.state
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%c"

l_.str.1:                               ; @.str.1
	.asciz	" %02X"

l_.str.2:                               ; @.str.2
	.asciz	"LED status: %02X\n"

	.comm	_config_mode,4,2                ; @config_mode
	.comm	_force_usb,4,2                  ; @force_usb
	.comm	_rn42_driver,4,2                ; @rn42_driver
	.comm	_lufa_driver,4,2                ; @lufa_driver
.zerofill __DATA,__bss,_rn42_task.prev_timer,4,2 ; @rn42_task.prev_timer
	.comm	_LOW_VOLTAGE,8,3                ; @LOW_VOLTAGE
	.comm	_LED_ON,4,2                     ; @LED_ON
	.comm	_LED_CHARGER,4,2                ; @LED_CHARGER
l_.str.3:                               ; @.str.3
	.asciz	"%02u:%02u:%02u\t%umV\n"

	.comm	_keymap_config,4,2              ; @keymap_config
	.comm	_rn42_nkro_last,4,2             ; @rn42_nkro_last
.subsections_via_symbols
