	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lb_manual_suspend_ctrl
_lb_manual_suspend_ctrl:                ## @lb_manual_suspend_ctrl
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_alloc_lightbar_cmd_msg
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	8(%rax), %rax
	movq	_LIGHTBAR_CMD_MANUAL_SUSPEND_CTRL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rax)
	movl	%ebx, (%rax)
	xorl	%eax, %eax
	callq	_lb_throttle
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_3
LBB0_7:
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_8
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	(%r15), %edi
	movq	%r14, %rsi
	callq	_cros_ec_cmd_xfer
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	movq	(%r14), %rax
	movq	_EC_RES_SUCCESS@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_4:
	movl	%eax, %ebx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_LIGHTBAR_CMD_MANUAL_SUSPEND_CTRL,4,2 ## @LIGHTBAR_CMD_MANUAL_SUSPEND_CTRL
	.comm	_EC_RES_SUCCESS,8,3             ## @EC_RES_SUCCESS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_lb_manual_suspend_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lb_manual_suspend_ctrl
_lb_manual_suspend_ctrl:                ; @lb_manual_suspend_ctrl
	.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, x1
	mov	x21, x0
	bl	_alloc_lightbar_cmd_msg
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _LIGHTBAR_CMD_MANUAL_SUSPEND_CTRL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _LIGHTBAR_CMD_MANUAL_SUSPEND_CTRL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	stp	w20, w9, [x8]
	bl	_lb_throttle
	mov	x20, x0
	cbz	w0, LBB0_5
LBB0_2:
	mov	x0, x19
	bl	_kfree
	b	LBB0_4
LBB0_3:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	mov	x0, x20
	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
LBB0_5:
	ldr	w0, [x21]
	mov	x1, x19
	bl	_cros_ec_cmd_xfer
	tbnz	w0, #31, LBB0_8
; %bb.6:
	ldr	x8, [x19]
Lloh6:
	adrp	x9, _EC_RES_SUCCESS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _EC_RES_SUCCESS@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.7:
	mov	w20, #0
	b	LBB0_2
LBB0_8:
	mov	x20, x0
	b	LBB0_2
LBB0_9:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_LIGHTBAR_CMD_MANUAL_SUSPEND_CTRL,4,2 ; @LIGHTBAR_CMD_MANUAL_SUSPEND_CTRL
	.comm	_EC_RES_SUCCESS,8,3             ; @EC_RES_SUCCESS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_lb_manual_suspend_ctrl
.subsections_via_symbols
