	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SV_NextDownload_f              ## -- Begin function SV_NextDownload_f
	.p2align	4, 0x90
_SV_NextDownload_f:                     ## @SV_NextDownload_f
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	$1, %edi
	callq	_Cmd_Argv
	movl	%eax, %edi
	callq	_atoi
	cmpl	(%rbx), %eax
	jne	LBB0_6
## %bb.1:
	movq	_svs@GOTPCREL(%rip), %r14
	movslq	(%r14), %rcx
	negq	%rcx
	leaq	(%rcx,%rcx,2), %rcx
	leaq	(%rbx,%rcx,8), %rsi
	leaq	L_.str(%rip), %rdi
	movl	%eax, %edx
	callq	_Com_DPrintf
	movq	8(%rbx), %rsi
	movslq	(%rbx), %rcx
	movq	_MAX_DOWNLOAD_WINDOW@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rcx, %rax
	orq	%rdi, %rax
	shrq	$32, %rax
	je	LBB0_2
## %bb.3:
	movq	%rcx, %rax
	xorl	%edx, %edx
	divq	%rdi
	cmpq	$0, (%rsi,%rdx,8)
	je	LBB0_7
LBB0_5:
	movl	4(%r14), %eax
	movl	%eax, 16(%rbx)
	incl	%ecx
	movl	%ecx, (%rbx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_SV_DropClient                  ## TAILCALL
LBB0_2:
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%edi
                                        ## kill: def $edx killed $edx def $rdx
	cmpq	$0, (%rsi,%rdx,8)
	jne	LBB0_5
LBB0_7:
	movslq	(%r14), %rax
	negq	%rax
	leaq	(%rax,%rax,2), %rax
	leaq	(%rbx,%rax,8), %rsi
	movl	20(%rbx), %edx
	leaq	L_.str.1(%rip), %rdi
	callq	_Com_Printf
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_SV_CloseDownload               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"clientDownload: %d : client acknowledge of block %d\n"

	.comm	_svs,8,2                        ## @svs
	.comm	_MAX_DOWNLOAD_WINDOW,8,3        ## @MAX_DOWNLOAD_WINDOW
L_.str.1:                               ## @.str.1
	.asciz	"clientDownload: %d : file \"%s\" completed\n"

L_.str.2:                               ## @.str.2
	.asciz	"broken download"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_SV_NextDownload_f              ; -- Begin function SV_NextDownload_f
	.p2align	2
_SV_NextDownload_f:                     ; @SV_NextDownload_f
	.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
	mov	w0, #1
	bl	_Cmd_Argv
	bl	_atoi
	ldr	w8, [x19]
	cmp	w0, w8
	b.ne	LBB0_3
; %bb.1:
	mov	x2, x0
Lloh0:
	adrp	x20, _svs@GOTPAGE
Lloh1:
	ldr	x20, [x20, _svs@GOTPAGEOFF]
	ldrsw	x8, [x20]
	mov	w9, #24
	mneg	x8, x8, x9
	add	x1, x19, x8
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Com_DPrintf
	ldr	x9, [x19, #8]
Lloh4:
	adrp	x10, _MAX_DOWNLOAD_WINDOW@GOTPAGE
Lloh5:
	ldr	x10, [x10, _MAX_DOWNLOAD_WINDOW@GOTPAGEOFF]
	ldrsw	x8, [x19]
Lloh6:
	ldr	x10, [x10]
	udiv	x11, x8, x10
	msub	x10, x11, x10, x8
	ldr	x9, [x9, x10, lsl #3]
	cbz	x9, LBB0_4
; %bb.2:
	ldr	w9, [x20, #4]
	str	w9, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_SV_DropClient
LBB0_4:
	ldrsw	x8, [x20]
	mov	w9, #24
	mneg	x8, x8, x9
	add	x1, x19, x8
	ldr	w2, [x19, #20]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Com_Printf
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_SV_CloseDownload
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"clientDownload: %d : client acknowledge of block %d\n"

	.comm	_svs,8,2                        ; @svs
	.comm	_MAX_DOWNLOAD_WINDOW,8,3        ; @MAX_DOWNLOAD_WINDOW
l_.str.1:                               ; @.str.1
	.asciz	"clientDownload: %d : file \"%s\" completed\n"

l_.str.2:                               ; @.str.2
	.asciz	"broken download"

.subsections_via_symbols
