	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elan_i2c_iap_get_mode
_elan_i2c_iap_get_mode:                 ## @elan_i2c_iap_get_mode
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_ETP_I2C_IAP_CTRL_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdx
	callq	_elan_i2c_read_cmd
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_dev_err
	jmp	LBB0_6
LBB0_2:
	leaq	-52(%rbp), %rdi
	callq	_le16_to_cpup
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_dev_dbg
	movq	_ETP_I2C_MAIN_MODE_ON@GOTPCREL(%rip), %rax
	andl	(%rax), %r12d
	jne	LBB0_3
## %bb.4:
	movq	_IAP_MODE@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_MAIN_MODE@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%r15d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ETP_I2C_IAP_CTRL_CMD,4,2       ## @ETP_I2C_IAP_CTRL_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read iap control register: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"iap control reg: 0x%04x.\n"

	.comm	_ETP_I2C_MAIN_MODE_ON,4,2       ## @ETP_I2C_MAIN_MODE_ON
	.comm	_MAIN_MODE,4,2                  ## @MAIN_MODE
	.comm	_IAP_MODE,4,2                   ## @IAP_MODE
	.no_dead_strip	_elan_i2c_iap_get_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elan_i2c_iap_get_mode
_elan_i2c_iap_get_mode:                 ; @elan_i2c_iap_get_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _ETP_I2C_IAP_CTRL_CMD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETP_I2C_IAP_CTRL_CMD@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_elan_i2c_read_cmd
	mov	x19, x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x19
	bl	_dev_err
	b	LBB0_3
LBB0_2:
	add	x0, sp, #12
	bl	_le16_to_cpup
	mov	x22, x0
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_dev_dbg
Lloh10:
	adrp	x8, _ETP_I2C_MAIN_MODE_ON@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ETP_I2C_MAIN_MODE_ON@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _MAIN_MODE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _MAIN_MODE@GOTPAGEOFF]
Lloh15:
	adrp	x10, _IAP_MODE@GOTPAGE
Lloh16:
	ldr	x10, [x10, _IAP_MODE@GOTPAGEOFF]
	tst	w8, w22
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_3:
	ldr	x8, [sp, #24]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_ETP_I2C_IAP_CTRL_CMD,4,2       ; @ETP_I2C_IAP_CTRL_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read iap control register: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"iap control reg: 0x%04x.\n"

	.comm	_ETP_I2C_MAIN_MODE_ON,4,2       ; @ETP_I2C_MAIN_MODE_ON
	.comm	_MAIN_MODE,4,2                  ; @MAIN_MODE
	.comm	_IAP_MODE,4,2                   ; @IAP_MODE
	.no_dead_strip	_elan_i2c_iap_get_mode
.subsections_via_symbols
