	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_alloc                          ## -- Begin function alloc
	.p2align	4, 0x90
_alloc:                                 ## @alloc
	.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, %r12d
	movl	%edi, %r15d
	movq	_part_ofs@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	_sblock@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_cgtod
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_fsbtodb
	addq	%rax, %rbx
	movl	36(%r14), %ecx
	movq	_disk@GOTPCREL(%rip), %rdi
	movq	_acg@GOTPCREL(%rip), %r13
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_bread
	movq	(%r13), %rax
	movq	_CG_MAGIC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.1:
	cmpq	$0, 24(%r13)
	je	LBB0_19
## %bb.2:
	cmpl	$0, 8(%r13)
	jle	LBB0_6
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_cg_blksfree
	movl	%eax, %esi
	movl	%ebx, %eax
	cltd
	idivl	(%r14)
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_isblock
	testq	%rax, %rax
	jne	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	addl	(%r14), %ebx
	cmpl	8(%r13), %ebx
	jl	LBB0_4
LBB0_6:
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	$40, %edi
	callq	_exit
LBB0_7:
	movl	%r15d, %r13d
	movl	%r12d, %r15d
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_fragstoblks
	movl	%eax, %r12d
	movq	_acg@GOTPCREL(%rip), %rdi
	callq	_cg_blksfree
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	%r12d, %edx
	callq	_clrblock
	cmpq	$0, 8(%r14)
	jle	LBB0_9
## %bb.8:
	movq	_acg@GOTPCREL(%rip), %rdi
	callq	_cg_clustersfree
	movl	%eax, %edi
	movl	%r12d, %esi
	callq	_clrbit
LBB0_9:
	movq	_acg@GOTPCREL(%rip), %rdx
	decq	24(%rdx)
	decl	28(%r14)
	movq	_fscs@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	decl	8(%rax)
	movq	_IFDIR@GOTPCREL(%rip), %rcx
	testl	%r15d, (%rcx)
	je	LBB0_11
## %bb.10:
	incl	36(%rdx)
	incl	24(%r14)
	incl	4(%rax)
LBB0_11:
	cmpl	%r13d, 16(%r14)
	je	LBB0_15
## %bb.12:
	movl	32(%r14), %esi
	movl	%r13d, %edi
	movq	%rdx, %r13
	callq	_howmany
	movl	%eax, %r15d
	movslq	(%r14), %rax
	movslq	%r15d, %rcx
	subq	%rcx, %rax
	movq	(%r12), %rcx
	addl	%eax, (%rcx)
	addl	%eax, 20(%r14)
	addl	%eax, 32(%r13)
	movq	16(%r13), %rcx
	incl	(%rcx,%rax,4)
	cmpl	(%r14), %r15d
	jge	LBB0_15
## %bb.13:
	movq	_acg@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_cg_blksfree
	leal	(%rbx,%r15), %esi
	movl	%eax, %edi
	callq	_setbit
	incl	%r15d
	cmpl	(%r14), %r15d
	jl	LBB0_14
LBB0_15:
	movq	_disk@GOTPCREL(%rip), %r14
	movq	_acg@GOTPCREL(%rip), %rsi
	movq	%r14, %rdi
	callq	_cgput
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movl	(%r14), %edx
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	leaq	L_str.5(%rip), %rdi
	callq	_puts
	movl	$38, %edi
	callq	_exit
LBB0_19:
	leaq	L_str.4(%rip), %rdi
	callq	_puts
	movl	$39, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_disk,4,2                       ## @disk
	.comm	_part_ofs,8,3                   ## @part_ofs
	.comm	_sblock,40,3                    ## @sblock
	.comm	_acg,40,3                       ## @acg
	.comm	_CG_MAGIC,8,3                   ## @CG_MAGIC
	.comm	_fscs,8,3                       ## @fscs
	.comm	_IFDIR,4,2                      ## @IFDIR
	.section	__TEXT,__cstring,cstring_literals
L_.str.3:                               ## @.str.3
	.asciz	"alloc: cgput: %s"

L_str:                                  ## @str
	.asciz	"internal error: can't find block in cyl 0"

L_str.4:                                ## @str.4
	.asciz	"first cylinder group ran out of space"

L_str.5:                                ## @str.5
	.asciz	"cg 0: bad magic number"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_alloc                          ; -- Begin function alloc
	.p2align	2
_alloc:                                 ; @alloc
	.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
	mov	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _part_ofs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _part_ofs@GOTPAGEOFF]
Lloh2:
	ldr	x20, [x8]
Lloh3:
	adrp	x19, _sblock@GOTPAGE
Lloh4:
	ldr	x19, [x19, _sblock@GOTPAGEOFF]
	mov	x0, x19
	mov	w1, #0
	bl	_cgtod
	mov	x1, x0
	mov	x0, x19
	bl	_fsbtodb
	add	x1, x0, x20
	ldr	w3, [x19, #36]
Lloh5:
	adrp	x0, _disk@GOTPAGE
Lloh6:
	ldr	x0, [x0, _disk@GOTPAGEOFF]
Lloh7:
	adrp	x23, _acg@GOTPAGE
Lloh8:
	ldr	x23, [x23, _acg@GOTPAGEOFF]
	mov	x2, x23
	bl	_bread
	ldr	x8, [x23]
Lloh9:
	adrp	x9, _CG_MAGIC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CG_MAGIC@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.1:
	ldr	x8, [x23, #24]
	cbz	x8, LBB0_19
; %bb.2:
	ldr	w8, [x23, #8]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.3:
	mov	w20, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_cg_blksfree
	mov	x1, x0
	ldr	w8, [x19]
	sdiv	w2, w20, w8
	mov	x0, x19
	bl	_isblock
	cbnz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19]
	ldr	w9, [x23, #8]
	add	w20, w8, w20
	cmp	w20, w9
	b.lt	LBB0_4
LBB0_6:
Lloh12:
	adrp	x0, l_str@PAGE
Lloh13:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	mov	w0, #40
	bl	_exit
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	bl	_fragstoblks
	mov	x24, x0
Lloh14:
	adrp	x23, _acg@GOTPAGE
Lloh15:
	ldr	x23, [x23, _acg@GOTPAGEOFF]
	mov	x0, x23
	bl	_cg_blksfree
	mov	x1, x0
	mov	x0, x19
	mov	x2, x24
	bl	_clrblock
	ldr	x8, [x19, #8]
	cmp	x8, #1
	b.lt	LBB0_9
; %bb.8:
Lloh16:
	adrp	x0, _acg@GOTPAGE
Lloh17:
	ldr	x0, [x0, _acg@GOTPAGEOFF]
	bl	_cg_clustersfree
	mov	x1, x24
	bl	_clrbit
LBB0_9:
	ldr	x8, [x23, #24]
	sub	x8, x8, #1
	str	x8, [x23, #24]
	ldr	w8, [x19, #28]
	sub	w8, w8, #1
	str	w8, [x19, #28]
Lloh18:
	adrp	x24, _fscs@GOTPAGE
Lloh19:
	ldr	x24, [x24, _fscs@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	w9, [x8, #8]
	sub	w9, w9, #1
	str	w9, [x8, #8]
Lloh20:
	adrp	x9, _IFDIR@GOTPAGE
Lloh21:
	ldr	x9, [x9, _IFDIR@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w22
	b.eq	LBB0_11
; %bb.10:
	ldr	w9, [x23, #36]
	add	w9, w9, #1
	str	w9, [x23, #36]
	ldr	w9, [x19, #24]
	add	w9, w9, #1
	str	w9, [x19, #24]
	ldr	w9, [x8, #4]
	add	w9, w9, #1
	str	w9, [x8, #4]
LBB0_11:
	ldr	w8, [x19, #16]
	cmp	w8, w21
	b.eq	LBB0_15
; %bb.12:
	ldr	w1, [x19, #32]
	mov	x0, x21
	bl	_howmany
	ldr	w8, [x19]
	ldr	x9, [x24]
	ldr	w10, [x9]
	sub	w8, w8, w0
	add	w10, w10, w8
	str	w10, [x9]
	ldr	w9, [x19, #20]
	add	w9, w9, w8
	str	w9, [x19, #20]
	ldr	w9, [x23, #32]
	add	w9, w9, w8
	str	w9, [x23, #32]
	ldr	x9, [x23, #16]
	sbfiz	x8, x8, #2, #32
	ldr	w10, [x9, x8]
	add	w10, w10, #1
	str	w10, [x9, x8]
	ldr	w8, [x19]
	cmp	w0, w8
	b.ge	LBB0_15
; %bb.13:
	mov	x21, x0
Lloh23:
	adrp	x22, _acg@GOTPAGE
Lloh24:
	ldr	x22, [x22, _acg@GOTPAGEOFF]
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_cg_blksfree
	add	w1, w20, w21
	bl	_setbit
	add	w21, w21, #1
	ldr	w8, [x19]
	cmp	w21, w8
	b.lt	LBB0_14
LBB0_15:
Lloh25:
	adrp	x19, _disk@GOTPAGE
Lloh26:
	ldr	x19, [x19, _disk@GOTPAGEOFF]
Lloh27:
	adrp	x1, _acg@GOTPAGE
Lloh28:
	ldr	x1, [x1, _acg@GOTPAGEOFF]
	mov	x0, x19
	bl	_cgput
	cbz	x0, LBB0_17
; %bb.16:
	ldr	w2, [x19]
Lloh29:
	adrp	x1, l_.str.3@PAGE
Lloh30:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_17:
	mov	x0, x20
	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
LBB0_18:
Lloh31:
	adrp	x0, l_str.5@PAGE
Lloh32:
	add	x0, x0, l_str.5@PAGEOFF
	bl	_puts
	mov	w0, #38
	bl	_exit
LBB0_19:
Lloh33:
	adrp	x0, l_str.4@PAGE
Lloh34:
	add	x0, x0, l_str.4@PAGEOFF
	bl	_puts
	mov	w0, #39
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_disk,4,2                       ; @disk
	.comm	_part_ofs,8,3                   ; @part_ofs
	.comm	_sblock,40,3                    ; @sblock
	.comm	_acg,40,3                       ; @acg
	.comm	_CG_MAGIC,8,3                   ; @CG_MAGIC
	.comm	_fscs,8,3                       ; @fscs
	.comm	_IFDIR,4,2                      ; @IFDIR
	.section	__TEXT,__cstring,cstring_literals
l_.str.3:                               ; @.str.3
	.asciz	"alloc: cgput: %s"

l_str:                                  ; @str
	.asciz	"internal error: can't find block in cyl 0"

l_str.4:                                ; @str.4
	.asciz	"first cylinder group ran out of space"

l_str.5:                                ; @str.5
	.asciz	"cg 0: bad magic number"

.subsections_via_symbols
