	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cbas_ec_query_base
_cbas_ec_query_base:                    ## @cbas_ec_query_base
	.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	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	$4, %edi
	movl	$8, %esi
	callq	_max
	leaq	32(%rax), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	_EC_CMD_MKBP_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r12)
	movabsq	$34359738369, %rax              ## imm = 0x800000001
	movq	%rax, (%r12)
	movl	$4, 8(%r12)
	movq	16(%r12), %rax
	testl	%ebx, %ebx
	jne	LBB0_3
## %bb.4:
	movq	_EC_MKBP_INFO_SUPPORTED@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_3:
	movq	_EC_MKBP_INFO_CURRENT@GOTPCREL(%rip), %rcx
LBB0_5:
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rax)
	movq	_EC_MKBP_EVENT_SWITCH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_cros_ec_cmd_xfer_status
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_9
## %bb.6:
	cmpl	$4, %ebx
	jne	LBB0_7
## %bb.8:
	movq	16(%r12), %rdi
	callq	_cbas_parse_base_state
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_7:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movl	$4, %ecx
	callq	_dev_warn
	movq	_EPROTO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movq	%r12, %rdi
	callq	_kfree
LBB0_10:
	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_MKBP_INFO,4,2           ## @EC_CMD_MKBP_INFO
	.comm	_EC_MKBP_INFO_CURRENT,4,2       ## @EC_MKBP_INFO_CURRENT
	.comm	_EC_MKBP_INFO_SUPPORTED,4,2     ## @EC_MKBP_INFO_SUPPORTED
	.comm	_EC_MKBP_EVENT_SWITCH,4,2       ## @EC_MKBP_EVENT_SWITCH
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"wrong result size: %d != %zu\n"

	.comm	_EPROTO,4,2                     ## @EPROTO
	.no_dead_strip	_cbas_ec_query_base
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function cbas_ec_query_base
lCPI0_0:
	.long	1                               ; 0x1
	.long	8                               ; 0x8
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_cbas_ec_query_base:                    ; @cbas_ec_query_base
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x1
	mov	x21, x0
	mov	w23, #4
	mov	w0, #4
	mov	w1, #8
	bl	_max
	add	x0, x0, #32
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _EC_CMD_MKBP_INFO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EC_CMD_MKBP_INFO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x0, #24]
Lloh6:
	adrp	x8, lCPI0_0@PAGE
Lloh7:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x0]
	str	w23, [x0, #8]
	ldr	x8, [x0, #16]
Lloh8:
	adrp	x9, _EC_MKBP_INFO_CURRENT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EC_MKBP_INFO_CURRENT@GOTPAGEOFF]
Lloh10:
	adrp	x10, _EC_MKBP_INFO_SUPPORTED@GOTPAGE
Lloh11:
	ldr	x10, [x10, _EC_MKBP_INFO_SUPPORTED@GOTPAGEOFF]
	cmp	w22, #0
	csel	x9, x10, x9, eq
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _EC_MKBP_EVENT_SWITCH@GOTPAGE
Lloh13:
	ldr	x10, [x10, _EC_MKBP_EVENT_SWITCH@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	stp	w10, w9, [x8]
	mov	x0, x21
	mov	x1, x19
	bl	_cros_ec_cmd_xfer_status
	mov	x22, x0
	tbnz	w0, #31, LBB0_6
; %bb.2:
	cmp	w22, #4
	b.ne	LBB0_5
; %bb.3:
	ldr	x0, [x19, #16]
	bl	_cbas_parse_base_state
	mov	w22, #0
	str	w0, [x20]
	b	LBB0_6
LBB0_4:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_7
LBB0_5:
	ldr	w0, [x21]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	mov	w3, #4
	bl	_dev_warn
Lloh20:
	adrp	x8, _EPROTO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EPROTO@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_6:
	mov	x0, x19
	bl	_kfree
LBB0_7:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdr	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EC_CMD_MKBP_INFO,4,2           ; @EC_CMD_MKBP_INFO
	.comm	_EC_MKBP_INFO_CURRENT,4,2       ; @EC_MKBP_INFO_CURRENT
	.comm	_EC_MKBP_INFO_SUPPORTED,4,2     ; @EC_MKBP_INFO_SUPPORTED
	.comm	_EC_MKBP_EVENT_SWITCH,4,2       ; @EC_MKBP_EVENT_SWITCH
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wrong result size: %d != %zu\n"

	.comm	_EPROTO,4,2                     ; @EPROTO
	.no_dead_strip	_cbas_ec_query_base
.subsections_via_symbols
