	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elan_i2c_initialize
_elan_i2c_initialize:                   ## @elan_i2c_initialize
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$1040, %rsp                     ## imm = 0x410
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	_ETP_I2C_STAND_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ETP_I2C_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_elan_i2c_write_cmd
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
LBB0_9:
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%ebx, %eax
	addq	$1040, %rsp                     ## imm = 0x410
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_2:
	movl	$100, %edi
	callq	_msleep
	movq	_ETP_I2C_INF_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-1056(%rbp), %rsi
	movq	%r14, %rdi
	callq	_i2c_master_recv
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	_ETP_I2C_DESC_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ETP_I2C_DESC_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-1056(%rbp), %rdx
	movq	%r14, %rdi
	callq	_elan_i2c_read_block
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_9
LBB0_3:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_9
LBB0_6:
	movq	_ETP_I2C_REPORT_DESC_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_ETP_I2C_REPORT_DESC_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-1056(%rbp), %rdx
	movq	%r14, %rdi
	callq	_elan_i2c_read_block
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_9
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ETP_I2C_STAND_CMD,4,2          ## @ETP_I2C_STAND_CMD
	.comm	_ETP_I2C_RESET,4,2              ## @ETP_I2C_RESET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"device reset failed: %d\n"

	.comm	_ETP_I2C_INF_LENGTH,4,2         ## @ETP_I2C_INF_LENGTH
L_.str.1:                               ## @.str.1
	.asciz	"failed to read reset response: %d\n"

	.comm	_ETP_I2C_DESC_CMD,4,2           ## @ETP_I2C_DESC_CMD
	.comm	_ETP_I2C_DESC_LENGTH,4,2        ## @ETP_I2C_DESC_LENGTH
L_.str.2:                               ## @.str.2
	.asciz	"cannot get device descriptor: %d\n"

	.comm	_ETP_I2C_REPORT_DESC_CMD,4,2    ## @ETP_I2C_REPORT_DESC_CMD
	.comm	_ETP_I2C_REPORT_DESC_LENGTH,4,2 ## @ETP_I2C_REPORT_DESC_LENGTH
L_.str.3:                               ## @.str.3
	.asciz	"fetching report descriptor failed.: %d\n"

	.no_dead_strip	_elan_i2c_initialize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elan_i2c_initialize
_elan_i2c_initialize:                   ; @elan_i2c_initialize
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [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 w27, -40
	.cfi_offset w28, -48
	sub	sp, sp, #1040
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _ETP_I2C_STAND_CMD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETP_I2C_STAND_CMD@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _ETP_I2C_RESET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETP_I2C_RESET@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_elan_i2c_write_cmd
	cbz	w0, LBB0_5
; %bb.1:
	mov	x20, x0
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	mov	x2, x20
	bl	_dev_err
LBB0_3:
	ldur	x8, [x29, #-40]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.4:
	mov	x0, x20
	add	sp, sp, #1040
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	mov	w0, #100
	bl	_msleep
Lloh14:
	adrp	x8, _ETP_I2C_INF_LENGTH@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ETP_I2C_INF_LENGTH@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x19
	bl	_i2c_master_recv
	tbnz	w0, #31, LBB0_8
; %bb.6:
Lloh17:
	adrp	x8, _ETP_I2C_DESC_CMD@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ETP_I2C_DESC_CMD@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x8, _ETP_I2C_DESC_LENGTH@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ETP_I2C_DESC_LENGTH@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_elan_i2c_read_block
	cbz	w0, LBB0_9
; %bb.7:
	mov	x20, x0
Lloh23:
	adrp	x1, l_.str.2@PAGE
Lloh24:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_8:
	mov	x20, x0
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_9:
Lloh27:
	adrp	x8, _ETP_I2C_REPORT_DESC_CMD@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ETP_I2C_REPORT_DESC_CMD@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x8, _ETP_I2C_REPORT_DESC_LENGTH@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ETP_I2C_REPORT_DESC_LENGTH@GOTPAGEOFF]
Lloh32:
	ldr	w3, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_elan_i2c_read_block
	mov	x20, x0
	cbz	w0, LBB0_3
; %bb.10:
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_2
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_ETP_I2C_STAND_CMD,4,2          ; @ETP_I2C_STAND_CMD
	.comm	_ETP_I2C_RESET,4,2              ; @ETP_I2C_RESET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"device reset failed: %d\n"

	.comm	_ETP_I2C_INF_LENGTH,4,2         ; @ETP_I2C_INF_LENGTH
l_.str.1:                               ; @.str.1
	.asciz	"failed to read reset response: %d\n"

	.comm	_ETP_I2C_DESC_CMD,4,2           ; @ETP_I2C_DESC_CMD
	.comm	_ETP_I2C_DESC_LENGTH,4,2        ; @ETP_I2C_DESC_LENGTH
l_.str.2:                               ; @.str.2
	.asciz	"cannot get device descriptor: %d\n"

	.comm	_ETP_I2C_REPORT_DESC_CMD,4,2    ; @ETP_I2C_REPORT_DESC_CMD
	.comm	_ETP_I2C_REPORT_DESC_LENGTH,4,2 ; @ETP_I2C_REPORT_DESC_LENGTH
l_.str.3:                               ; @.str.3
	.asciz	"fetching report descriptor failed.: %d\n"

	.no_dead_strip	_elan_i2c_initialize
.subsections_via_symbols
