	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function al_write
_al_write:                              ## @al_write
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r12
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_al_fill_internal_buf
	movq	%rax, %r13
	addq	%rax, %r15
	movq	(%rbx), %rax
	movq	_BUFSIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	leaq	-44(%rbp), %rsi
	callq	_al_get_buffer
	testl	%eax, %eax
	je	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %edi
	movq	_AL_FORMAT_STEREO16@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%rbx), %r8d
	movl	16(%rbx), %edx
	movq	_BUFSIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	callq	_alBufferData
	movq	$0, (%rbx)
	movl	8(%rbx), %edi
	movl	$1, %esi
	leaq	-44(%rbp), %rdx
	callq	_alSourceQueueBuffers
	xorl	%eax, %eax
	callq	_alGetError
	movq	_AL_NO_ERROR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%rbx), %edi
	movq	_AL_SOURCE_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	callq	_alGetSourcei
	movq	-56(%rbp), %rax
	movq	_AL_PLAYING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%rbx), %edi
	callq	_alSourcePlay
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_alGetError
	movq	_AL_NO_ERROR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%r14,%r13,4), %r14
	subq	%r13, %r12
	jne	LBB0_3
	jmp	LBB0_11
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_11
LBB0_9:
	movl	$-1, %r15d
LBB0_11:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFSIZE,8,3                    ## @BUFSIZE
	.comm	_AL_FORMAT_STEREO16,4,2         ## @AL_FORMAT_STEREO16
	.comm	_AL_NO_ERROR,8,3                ## @AL_NO_ERROR
	.comm	_AL_SOURCE_STATE,4,2            ## @AL_SOURCE_STATE
	.comm	_AL_PLAYING,8,3                 ## @AL_PLAYING
	.no_dead_strip	_al_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function al_write
_al_write:                              ; @al_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	cbz	x2, LBB0_9
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	mov	x19, #0
Lloh0:
	adrp	x24, _BUFSIZE@GOTPAGE
Lloh1:
	ldr	x24, [x24, _BUFSIZE@GOTPAGEOFF]
Lloh2:
	adrp	x25, _AL_FORMAT_STEREO16@GOTPAGE
Lloh3:
	ldr	x25, [x25, _AL_FORMAT_STEREO16@GOTPAGEOFF]
Lloh4:
	adrp	x26, _AL_NO_ERROR@GOTPAGE
Lloh5:
	ldr	x26, [x26, _AL_NO_ERROR@GOTPAGEOFF]
Lloh6:
	adrp	x27, _AL_SOURCE_STATE@GOTPAGE
Lloh7:
	ldr	x27, [x27, _AL_SOURCE_STATE@GOTPAGEOFF]
Lloh8:
	adrp	x28, _AL_PLAYING@GOTPAGE
Lloh9:
	ldr	x28, [x28, _AL_PLAYING@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_al_fill_internal_buf
	add	x19, x0, x19
	ldr	x8, [x22]
	ldr	x9, [x24]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x23, x0
	add	x1, sp, #4
	mov	x0, x22
	bl	_al_get_buffer
	cbz	w0, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [sp, #4]
	ldr	w1, [x25]
	ldr	x3, [x24]
	ldp	w4, w2, [x22, #12]
	bl	_alBufferData
	str	xzr, [x22]
	ldr	w0, [x22, #8]
	add	x2, sp, #4
	mov	w1, #1
	bl	_alSourceQueueBuffers
	bl	_alGetError
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x22, #8]
	ldr	w1, [x27]
	add	x2, sp, #8
	bl	_alGetSourcei
	ldr	x8, [sp, #8]
	ldr	x9, [x28]
	cmp	x8, x9
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x22, #8]
	bl	_alSourcePlay
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	bl	_alGetError
	ldr	x8, [x26]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, x23, lsl #2
	sub	x20, x20, x23
	cbnz	x20, LBB0_2
	b	LBB0_11
LBB0_9:
	mov	x19, #0
	b	LBB0_11
LBB0_10:
	mov	w19, #-1
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFSIZE,8,3                    ; @BUFSIZE
	.comm	_AL_FORMAT_STEREO16,4,2         ; @AL_FORMAT_STEREO16
	.comm	_AL_NO_ERROR,8,3                ; @AL_NO_ERROR
	.comm	_AL_SOURCE_STATE,4,2            ; @AL_SOURCE_STATE
	.comm	_AL_PLAYING,8,3                 ; @AL_PLAYING
	.no_dead_strip	_al_write
.subsections_via_symbols
