	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WriteSound                     ## -- Begin function WriteSound
	.p2align	4, 0x90
_WriteSound:                            ## @WriteSound
	.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
	testl	%esi, %esi
	je	LBB0_8
## %bb.1:
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_BufferIn@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movq	_BufferSize@GOTPCREL(%rip), %r12
	movq	(%r12), %rsi
	movq	_BufferWrite@GOTPCREL(%rip), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %edi
	callq	_SDL_Delay
	movq	(%rbx), %rcx
	movq	(%r12), %rsi
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%rsi, %rcx
	je	LBB0_2
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %edx
	movq	_Buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	(%r13), %rax
	movl	%edx, (%rdi,%rax,4)
	decl	%r14d
	incq	%rax
	movq	%rax, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_7
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%esi
                                        ## kill: def $edx killed $edx def $rdx
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rdx, (%r13)
	incq	%rcx
	movq	%rcx, (%rbx)
	addq	$4, %r15
	testl	%r14d, %r14d
	jne	LBB0_3
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BufferIn,8,3                   ## @BufferIn
	.comm	_BufferSize,8,3                 ## @BufferSize
	.comm	_Buffer,8,3                     ## @Buffer
	.comm	_BufferWrite,8,3                ## @BufferWrite
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WriteSound                     ; -- Begin function WriteSound
	.p2align	2
_WriteSound:                            ; @WriteSound
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cbz	w1, LBB0_5
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x21, _BufferIn@GOTPAGE
Lloh1:
	ldr	x21, [x21, _BufferIn@GOTPAGEOFF]
Lloh2:
	adrp	x22, _BufferSize@GOTPAGE
Lloh3:
	ldr	x22, [x22, _BufferSize@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x9, [x22]
Lloh4:
	adrp	x23, _Buffer@GOTPAGE
Lloh5:
	ldr	x23, [x23, _Buffer@GOTPAGEOFF]
Lloh6:
	adrp	x24, _BufferWrite@GOTPAGE
Lloh7:
	ldr	x24, [x24, _BufferWrite@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #1
	bl	_SDL_Delay
	ldr	x8, [x21]
	ldr	x9, [x22]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w10, [x20], #4
	ldr	x11, [x23]
	ldr	x12, [x24]
	str	w10, [x11, x12, lsl #2]
	add	x10, x12, #1
	udiv	x11, x10, x9
	msub	x10, x11, x9, x10
	str	x10, [x24]
	add	x8, x8, #1
	str	x8, [x21]
	subs	w19, w19, #1
	b.ne	LBB0_3
LBB0_5:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_BufferIn,8,3                   ; @BufferIn
	.comm	_BufferSize,8,3                 ; @BufferSize
	.comm	_Buffer,8,3                     ; @Buffer
	.comm	_BufferWrite,8,3                ; @BufferWrite
.subsections_via_symbols
