	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fill_keyboard_dideviceinstanceW
_fill_keyboard_dideviceinstanceW:       ## @fill_keyboard_dideviceinstanceW
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	(%rdi), %r13d
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movq	%r14, %rdx
	callq	_TRACE
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%r13d, %edx
	callq	_memset
	leaq	-72(%rbp), %rdi
	movl	$32, %r12d
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movl	%r13d, -72(%rbp)
	movq	_GUID_SysKeyboard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rax, -56(%rbp)
	cmpl	$2048, %r15d                    ## imm = 0x800
	jl	LBB0_1
## %bb.2:
	movq	_DI8DEVTYPE_KEYBOARD@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_DIDEVTYPE_KEYBOARD@GOTPCREL(%rip), %rax
LBB0_3:
	shll	$8, %ebx
	orl	(%rax), %ebx
	movl	%ebx, -68(%rbp)
	movq	_CP_ACP@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movl	-60(%rbp), %r8d
	movq	_MAX_PATH@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r9d
	leaq	L_.str.1(%rip), %rdx
	xorl	%esi, %esi
	movl	$-1, %ecx
	callq	_MultiByteToWideChar
	movl	(%r15), %edi
	movl	-64(%rbp), %r8d
	movl	(%rbx), %r9d
	leaq	L_.str.2(%rip), %rdx
	xorl	%esi, %esi
	movl	$-1, %ecx
	callq	_MultiByteToWideChar
	cmpl	$32, %r13d
	cmovbl	%r13d, %r12d
	movq	%r14, %rdi
	leaq	-72(%rbp), %rsi
	movl	%r12d, %edx
	callq	_memcpy
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d %p\n"

	.comm	_GUID_SysKeyboard,8,3           ## @GUID_SysKeyboard
	.comm	_DI8DEVTYPE_KEYBOARD,4,2        ## @DI8DEVTYPE_KEYBOARD
	.comm	_DIDEVTYPE_KEYBOARD,4,2         ## @DIDEVTYPE_KEYBOARD
	.comm	_CP_ACP,4,2                     ## @CP_ACP
L_.str.1:                               ## @.str.1
	.asciz	"Keyboard"

	.comm	_MAX_PATH,4,2                   ## @MAX_PATH
L_.str.2:                               ## @.str.2
	.asciz	"Wine Keyboard"

	.no_dead_strip	_fill_keyboard_dideviceinstanceW
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fill_keyboard_dideviceinstanceW
_fill_keyboard_dideviceinstanceW:       ; @fill_keyboard_dideviceinstanceW
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	w20, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x19
	bl	_TRACE
	mov	x0, x19
	mov	w1, #0
	mov	x2, x20
	bl	_memset
	mov	w23, #32
	mov	x0, sp
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	str	w20, [sp]
Lloh2:
	adrp	x8, _GUID_SysKeyboard@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GUID_SysKeyboard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stp	x8, x8, [sp, #16]
Lloh5:
	adrp	x8, _DI8DEVTYPE_KEYBOARD@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DI8DEVTYPE_KEYBOARD@GOTPAGEOFF]
Lloh7:
	adrp	x9, _DIDEVTYPE_KEYBOARD@GOTPAGE
Lloh8:
	ldr	x9, [x9, _DIDEVTYPE_KEYBOARD@GOTPAGEOFF]
	cmp	w22, #2047
	csel	x8, x8, x9, gt
	ldr	w8, [x8]
	orr	w8, w8, w21, lsl #8
Lloh9:
	adrp	x21, _CP_ACP@GOTPAGE
Lloh10:
	ldr	x21, [x21, _CP_ACP@GOTPAGEOFF]
	str	w8, [sp, #4]
	ldr	w0, [x21]
	ldr	w4, [sp, #12]
Lloh11:
	adrp	x22, _MAX_PATH@GOTPAGE
Lloh12:
	ldr	x22, [x22, _MAX_PATH@GOTPAGEOFF]
	ldr	w5, [x22]
Lloh13:
	adrp	x2, l_.str.1@PAGE
Lloh14:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #0
	mov	w3, #-1
	bl	_MultiByteToWideChar
	ldr	w0, [x21]
	ldr	w4, [sp, #8]
	ldr	w5, [x22]
Lloh15:
	adrp	x2, l_.str.2@PAGE
Lloh16:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w1, #0
	mov	w3, #-1
	bl	_MultiByteToWideChar
	cmp	w20, #32
	csel	w2, w20, w23, lo
	mov	x1, sp
	mov	x0, x19
	bl	_memcpy
	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
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d %p\n"

	.comm	_GUID_SysKeyboard,8,3           ; @GUID_SysKeyboard
	.comm	_DI8DEVTYPE_KEYBOARD,4,2        ; @DI8DEVTYPE_KEYBOARD
	.comm	_DIDEVTYPE_KEYBOARD,4,2         ; @DIDEVTYPE_KEYBOARD
	.comm	_CP_ACP,4,2                     ; @CP_ACP
l_.str.1:                               ; @.str.1
	.asciz	"Keyboard"

	.comm	_MAX_PATH,4,2                   ; @MAX_PATH
l_.str.2:                               ; @.str.2
	.asciz	"Wine Keyboard"

	.no_dead_strip	_fill_keyboard_dideviceinstanceW
.subsections_via_symbols
