	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wasapi_init_client_sh
_wasapi_init_client_sh:                 ## @wasapi_init_client_sh
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -68(%rbp)                 ## 4-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	$0, -56(%rbp)
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_IID_IAudioClient@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CLSCTX_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %r8
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	xorl	%ecx, %ecx
	callq	__IMMDevice_Activate
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_FAILED
	movq	%rax, %rcx
	movl	$0, %eax
	testq	%rcx, %rcx
	jne	LBB0_16
## %bb.1:
	xorl	%edx, %edx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	leal	1(%rcx), %eax
	testl	%ecx, %ecx
	movl	%eax, %edx
	jne	LBB0_12
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %r15d
	xorl	%ecx, %ecx
	testl	%eax, %eax
	sete	%cl
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	cmpl	$1, %edx
	cmovnel	%eax, %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	testl	%r15d, %r15d
	je	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	leaq	L_.str.1(%rip), %r12
	leaq	L_.str.2(%rip), %rax
	cmoveq	%rax, %r12
	xorl	%r14d, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=2
	incl	%r14d
	testl	%r15d, %r15d
	je	LBB0_11
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leaq	L_.str(%rip), %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	movl	-68(%rbp), %ecx                 ## 4-byte Reload
	callq	_RARCH_LOG
	leaq	-72(%rbp), %rbx
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	%r15d, %edx
	callq	_wasapi_set_format
	movq	-56(%rbp), %rdi
	movq	8(%rdi), %rax
	movq	_AUDCLNT_SHAREMODE_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_AUDCLNT_STREAMFLAGS_NOPERSIST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_AUDCLNT_STREAMFLAGS_EVENTCALLBACK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	$0, (%rsp)
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movq	%rbx, %r9
	callq	*(%rax)
	movq	%rax, %r13
	movq	_AUDCLNT_E_ALREADY_INITIALIZED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	-56(%rbp), %rdi
	callq	_IFACE_RELEASE
	movq	_IID_IAudioClient@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CLSCTX_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	xorl	%ecx, %ecx
	leaq	-56(%rbp), %r8
	callq	__IMMDevice_Activate
	movq	%rax, %rdi
	callq	_FAILED
	movq	%rax, %rcx
	movl	$0, %eax
	testq	%rcx, %rcx
	jne	LBB0_16
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	-56(%rbp), %rdi
	movq	8(%rdi), %rax
	movq	_AUDCLNT_SHAREMODE_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_AUDCLNT_STREAMFLAGS_NOPERSIST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_AUDCLNT_STREAMFLAGS_EVENTCALLBACK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	$0, (%rsp)
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	leaq	-72(%rbp), %r9
	callq	*(%rax)
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=2
	movq	_AUDCLNT_E_UNSUPPORTED_FORMAT@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r13
	jne	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	leaq	L_.str.3(%rip), %rdi
	callq	_RARCH_WARN
	movl	%r14d, %edi
	callq	_wasapi_pref_rate
	movl	%eax, %r15d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpl	(%rax), %r15d
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=2
	incl	%r14d
	movl	%r14d, %edi
	callq	_wasapi_pref_rate
	movl	%eax, %r15d
	jmp	LBB0_10
LBB0_12:
	xorl	%r15d, %r15d
LBB0_13:
	movq	%r13, %rdi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_14
## %bb.15:
	movq	-56(%rbp), %rdi
	callq	_IFACE_RELEASE
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_14:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%rax)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%r15d, (%rax)
	movq	-56(%rbp), %rax
LBB0_16:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IID_IAudioClient,4,2           ## @IID_IAudioClient
	.comm	_CLSCTX_ALL,4,2                 ## @CLSCTX_ALL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[WASAPI]: Initializing client (shared, %s, %uHz, %ums) ...\n"

L_.str.1:                               ## @.str.1
	.asciz	"float"

L_.str.2:                               ## @.str.2
	.asciz	"pcm"

	.comm	_AUDCLNT_SHAREMODE_SHARED,4,2   ## @AUDCLNT_SHAREMODE_SHARED
	.comm	_AUDCLNT_STREAMFLAGS_EVENTCALLBACK,4,2 ## @AUDCLNT_STREAMFLAGS_EVENTCALLBACK
	.comm	_AUDCLNT_STREAMFLAGS_NOPERSIST,4,2 ## @AUDCLNT_STREAMFLAGS_NOPERSIST
	.comm	_AUDCLNT_E_ALREADY_INITIALIZED,8,3 ## @AUDCLNT_E_ALREADY_INITIALIZED
	.comm	_AUDCLNT_E_UNSUPPORTED_FORMAT,8,3 ## @AUDCLNT_E_UNSUPPORTED_FORMAT
L_.str.3:                               ## @.str.3
	.asciz	"[WASAPI]: Unsupported format.\n"

	.no_dead_strip	_wasapi_init_client_sh
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wasapi_init_client_sh
_wasapi_init_client_sh:                 ; @wasapi_init_client_sh
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x22, x3
	mov	x19, x2
	mov	x20, x1
	mov	x23, x0
	str	xzr, [sp, #32]
	ldr	w21, [x1]
Lloh0:
	adrp	x8, _IID_IAudioClient@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IID_IAudioClient@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _CLSCTX_ALL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CLSCTX_ALL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x4, sp, #32
	mov	x3, #0
	bl	__IMMDevice_Activate
	mov	x26, x0
	bl	_FAILED
	mov	x8, x0
	mov	x0, #0
	cbnz	x8, LBB0_17
; %bb.1:
	str	x23, [sp, #24]                  ; 8-byte Folded Spill
	str	x20, [sp, #8]                   ; 8-byte Folded Spill
Lloh6:
	adrp	x25, _AUDCLNT_SHAREMODE_SHARED@GOTPAGE
Lloh7:
	ldr	x25, [x25, _AUDCLNT_SHAREMODE_SHARED@GOTPAGEOFF]
Lloh8:
	adrp	x24, _AUDCLNT_STREAMFLAGS_EVENTCALLBACK@GOTPAGE
Lloh9:
	ldr	x24, [x24, _AUDCLNT_STREAMFLAGS_EVENTCALLBACK@GOTPAGEOFF]
Lloh10:
	adrp	x23, _AUDCLNT_STREAMFLAGS_NOPERSIST@GOTPAGE
Lloh11:
	ldr	x23, [x23, _AUDCLNT_STREAMFLAGS_NOPERSIST@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [sp, #20]                   ; 4-byte Folded Reload
	add	w8, w9, #1
	cbnz	w9, LBB0_12
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	mov	x9, x8
	ldr	w27, [x19]
	cmp	w21, #0
	cset	w8, eq
	str	w9, [sp, #20]                   ; 4-byte Folded Spill
	cmp	w9, #1
	csel	w21, w8, w21, eq
	cbz	w27, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w28, #0
	cmp	w21, #0
Lloh12:
	adrp	x8, l_.str.1@PAGE
Lloh13:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh14:
	adrp	x9, l_.str.2@PAGE
Lloh15:
	add	x9, x9, l_.str.2@PAGEOFF
	csel	x20, x9, x8, eq
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=2
	mov	x27, x0
	add	w28, w28, #1
	cbz	w0, LBB0_2
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x27
	mov	x3, x22
	bl	_RARCH_LOG
	add	x0, sp, #44
	mov	x1, x21
	mov	x2, x27
	bl	_wasapi_set_format
	ldr	x0, [sp, #32]
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	w1, [x25]
	ldr	w9, [x24]
	ldr	w10, [x23]
	orr	w2, w10, w9
	add	x5, sp, #44
	mov	w3, #0
	mov	w4, #0
	mov	x6, #0
	blr	x8
	mov	x26, x0
Lloh18:
	adrp	x8, _AUDCLNT_E_ALREADY_INITIALIZED@GOTPAGE
Lloh19:
	ldr	x8, [x8, _AUDCLNT_E_ALREADY_INITIALIZED@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x0, [sp, #32]
	bl	_IFACE_RELEASE
Lloh21:
	adrp	x8, _IID_IAudioClient@GOTPAGE
Lloh22:
	ldr	x8, [x8, _IID_IAudioClient@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _CLSCTX_ALL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _CLSCTX_ALL@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	add	x4, sp, #32
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x3, #0
	bl	__IMMDevice_Activate
	bl	_FAILED
	cbnz	x0, LBB0_15
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x0, [sp, #32]
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	ldr	w1, [x25]
	ldr	w9, [x24]
	ldr	w10, [x23]
	orr	w2, w10, w9
	add	x5, sp, #44
	mov	w3, #0
	mov	w4, #0
	mov	x6, #0
	blr	x8
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=2
Lloh27:
	adrp	x8, _AUDCLNT_E_UNSUPPORTED_FORMAT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AUDCLNT_E_UNSUPPORTED_FORMAT@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	cmp	x26, x8
	b.ne	LBB0_13
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=2
Lloh30:
	adrp	x0, l_.str.3@PAGE
Lloh31:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_RARCH_WARN
	mov	x0, x28
	bl	_wasapi_pref_rate
	ldr	w8, [x19]
	cmp	w0, w8
	b.ne	LBB0_5
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=2
	add	w28, w28, #1
	mov	x0, x28
	bl	_wasapi_pref_rate
	b	LBB0_5
LBB0_12:
	mov	w27, #0
LBB0_13:
	mov	x0, x26
	bl	_FAILED
	cbz	x0, LBB0_16
; %bb.14:
	ldr	x0, [sp, #32]
	bl	_IFACE_RELEASE
LBB0_15:
	mov	x0, #0
	b	LBB0_17
LBB0_16:
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	str	w21, [x8]
	str	w27, [x19]
	ldr	x0, [sp, #32]
LBB0_17:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_IID_IAudioClient,4,2           ; @IID_IAudioClient
	.comm	_CLSCTX_ALL,4,2                 ; @CLSCTX_ALL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[WASAPI]: Initializing client (shared, %s, %uHz, %ums) ...\n"

l_.str.1:                               ; @.str.1
	.asciz	"float"

l_.str.2:                               ; @.str.2
	.asciz	"pcm"

	.comm	_AUDCLNT_SHAREMODE_SHARED,4,2   ; @AUDCLNT_SHAREMODE_SHARED
	.comm	_AUDCLNT_STREAMFLAGS_EVENTCALLBACK,4,2 ; @AUDCLNT_STREAMFLAGS_EVENTCALLBACK
	.comm	_AUDCLNT_STREAMFLAGS_NOPERSIST,4,2 ; @AUDCLNT_STREAMFLAGS_NOPERSIST
	.comm	_AUDCLNT_E_ALREADY_INITIALIZED,8,3 ; @AUDCLNT_E_ALREADY_INITIALIZED
	.comm	_AUDCLNT_E_UNSUPPORTED_FORMAT,8,3 ; @AUDCLNT_E_UNSUPPORTED_FORMAT
l_.str.3:                               ; @.str.3
	.asciz	"[WASAPI]: Unsupported format.\n"

	.no_dead_strip	_wasapi_init_client_sh
.subsections_via_symbols
