	.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_v2
_cros_ec_host_command_proto_query_v2:   ## @cros_ec_host_command_proto_query_v2
	.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
	movq	%rdi, %r14
	movl	$4, %edi
	movl	$4, %esi
	callq	_max
                                        ## kill: def $eax killed $eax def $rax
	leal	40(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	$0, 32(%rax)
	movq	_EC_CMD_HELLO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r15)
	movq	16(%r15), %r12
	movabsq	$17179869188, %rax              ## imm = 0x400000004
	movq	%rax, (%r15)
	movl	$-1599029040, (%r12)            ## imm = 0xA0B0C0D0
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_send_command
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	8(%r15), %edx
	movq	_EC_RES_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_5
## %bb.6:
	movl	(%r12), %edx
	xorl	%ebx, %ebx
	cmpl	$-1582119980, %edx              ## imm = 0xA1B2C3D4
	je	LBB0_8
## %bb.7:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_3:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_dbg
	jmp	LBB0_8
LBB0_5:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	8(%r15), %ebx
LBB0_8:
	movq	%r15, %rdi
	callq	_kfree
LBB0_9:
	movl	%ebx, %eax
	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_HELLO,4,2               ## @EC_CMD_HELLO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"EC failed to respond to v2 hello: %d\n"

	.comm	_EC_RES_SUCCESS,4,2             ## @EC_RES_SUCCESS
L_.str.1:                               ## @.str.1
	.asciz	"EC responded to v2 hello with error: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"EC responded to v2 hello with bad result: %u\n"

	.comm	_EBADMSG,4,2                    ## @EBADMSG
	.no_dead_strip	_cros_ec_host_command_proto_query_v2
.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_v2
_cros_ec_host_command_proto_query_v2:   ; @cros_ec_host_command_proto_query_v2
	.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	w0, w0, #40
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	str	xzr, [x0, #32]
Lloh3:
	adrp	x8, _EC_CMD_HELLO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EC_CMD_HELLO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x0, #24]
	ldr	x22, [x0, #16]
	movi.2s	v0, #4
	str	d0, [x0]
	mov	w8, #49360
	movk	w8, #41136, lsl #16
	str	w8, [x22]
	mov	x0, x20
	mov	x1, x19
	bl	_send_command
	tbnz	w0, #31, LBB0_6
; %bb.2:
	ldr	w2, [x19, #8]
Lloh6:
	adrp	x8, _EC_RES_SUCCESS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EC_RES_SUCCESS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w2, w8
	b.ne	LBB0_7
; %bb.3:
	ldr	w2, [x22]
	mov	w8, #50132
	movk	w8, #41394, lsl #16
	cmp	w2, w8
	b.ne	LBB0_8
; %bb.4:
	mov	w21, #0
	b	LBB0_9
LBB0_5:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_6:
	mov	x21, x0
	ldr	w0, [x20]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	b	LBB0_9
LBB0_7:
	ldr	w0, [x20]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	w21, [x19, #8]
	b	LBB0_9
LBB0_8:
	ldr	w0, [x20]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x19
	bl	_kfree
LBB0_10:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EC_CMD_HELLO,4,2               ; @EC_CMD_HELLO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"EC failed to respond to v2 hello: %d\n"

	.comm	_EC_RES_SUCCESS,4,2             ; @EC_RES_SUCCESS
l_.str.1:                               ; @.str.1
	.asciz	"EC responded to v2 hello with error: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"EC responded to v2 hello with bad result: %u\n"

	.comm	_EBADMSG,4,2                    ; @EBADMSG
	.no_dead_strip	_cros_ec_host_command_proto_query_v2
.subsections_via_symbols
