	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_ec_host_command_proto_query
_cros_ec_host_command_proto_query:      ## @cros_ec_host_command_proto_query
	.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
	cmpl	$0, 4(%rdi)
	je	LBB0_1
## %bb.3:
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %r12
	movq	%rdx, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movl	%r14d, %edi
	callq	_EC_CMD_PASSTHRU_OFFSET
	movq	_EC_CMD_GET_PROTOCOL_INFO@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r15)
	movl	$4, 4(%r15)
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_send_command
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	8(%r15), %rbx
	testl	%r14d, %r14d
	jle	LBB0_8
## %bb.6:
	movq	_EC_RES_INVALID_COMMAND@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_8
## %bb.7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_EPROTONOSUPPORT@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_4:
	movl	%eax, %ebx
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_dev_dbg
	jmp	LBB0_9
LBB0_8:
	movq	_EC_RES_SUCCESS@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpq	(%rax), %rbx
	cmovel	%ecx, %ebx
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EPROTONOSUPPORT,4,2            ## @EPROTONOSUPPORT
	.comm	_EC_CMD_GET_PROTOCOL_INFO,4,2   ## @EC_CMD_GET_PROTOCOL_INFO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to check for EC[%d] protocol version: %d\n"

	.comm	_EC_RES_INVALID_COMMAND,8,3     ## @EC_RES_INVALID_COMMAND
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EC_RES_SUCCESS,8,3             ## @EC_RES_SUCCESS
	.no_dead_strip	_cros_ec_host_command_proto_query
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cros_ec_host_command_proto_query
_cros_ec_host_command_proto_query:      ; @cros_ec_host_command_proto_query
	.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
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	mov	x0, x2
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	mov	x0, x19
	bl	_EC_CMD_PASSTHRU_OFFSET
Lloh0:
	adrp	x8, _EC_CMD_GET_PROTOCOL_INFO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EC_CMD_GET_PROTOCOL_INFO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	orr	w8, w8, w0
	mov	w9, #4
	stp	w8, w9, [x20]
	mov	x0, x21
	mov	x1, x20
	bl	_send_command
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	x8, [x20, #8]
	cmp	w19, #1
	b.lt	LBB0_8
; %bb.3:
Lloh3:
	adrp	x9, _EC_RES_INVALID_COMMAND@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EC_RES_INVALID_COMMAND@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.4:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _EPROTONOSUPPORT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EPROTONOSUPPORT@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_9
LBB0_7:
	mov	x22, x0
	ldr	w0, [x21]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x22
	bl	_dev_dbg
	b	LBB0_9
LBB0_8:
Lloh12:
	adrp	x9, _EC_RES_SUCCESS@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EC_RES_SUCCESS@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	csel	w22, wzr, w8, eq
LBB0_9:
	mov	x0, x22
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EPROTONOSUPPORT,4,2            ; @EPROTONOSUPPORT
	.comm	_EC_CMD_GET_PROTOCOL_INFO,4,2   ; @EC_CMD_GET_PROTOCOL_INFO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to check for EC[%d] protocol version: %d\n"

	.comm	_EC_RES_INVALID_COMMAND,8,3     ; @EC_RES_INVALID_COMMAND
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EC_RES_SUCCESS,8,3             ; @EC_RES_SUCCESS
	.no_dead_strip	_cros_ec_host_command_proto_query
.subsections_via_symbols
