	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rt_setvol
_rt_setvol:                             ## @rt_setvol
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r12
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r12), %r13d
	cmpl	%r15d, %r13d
	jne	LBB0_3
## %bb.1:
	cmpq	$0, 8(%r12)
	je	LBB0_11
## %bb.2:
	movq	$0, 8(%r12)
	movl	16(%r12), %esi
	movl	$216, %edi
	callq	_outb
	jmp	LBB0_11
LBB0_3:
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.5:
	movq	$0, 8(%r12)
	cmpl	%r15d, %r13d
	jge	LBB0_8
## %bb.6:
	movl	%r15d, %ebx
	subl	%r13d, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_rt_incvol
	decl	%ebx
	jne	LBB0_7
	jmp	LBB0_10
LBB0_4:
	movl	16(%r12), %esi
	movl	$72, %edi
	callq	_outb
	movl	$2000000, %edi                  ## imm = 0x1E8480
	callq	_sleep_delay
	movl	16(%r12), %esi
	movl	$208, %edi
	callq	_outb
	movl	$0, (%r12)
	jmp	LBB0_11
LBB0_8:
	jle	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_rt_decvol
	decl	%r13d
	cmpl	%r15d, %r13d
	jg	LBB0_9
LBB0_10:
	movl	%r15d, (%r12)
LBB0_11:
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_rt_setvol
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rt_setvol
_rt_setvol:                             ; @rt_setvol
	.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	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	w22, [x20]
	cmp	w22, w21
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_11
; %bb.2:
	str	xzr, [x20, #8]
	ldr	w1, [x20, #16]
	mov	w0, #216
	bl	_outb
	b	LBB0_11
LBB0_3:
	cbz	w21, LBB0_7
; %bb.4:
	str	xzr, [x20, #8]
	cmp	w22, w21
	b.ge	LBB0_8
; %bb.5:
	sub	w22, w21, w22
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_rt_incvol
	subs	w22, w22, #1
	b.ne	LBB0_6
	b	LBB0_10
LBB0_7:
	ldr	w1, [x20, #16]
	mov	w0, #72
	bl	_outb
	mov	w0, #33920
	movk	w0, #30, lsl #16
	bl	_sleep_delay
	ldr	w1, [x20, #16]
	mov	w0, #208
	bl	_outb
	str	wzr, [x20]
	b	LBB0_11
LBB0_8:
	b.le	LBB0_10
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_rt_decvol
	sub	w22, w22, #1
	cmp	w22, w21
	b.gt	LBB0_9
LBB0_10:
	str	w21, [x20]
LBB0_11:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_rt_setvol
.subsections_via_symbols
