	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sndout_oss_start               ## -- Begin function sndout_oss_start
	.p2align	4, 0x90
_sndout_oss_start:                      ## @sndout_oss_start
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	movl	%edi, -36(%rbp)
	movl	%esi, -32(%rbp)
	movq	_sounddev@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	js	LBB0_3
## %bb.1:
	cmpl	%r15d, _sndout_oss_start.s_oldrate(%rip)
	jne	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	cmpl	%esi, _sndout_oss_start.s_oldstereo(%rip)
	je	LBB0_17
LBB0_3:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_sndout_oss_stop
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_open
	movl	%eax, (%r14)
	cmpl	$-1, %eax
	je	LBB0_4
LBB0_6:
	movq	_sndout_oss_frag_frames@GOTPCREL(%rip), %rcx
	imull	(%rcx), %r15d
	leal	49(%r15), %ecx
	cmpl	$99, %ecx
	jb	LBB0_9
## %bb.7:
	movslq	%r15d, %rcx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$36, %rcx
	addl	%edx, %ecx
	shll	$2, %ecx
	xorl	%ebx, %ebx
	movl	%ecx, %edx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	sarl	%edx
	incl	%ebx
	cmpl	$1, %ecx
	movl	%edx, %ecx
	ja	LBB0_8
LBB0_9:
	movq	_FRAG_COUNT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	shll	$16, %ecx
	orl	%ebx, %ecx
	movl	%ecx, -28(%rbp)
	movq	_SNDCTL_DSP_SETFRAGMENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	-28(%rbp), %rdx
	movl	%eax, %edi
	callq	_ioctl
	testl	%eax, %eax
	js	LBB0_10
LBB0_11:
	movl	$16, -40(%rbp)
	movl	(%r14), %edi
	movq	_SNDCTL_DSP_STEREO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	callq	_ioctl
	testl	%eax, %eax
	jne	LBB0_14
## %bb.12:
	movl	(%r14), %edi
	movq	_SNDCTL_DSP_SETFMT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	callq	_ioctl
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movl	(%r14), %edi
	movq	_SNDCTL_DSP_SPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	callq	_ioctl
LBB0_14:
	testl	%eax, %eax
	js	LBB0_15
LBB0_16:
	movl	-36(%rbp), %esi
	movl	-40(%rbp), %edx
	cmpl	$0, -32(%rbp)
	leaq	L_.str.8(%rip), %rcx
	leaq	L_.str.7(%rip), %rax
	cmoveq	%rcx, %rax
	movl	-28(%rbp), %ecx
	movl	%ecx, %r8d
	sarl	$16, %r8d
	movl	$1, %r9d
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r9d
	leaq	L_.str.6(%rip), %rdi
	movq	%rax, %rcx
	callq	_printf
	movl	-36(%rbp), %eax
	movl	%eax, _sndout_oss_start.s_oldrate(%rip)
	movl	-32(%rbp), %eax
	movl	%eax, _sndout_oss_start.s_oldstereo(%rip)
	movq	_can_write_safe@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	xorl	%eax, %eax
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	-28(%rbp), %rdi
	callq	_sndout_oss_start.cold.1
	movl	%eax, %ecx
	movl	$-1, %eax
	testb	$1, %cl
	je	LBB0_17
## %bb.5:
	movl	-28(%rbp), %eax
	jmp	LBB0_6
LBB0_10:
	leaq	L_.str.4(%rip), %rdi
	callq	_perror
	jmp	LBB0_11
LBB0_15:
	leaq	L_.str.5(%rip), %rdi
	callq	_perror
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function sndout_oss_start.cold.1
_sndout_oss_start.cold.1:               ## @sndout_oss_start.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	leaq	L_.str.1(%rip), %rdi
	callq	_perror
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_open
	movl	%eax, (%rbx)
	movq	_sounddev@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	cmpl	$-1, %eax
	je	LBB1_1
## %bb.2:
	movb	$1, %al
LBB1_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB1_1:
	leaq	L_.str.3(%rip), %rdi
	callq	_perror
	xorl	%eax, %eax
	jmp	LBB1_3
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_sndout_oss_start.s_oldrate,4,2 ## @sndout_oss_start.s_oldrate
.zerofill __DATA,__bss,_sndout_oss_start.s_oldstereo,4,2 ## @sndout_oss_start.s_oldstereo
	.comm	_sounddev,4,2                   ## @sounddev
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/dsp"

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
L_.str.1:                               ## @.str.1
	.asciz	"open(\"/dev/dsp\")"

L_.str.2:                               ## @.str.2
	.asciz	"/dev/dsp1"

L_.str.3:                               ## @.str.3
	.asciz	"open(\"/dev/dsp1\")"

	.comm	_sndout_oss_frag_frames,4,2     ## @sndout_oss_frag_frames
	.comm	_FRAG_COUNT,4,2                 ## @FRAG_COUNT
	.comm	_SNDCTL_DSP_SETFRAGMENT,4,2     ## @SNDCTL_DSP_SETFRAGMENT
L_.str.4:                               ## @.str.4
	.asciz	"SNDCTL_DSP_SETFRAGMENT failed"

	.comm	_SNDCTL_DSP_STEREO,4,2          ## @SNDCTL_DSP_STEREO
	.comm	_SNDCTL_DSP_SETFMT,4,2          ## @SNDCTL_DSP_SETFMT
	.comm	_SNDCTL_DSP_SPEED,4,2           ## @SNDCTL_DSP_SPEED
L_.str.5:                               ## @.str.5
	.asciz	"failed to set audio format"

L_.str.6:                               ## @.str.6
	.asciz	"sndout_oss_start: %d/%dbit/%s, %d buffers of %i bytes\n"

L_.str.7:                               ## @.str.7
	.asciz	"stereo"

L_.str.8:                               ## @.str.8
	.asciz	"mono"

	.comm	_can_write_safe,8,3             ## @can_write_safe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sndout_oss_start               ; -- Begin function sndout_oss_start
	.p2align	2
_sndout_oss_start:                      ; @sndout_oss_start
	.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	x19, x0
	stp	w1, w0, [sp, #4]
Lloh0:
	adrp	x22, _sounddev@GOTPAGE
Lloh1:
	ldr	x22, [x22, _sounddev@GOTPAGEOFF]
	ldr	w8, [x22]
	adrp	x21, _sndout_oss_start.s_oldrate@PAGE
	adrp	x20, _sndout_oss_start.s_oldstereo@PAGE
	tbnz	w8, #31, LBB0_3
; %bb.1:
	ldr	w8, [x21, _sndout_oss_start.s_oldrate@PAGEOFF]
	ldr	w9, [x20, _sndout_oss_start.s_oldstereo@PAGEOFF]
	cmp	w8, w19
	ccmp	w9, w1, #0, eq
	b.ne	LBB0_3
; %bb.2:
	mov	w0, #0
	b	LBB0_14
LBB0_3:
	bl	_sndout_oss_stop
Lloh2:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_open
	str	w0, [x22]
	cmn	w0, #1
	b.eq	LBB0_15
LBB0_4:
Lloh7:
	adrp	x8, _sndout_oss_frag_frames@GOTPAGE
Lloh8:
	ldr	x8, [x8, _sndout_oss_frag_frames@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	mul	w9, w8, w19
	add	w8, w9, #49
	cmp	w8, #99
	b.hs	LBB0_6
; %bb.5:
	mov	w8, #0
	b	LBB0_8
LBB0_6:
	mov	w8, #0
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	smull	x9, w9, w10
	lsr	x10, x9, #63
	asr	x9, x9, #36
	add	w9, w9, w10
	lsl	w9, w9, #2
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	asr	w10, w9, #1
	add	w8, w8, #1
	cmp	w9, #1
	mov	x9, x10
	b.hi	LBB0_7
LBB0_8:
Lloh10:
	adrp	x9, _FRAG_COUNT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _FRAG_COUNT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	orr	w8, w8, w9, lsl #16
	str	w8, [sp, #12]
Lloh13:
	adrp	x8, _SNDCTL_DSP_SETFRAGMENT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SNDCTL_DSP_SETFRAGMENT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_ioctl
	tbnz	w0, #31, LBB0_17
LBB0_9:
	mov	w8, #16
	str	w8, [sp]
	ldr	w0, [x22]
Lloh16:
	adrp	x8, _SNDCTL_DSP_STEREO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _SNDCTL_DSP_STEREO@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	add	x2, sp, #4
	bl	_ioctl
	cbnz	w0, LBB0_12
; %bb.10:
	ldr	w0, [x22]
Lloh19:
	adrp	x8, _SNDCTL_DSP_SETFMT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SNDCTL_DSP_SETFMT@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_ioctl
	cbnz	w0, LBB0_12
; %bb.11:
	ldr	w0, [x22]
Lloh22:
	adrp	x8, _SNDCTL_DSP_SPEED@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SNDCTL_DSP_SPEED@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_ioctl
LBB0_12:
	tbnz	w0, #31, LBB0_18
LBB0_13:
	ldp	w8, w1, [sp, #4]
	ldr	w2, [sp]
Lloh25:
	adrp	x9, l_.str.7@PAGE
Lloh26:
	add	x9, x9, l_.str.7@PAGEOFF
Lloh27:
	adrp	x10, l_.str.8@PAGE
Lloh28:
	add	x10, x10, l_.str.8@PAGEOFF
	cmp	w8, #0
	csel	x3, x10, x9, eq
	ldr	w8, [sp, #12]
	asr	w4, w8, #16
	mov	w9, #1
	lsl	w5, w9, w8
Lloh29:
	adrp	x0, l_.str.6@PAGE
Lloh30:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_printf
	mov	w0, #0
	ldr	w8, [sp, #8]
	str	w8, [x21, _sndout_oss_start.s_oldrate@PAGEOFF]
	ldr	w8, [sp, #4]
	str	w8, [x20, _sndout_oss_start.s_oldstereo@PAGEOFF]
Lloh31:
	adrp	x8, _can_write_safe@GOTPAGE
Lloh32:
	ldr	x8, [x8, _can_write_safe@GOTPAGEOFF]
Lloh33:
	str	xzr, [x8]
LBB0_14:
	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
LBB0_15:
	add	x0, sp, #12
	bl	_sndout_oss_start.cold.1
	tbz	w0, #0, LBB0_19
; %bb.16:
	ldr	w0, [sp, #12]
	b	LBB0_4
LBB0_17:
Lloh34:
	adrp	x0, l_.str.4@PAGE
Lloh35:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_perror
	b	LBB0_9
LBB0_18:
Lloh36:
	adrp	x0, l_.str.5@PAGE
Lloh37:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_perror
	b	LBB0_13
LBB0_19:
	mov	w0, #-1
	b	LBB0_14
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotStr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function sndout_oss_start.cold.1
_sndout_oss_start.cold.1:               ; @sndout_oss_start.cold.1
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh38:
	adrp	x0, l_.str.1@PAGE
Lloh39:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perror
Lloh40:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh41:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
Lloh43:
	adrp	x0, l_.str.2@PAGE
Lloh44:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_open
	str	w0, [x19]
Lloh45:
	adrp	x8, _sounddev@GOTPAGE
Lloh46:
	ldr	x8, [x8, _sounddev@GOTPAGEOFF]
Lloh47:
	str	w0, [x8]
	cmn	w0, #1
	b.eq	LBB1_3
; %bb.1:
	mov	w0, #1
LBB1_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB1_3:
Lloh48:
	adrp	x0, l_.str.3@PAGE
Lloh49:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_perror
	mov	w0, #0
	b	LBB1_2
	.loh AdrpLdrGotStr	Lloh45, Lloh46, Lloh47
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_sndout_oss_start.s_oldrate,4,2 ; @sndout_oss_start.s_oldrate
.zerofill __DATA,__bss,_sndout_oss_start.s_oldstereo,4,2 ; @sndout_oss_start.s_oldstereo
	.comm	_sounddev,4,2                   ; @sounddev
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/dsp"

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
l_.str.1:                               ; @.str.1
	.asciz	"open(\"/dev/dsp\")"

l_.str.2:                               ; @.str.2
	.asciz	"/dev/dsp1"

l_.str.3:                               ; @.str.3
	.asciz	"open(\"/dev/dsp1\")"

	.comm	_sndout_oss_frag_frames,4,2     ; @sndout_oss_frag_frames
	.comm	_FRAG_COUNT,4,2                 ; @FRAG_COUNT
	.comm	_SNDCTL_DSP_SETFRAGMENT,4,2     ; @SNDCTL_DSP_SETFRAGMENT
l_.str.4:                               ; @.str.4
	.asciz	"SNDCTL_DSP_SETFRAGMENT failed"

	.comm	_SNDCTL_DSP_STEREO,4,2          ; @SNDCTL_DSP_STEREO
	.comm	_SNDCTL_DSP_SETFMT,4,2          ; @SNDCTL_DSP_SETFMT
	.comm	_SNDCTL_DSP_SPEED,4,2           ; @SNDCTL_DSP_SPEED
l_.str.5:                               ; @.str.5
	.asciz	"failed to set audio format"

l_.str.6:                               ; @.str.6
	.asciz	"sndout_oss_start: %d/%dbit/%s, %d buffers of %i bytes\n"

l_.str.7:                               ; @.str.7
	.asciz	"stereo"

l_.str.8:                               ; @.str.8
	.asciz	"mono"

	.comm	_can_write_safe,8,3             ; @can_write_safe
.subsections_via_symbols
