	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tar_close
_tar_close:                             ## @tar_close
	.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	$520, %rsp                      ## imm = 0x208
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorl	%edi, %edi
	testq	%r12, %r12
	setne	%dil
	callq	_Assert
	xorl	%eax, %eax
	callq	_tar_clear_error
	movq	_CLOSE_UNLINK@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jne	LBB0_5
## %bb.1:
	movq	_tar_data@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_tar_set_error
	movl	$-1, %r15d
	jmp	LBB0_24
LBB0_5:
	movq	8(%r12), %rsi
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.6:
	movq	_tar_data@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_10
## %bb.7:
	subq	16(%r12), %rsi
	je	LBB0_11
## %bb.8:
	movq	%r12, %rdi
	callq	_tar_write_padding_data
	testl	%eax, %eax
	jne	LBB0_11
## %bb.9:
	movl	$-1, %r15d
	jmp	LBB0_24
LBB0_3:
	movl	8(%rax), %edi
	movq	(%r12), %rsi
	callq	_ftruncate
	movl	$-1, %r15d
	testq	%rax, %rax
	jne	LBB0_24
	jmp	LBB0_4
LBB0_10:
	movq	%rsi, 16(%r12)
LBB0_11:
	movq	%r12, %rdi
	callq	_tar_get_current_pos
	movl	%eax, %r13d
	leal	511(%r13), %ebx
	andl	$-512, %ebx                     ## imm = 0xFE00
	subl	%eax, %ebx
	je	LBB0_13
## %bb.12:
	leaq	-560(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	%ebx, %edx
	callq	_MemSet
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_tar_write
	movl	$-1, %r15d
	cmpl	%ebx, %eax
	jne	LBB0_24
LBB0_13:
	movl	$496, %edi                      ## imm = 0x1F0
	addq	32(%r12), %rdi
	movl	$12, %esi
	movl	%r13d, %edx
	callq	_print_tar_number
	movq	_CLOSE_NORMAL@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	jne	LBB0_15
## %bb.14:
	movq	24(%r12), %rsi
	movq	32(%r12), %rdi
	movl	$100, %edx
	callq	_strlcpy
LBB0_15:
	movq	32(%r12), %rdi
	leaq	592(%rdi), %rbx
	callq	_tarChecksum
	movq	%rbx, %rdi
	movl	$8, %esi
	movl	%eax, %edx
	callq	_print_tar_number
	movq	_tar_data@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movl	8(%rax), %edi
	movq	(%r12), %rsi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_lseek
	movl	$-1, %r15d
	cmpq	(%r12), %rax
	jne	LBB0_24
## %bb.16:
	movq	(%rbx), %rax
	cmpq	$0, 16(%rax)
	jne	LBB0_19
## %bb.17:
	movq	_errno@GOTPCREL(%rip), %r14
	movq	$0, (%r14)
	movl	8(%rax), %edi
	movq	32(%r12), %rsi
	movl	$512, %edx                      ## imm = 0x200
	callq	_write
	cmpl	$512, %eax                      ## imm = 0x200
	jne	LBB0_22
## %bb.18:
	movq	(%rbx), %rax
LBB0_19:
	movl	8(%rax), %edi
	movq	_SEEK_END@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_lseek
	testq	%rax, %rax
	js	LBB0_24
## %bb.20:
	movq	%r12, %rdi
	callq	_tar_sync
	testq	%rax, %rax
	js	LBB0_21
LBB0_4:
	movq	24(%r12), %rdi
	callq	_pg_free
	movq	%r12, %rdi
	callq	_pg_free
	movq	(%rbx), %rax
	movq	$0, (%rax)
	xorl	%r15d, %r15d
LBB0_24:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_26
## %bb.25:
	movl	%r15d, %eax
	addq	$520, %rsp                      ## imm = 0x208
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	cmpq	$0, (%r14)
	jne	LBB0_24
## %bb.23:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	jmp	LBB0_24
LBB0_26:
	callq	___stack_chk_fail
LBB0_21:
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_CLOSE_UNLINK,8,3               ## @CLOSE_UNLINK
	.comm	_tar_data,8,3                   ## @tar_data
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unlink not supported with compression"

	.comm	_CLOSE_NORMAL,8,3               ## @CLOSE_NORMAL
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_errno,8,3                      ## @errno
	.comm	_ENOSPC,8,3                     ## @ENOSPC
	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_Z_OK,8,3                       ## @Z_OK
	.no_dead_strip	_tar_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tar_close
_tar_close:                             ; @tar_close
	.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
	sub	sp, sp, #528
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	cmp	x0, #0
	cset	w0, ne
	bl	_Assert
	bl	_tar_clear_error
Lloh3:
	adrp	x8, _CLOSE_UNLINK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CLOSE_UNLINK@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ne	LBB0_3
; %bb.1:
Lloh6:
	adrp	x20, _tar_data@GOTPAGE
Lloh7:
	ldr	x20, [x20, _tar_data@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_7
; %bb.2:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_tar_set_error
	b	LBB0_24
LBB0_3:
	ldr	x8, [x19, #8]
Lloh10:
	adrp	x23, _tar_data@GOTPAGE
Lloh11:
	ldr	x23, [x23, _tar_data@GOTPAGEOFF]
	cbz	x8, LBB0_10
; %bb.4:
	ldr	x9, [x23]
	ldr	x9, [x9, #16]
	cbz	x9, LBB0_9
; %bb.5:
	ldr	x9, [x19, #16]
	subs	x1, x8, x9
	b.eq	LBB0_10
; %bb.6:
	mov	x0, x19
	bl	_tar_write_padding_data
	cbnz	w0, LBB0_10
	b	LBB0_24
LBB0_7:
	ldr	w0, [x8, #8]
	ldr	x1, [x19]
	bl	_ftruncate
	cbnz	x0, LBB0_24
; %bb.8:
	ldr	x0, [x19, #24]
	bl	_pg_free
	mov	x0, x19
	bl	_pg_free
	mov	w0, #0
	ldr	x8, [x20]
	b	LBB0_21
LBB0_9:
	str	x8, [x19, #16]
LBB0_10:
	mov	x0, x19
	bl	_tar_get_current_pos
	mov	x21, x0
	add	w8, w0, #511
	and	w8, w8, #0xfffffe00
	subs	w22, w8, w0
	b.eq	LBB0_12
; %bb.11:
	add	x0, sp, #8
	mov	w1, #0
	mov	x2, x22
	bl	_MemSet
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, x22
	bl	_tar_write
	cmp	w0, w22
	b.ne	LBB0_24
LBB0_12:
	ldr	x8, [x19, #32]
	add	x0, x8, #496
	mov	w1, #12
	mov	x2, x21
	bl	_print_tar_number
Lloh12:
	adrp	x8, _CLOSE_NORMAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CLOSE_NORMAL@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x8, x20
	b.ne	LBB0_14
; %bb.13:
	ldp	x1, x0, [x19, #24]
	mov	w2, #100
	bl	_strlcpy
LBB0_14:
	ldr	x0, [x19, #32]
	add	x20, x0, #592
	bl	_tarChecksum
	mov	x2, x0
	mov	x0, x20
	mov	w1, #8
	bl	_print_tar_number
	ldr	x8, [x23]
	ldr	w0, [x8, #8]
	ldr	x1, [x19]
Lloh15:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	bl	_lseek
	ldr	x8, [x19]
	cmp	x0, x8
	b.ne	LBB0_24
; %bb.15:
	ldr	x8, [x23]
	ldr	x9, [x8, #16]
	cbnz	x9, LBB0_18
; %bb.16:
Lloh18:
	adrp	x20, _errno@GOTPAGE
Lloh19:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	str	xzr, [x20]
	ldr	w0, [x8, #8]
	ldr	x1, [x19, #32]
	mov	w2, #512
	bl	_write
	cmp	w0, #512
	b.ne	LBB0_22
; %bb.17:
	ldr	x8, [x23]
LBB0_18:
	ldr	w0, [x8, #8]
Lloh20:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x1, #0
	bl	_lseek
	tbnz	x0, #63, LBB0_24
; %bb.19:
	mov	x0, x19
	bl	_tar_sync
	tbnz	x0, #63, LBB0_28
; %bb.20:
	ldr	x0, [x19, #24]
	bl	_pg_free
	mov	x0, x19
	bl	_pg_free
	mov	w0, #0
	ldr	x8, [x23]
LBB0_21:
	str	xzr, [x8]
	b	LBB0_25
LBB0_22:
	ldr	x8, [x20]
	cbnz	x8, LBB0_24
; %bb.23:
Lloh23:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	str	x8, [x20]
LBB0_24:
	mov	w0, #-1
LBB0_25:
	ldur	x8, [x29, #-56]
Lloh26:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh27:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.26:
	add	sp, sp, #528
	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_27:
	bl	___stack_chk_fail
LBB0_28:
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_CLOSE_UNLINK,8,3               ; @CLOSE_UNLINK
	.comm	_tar_data,8,3                   ; @tar_data
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unlink not supported with compression"

	.comm	_CLOSE_NORMAL,8,3               ; @CLOSE_NORMAL
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_errno,8,3                      ; @errno
	.comm	_ENOSPC,8,3                     ; @ENOSPC
	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_Z_OK,8,3                       ; @Z_OK
	.no_dead_strip	_tar_close
.subsections_via_symbols
