	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mousedev_create_device
_mousedev_create_device:                ## @mousedev_create_device
	.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
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	%rsi, %rdi
	callq	_debugstr_guid
	movl	%eax, %r15d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_debugstr_guid
	leaq	L_.str(%rip), %rdi
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rsi
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r15d, %edx
	movl	%eax, %ecx
	movq	%r13, %r8
	movl	%r14d, %r9d
	xorl	%eax, %eax
	callq	_TRACE
	movq	$0, (%r13)
	movq	_GUID_SysMouse@GOTPCREL(%rip), %rdi
	movq	%r12, %rsi
	callq	_IsEqualGUID
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_12
## %bb.3:
	movq	_IID_IDirectInputDeviceA@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_IsEqualGUID
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_12
## %bb.4:
	movq	_IID_IDirectInputDevice2A@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_IsEqualGUID
	testq	%rax, %rax
	jne	LBB0_12
## %bb.5:
	movq	_IID_IDirectInputDevice7A@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_IsEqualGUID
	testq	%rax, %rax
	jne	LBB0_12
## %bb.6:
	movq	_IID_IDirectInputDevice8A@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_IsEqualGUID
	testq	%rax, %rax
	jne	LBB0_12
## %bb.7:
	movq	_IID_IDirectInputDeviceW@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_IsEqualGUID
	movl	$1, %r14d
	testq	%rax, %rax
	jne	LBB0_12
## %bb.8:
	movq	_IID_IDirectInputDevice2W@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_IsEqualGUID
	testq	%rax, %rax
	jne	LBB0_12
## %bb.9:
	movq	_IID_IDirectInputDevice7W@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_IsEqualGUID
	testq	%rax, %rax
	jne	LBB0_12
## %bb.10:
	movq	_IID_IDirectInputDevice8W@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	callq	_IsEqualGUID
	testq	%rax, %rax
	je	LBB0_11
LBB0_12:
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_alloc_device
	movq	%rax, %rbx
	leaq	L_.str.2(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_TRACE
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.14:
	leaq	4(%rbx), %rax
	testl	%r14d, %r14d
	cmoveq	%rbx, %rax
	movq	%rax, (%r13)
	movq	_DI_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_1:
	movq	_DIERR_DEVICENOTREG@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_13:
	movq	_DIERR_OUTOFMEMORY@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	callq	_WARN
	movq	_DIERR_NOINTERFACE@GOTPCREL(%rip), %rax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%p %s %s %p %i\n"

	.comm	_GUID_SysMouse,4,2              ## @GUID_SysMouse
	.comm	_IID_IDirectInputDeviceA,4,2    ## @IID_IDirectInputDeviceA
	.comm	_IID_IDirectInputDevice2A,4,2   ## @IID_IDirectInputDevice2A
	.comm	_IID_IDirectInputDevice7A,4,2   ## @IID_IDirectInputDevice7A
	.comm	_IID_IDirectInputDevice8A,4,2   ## @IID_IDirectInputDevice8A
	.comm	_IID_IDirectInputDeviceW,4,2    ## @IID_IDirectInputDeviceW
	.comm	_IID_IDirectInputDevice2W,4,2   ## @IID_IDirectInputDevice2W
	.comm	_IID_IDirectInputDevice7W,4,2   ## @IID_IDirectInputDevice7W
	.comm	_IID_IDirectInputDevice8W,4,2   ## @IID_IDirectInputDevice8W
L_.str.1:                               ## @.str.1
	.asciz	"no interface\n"

	.comm	_DIERR_NOINTERFACE,4,2          ## @DIERR_NOINTERFACE
L_.str.2:                               ## @.str.2
	.asciz	"Created a Mouse device (%p)\n"

	.comm	_DIERR_OUTOFMEMORY,4,2          ## @DIERR_OUTOFMEMORY
	.comm	_DI_OK,4,2                      ## @DI_OK
	.comm	_DIERR_DEVICENOTREG,4,2         ## @DIERR_DEVICENOTREG
	.no_dead_strip	_mousedev_create_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mousedev_create_device
_mousedev_create_device:                ; @mousedev_create_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x23, x4
	mov	x19, x3
	mov	x22, x2
	mov	x21, x1
	mov	x20, x0
	mov	x0, x1
	bl	_debugstr_guid
	mov	x24, x0
	mov	x0, x22
	bl	_debugstr_guid
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x19, x23, [sp, #16]
	stp	x24, x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_TRACE
	str	xzr, [x19]
Lloh2:
	adrp	x0, _GUID_SysMouse@GOTPAGE
Lloh3:
	ldr	x0, [x0, _GUID_SysMouse@GOTPAGEOFF]
	mov	x1, x21
	bl	_IsEqualGUID
	cbz	x0, LBB0_9
; %bb.1:
	cbz	x22, LBB0_7
; %bb.2:
Lloh4:
	adrp	x0, _IID_IDirectInputDeviceA@GOTPAGE
Lloh5:
	ldr	x0, [x0, _IID_IDirectInputDeviceA@GOTPAGEOFF]
	mov	x1, x22
	bl	_IsEqualGUID
	cbnz	x0, LBB0_6
; %bb.3:
Lloh6:
	adrp	x0, _IID_IDirectInputDevice2A@GOTPAGE
Lloh7:
	ldr	x0, [x0, _IID_IDirectInputDevice2A@GOTPAGEOFF]
	mov	x1, x22
	bl	_IsEqualGUID
	cbnz	x0, LBB0_6
; %bb.4:
Lloh8:
	adrp	x0, _IID_IDirectInputDevice7A@GOTPAGE
Lloh9:
	ldr	x0, [x0, _IID_IDirectInputDevice7A@GOTPAGEOFF]
	mov	x1, x22
	bl	_IsEqualGUID
	cbnz	x0, LBB0_6
; %bb.5:
Lloh10:
	adrp	x0, _IID_IDirectInputDevice8A@GOTPAGE
Lloh11:
	ldr	x0, [x0, _IID_IDirectInputDevice8A@GOTPAGEOFF]
	mov	x1, x22
	bl	_IsEqualGUID
	cbz	x0, LBB0_12
LBB0_6:
	mov	w23, #0
LBB0_7:
	mov	x0, x21
	mov	x1, x20
	bl	_alloc_device
	mov	x20, x0
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_TRACE
	cbz	x20, LBB0_10
; %bb.8:
	add	x8, x20, #4
	cmp	w23, #0
	csel	x8, x20, x8, eq
	str	x8, [x19]
Lloh14:
	adrp	x8, _DI_OK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DI_OK@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh16:
	adrp	x8, _DIERR_DEVICENOTREG@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DIERR_DEVICENOTREG@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh18:
	adrp	x8, _DIERR_OUTOFMEMORY@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DIERR_OUTOFMEMORY@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x8]
	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
	add	sp, sp, #96
	ret
LBB0_12:
Lloh20:
	adrp	x0, _IID_IDirectInputDeviceW@GOTPAGE
Lloh21:
	ldr	x0, [x0, _IID_IDirectInputDeviceW@GOTPAGEOFF]
	mov	x1, x22
	bl	_IsEqualGUID
	cbnz	x0, LBB0_16
; %bb.13:
Lloh22:
	adrp	x0, _IID_IDirectInputDevice2W@GOTPAGE
Lloh23:
	ldr	x0, [x0, _IID_IDirectInputDevice2W@GOTPAGEOFF]
	mov	x1, x22
	bl	_IsEqualGUID
	cbnz	x0, LBB0_16
; %bb.14:
Lloh24:
	adrp	x0, _IID_IDirectInputDevice7W@GOTPAGE
Lloh25:
	ldr	x0, [x0, _IID_IDirectInputDevice7W@GOTPAGEOFF]
	mov	x1, x22
	bl	_IsEqualGUID
	cbnz	x0, LBB0_16
; %bb.15:
Lloh26:
	adrp	x0, _IID_IDirectInputDevice8W@GOTPAGE
Lloh27:
	ldr	x0, [x0, _IID_IDirectInputDevice8W@GOTPAGEOFF]
	mov	x1, x22
	bl	_IsEqualGUID
	cbz	x0, LBB0_17
LBB0_16:
	mov	w23, #1
	b	LBB0_7
LBB0_17:
Lloh28:
	adrp	x0, l_.str.1@PAGE
Lloh29:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_WARN
Lloh30:
	adrp	x8, _DIERR_NOINTERFACE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DIERR_NOINTERFACE@GOTPAGEOFF]
	b	LBB0_11
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%p %s %s %p %i\n"

	.comm	_GUID_SysMouse,4,2              ; @GUID_SysMouse
	.comm	_IID_IDirectInputDeviceA,4,2    ; @IID_IDirectInputDeviceA
	.comm	_IID_IDirectInputDevice2A,4,2   ; @IID_IDirectInputDevice2A
	.comm	_IID_IDirectInputDevice7A,4,2   ; @IID_IDirectInputDevice7A
	.comm	_IID_IDirectInputDevice8A,4,2   ; @IID_IDirectInputDevice8A
	.comm	_IID_IDirectInputDeviceW,4,2    ; @IID_IDirectInputDeviceW
	.comm	_IID_IDirectInputDevice2W,4,2   ; @IID_IDirectInputDevice2W
	.comm	_IID_IDirectInputDevice7W,4,2   ; @IID_IDirectInputDevice7W
	.comm	_IID_IDirectInputDevice8W,4,2   ; @IID_IDirectInputDevice8W
l_.str.1:                               ; @.str.1
	.asciz	"no interface\n"

	.comm	_DIERR_NOINTERFACE,4,2          ; @DIERR_NOINTERFACE
l_.str.2:                               ; @.str.2
	.asciz	"Created a Mouse device (%p)\n"

	.comm	_DIERR_OUTOFMEMORY,4,2          ; @DIERR_OUTOFMEMORY
	.comm	_DI_OK,4,2                      ; @DI_OK
	.comm	_DIERR_DEVICENOTREG,4,2         ; @DIERR_DEVICENOTREG
	.no_dead_strip	_mousedev_create_device
.subsections_via_symbols
