	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tc3589x_keypad_init_key_hardware
_tc3589x_keypad_init_key_hardware:      ## @tc3589x_keypad_init_key_hardware
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	movl	(%rbx), %eax
	movq	_TC3589x_MAX_KPCOL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jg	LBB0_2
## %bb.1:
	movl	4(%rbx), %edx
	movq	_TC3589x_MAX_KPROW@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edx
	jle	LBB0_3
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	8(%rdi), %r14
	movq	_TC3589x_KBDSIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_KP_ROW_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %edx
	orl	%eax, %edx
	movq	%r14, %rdi
	callq	_tc3589x_reg_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.4:
	movq	_TC3589x_KBCFG_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DEDICATED_KEY_VAL@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_tc3589x_reg_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.5:
	movq	_TC3589x_KBCFG_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_tc3589x_reg_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.6:
	movq	_TC3589x_KBDSETTLE_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%rbx), %edx
	movq	%r14, %rdi
	callq	_tc3589x_reg_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.7:
	movq	_TC3589x_KBDBOUNCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%rbx), %edx
	movq	%r14, %rdi
	callq	_tc3589x_reg_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.8:
	movq	_TC3589x_IOCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IOCFG_IG@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_tc3589x_set_bits
	testl	%eax, %eax
	js	LBB0_13
## %bb.9:
	movq	_TC3589x_IOPULLCFG0_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TC3589x_PULLUP_ALL_MASK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r14, %rdi
	callq	_tc3589x_reg_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.10:
	movq	_TC3589x_IOPULLCFG0_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%r14, %rdi
	callq	_tc3589x_reg_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.11:
	movq	_TC3589x_IOPULLCFG1_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%r14, %rdi
	callq	_tc3589x_reg_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.12:
	movq	_TC3589x_IOPULLCFG1_MSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%r14, %rdi
	callq	_tc3589x_reg_write
	testl	%eax, %eax
	js	LBB0_13
## %bb.14:
	movq	_TC3589x_IOPULLCFG2_LSB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tc3589x_reg_write              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TC3589x_MAX_KPCOL,4,2          ## @TC3589x_MAX_KPCOL
	.comm	_TC3589x_MAX_KPROW,4,2          ## @TC3589x_MAX_KPROW
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_TC3589x_KBDSIZE,4,2            ## @TC3589x_KBDSIZE
	.comm	_KP_ROW_SHIFT,4,2               ## @KP_ROW_SHIFT
	.comm	_TC3589x_KBCFG_LSB,4,2          ## @TC3589x_KBCFG_LSB
	.comm	_DEDICATED_KEY_VAL,4,2          ## @DEDICATED_KEY_VAL
	.comm	_TC3589x_KBCFG_MSB,4,2          ## @TC3589x_KBCFG_MSB
	.comm	_TC3589x_KBDSETTLE_REG,4,2      ## @TC3589x_KBDSETTLE_REG
	.comm	_TC3589x_KBDBOUNCE,4,2          ## @TC3589x_KBDBOUNCE
	.comm	_TC3589x_IOCFG,4,2              ## @TC3589x_IOCFG
	.comm	_IOCFG_IG,4,2                   ## @IOCFG_IG
	.comm	_TC3589x_IOPULLCFG0_LSB,4,2     ## @TC3589x_IOPULLCFG0_LSB
	.comm	_TC3589x_PULLUP_ALL_MASK,4,2    ## @TC3589x_PULLUP_ALL_MASK
	.comm	_TC3589x_IOPULLCFG0_MSB,4,2     ## @TC3589x_IOPULLCFG0_MSB
	.comm	_TC3589x_IOPULLCFG1_LSB,4,2     ## @TC3589x_IOPULLCFG1_LSB
	.comm	_TC3589x_IOPULLCFG1_MSB,4,2     ## @TC3589x_IOPULLCFG1_MSB
	.comm	_TC3589x_IOPULLCFG2_LSB,4,2     ## @TC3589x_IOPULLCFG2_LSB
	.no_dead_strip	_tc3589x_keypad_init_key_hardware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tc3589x_keypad_init_key_hardware
_tc3589x_keypad_init_key_hardware:      ; @tc3589x_keypad_init_key_hardware
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x20, [x0]
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _TC3589x_MAX_KPCOL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TC3589x_MAX_KPCOL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.gt	LBB0_2
; %bb.1:
	ldr	w9, [x20, #4]
Lloh3:
	adrp	x10, _TC3589x_MAX_KPROW@GOTPAGE
Lloh4:
	ldr	x10, [x10, _TC3589x_MAX_KPROW@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	w9, w10
	b.le	LBB0_4
LBB0_2:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_4:
	ldr	x19, [x0, #8]
Lloh9:
	adrp	x10, _TC3589x_KBDSIZE@GOTPAGE
Lloh10:
	ldr	x10, [x10, _TC3589x_KBDSIZE@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x10]
Lloh12:
	adrp	x10, _KP_ROW_SHIFT@GOTPAGE
Lloh13:
	ldr	x10, [x10, _KP_ROW_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w2, w9, w8
	mov	x0, x19
	bl	_tc3589x_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.5:
Lloh15:
	adrp	x8, _TC3589x_KBCFG_LSB@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TC3589x_KBCFG_LSB@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x21, _DEDICATED_KEY_VAL@GOTPAGE
Lloh19:
	ldr	x21, [x21, _DEDICATED_KEY_VAL@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_tc3589x_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.6:
Lloh20:
	adrp	x8, _TC3589x_KBCFG_MSB@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TC3589x_KBCFG_MSB@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldr	w2, [x21]
	mov	x0, x19
	bl	_tc3589x_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.7:
Lloh23:
	adrp	x8, _TC3589x_KBDSETTLE_REG@GOTPAGE
Lloh24:
	ldr	x8, [x8, _TC3589x_KBDSETTLE_REG@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldr	w2, [x20, #8]
	mov	x0, x19
	bl	_tc3589x_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.8:
Lloh26:
	adrp	x8, _TC3589x_KBDBOUNCE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _TC3589x_KBDBOUNCE@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	ldr	w2, [x20, #12]
	mov	x0, x19
	bl	_tc3589x_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.9:
Lloh29:
	adrp	x8, _TC3589x_IOCFG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _TC3589x_IOCFG@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
Lloh32:
	adrp	x8, _IOCFG_IG@GOTPAGE
Lloh33:
	ldr	x8, [x8, _IOCFG_IG@GOTPAGEOFF]
Lloh34:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_tc3589x_set_bits
	tbnz	w0, #31, LBB0_3
; %bb.10:
Lloh35:
	adrp	x8, _TC3589x_IOPULLCFG0_LSB@GOTPAGE
Lloh36:
	ldr	x8, [x8, _TC3589x_IOPULLCFG0_LSB@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
Lloh38:
	adrp	x20, _TC3589x_PULLUP_ALL_MASK@GOTPAGE
Lloh39:
	ldr	x20, [x20, _TC3589x_PULLUP_ALL_MASK@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_tc3589x_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.11:
Lloh40:
	adrp	x8, _TC3589x_IOPULLCFG0_MSB@GOTPAGE
Lloh41:
	ldr	x8, [x8, _TC3589x_IOPULLCFG0_MSB@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_tc3589x_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.12:
Lloh43:
	adrp	x8, _TC3589x_IOPULLCFG1_LSB@GOTPAGE
Lloh44:
	ldr	x8, [x8, _TC3589x_IOPULLCFG1_LSB@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_tc3589x_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.13:
Lloh46:
	adrp	x8, _TC3589x_IOPULLCFG1_MSB@GOTPAGE
Lloh47:
	ldr	x8, [x8, _TC3589x_IOPULLCFG1_MSB@GOTPAGEOFF]
Lloh48:
	ldr	w1, [x8]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_tc3589x_reg_write
	tbnz	w0, #31, LBB0_3
; %bb.14:
Lloh49:
	adrp	x8, _TC3589x_IOPULLCFG2_LSB@GOTPAGE
Lloh50:
	ldr	x8, [x8, _TC3589x_IOPULLCFG2_LSB@GOTPAGEOFF]
Lloh51:
	ldr	w1, [x8]
	ldr	w2, [x20]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_tc3589x_reg_write
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.comm	_TC3589x_MAX_KPCOL,4,2          ; @TC3589x_MAX_KPCOL
	.comm	_TC3589x_MAX_KPROW,4,2          ; @TC3589x_MAX_KPROW
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_TC3589x_KBDSIZE,4,2            ; @TC3589x_KBDSIZE
	.comm	_KP_ROW_SHIFT,4,2               ; @KP_ROW_SHIFT
	.comm	_TC3589x_KBCFG_LSB,4,2          ; @TC3589x_KBCFG_LSB
	.comm	_DEDICATED_KEY_VAL,4,2          ; @DEDICATED_KEY_VAL
	.comm	_TC3589x_KBCFG_MSB,4,2          ; @TC3589x_KBCFG_MSB
	.comm	_TC3589x_KBDSETTLE_REG,4,2      ; @TC3589x_KBDSETTLE_REG
	.comm	_TC3589x_KBDBOUNCE,4,2          ; @TC3589x_KBDBOUNCE
	.comm	_TC3589x_IOCFG,4,2              ; @TC3589x_IOCFG
	.comm	_IOCFG_IG,4,2                   ; @IOCFG_IG
	.comm	_TC3589x_IOPULLCFG0_LSB,4,2     ; @TC3589x_IOPULLCFG0_LSB
	.comm	_TC3589x_PULLUP_ALL_MASK,4,2    ; @TC3589x_PULLUP_ALL_MASK
	.comm	_TC3589x_IOPULLCFG0_MSB,4,2     ; @TC3589x_IOPULLCFG0_MSB
	.comm	_TC3589x_IOPULLCFG1_LSB,4,2     ; @TC3589x_IOPULLCFG1_LSB
	.comm	_TC3589x_IOPULLCFG1_MSB,4,2     ; @TC3589x_IOPULLCFG1_MSB
	.comm	_TC3589x_IOPULLCFG2_LSB,4,2     ; @TC3589x_IOPULLCFG2_LSB
	.no_dead_strip	_tc3589x_keypad_init_key_hardware
.subsections_via_symbols
