	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_ReopenDevice            ## -- Begin function DSOUND_ReopenDevice
	.p2align	4, 0x90
_DSOUND_ReopenDevice:                   ## @DSOUND_ReopenDevice
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_DS_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_TRACE
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	callq	_IDsDriver_Close
	movq	_DSDDESC_DOMMSYSTEMOPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%rbx)
	je	LBB0_3
## %bb.2:
	movq	24(%rbx), %rdi
	callq	_waveOutClose
LBB0_3:
	movq	(%rbx), %rdi
	callq	_IDsDriver_Release
	movq	$0, (%rbx)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%rbx)
	jmp	LBB0_6
LBB0_4:
	movq	_DSDDESC_DOMMSYSTEMOPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%rbx)
	je	LBB0_6
## %bb.5:
	movq	24(%rbx), %rdi
	callq	_waveOutClose
LBB0_6:
	testl	%r15d, %r15d
	jne	LBB0_9
## %bb.7:
	movq	_ds_hw_accel@GOTPCREL(%rip), %rax
	movq	_DS_HW_ACCEL_EMULATION@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	%rcx, (%rax)
	je	LBB0_9
## %bb.8:
	movl	16(%rbx), %edi
	movq	_DRV_QUERYDSOUNDIFACE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	callq	_waveOutMessage
LBB0_9:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.10:
	leaq	12(%rbx), %rsi
	movl	16(%rbx), %r15d
	callq	_IDsDriver_GetDriverDesc
	movl	%eax, %r14d
	movl	%r15d, 16(%rbx)
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_WARN
	movq	(%rbx), %rdi
	callq	_IDsDriver_Release
	movq	$0, (%rbx)
LBB0_12:
	movq	_DSDDESC_DOMMSYSTEMOPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_DSDDESC_DOMMSYSTEMSETFORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	%ecx, %edx
	movl	%edx, 12(%rbx)
	movb	$1, %al
	xorl	%edi, %edi
	testl	%edx, %ecx
	je	LBB0_20
LBB0_16:
	movq	_CALLBACK_FUNCTION@GOTPCREL(%rip), %rcx
	movq	_WAVE_MAPPED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	orl	(%rcx), %r9d
	xorl	%ecx, %ecx
	testb	%al, %al
	jne	LBB0_18
## %bb.17:
	movq	_WAVE_DIRECTSOUND@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_18:
	orl	%ecx, %r9d
	leaq	24(%rbx), %rdi
	movl	8(%rbx), %edx
	movl	16(%rbx), %esi
	movq	_DSOUND_callback@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rbx, %r8
	callq	_waveOutOpen
	movl	%eax, %edi
	callq	_mmErr
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_19
## %bb.22:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_WARN
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_24
## %bb.23:
	callq	_IDsDriver_Release
	movq	$0, (%rbx)
	jmp	LBB0_24
LBB0_13:
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.14:
	movl	12(%rbx), %edx
	movq	_DSDDESC_DOMMSYSTEMOPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%eax, %eax
	testl	%edx, %ecx
	jne	LBB0_16
	jmp	LBB0_20
LBB0_19:
	movq	(%rbx), %rdi
LBB0_20:
	testq	%rdi, %rdi
	je	LBB0_24
## %bb.21:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_IDsDriver_Open                 ## TAILCALL
LBB0_24:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DS_OK,4,2                      ## @DS_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"(%p, %d)\n"

	.comm	_DSDDESC_DOMMSYSTEMOPEN,4,2     ## @DSDDESC_DOMMSYSTEMOPEN
	.comm	_ds_hw_accel,8,3                ## @ds_hw_accel
	.comm	_DS_HW_ACCEL_EMULATION,8,3      ## @DS_HW_ACCEL_EMULATION
	.comm	_DRV_QUERYDSOUNDIFACE,4,2       ## @DRV_QUERYDSOUNDIFACE
L_.str.1:                               ## @.str.1
	.asciz	"IDsDriver_GetDriverDesc failed: %08x\n"

	.comm	_DSDDESC_DOMMSYSTEMSETFORMAT,4,2 ## @DSDDESC_DOMMSYSTEMSETFORMAT
	.comm	_CALLBACK_FUNCTION,4,2          ## @CALLBACK_FUNCTION
	.comm	_WAVE_MAPPED,4,2                ## @WAVE_MAPPED
	.comm	_WAVE_DIRECTSOUND,4,2           ## @WAVE_DIRECTSOUND
	.comm	_DSOUND_callback,8,3            ## @DSOUND_callback
L_.str.2:                               ## @.str.2
	.asciz	"waveOutOpen failed\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DSOUND_ReopenDevice            ; -- Begin function DSOUND_ReopenDevice
	.p2align	2
_DSOUND_ReopenDevice:                   ; @DSOUND_ReopenDevice
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _DS_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DS_OK@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x21
	bl	_TRACE
	ldr	x0, [x19]
Lloh5:
	adrp	x22, _DSDDESC_DOMMSYSTEMOPEN@GOTPAGE
Lloh6:
	ldr	x22, [x22, _DSDDESC_DOMMSYSTEMOPEN@GOTPAGEOFF]
	cbz	x0, LBB0_4
; %bb.1:
	bl	_IDsDriver_Close
	ldr	w8, [x19, #12]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	ldr	x0, [x19, #24]
	bl	_waveOutClose
LBB0_3:
	ldr	x0, [x19]
	bl	_IDsDriver_Release
	str	xzr, [x19]
	stp	xzr, xzr, [x19, #24]
	b	LBB0_6
LBB0_4:
	ldr	w8, [x19, #12]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	ldr	x0, [x19, #24]
	bl	_waveOutClose
LBB0_6:
	cbnz	w21, LBB0_9
; %bb.7:
Lloh7:
	adrp	x8, _ds_hw_accel@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ds_hw_accel@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _DS_HW_ACCEL_EMULATION@GOTPAGE
Lloh11:
	ldr	x9, [x9, _DS_HW_ACCEL_EMULATION@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_9
; %bb.8:
	ldr	w0, [x19, #16]
Lloh13:
	adrp	x8, _DRV_QUERYDSOUNDIFACE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _DRV_QUERYDSOUNDIFACE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x2, x19
	mov	w3, #0
	bl	_waveOutMessage
LBB0_9:
	ldr	x0, [x19]
	cbz	x0, LBB0_12
; %bb.10:
	add	x1, x19, #12
	ldr	w21, [x19, #16]
	bl	_IDsDriver_GetDriverDesc
	mov	x20, x0
	str	w21, [x19, #16]
	bl	_FAILED
	cbz	x0, LBB0_16
; %bb.11:
	str	x20, [sp]
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_WARN
	ldr	x0, [x19]
	bl	_IDsDriver_Release
	str	xzr, [x19]
LBB0_12:
	mov	x0, #0
	ldr	w9, [x22]
Lloh18:
	adrp	x8, _DSDDESC_DOMMSYSTEMSETFORMAT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DSDDESC_DOMMSYSTEMSETFORMAT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	orr	w10, w8, w9
	str	w10, [x19, #12]
	mov	w8, #1
	tst	w9, w10
	b.eq	LBB0_19
LBB0_13:
Lloh21:
	adrp	x9, _CALLBACK_FUNCTION@GOTPAGE
Lloh22:
	ldr	x9, [x9, _CALLBACK_FUNCTION@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
Lloh24:
	adrp	x10, _WAVE_MAPPED@GOTPAGE
Lloh25:
	ldr	x10, [x10, _WAVE_MAPPED@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh27:
	adrp	x10, _WAVE_DIRECTSOUND@GOTPAGE
Lloh28:
	ldr	x10, [x10, _WAVE_DIRECTSOUND@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	cmp	w8, #0
	csel	w8, wzr, w10, ne
	orr	w5, w9, w8
	add	x0, x19, #24
	ldr	w1, [x19, #16]
	ldr	w2, [x19, #8]
Lloh30:
	adrp	x8, _DSOUND_callback@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DSOUND_callback@GOTPAGEOFF]
Lloh32:
	ldr	x3, [x8]
	mov	x4, x19
	bl	_waveOutOpen
	bl	_mmErr
	mov	x20, x0
	bl	_FAILED
	cbz	x0, LBB0_18
; %bb.14:
Lloh33:
	adrp	x0, l_.str.2@PAGE
Lloh34:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_WARN
	ldr	x0, [x19]
	cbz	x0, LBB0_21
; %bb.15:
	bl	_IDsDriver_Release
	str	xzr, [x19]
	b	LBB0_21
LBB0_16:
	ldr	x0, [x19]
	cbz	x0, LBB0_12
; %bb.17:
	mov	w8, #0
	ldr	w10, [x19, #12]
	ldr	w9, [x22]
	tst	w9, w10
	b.ne	LBB0_13
	b	LBB0_19
LBB0_18:
	ldr	x0, [x19]
LBB0_19:
	cbz	x0, LBB0_21
; %bb.20:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_IDsDriver_Open
LBB0_21:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_DS_OK,4,2                      ; @DS_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"(%p, %d)\n"

	.comm	_DSDDESC_DOMMSYSTEMOPEN,4,2     ; @DSDDESC_DOMMSYSTEMOPEN
	.comm	_ds_hw_accel,8,3                ; @ds_hw_accel
	.comm	_DS_HW_ACCEL_EMULATION,8,3      ; @DS_HW_ACCEL_EMULATION
	.comm	_DRV_QUERYDSOUNDIFACE,4,2       ; @DRV_QUERYDSOUNDIFACE
l_.str.1:                               ; @.str.1
	.asciz	"IDsDriver_GetDriverDesc failed: %08x\n"

	.comm	_DSDDESC_DOMMSYSTEMSETFORMAT,4,2 ; @DSDDESC_DOMMSYSTEMSETFORMAT
	.comm	_CALLBACK_FUNCTION,4,2          ; @CALLBACK_FUNCTION
	.comm	_WAVE_MAPPED,4,2                ; @WAVE_MAPPED
	.comm	_WAVE_DIRECTSOUND,4,2           ; @WAVE_DIRECTSOUND
	.comm	_DSOUND_callback,8,3            ; @DSOUND_callback
l_.str.2:                               ; @.str.2
	.asciz	"waveOutOpen failed\n"

.subsections_via_symbols
