	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wasapi_init_device
_wasapi_init_device:                    ## @wasapi_init_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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	$0, -64(%rbp)
	movq	$0, -48(%rbp)
	movq	$0, -56(%rbp)
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_RARCH_LOG
LBB0_3:
	movq	_CLSCTX_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_CLSID_MMDeviceEnumerator@GOTPCREL(%rip), %rdi
	movq	_IID_IMMDeviceEnumerator@GOTPCREL(%rip), %rcx
	leaq	-64(%rbp), %r8
	xorl	%esi, %esi
	callq	_CoCreateInstance
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_4
LBB0_30:
	movq	-56(%rbp), %rdi
	callq	_IFACE_RELEASE
	movq	-64(%rbp), %rdi
	callq	_IFACE_RELEASE
	leaq	L_.str.4(%rip), %rdi
	testq	%r14, %r14
	je	LBB0_32
## %bb.31:
	callq	_RARCH_WARN
	jmp	LBB0_33
LBB0_4:
	testq	%r14, %r14
	je	LBB0_26
## %bb.5:
	xorl	%edi, %edi
	callq	_mmdevice_list_new
	testq	%rax, %rax
	je	LBB0_16
## %bb.6:
	movq	%rax, %r15
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.7:
	cmpl	$0, (%r15)
	je	LBB0_13
## %bb.8:
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movq	8(%r15), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_string_is_equal
	testq	%rax, %rax
	jne	LBB0_12
## %bb.9:
	movl	$1, %ebx
	leaq	L_.str.2(%rip), %r13
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %eax
	cmpq	%rax, %rbx
	jae	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	8(%r15), %rax
	movl	(%rax,%rbx,4), %edx
	movq	%r13, %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movq	8(%r15), %rax
	movl	(%rax,%rbx,4), %esi
	movq	%r14, %rdi
	callq	_string_is_equal
	incl	%r12d
	incq	%rbx
	testq	%rax, %rax
	je	LBB0_10
LBB0_12:
	movq	%r15, %rdi
	callq	_string_list_free
	jmp	LBB0_17
LBB0_32:
	callq	_RARCH_ERR
LBB0_33:
	xorl	%eax, %eax
LBB0_34:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_26:
	movq	-64(%rbp), %rdi
	movq	_eRender@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_eConsole@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	callq	__IMMDeviceEnumerator_GetDefaultAudioEndpoint
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_30
## %bb.27:
	cmpq	$0, -48(%rbp)
	je	LBB0_30
## %bb.28:
	xorl	%edi, %edi
	jmp	LBB0_29
LBB0_13:
	movsbl	(%r14), %edi
	callq	_isdigit
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_strtoul
	movl	%eax, %r12d
	leaq	L_.str.3(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	movq	%r15, %rdi
	callq	_string_list_free
	cmpl	$-1, %r12d
	jne	LBB0_17
	jmp	LBB0_16
LBB0_14:
	movq	%r15, %rdi
	callq	_string_list_free
LBB0_16:
	xorl	%r12d, %r12d
LBB0_17:
	movq	-64(%rbp), %rdi
	movq	_eRender@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DEVICE_STATE_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %rcx
	callq	__IMMDeviceEnumerator_EnumAudioEndpoints
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_30
## %bb.18:
	movq	-56(%rbp), %rdi
	leaq	-68(%rbp), %rsi
	callq	__IMMDeviceCollection_GetCount
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_30
## %bb.19:
	cmpl	$0, -68(%rbp)
	jle	LBB0_30
## %bb.20:
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %r15
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	__IMMDeviceCollection_Item
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_30
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=1
	cmpl	%ebx, %r12d
	je	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_21 Depth=1
	movq	-48(%rbp), %rdi
	callq	_IFACE_RELEASE
	incl	%ebx
	cmpl	-68(%rbp), %ebx
	jl	LBB0_21
LBB0_24:
	cmpq	$0, -48(%rbp)
	je	LBB0_30
## %bb.25:
	movq	-56(%rbp), %rdi
LBB0_29:
	callq	_IFACE_RELEASE
	movq	-64(%rbp), %rdi
	callq	_IFACE_RELEASE
	movq	-48(%rbp), %rax
	jmp	LBB0_34
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[WASAPI]: Initializing device %s ...\n"

L_.str.1:                               ## @.str.1
	.asciz	"[WASAPI]: Initializing default device.. \n"

	.comm	_CLSID_MMDeviceEnumerator,8,3   ## @CLSID_MMDeviceEnumerator
	.comm	_CLSCTX_ALL,4,2                 ## @CLSCTX_ALL
	.comm	_IID_IMMDeviceEnumerator,8,3    ## @IID_IMMDeviceEnumerator
L_.str.2:                               ## @.str.2
	.asciz	"[WASAPI]: %d : %s\n"

L_.str.3:                               ## @.str.3
	.asciz	"[WASAPI]: Fallback, device index is a single number index instead: %d.\n"

	.comm	_eRender,4,2                    ## @eRender
	.comm	_DEVICE_STATE_ACTIVE,4,2        ## @DEVICE_STATE_ACTIVE
	.comm	_eConsole,4,2                   ## @eConsole
L_.str.4:                               ## @.str.4
	.asciz	"[WASAPI]: Failed to initialize device.\n"

	.no_dead_strip	_wasapi_init_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wasapi_init_device
_wasapi_init_device:                    ; @wasapi_init_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x0
	stp	xzr, xzr, [sp, #24]
	str	xzr, [sp, #16]
	cbz	x0, LBB0_2
; %bb.1:
	str	x19, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_3
LBB0_2:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_3:
	bl	_RARCH_LOG
Lloh4:
	adrp	x8, _CLSCTX_ALL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CLSCTX_ALL@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
Lloh7:
	adrp	x0, _CLSID_MMDeviceEnumerator@GOTPAGE
Lloh8:
	ldr	x0, [x0, _CLSID_MMDeviceEnumerator@GOTPAGEOFF]
Lloh9:
	adrp	x3, _IID_IMMDeviceEnumerator@GOTPAGE
Lloh10:
	ldr	x3, [x3, _IID_IMMDeviceEnumerator@GOTPAGEOFF]
	add	x4, sp, #32
	mov	x1, #0
	bl	_CoCreateInstance
	bl	_FAILED
	cbz	x0, LBB0_6
LBB0_4:
	ldr	x0, [sp, #16]
	bl	_IFACE_RELEASE
	ldr	x0, [sp, #32]
	bl	_IFACE_RELEASE
Lloh11:
	adrp	x0, l_.str.4@PAGE
Lloh12:
	add	x0, x0, l_.str.4@PAGEOFF
	cbz	x19, LBB0_12
; %bb.5:
	bl	_RARCH_WARN
	b	LBB0_13
LBB0_6:
	cbz	x19, LBB0_15
; %bb.7:
	mov	x0, #0
	bl	_mmdevice_list_new
	cbz	x0, LBB0_25
; %bb.8:
	mov	x20, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_24
; %bb.9:
	ldr	w9, [x20]
	cbz	w9, LBB0_22
; %bb.10:
	ldr	w8, [x8]
	stp	xzr, x8, [sp]
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_RARCH_LOG
	ldr	x8, [x20, #8]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_string_is_equal
	cbz	x0, LBB0_17
; %bb.11:
	mov	w21, #0
	b	LBB0_21
LBB0_12:
	bl	_RARCH_ERR
LBB0_13:
	mov	x0, #0
LBB0_14:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_15:
	ldr	x0, [sp, #32]
Lloh15:
	adrp	x8, _eRender@GOTPAGE
Lloh16:
	ldr	x8, [x8, _eRender@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
Lloh18:
	adrp	x8, _eConsole@GOTPAGE
Lloh19:
	ldr	x8, [x8, _eConsole@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	add	x3, sp, #24
	bl	__IMMDeviceEnumerator_GetDefaultAudioEndpoint
	bl	_FAILED
	ldr	x8, [sp, #24]
	cmp	x0, #0
	ccmp	x8, #0, #4, eq
	b.eq	LBB0_4
; %bb.16:
	mov	x0, #0
	b	LBB0_35
LBB0_17:
	mov	x8, #0
Lloh21:
	adrp	x21, l_.str.2@PAGE
Lloh22:
	add	x21, x21, l_.str.2@PAGEOFF
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	add	x22, x8, #1
	ldr	w9, [x20]
	cmp	x22, x9
	b.hs	LBB0_22
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x9, [x20, #8]
	lsl	x23, x8, #2
	add	x8, x9, x23
	ldr	w8, [x8, #4]
	stp	x22, x8, [sp]
	mov	x0, x21
	bl	_RARCH_LOG
	ldr	x8, [x20, #8]
	add	x8, x8, x23
	ldr	w1, [x8, #4]
	mov	x0, x19
	bl	_string_is_equal
	mov	x8, x22
	cbz	x0, LBB0_18
; %bb.20:
	mov	x21, x22
LBB0_21:
	mov	x0, x20
	bl	_string_list_free
	b	LBB0_26
LBB0_22:
	ldrsb	w0, [x19]
	bl	_isdigit
	cbz	x0, LBB0_24
; %bb.23:
	mov	x0, x19
	mov	x1, #0
	mov	w2, #0
	bl	_strtoul
	mov	x21, x0
	str	x21, [sp]
Lloh23:
	adrp	x0, l_.str.3@PAGE
Lloh24:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_RARCH_LOG
	mov	x0, x20
	bl	_string_list_free
	cmn	w21, #1
	b.ne	LBB0_26
	b	LBB0_25
LBB0_24:
	mov	x0, x20
	bl	_string_list_free
LBB0_25:
	mov	w21, #0
LBB0_26:
	ldr	x0, [sp, #32]
Lloh25:
	adrp	x8, _eRender@GOTPAGE
Lloh26:
	ldr	x8, [x8, _eRender@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
Lloh28:
	adrp	x8, _DEVICE_STATE_ACTIVE@GOTPAGE
Lloh29:
	ldr	x8, [x8, _DEVICE_STATE_ACTIVE@GOTPAGEOFF]
Lloh30:
	ldr	w2, [x8]
	add	x3, sp, #16
	bl	__IMMDeviceEnumerator_EnumAudioEndpoints
	bl	_FAILED
	cbnz	x0, LBB0_4
; %bb.27:
	ldr	x0, [sp, #16]
	add	x1, sp, #44
	bl	__IMMDeviceCollection_GetCount
	bl	_FAILED
	cbnz	x0, LBB0_4
; %bb.28:
	ldr	w8, [sp, #44]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.29:
	mov	w20, #0
LBB0_30:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [sp, #16]
	add	x2, sp, #24
	mov	x1, x20
	bl	__IMMDeviceCollection_Item
	bl	_FAILED
	cbnz	x0, LBB0_4
; %bb.31:                               ;   in Loop: Header=BB0_30 Depth=1
	cmp	w21, w20
	b.eq	LBB0_33
; %bb.32:                               ;   in Loop: Header=BB0_30 Depth=1
	ldr	x0, [sp, #24]
	bl	_IFACE_RELEASE
	add	w20, w20, #1
	ldr	w8, [sp, #44]
	cmp	w20, w8
	b.lt	LBB0_30
LBB0_33:
	ldr	x8, [sp, #24]
	cbz	x8, LBB0_4
; %bb.34:
	ldr	x0, [sp, #16]
LBB0_35:
	bl	_IFACE_RELEASE
	ldr	x0, [sp, #32]
	bl	_IFACE_RELEASE
	ldr	x0, [sp, #24]
	b	LBB0_14
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[WASAPI]: Initializing device %s ...\n"

l_.str.1:                               ; @.str.1
	.asciz	"[WASAPI]: Initializing default device.. \n"

	.comm	_CLSID_MMDeviceEnumerator,8,3   ; @CLSID_MMDeviceEnumerator
	.comm	_CLSCTX_ALL,4,2                 ; @CLSCTX_ALL
	.comm	_IID_IMMDeviceEnumerator,8,3    ; @IID_IMMDeviceEnumerator
l_.str.2:                               ; @.str.2
	.asciz	"[WASAPI]: %d : %s\n"

l_.str.3:                               ; @.str.3
	.asciz	"[WASAPI]: Fallback, device index is a single number index instead: %d.\n"

	.comm	_eRender,4,2                    ; @eRender
	.comm	_DEVICE_STATE_ACTIVE,4,2        ; @DEVICE_STATE_ACTIVE
	.comm	_eConsole,4,2                   ; @eConsole
l_.str.4:                               ; @.str.4
	.asciz	"[WASAPI]: Failed to initialize device.\n"

	.no_dead_strip	_wasapi_init_device
.subsections_via_symbols
