	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rsi_handle_ps_confirm          ## -- Begin function rsi_handle_ps_confirm
	.p2align	4, 0x90
_rsi_handle_ps_confirm:                 ## @rsi_handle_ps_confirm
	.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
	movq	%rdi, %r15
	movq	_PS_CONFIRM_INDEX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	leaq	(%rsi,%rax,4), %rdi
	callq	_get_unaligned_le16
	cmpl	$128, %eax
	je	LBB0_5
## %bb.1:
	movl	%eax, %ebx
	cmpl	$129, %eax
	jne	LBB0_7
## %bb.2:
	movl	(%r15), %eax
	movq	_PS_ENABLE_REQ_SENT@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpl	(%rcx), %eax
	jne	LBB0_8
## %bb.3:
	movq	_PS_ENABLED@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_5:
	movl	(%r15), %eax
	movq	_PS_DISABLE_REQ_SENT@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpl	(%rcx), %eax
	jne	LBB0_8
## %bb.6:
	movq	_PS_NONE@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_rsi_modify_ps_state
	jmp	LBB0_8
LBB0_7:
	movq	_ERR_ZONE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	(%r15), %edi
	callq	_str_psstate
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_rsi_dbg
	movl	$-1, %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PS_CONFIRM_INDEX,4,2           ## @PS_CONFIRM_INDEX
	.comm	_PS_ENABLE_REQ_SENT,4,2         ## @PS_ENABLE_REQ_SENT
	.comm	_PS_ENABLED,4,2                 ## @PS_ENABLED
	.comm	_PS_DISABLE_REQ_SENT,4,2        ## @PS_DISABLE_REQ_SENT
	.comm	_PS_NONE,4,2                    ## @PS_NONE
	.comm	_ERR_ZONE,4,2                   ## @ERR_ZONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid PS confirm type %x in state %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rsi_handle_ps_confirm          ; -- Begin function rsi_handle_ps_confirm
	.p2align	2
_rsi_handle_ps_confirm:                 ; @rsi_handle_ps_confirm
	.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	x19, x0
Lloh0:
	adrp	x8, _PS_CONFIRM_INDEX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PS_CONFIRM_INDEX@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	add	x0, x1, x8, lsl #2
	bl	_get_unaligned_le16
	cmp	w0, #128
	b.eq	LBB0_4
; %bb.1:
	mov	x20, x0
	cmp	w0, #129
	b.ne	LBB0_8
; %bb.2:
	ldr	w8, [x19]
Lloh3:
	adrp	x9, _PS_ENABLE_REQ_SENT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PS_ENABLE_REQ_SENT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.3:
Lloh6:
	adrp	x8, _PS_ENABLED@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PS_ENABLED@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	ldr	w8, [x19]
Lloh8:
	adrp	x9, _PS_DISABLE_REQ_SENT@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PS_DISABLE_REQ_SENT@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.5:
Lloh11:
	adrp	x8, _PS_NONE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PS_NONE@GOTPAGEOFF]
LBB0_6:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_rsi_modify_ps_state
LBB0_7:
	mov	w0, #0
	b	LBB0_9
LBB0_8:
Lloh13:
	adrp	x8, _ERR_ZONE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ERR_ZONE@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
	ldr	w0, [x19]
	bl	_str_psstate
	mov	x3, x0
Lloh16:
	adrp	x1, l_.str@PAGE
Lloh17:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_rsi_dbg
	mov	w0, #-1
LBB0_9:
	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 AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PS_CONFIRM_INDEX,4,2           ; @PS_CONFIRM_INDEX
	.comm	_PS_ENABLE_REQ_SENT,4,2         ; @PS_ENABLE_REQ_SENT
	.comm	_PS_ENABLED,4,2                 ; @PS_ENABLED
	.comm	_PS_DISABLE_REQ_SENT,4,2        ; @PS_DISABLE_REQ_SENT
	.comm	_PS_NONE,4,2                    ; @PS_NONE
	.comm	_ERR_ZONE,4,2                   ; @ERR_ZONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid PS confirm type %x in state %s\n"

.subsections_via_symbols
