	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_ec_check_features
_cros_ec_check_features:                ## @cros_ec_check_features
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	(%rdi), %rax
	cmpl	$-1, (%rax)
	jne	LBB0_8
## %bb.1:
	cmpl	$-1, 4(%rax)
	jne	LBB0_8
## %bb.2:
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	_EC_CMD_GET_FEATURES@GOTPCREL(%rip), %rax
	movq	16(%r14), %rcx
	addq	(%rax), %rcx
	movq	%rcx, 16(%r15)
	movl	$8, 8(%r15)
	movl	12(%r14), %edi
	movq	%r15, %rsi
	callq	_cros_ec_cmd_xfer_status
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	(%r14), %rdi
	movl	(%r15), %esi
	movl	$8, %edx
	callq	_memcpy
	jmp	LBB0_7
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_9
LBB0_5:
	movl	8(%r14), %edi
	movl	4(%r15), %ecx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_warn
	movq	(%r14), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
LBB0_7:
	movl	8(%r14), %edi
	movq	(%r14), %rax
	movl	(%rax), %edx
	movl	4(%rax), %ecx
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	movq	%r15, %rdi
	callq	_kfree
	movq	(%r14), %rax
LBB0_8:
	leal	31(%r12), %ecx
	testl	%r12d, %r12d
	cmovnsl	%r12d, %ecx
	sarl	$5, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %ebx
	movl	%r12d, %edi
	callq	_EC_FEATURE_MASK_0
	andl	%ebx, %eax
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EC_CMD_GET_FEATURES,8,3        ## @EC_CMD_GET_FEATURES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cannot get EC features: %d/%d\n"

L_.str.1:                               ## @.str.1
	.asciz	"EC features %08x %08x\n"

	.no_dead_strip	_cros_ec_check_features
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cros_ec_check_features
_cros_ec_check_features:                ; @cros_ec_check_features
	.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
	mov	x19, x1
	ldr	x8, [x0]
	ldr	w9, [x8]
	cmn	w9, #1
	b.ne	LBB0_8
; %bb.1:
	ldr	w9, [x8, #4]
	cmn	w9, #1
	b.ne	LBB0_8
; %bb.2:
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.3:
	mov	x21, x0
Lloh3:
	adrp	x8, _EC_CMD_GET_FEATURES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EC_CMD_GET_FEATURES@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x9, [x20, #16]
	add	x8, x9, x8
	str	x8, [x0, #16]
	mov	w8, #8
	str	w8, [x0, #8]
	ldr	w0, [x20, #12]
	mov	x1, x21
	bl	_cros_ec_cmd_xfer_status
	tbnz	w0, #31, LBB0_6
; %bb.4:
	ldr	x0, [x20]
	ldr	w1, [x21]
	mov	w2, #8
	bl	_memcpy
	b	LBB0_7
LBB0_5:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_6:
	mov	x2, x0
	ldr	w0, [x20, #8]
	ldr	w3, [x21, #4]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	ldr	x0, [x20]
	mov	w1, #0
	mov	w2, #8
	bl	_memset
LBB0_7:
	ldr	w0, [x20, #8]
	ldr	x8, [x20]
	ldp	w2, w3, [x8]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	x0, x21
	bl	_kfree
	ldr	x8, [x20]
LBB0_8:
	add	w9, w19, #31
	cmp	w19, #0
	csel	w9, w9, w19, lt
	asr	w9, w9, #5
	ldr	w20, [x8, w9, sxtw #2]
	mov	x0, x19
	bl	_EC_FEATURE_MASK_0
	and	w0, w0, w20
LBB0_9:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EC_CMD_GET_FEATURES,8,3        ; @EC_CMD_GET_FEATURES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cannot get EC features: %d/%d\n"

l_.str.1:                               ; @.str.1
	.asciz	"EC features %08x %08x\n"

	.no_dead_strip	_cros_ec_check_features
.subsections_via_symbols
