	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function em28xx_init_buttons
_em28xx_init_buttons:                   ## @em28xx_init_buttons
	.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, %r13
	movq	_EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rdi)
	movq	40(%rdi), %r15
	movq	(%r15), %rax
	testq	%rax, %rax
	js	LBB0_24
## %bb.1:
	movq	_EM28XX_NUM_BUTTON_ROLES@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jge	LBB0_24
## %bb.2:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	(%r13), %rcx
	testq	%rcx, %rcx
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%r12,%r12,2), %rdx
	movq	8(%r15,%rdx,8), %rdx
	movq	8(%r13), %rsi
	movb	$1, %r14b
	cmpq	(%rsi), %rdx
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %r8
	movl	$1, %edi
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%rdi, %rcx
	je	LBB0_16
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	leaq	1(%rdi), %rbx
	cmpq	(%rsi,%rdi,8), %rdx
	movq	%rbx, %rdi
	jne	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	decq	%rbx
	cmpq	%rcx, %rbx
	setb	%r14b
	movq	%r8, %rbx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%r14d, %r14d
	jmp	LBB0_17
LBB0_16:                                ##   in Loop: Header=BB0_3 Depth=1
	seta	%r14b
	movq	%r8, %rbx
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_EM28XX_NUM_BUTTON_ADDRESSES_MAX@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jae	LBB0_18
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_EM28XX_BUTTON_SNAPSHOT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	_em28xx_register_snapshot_button
	testq	%rax, %rax
	jns	LBB0_12
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_EM28XX_BUTTON_ILLUMINATION@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_12
## %bb.20:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_EM28XX_LED_ILLUMINATION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_em28xx_find_led
	testl	%eax, %eax
	je	LBB0_21
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	testb	%r14b, %r14b
	jne	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %eax
	leaq	(%r12,%r12,2), %rcx
	movq	8(%r15,%rcx,8), %rcx
	movq	8(%r13), %rdx
	movq	%rcx, (%rdx,%rax,8)
	incq	(%r13)
LBB0_14:                                ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%r12,%r12,2), %rax
	cmpl	$0, 16(%r15,%rax,8)
	jne	LBB0_22
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_EM28XX_BUTTONS_VOLATILE_QUERY_INTERVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%r13)
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	leaq	L_.str(%rip), %rsi
	callq	_WARN_ONCE
	jmp	LBB0_22
LBB0_21:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	32(%r13), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r12
	movq	40(%r13), %r15
	leaq	(%r12,%r12,2), %rax
	movq	(%r15,%rax,8), %rax
	testq	%rax, %rax
	js	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_3 Depth=1
	cmpq	(%rbx), %rax
	jl	LBB0_3
LBB0_24:
	cmpq	$0, (%r13)
	je	LBB0_25
## %bb.26:
	movl	24(%r13), %edi
	movq	_EM28XX_NUM_BUTTON_ADDRESSES_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	xorl	%esi, %esi
	callq	_memset
	movl	16(%r13), %edi
	addq	$20, %r13
	callq	_msecs_to_jiffies
	movq	%r13, %rdi
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_schedule_delayed_work          ## TAILCALL
LBB0_25:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL,4,2 ## @EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL
	.comm	_EM28XX_NUM_BUTTON_ROLES,8,3    ## @EM28XX_NUM_BUTTON_ROLES
	.comm	_EM28XX_NUM_BUTTON_ADDRESSES_MAX,8,3 ## @EM28XX_NUM_BUTTON_ADDRESSES_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BUG: maximum number of button polling addresses exceeded."

	.comm	_EM28XX_BUTTON_SNAPSHOT,8,3     ## @EM28XX_BUTTON_SNAPSHOT
	.comm	_EM28XX_BUTTON_ILLUMINATION,8,3 ## @EM28XX_BUTTON_ILLUMINATION
	.comm	_EM28XX_LED_ILLUMINATION,4,2    ## @EM28XX_LED_ILLUMINATION
L_.str.1:                               ## @.str.1
	.asciz	"BUG: illumination button defined, but no illumination LED.\n"

	.comm	_EM28XX_BUTTONS_VOLATILE_QUERY_INTERVAL,4,2 ## @EM28XX_BUTTONS_VOLATILE_QUERY_INTERVAL
	.no_dead_strip	_em28xx_init_buttons
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function em28xx_init_buttons
_em28xx_init_buttons:                   ; @em28xx_init_buttons
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
Lloh0:
	adrp	x8, _EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	ldr	x21, [x0, #40]
	ldr	x8, [x21]
Lloh3:
	adrp	x22, _EM28XX_NUM_BUTTON_ADDRESSES_MAX@GOTPAGE
Lloh4:
	ldr	x22, [x22, _EM28XX_NUM_BUTTON_ADDRESSES_MAX@GOTPAGEOFF]
	tbnz	x8, #63, LBB0_25
; %bb.1:
Lloh5:
	adrp	x23, _EM28XX_NUM_BUTTON_ROLES@GOTPAGE
Lloh6:
	ldr	x23, [x23, _EM28XX_NUM_BUTTON_ROLES@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ge	LBB0_25
; %bb.2:
	mov	x24, #0
Lloh7:
	adrp	x25, _EM28XX_BUTTON_SNAPSHOT@GOTPAGE
Lloh8:
	ldr	x25, [x25, _EM28XX_BUTTON_SNAPSHOT@GOTPAGEOFF]
	mov	w26, #24
Lloh9:
	adrp	x20, l_.str@PAGE
Lloh10:
	add	x20, x20, l_.str@PAGEOFF
Lloh11:
	adrp	x28, _EM28XX_BUTTON_ILLUMINATION@GOTPAGE
Lloh12:
	ldr	x28, [x28, _EM28XX_BUTTON_ILLUMINATION@GOTPAGEOFF]
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x9, [x19]
	cbz	x9, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	madd	x10, x24, x26, x21
	ldr	x10, [x10, #8]
	ldr	x11, [x19, #8]
	ldr	x12, [x11]
	cmp	x10, x12
	b.ne	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w27, #1
	b	LBB0_13
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w27, #0
	b	LBB0_12
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w12, #1
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x9, x12
	b.eq	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	x13, [x11, x12, lsl #3]
	add	x12, x12, #1
	cmp	x10, x13
	b.ne	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=1
	sub	x10, x12, #1
	cmp	x10, x9
	cset	w27, lo
	b	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	x12, x9
	cset	w27, lo
LBB0_12:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x10, [x22]
	cmp	x9, x10
	b.hs	LBB0_21
LBB0_13:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_em28xx_register_snapshot_button
	tbz	x0, #63, LBB0_17
	b	LBB0_23
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x28]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh13:
	adrp	x8, _EM28XX_LED_ILLUMINATION@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EM28XX_LED_ILLUMINATION@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_em28xx_find_led
	cbz	w0, LBB0_22
LBB0_17:                                ;   in Loop: Header=BB0_3 Depth=1
	tbnz	w27, #0, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19]
	madd	x9, x24, x26, x21
	ldr	x9, [x9, #8]
	ldr	x10, [x19, #8]
	str	x9, [x10, x8, lsl #3]
	ldr	x8, [x19]
	add	x8, x8, #1
	str	x8, [x19]
LBB0_19:                                ;   in Loop: Header=BB0_3 Depth=1
	madd	x8, x24, x26, x21
	ldr	w8, [x8, #16]
	cbnz	w8, LBB0_23
; %bb.20:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh16:
	adrp	x8, _EM28XX_BUTTONS_VOLATILE_QUERY_INTERVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EM28XX_BUTTONS_VOLATILE_QUERY_INTERVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x19, #16]
	b	LBB0_23
LBB0_21:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1
	mov	x1, x20
	bl	_WARN_ONCE
	b	LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x19, #32]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_23:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x24, x24, #1
	ldr	x21, [x19, #40]
	mul	x8, x24, x26
	ldr	x8, [x21, x8]
	tbnz	x8, #63, LBB0_25
; %bb.24:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x23]
	cmp	x8, x9
	b.lt	LBB0_3
LBB0_25:
	ldr	x8, [x19]
	cbz	x8, LBB0_27
; %bb.26:
	ldr	w0, [x19, #24]
	ldr	x2, [x22]
	mov	w1, #0
	bl	_memset
	add	x20, x19, #20
	ldr	w0, [x19, #16]
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_schedule_delayed_work
LBB0_27:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL,4,2 ; @EM28XX_BUTTONS_DEBOUNCED_QUERY_INTERVAL
	.comm	_EM28XX_NUM_BUTTON_ROLES,8,3    ; @EM28XX_NUM_BUTTON_ROLES
	.comm	_EM28XX_NUM_BUTTON_ADDRESSES_MAX,8,3 ; @EM28XX_NUM_BUTTON_ADDRESSES_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BUG: maximum number of button polling addresses exceeded."

	.comm	_EM28XX_BUTTON_SNAPSHOT,8,3     ; @EM28XX_BUTTON_SNAPSHOT
	.comm	_EM28XX_BUTTON_ILLUMINATION,8,3 ; @EM28XX_BUTTON_ILLUMINATION
	.comm	_EM28XX_LED_ILLUMINATION,4,2    ; @EM28XX_LED_ILLUMINATION
l_.str.1:                               ; @.str.1
	.asciz	"BUG: illumination button defined, but no illumination LED.\n"

	.comm	_EM28XX_BUTTONS_VOLATILE_QUERY_INTERVAL,4,2 ; @EM28XX_BUTTONS_VOLATILE_QUERY_INTERVAL
	.no_dead_strip	_em28xx_init_buttons
.subsections_via_symbols
