	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function elan_sysfs_update_fw
_elan_sysfs_update_fw:                  ## @elan_sysfs_update_fw
	.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	%rcx, %r14
	movq	%rdi, %r12
	callq	_dev_get_drvdata
	cmpq	$0, (%rax)
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ETP_FW_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	20(%r15), %edx
	callq	_kasprintf
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movq	%rax, %rdx
	callq	_dev_info
	leaq	-48(%rbp), %rdi
	movq	%rbx, %rsi
	movq	%r12, %rdx
	callq	_request_firmware
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_kfree
	testl	%r13d, %r13d
	je	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	%r13d, %r14d
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_11
LBB0_6:
	movq	-48(%rbp), %rax
	movq	8(%r15), %r13
	shlq	$2, %r13
	addq	(%rax), %r13
	leaq	_elan_sysfs_update_fw.signature(%rip), %rsi
	movq	%r13, %rdi
	movl	$24, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	leaq	_elan_sysfs_update_fw.signature(%rip), %rcx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	$24, %edx
	movl	$24, %r8d
	movq	%r13, %r9
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EBADF@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_8:
	movq	%r15, %r12
	addq	$16, %r12
	movq	%r12, %rdi
	callq	_mutex_lock_interruptible
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_elan_update_firmware
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_10:
	movq	-48(%rbp), %rdi
	callq	_release_firmware
	testl	%ebx, %ebx
	cmovnel	%ebx, %r14d
LBB0_11:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @elan_sysfs_update_fw.signature
_elan_sysfs_update_fw.signature:
	.long	170                             ## 0xaa
	.long	85                              ## 0x55
	.long	204                             ## 0xcc
	.long	51                              ## 0x33
	.long	255                             ## 0xff
	.long	255                             ## 0xff

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ETP_FW_NAME,4,2                ## @ETP_FW_NAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate memory for firmware name\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"requesting fw '%s'\n"

L_.str.2:                               ## @.str.2
	.asciz	"failed to request firmware: %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"signature mismatch (expected %*ph, got %*ph)\n"

	.comm	_EBADF,4,2                      ## @EBADF
	.no_dead_strip	_elan_sysfs_update_fw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function elan_sysfs_update_fw
_elan_sysfs_update_fw:                  ; @elan_sysfs_update_fw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x3
	mov	x20, x0
	bl	_dev_get_drvdata
	ldr	x8, [x0]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _ETP_FW_NAME@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ETP_FW_NAME@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	w2, [x21, #20]
	bl	_kasprintf
	cbz	x0, LBB0_5
; %bb.2:
	mov	x23, x0
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x23
	bl	_dev_info
	add	x0, sp, #40
	mov	x1, x23
	mov	x2, x20
	bl	_request_firmware
	mov	x22, x0
	mov	x0, x23
	bl	_kfree
	cbz	w22, LBB0_8
; %bb.3:
	str	x22, [sp]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_err
	b	LBB0_7
LBB0_4:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	ldr	x8, [sp, #40]
	ldr	x8, [x8]
	ldr	x9, [x21, #8]
	add	x23, x8, x9, lsl #2
Lloh16:
	adrp	x22, _elan_sysfs_update_fw.signature@PAGE
Lloh17:
	add	x22, x22, _elan_sysfs_update_fw.signature@PAGEOFF
	mov	x0, x23
	mov	x1, x22
	mov	w2, #24
	bl	_memcmp
	cbz	x0, LBB0_10
; %bb.9:
	mov	w8, #24
	stp	x8, x23, [sp, #16]
	stp	x8, x22, [sp]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_err
Lloh20:
	adrp	x8, _EBADF@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EBADF@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_12
LBB0_10:
	add	x22, x21, #16
	mov	x0, x22
	bl	_mutex_lock_interruptible
	mov	x20, x0
	cbnz	w0, LBB0_12
; %bb.11:
	ldr	x1, [sp, #40]
	mov	x0, x21
	bl	_elan_update_firmware
	mov	x20, x0
	mov	x0, x22
	bl	_mutex_unlock
LBB0_12:
	ldr	x0, [sp, #40]
	bl	_release_firmware
	cmp	w20, #0
	csel	w22, w19, w20, eq
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @elan_sysfs_update_fw.signature
_elan_sysfs_update_fw.signature:
	.long	170                             ; 0xaa
	.long	85                              ; 0x55
	.long	204                             ; 0xcc
	.long	51                              ; 0x33
	.long	255                             ; 0xff
	.long	255                             ; 0xff

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ETP_FW_NAME,4,2                ; @ETP_FW_NAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate memory for firmware name\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"requesting fw '%s'\n"

l_.str.2:                               ; @.str.2
	.asciz	"failed to request firmware: %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"signature mismatch (expected %*ph, got %*ph)\n"

	.comm	_EBADF,4,2                      ; @EBADF
	.no_dead_strip	_elan_sysfs_update_fw
.subsections_via_symbols
