	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ec_read_version_supported
_ec_read_version_supported:             ## @ec_read_version_supported
	.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, %r14
	movl	$4, %edi
	movl	$4, %esi
	callq	_max
	leaq	24(%rax), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	_EC_CMD_GET_CMD_VERSIONS@GOTPCREL(%rip), %rax
	movq	8(%r14), %rcx
	addq	(%rax), %rcx
	movq	%rcx, 16(%rbx)
	movabsq	$17179869188, %rax              ## imm = 0x400000004
	movq	%rax, (%rbx)
	movq	8(%rbx), %r15
	movq	_EC_CMD_CONSOLE_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
	movl	(%r14), %edi
	movq	%rbx, %rsi
	callq	_cros_ec_cmd_xfer_status
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	movl	(%r15), %r15d
	movl	$1, %edi
	callq	_EC_VER_MASK
	xorl	%r14d, %r14d
	testl	%r15d, %eax
	setne	%r14b
	jmp	LBB0_5
LBB0_1:
	xorl	%r14d, %r14d
	jmp	LBB0_6
LBB0_3:
	xorl	%r14d, %r14d
LBB0_5:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_EC_CMD_GET_CMD_VERSIONS,8,3    ## @EC_CMD_GET_CMD_VERSIONS
	.comm	_EC_CMD_CONSOLE_READ,4,2        ## @EC_CMD_CONSOLE_READ
	.no_dead_strip	_ec_read_version_supported
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ec_read_version_supported
_ec_read_version_supported:             ; @ec_read_version_supported
	.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	x20, x0
	mov	w0, #4
	mov	w1, #4
	bl	_max
	add	x0, x0, #24
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _EC_CMD_GET_CMD_VERSIONS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EC_CMD_GET_CMD_VERSIONS@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x9, [x20, #8]
	add	x8, x9, x8
	str	x8, [x0, #16]
	movi.2s	v0, #4
	str	d0, [x0]
	ldr	x21, [x0, #8]
Lloh6:
	adrp	x8, _EC_CMD_CONSOLE_READ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EC_CMD_CONSOLE_READ@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x21]
	ldr	w0, [x20]
	mov	x1, x19
	bl	_cros_ec_cmd_xfer_status
	tbnz	x0, #63, LBB0_4
; %bb.2:
	ldr	w20, [x21]
	mov	w0, #1
	bl	_EC_VER_MASK
	tst	w0, w20
	cset	w20, ne
	b	LBB0_5
LBB0_3:
	mov	w20, #0
	b	LBB0_6
LBB0_4:
	mov	w20, #0
LBB0_5:
	mov	x0, x19
	bl	_kfree
LBB0_6:
	mov	x0, x20
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_EC_CMD_GET_CMD_VERSIONS,8,3    ; @EC_CMD_GET_CMD_VERSIONS
	.comm	_EC_CMD_CONSOLE_READ,4,2        ; @EC_CMD_CONSOLE_READ
	.no_dead_strip	_ec_read_version_supported
.subsections_via_symbols
