	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FindWinMMDeviceIndex           ## -- Begin function FindWinMMDeviceIndex
	.p2align	4, 0x90
_FindWinMMDeviceIndex:                  ## @FindWinMMDeviceIndex
	.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	%esi, %r13d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_PATH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	testl	%r13d, %r13d
	je	LBB0_2
## %bb.1:
	callq	_waveInGetNumDevs
	jmp	LBB0_3
LBB0_2:
	callq	_waveOutGetNumDevs
LBB0_3:
	movq	%rax, %r12
	testq	%rax, %rax
	jle	LBB0_11
## %bb.4:
	leaq	-80(%rbp), %r15
	xorl	%ebx, %ebx
	movq	_DRV_QUERYDEVICEINTERFACESIZE@GOTPCREL(%rip), %r14
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	movl	%r13d, %edx
	movq	%rbx, %rcx
	callq	_DPRINT
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	cmpq	%rbx, %r12
	je	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, -80(%rbp)
	movq	%rbx, %rdi
	callq	_UlongToHandle
	movl	(%r14), %esi
	movl	%eax, %edi
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	callq	_waveInMessage
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	callq	_waveOutMessage
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	_MMSYSERR_NOERROR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.13:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %r12
	movq	%r15, %r14
	movq	_MAX_PATH@GOTPCREL(%rip), %r15
	movslq	(%r15), %rax
	xorl	%edi, %edi
	cmpq	%rax, -80(%rbp)
	setl	%dil
	callq	_ASSERT
	movq	%rbx, %rdi
	callq	_UlongToHandle
	movq	_DRV_QUERYDEVICEINTERFACE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r15), %ecx
	movl	%eax, %edi
	testl	%r13d, %r13d
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_waveInMessage
	jmp	LBB0_16
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_waveOutMessage
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_MMSYSERR_NOERROR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%r14, %r15
	jne	LBB0_17
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_wcsicmp
	testl	%eax, %eax
	movq	%r12, %r14
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	jne	LBB0_10
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	movl	%r13d, %edx
	movq	%rbx, %rcx
	callq	_DPRINT
	movq	%r12, %r14
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_10
LBB0_11:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	8(%rbx), %esi
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %edx
	movq	%r12, %rcx
	callq	_DPRINT1
	movq	(%rbx), %rax
	testl	%r13d, %r13d
	je	LBB0_22
## %bb.12:
	movq	$0, (%rax)
	jmp	LBB0_23
LBB0_22:
	movq	$0, 8(%rax)
LBB0_23:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_25
## %bb.24:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	testl	%r13d, %r13d
	je	LBB0_21
## %bb.20:
	movq	%rbx, (%rax)
	jmp	LBB0_23
LBB0_21:
	movq	%rbx, 8(%rax)
	jmp	LBB0_23
LBB0_25:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_PATH,4,2                   ## @MAX_PATH
	.comm	_DRV_QUERYDEVICEINTERFACESIZE,4,2 ## @DRV_QUERYDEVICEINTERFACESIZE
	.comm	_MMSYSERR_NOERROR,8,3           ## @MMSYSERR_NOERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed DRV_QUERYDEVICEINTERFACESIZE with %lx bRecord %u Index %u\n"

	.comm	_DRV_QUERYDEVICEINTERFACE,4,2   ## @DRV_QUERYDEVICEINTERFACE
L_.str.1:                               ## @.str.1
	.asciz	"Failed DRV_QUERYDEVICEINTERFACE with %lx bRecord %u Index %u\n"

	.comm	_TRUE,4,2                       ## @TRUE
L_.str.2:                               ## @.str.2
	.asciz	"Failed to find device %ws bRecord %u Count %u\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FindWinMMDeviceIndex           ; -- Begin function FindWinMMDeviceIndex
	.p2align	2
_FindWinMMDeviceIndex:                  ; @FindWinMMDeviceIndex
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x26, _MAX_PATH@GOTPAGE
Lloh4:
	ldr	x26, [x26, _MAX_PATH@GOTPAGEOFF]
	ldr	w8, [x26]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	cbz	w1, LBB0_2
; %bb.1:
	bl	_waveInGetNumDevs
	b	LBB0_3
LBB0_2:
	bl	_waveOutGetNumDevs
LBB0_3:
	mov	x22, x0
	cmp	x0, #1
	b.lt	LBB0_18
; %bb.4:
	mov	x23, #0
Lloh7:
	adrp	x27, _DRV_QUERYDEVICEINTERFACESIZE@GOTPAGE
Lloh8:
	ldr	x27, [x27, _DRV_QUERYDEVICEINTERFACESIZE@GOTPAGEOFF]
Lloh9:
	adrp	x28, _MMSYSERR_NOERROR@GOTPAGE
Lloh10:
	ldr	x28, [x28, _MMSYSERR_NOERROR@GOTPAGEOFF]
Lloh11:
	adrp	x24, _DRV_QUERYDEVICEINTERFACE@GOTPAGE
Lloh12:
	ldr	x24, [x24, _DRV_QUERYDEVICEINTERFACE@GOTPAGEOFF]
Lloh13:
	adrp	x25, l_.str@PAGE
Lloh14:
	add	x25, x25, l_.str@PAGEOFF
	b	LBB0_8
LBB0_5:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x25
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x2, x19
	mov	x3, x23
	bl	_DPRINT
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x23, x23, #1
	cmp	x22, x23
	b.eq	LBB0_18
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	stur	xzr, [x29, #-96]
	mov	x0, x23
	bl	_UlongToHandle
	ldr	w1, [x27]
	sub	x2, x29, #96
	mov	w3, #0
	cbz	w19, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_waveInMessage
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_waveOutMessage
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x1, x0
	ldr	x8, [x28]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	ldur	x8, [x29, #-96]
	ldrsw	x9, [x26]
	cmp	x8, x9
	cset	w0, lt
	bl	_ASSERT
	mov	x0, x23
	bl	_UlongToHandle
	ldr	w1, [x24]
	ldr	w3, [x26]
	mov	x2, x21
	cbz	w19, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	bl	_waveInMessage
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	bl	_waveOutMessage
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x1, x0
	ldr	x8, [x28]
	cmp	x0, x8
	b.ne	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x20, #8]
	mov	x1, x21
	bl	_wcsicmp
	cbnz	w0, LBB0_7
	b	LBB0_23
LBB0_17:                                ;   in Loop: Header=BB0_8 Depth=1
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_18:
	ldr	w1, [x20, #8]
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x2, x19
	mov	x3, x22
	bl	_DPRINT1
	ldr	x8, [x20]
	cbz	w19, LBB0_20
; %bb.19:
	str	xzr, [x8]
	b	LBB0_21
LBB0_20:
	str	xzr, [x8, #8]
LBB0_21:
Lloh19:
	adrp	x8, _TRUE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	ldur	x8, [x29, #-88]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_26
; %bb.22:
	sub	sp, x29, #80
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_23:
	ldr	x8, [x20]
	cbz	w19, LBB0_25
; %bb.24:
	str	x23, [x8]
	b	LBB0_21
LBB0_25:
	str	x23, [x8, #8]
	b	LBB0_21
LBB0_26:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_PATH,4,2                   ; @MAX_PATH
	.comm	_DRV_QUERYDEVICEINTERFACESIZE,4,2 ; @DRV_QUERYDEVICEINTERFACESIZE
	.comm	_MMSYSERR_NOERROR,8,3           ; @MMSYSERR_NOERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed DRV_QUERYDEVICEINTERFACESIZE with %lx bRecord %u Index %u\n"

	.comm	_DRV_QUERYDEVICEINTERFACE,4,2   ; @DRV_QUERYDEVICEINTERFACE
l_.str.1:                               ; @.str.1
	.asciz	"Failed DRV_QUERYDEVICEINTERFACE with %lx bRecord %u Index %u\n"

	.comm	_TRUE,4,2                       ; @TRUE
l_.str.2:                               ; @.str.2
	.asciz	"Failed to find device %ws bRecord %u Count %u\n"

.subsections_via_symbols
