	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvr2_hdw_set_input_allowed     ## -- Begin function pvr2_hdw_set_input_allowed
	.p2align	4, 0x90
_pvr2_hdw_set_input_allowed:            ## @pvr2_hdw_set_input_allowed
	.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	%edx, %ebx
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	16(%rdi), %edi
	callq	_LOCK_TAKE
	movl	(%r14), %eax
	xorl	%eax, %ebx
	andl	%r15d, %ebx
	xorl	%eax, %ebx
	andl	4(%r14), %ebx
	je	LBB0_1
## %bb.2:
	movl	%ebx, (%r14)
	movb	8(%r14), %cl
	movl	$1, %eax
	shlq	%cl, %rax
	xorl	%r15d, %r15d
	testl	%ebx, %eax
	jne	LBB0_14
## %bb.3:
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	$1, %eax
	shlq	%cl, %rax
	testl	%ebx, %eax
	jne	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rax
	shrq	%cl, %rax
	testb	$2, %al
	jne	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rax
	shrq	%cl, %rax
	testb	$4, %al
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rax
	shrq	%cl, %rax
	testb	$8, %al
	jne	LBB0_8
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	addq	$4, %rcx
	cmpq	$32, %rcx
	jne	LBB0_4
	jmp	LBB0_13
LBB0_1:
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_14
LBB0_10:
	incq	%rcx
	jmp	LBB0_11
LBB0_9:
	addq	$2, %rcx
	jmp	LBB0_11
LBB0_8:
	addq	$3, %rcx
LBB0_11:
	movq	%r14, %rdi
	movl	%ecx, %esi
	callq	_pvr2_hdw_set_input
LBB0_13:
	xorl	%r15d, %r15d
LBB0_14:
	movl	16(%r14), %edi
	callq	_LOCK_GIVE
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EPERM,4,2                      ## @EPERM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pvr2_hdw_set_input_allowed     ; -- Begin function pvr2_hdw_set_input_allowed
	.p2align	2
_pvr2_hdw_set_input_allowed:            ; @pvr2_hdw_set_input_allowed
	.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, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w0, [x0, #16]
	bl	_LOCK_TAKE
	ldp	w8, w9, [x19]
	bic	w8, w8, w21
	and	w10, w20, w21
	orr	w8, w8, w10
	and	x8, x8, x9
	cbz	w8, LBB0_5
; %bb.1:
	str	w8, [x19]
	ldr	x9, [x19, #8]
	lsr	x9, x8, x9
	tbnz	w9, #0, LBB0_7
; %bb.2:
	mov	x1, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	lsr	x9, x8, x1
	tbnz	w9, #0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x1, x1, #1
	cmp	x1, #32
	b.ne	LBB0_3
	b	LBB0_7
LBB0_5:
Lloh0:
	adrp	x8, _EPERM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_8
LBB0_6:
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_pvr2_hdw_set_input
LBB0_7:
	mov	w20, #0
LBB0_8:
	ldr	w0, [x19, #16]
	bl	_LOCK_GIVE
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EPERM,4,2                      ; @EPERM
.subsections_via_symbols
