	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sq_open
_sq_open:                               ## @sq_open
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_dmasound@GOTPCREL(%rip), %r12
	movl	8(%r12), %edi
	callq	_try_module_get
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	callq	_write_sq_open
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:
	movl	(%r15), %edi
	movq	_FMODE_READ@GOTPCREL(%rip), %rax
	testl	%edi, (%rax)
	je	LBB0_6
## %bb.4:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	8(%r12), %edi
	callq	_module_put
	jmp	LBB0_12
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	24(%r12), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	callq	*%rax
LBB0_8:
	movq	%r14, %rdi
	callq	_iminor
	andl	$15, %eax
	movl	%eax, (%r12)
	movq	_shared_resource_owner@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	jne	LBB0_10
## %bb.9:
	movl	12(%r12), %ecx
	movl	16(%r12), %edx
	movl	%edx, 40(%r12)
	movl	%edx, 36(%r12)
	movl	%ecx, 32(%r12)
LBB0_10:
	movq	_SND_DEV_AUDIO@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpl	(%rcx), %eax
	jne	LBB0_12
## %bb.11:
	movl	$8000, %edi                     ## imm = 0x1F40
	callq	_sound_set_speed
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_sound_set_stereo
	movq	_AFMT_MU_LAW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_sound_set_format
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_dmasound,48,3                  ## @dmasound
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_FMODE_READ,4,2                 ## @FMODE_READ
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_shared_resource_owner,8,3      ## @shared_resource_owner
	.comm	_SND_DEV_AUDIO,4,2              ## @SND_DEV_AUDIO
	.comm	_AFMT_MU_LAW,4,2                ## @AFMT_MU_LAW
	.no_dead_strip	_sq_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sq_open
_sq_open:                               ; @sq_open
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x22, _dmasound@GOTPAGE
Lloh1:
	ldr	x22, [x22, _dmasound@GOTPAGEOFF]
	ldr	w0, [x22, #8]
	bl	_try_module_get
	cbz	w0, LBB0_5
; %bb.1:
	mov	x0, x21
	bl	_write_sq_open
	mov	x20, x0
	cbnz	w0, LBB0_4
; %bb.2:
	ldr	w0, [x21]
Lloh2:
	adrp	x8, _FMODE_READ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FMODE_READ@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_7
; %bb.3:
Lloh5:
	adrp	x8, _ENXIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_4:
	ldr	w0, [x22, #8]
	bl	_module_put
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _ENODEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
	ldr	x8, [x22, #24]
	cbz	x8, LBB0_9
; %bb.8:
	blr	x8
LBB0_9:
	mov	x0, x19
	bl	_iminor
	and	w8, w0, #0xf
	str	w8, [x22]
Lloh11:
	adrp	x9, _shared_resource_owner@GOTPAGE
Lloh12:
	ldr	x9, [x9, _shared_resource_owner@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cbnz	x9, LBB0_11
; %bb.10:
	ldp	w10, w9, [x22, #12]
	stp	w9, w9, [x22, #36]
	str	w10, [x22, #32]
LBB0_11:
Lloh14:
	adrp	x9, _SND_DEV_AUDIO@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SND_DEV_AUDIO@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_13
; %bb.12:
	mov	w0, #8000
	bl	_sound_set_speed
	mov	w0, #0
	bl	_sound_set_stereo
Lloh17:
	adrp	x8, _AFMT_MU_LAW@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AFMT_MU_LAW@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_sound_set_format
LBB0_13:
	mov	w20, #0
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_dmasound,48,3                  ; @dmasound
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_FMODE_READ,4,2                 ; @FMODE_READ
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_shared_resource_owner,8,3      ; @shared_resource_owner
	.comm	_SND_DEV_AUDIO,4,2              ; @SND_DEV_AUDIO
	.comm	_AFMT_MU_LAW,4,2                ; @AFMT_MU_LAW
	.no_dead_strip	_sq_open
.subsections_via_symbols
