	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ec_get_version
_ec_get_version:                        ## @ec_get_version
	.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
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$48, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	_EC_CMD_GET_VERSION@GOTPCREL(%rip), %rax
	movq	8(%rbx), %rcx
	addq	(%rax), %rcx
	movq	%rcx, 16(%r12)
	movl	$24, (%r12)
	movl	(%rbx), %edi
	movq	%r12, %rsi
	callq	_cros_ec_cmd_xfer_status
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	8(%r12), %rbx
	movl	(%rbx), %r13d
	leaq	_ec_get_version.current_image_name(%rip), %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %r13d
	jge	LBB0_6
## %bb.5:
	movslq	(%rbx), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_3:
	movl	%eax, %ebx
	movl	4(%r12), %ecx
	leaq	L_.str.4(%rip), %rdx
	movq	%r15, %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_snprintf
	jmp	LBB0_8
LBB0_6:
	movl	$3, (%rbx)
	movl	$3, %eax
LBB0_7:
	movq	_CROS_EC_DEV_VERSION@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	8(%rbx), %r8
	movq	16(%rbx), %r9
	leaq	_ec_get_version.current_image_name(%rip), %rdx
	movq	(%rdx,%rax,8), %rax
	movq	%rax, (%rsp)
	leaq	L_.str.5(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_snprintf
LBB0_8:
	movq	%r12, %rdi
	callq	_kfree
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__const
	.p2align	4                               ## @ec_get_version.current_image_name
_ec_get_version.current_image_name:
	.quad	L_.str
	.quad	L_.str.1
	.quad	L_.str.2
	.quad	L_.str.3

	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown"

L_.str.1:                               ## @.str.1
	.asciz	"read-only"

L_.str.2:                               ## @.str.2
	.asciz	"read-write"

L_.str.3:                               ## @.str.3
	.asciz	"invalid"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EC_CMD_GET_VERSION,8,3         ## @EC_CMD_GET_VERSION
L_.str.4:                               ## @.str.4
	.asciz	"Unknown EC version, returned error: %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"%s\n%s\n%s\n%s\n"

	.comm	_CROS_EC_DEV_VERSION,8,3        ## @CROS_EC_DEV_VERSION
	.no_dead_strip	_ec_get_version
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ec_get_version
_ec_get_version:                        ; @ec_get_version
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #48
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _EC_CMD_GET_VERSION@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EC_CMD_GET_VERSION@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x9, [x22, #8]
	add	x8, x9, x8
	str	x8, [x0, #16]
	mov	w8, #24
	str	w8, [x0]
	ldr	w0, [x22]
	mov	x1, x19
	bl	_cros_ec_cmd_xfer_status
	tbnz	w0, #31, LBB0_5
; %bb.2:
	ldr	x23, [x19, #8]
	ldr	w24, [x23]
Lloh6:
	adrp	x22, _ec_get_version.current_image_name@PAGE
Lloh7:
	add	x22, x22, _ec_get_version.current_image_name@PAGEOFF
	mov	x0, x22
	bl	_ARRAY_SIZE
	cmp	w24, w0
	b.ge	LBB0_6
; %bb.3:
	ldrsw	x8, [x23]
	b	LBB0_7
LBB0_4:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_9
LBB0_5:
	mov	x22, x0
	ldr	w8, [x19, #4]
	str	x8, [sp]
Lloh11:
	adrp	x2, l_.str.4@PAGE
Lloh12:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	x1, x20
	bl	_snprintf
	b	LBB0_8
LBB0_6:
	mov	w8, #3
	str	w8, [x23]
LBB0_7:
Lloh13:
	adrp	x9, _CROS_EC_DEV_VERSION@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CROS_EC_DEV_VERSION@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	ldp	x10, x11, [x23, #8]
	ldr	x8, [x22, x8, lsl #3]
	stp	x11, x8, [sp, #16]
	stp	x9, x10, [sp]
Lloh16:
	adrp	x2, l_.str.5@PAGE
Lloh17:
	add	x2, x2, l_.str.5@PAGEOFF
	mov	x0, x21
	mov	x1, x20
	bl	_snprintf
	mov	w22, #0
LBB0_8:
	mov	x0, x19
	bl	_kfree
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__const
	.p2align	3                               ; @ec_get_version.current_image_name
_ec_get_version.current_image_name:
	.quad	l_.str
	.quad	l_.str.1
	.quad	l_.str.2
	.quad	l_.str.3

	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown"

l_.str.1:                               ; @.str.1
	.asciz	"read-only"

l_.str.2:                               ; @.str.2
	.asciz	"read-write"

l_.str.3:                               ; @.str.3
	.asciz	"invalid"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EC_CMD_GET_VERSION,8,3         ; @EC_CMD_GET_VERSION
l_.str.4:                               ; @.str.4
	.asciz	"Unknown EC version, returned error: %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"%s\n%s\n%s\n%s\n"

	.comm	_CROS_EC_DEV_VERSION,8,3        ; @CROS_EC_DEV_VERSION
	.no_dead_strip	_ec_get_version
.subsections_via_symbols
