	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_usbpd_charger_ec_command
_cros_usbpd_charger_ec_command:         ## @cros_usbpd_charger_ec_command
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movl	%r8d, %r13d
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %r12
	movl	16(%rbp), %esi
	movq	8(%rdi), %r15
	movl	%r8d, %edi
	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, %rbx
	movl	%r14d, (%rax)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	(%r15), %rax
	movq	%rax, 24(%rbx)
	movl	%r13d, 4(%rbx)
	movl	16(%rbp), %r15d
	movl	%r15d, 8(%rbx)
	testl	%r13d, %r13d
	je	LBB0_4
## %bb.3:
	movq	16(%rbx), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_memcpy
LBB0_4:
	movl	(%r12), %edi
	movq	%rbx, %rsi
	callq	_cros_ec_cmd_xfer_status
	movl	%eax, %r14d
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.5:
	testl	%r14d, %r14d
	js	LBB0_7
## %bb.6:
	movq	16(%rbx), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r15d, %edx
	callq	_memcpy
LBB0_7:
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_cros_usbpd_charger_ec_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cros_usbpd_charger_ec_command
_cros_usbpd_charger_ec_command:         ; @cros_usbpd_charger_ec_command
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x6
	mov	x20, x5
	mov	x23, x4
	mov	x24, x3
	mov	x26, x2
	mov	x25, x1
	mov	x22, x0
	ldr	x27, [x0, #8]
	mov	x0, x4
	mov	x1, x6
	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_7
; %bb.1:
	mov	x21, x0
	ldr	x8, [x27]
	add	x8, x8, w26, uxtw
	str	x8, [x0, #24]
	stp	w25, w23, [x0]
	str	w19, [x0, #8]
	cbz	w23, LBB0_3
; %bb.2:
	ldr	x0, [x21, #16]
	mov	x1, x24
	mov	x2, x23
	bl	_memcpy
LBB0_3:
	ldr	w0, [x22]
	mov	x1, x21
	bl	_cros_ec_cmd_xfer_status
	mov	x22, x0
	cbz	w19, LBB0_6
; %bb.4:
	tbnz	w22, #31, LBB0_6
; %bb.5:
	ldr	x1, [x21, #16]
	mov	x0, x20
	mov	x2, x19
	bl	_memcpy
LBB0_6:
	mov	x0, x21
	bl	_kfree
	b	LBB0_8
LBB0_7:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_8:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_cros_usbpd_charger_ec_command
.subsections_via_symbols
