	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dinput_grab_mouse
_dinput_grab_mouse:                     ## @dinput_grab_mouse
	.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, %r15d
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_IDirectInputDevice8_Unacquire
	movl	(%rbx), %r14d
	xorl	%eax, %eax
	callq	_video_driver_window_get
	testl	%r15d, %r15d
	jne	LBB0_1
## %bb.2:
	movq	_DISCL_NONEXCLUSIVE@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_1:
	movq	_DISCL_EXCLUSIVE@GOTPCREL(%rip), %rcx
LBB0_3:
	movq	_DISCL_FOREGROUND@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_IDirectInputDevice8_SetCooperativeLevel
	movl	(%rbx), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_IDirectInputDevice8_Acquire    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DISCL_EXCLUSIVE,4,2            ## @DISCL_EXCLUSIVE
	.comm	_DISCL_FOREGROUND,4,2           ## @DISCL_FOREGROUND
	.comm	_DISCL_NONEXCLUSIVE,4,2         ## @DISCL_NONEXCLUSIVE
	.no_dead_strip	_dinput_grab_mouse
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dinput_grab_mouse
_dinput_grab_mouse:                     ; @dinput_grab_mouse
	.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, x1
	mov	x20, x0
	ldr	w0, [x0]
	bl	_IDirectInputDevice8_Unacquire
	ldr	w21, [x20]
	bl	_video_driver_window_get
	mov	x1, x0
Lloh0:
	adrp	x8, _DISCL_NONEXCLUSIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DISCL_NONEXCLUSIVE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _DISCL_EXCLUSIVE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DISCL_EXCLUSIVE@GOTPAGEOFF]
	cmp	w19, #0
	csel	x8, x8, x9, eq
	ldr	w8, [x8]
Lloh4:
	adrp	x9, _DISCL_FOREGROUND@GOTPAGE
Lloh5:
	ldr	x9, [x9, _DISCL_FOREGROUND@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x21
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_IDirectInputDevice8_SetCooperativeLevel
	ldr	w0, [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
	b	_IDirectInputDevice8_Acquire
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_DISCL_EXCLUSIVE,4,2            ; @DISCL_EXCLUSIVE
	.comm	_DISCL_FOREGROUND,4,2           ; @DISCL_FOREGROUND
	.comm	_DISCL_NONEXCLUSIVE,4,2         ; @DISCL_NONEXCLUSIVE
	.no_dead_strip	_dinput_grab_mouse
.subsections_via_symbols
