	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___archive_write_program_close  ## -- Begin function __archive_write_program_close
	.p2align	4, 0x90
___archive_write_program_close:         ## @__archive_write_program_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rsi)
	je	LBB0_21
## %bb.1:
	movq	%rsi, %rbx
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	8(%rsi), %edi
	callq	_close
	movl	$-1, 8(%rbx)
	movl	12(%rbx), %edi
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	callq	_fcntl
	movq	_errno@GOTPCREL(%rip), %r13
	movq	_EINTR@GOTPCREL(%rip), %r14
	movq	_ARCHIVE_OK@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	12(%rbx), %edi
	movq	24(%rbx), %rax
	movq	32(%rbx), %rsi
	addq	%rax, %rsi
	movq	40(%rbx), %rdx
	subq	%rax, %rdx
	callq	_read
	movq	(%r13), %rsi
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	(%r14), %rsi
	je	LBB0_2
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	testl	%eax, %eax
	je	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-1, %eax
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_EPIPE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rsi
	je	LBB0_11
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movslq	%eax, %rdx
	addq	24(%rbx), %rdx
	movq	%rdx, 24(%rbx)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	32(%rbx), %rsi
	callq	___archive_write_filter
	cmpl	(%r12), %eax
	jne	LBB0_10
## %bb.22:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %r15d
	movq	$0, 24(%rbx)
	jmp	LBB0_2
LBB0_21:
	movl	(%rdi), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	___archive_write_close_filter   ## TAILCALL
LBB0_8:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %edi
	movl	16(%rbx), %ecx
	leaq	L_.str(%rip), %rdx
	callq	_archive_set_error
LBB0_10:
	movq	_ARCHIVE_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_11:
	movl	8(%rbx), %edi
	cmpl	$-1, %edi
	je	LBB0_13
## %bb.12:
	callq	_close
LBB0_13:
	movl	12(%rbx), %edi
	cmpl	$-1, %edi
	je	LBB0_15
## %bb.14:
	callq	_close
LBB0_15:
	leaq	-52(%rbp), %r12
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_waitpid
	cmpl	$-1, %eax
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	(%r14), %rax
	cmpq	%rax, (%r13)
	je	LBB0_16
LBB0_18:
	movq	$0, (%rbx)
	cmpl	$0, -52(%rbp)
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_20
## %bb.19:
	movl	4(%r14), %edi
	movq	_EIO@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	16(%rbx), %ecx
	leaq	L_.str.1(%rip), %rdx
	callq	_archive_set_error
	movq	_ARCHIVE_FATAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_20:
	movl	(%r14), %edi
	callq	___archive_write_close_filter
	cmpl	%r15d, %eax
	cmovgel	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
	.comm	_EPIPE,8,3                      ## @EPIPE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading from program: %s"

	.comm	_ARCHIVE_FATAL,4,2              ## @ARCHIVE_FATAL
	.comm	_ARCHIVE_OK,4,2                 ## @ARCHIVE_OK
	.comm	_EIO,8,3                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"Error closing program: %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	___archive_write_program_close  ; -- Begin function __archive_write_program_close
	.p2align	2
___archive_write_program_close:         ; @__archive_write_program_close
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
	ldr	x8, [x1]
	cbz	x8, LBB0_8
; %bb.1:
	mov	x20, x1
	ldr	w0, [x1, #8]
	bl	_close
	mov	w8, #-1
	str	w8, [x20, #8]
	ldr	w0, [x20, #12]
Lloh0:
	adrp	x8, _F_SETFL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _F_SETFL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_fcntl
	mov	w21, #0
Lloh3:
	adrp	x22, _errno@GOTPAGE
Lloh4:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
Lloh5:
	adrp	x23, _EINTR@GOTPAGE
Lloh6:
	ldr	x23, [x23, _EINTR@GOTPAGEOFF]
Lloh7:
	adrp	x24, _EPIPE@GOTPAGE
Lloh8:
	ldr	x24, [x24, _EPIPE@GOTPAGEOFF]
Lloh9:
	adrp	x25, _ARCHIVE_OK@GOTPAGE
Lloh10:
	ldr	x25, [x25, _ARCHIVE_OK@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20, #12]
	ldp	x9, x8, [x20, #24]
	add	x1, x9, x8
	ldr	x8, [x20, #40]
	sub	x2, x8, x9
	bl	_read
	ldr	x1, [x22]
	ldr	x8, [x23]
	cmn	w0, #1
	ccmp	x1, x8, #0, eq
	b.eq	LBB0_2
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cbz	w0, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x24]
	cmn	w0, #1
	ccmp	x1, x8, #0, eq
	b.eq	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldp	x8, x1, [x20, #24]
	add	x2, x8, w0, sxtw
	str	x2, [x20, #24]
	ldr	w0, [x19]
	bl	___archive_write_filter
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x21, x0
	str	xzr, [x20, #24]
	b	LBB0_2
LBB0_8:
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	___archive_write_close_filter
LBB0_9:
	ldr	w0, [x19, #4]
	ldr	w3, [x20, #16]
Lloh11:
	adrp	x2, l_.str@PAGE
Lloh12:
	add	x2, x2, l_.str@PAGEOFF
	bl	_archive_set_error
LBB0_10:
Lloh13:
	adrp	x8, _ARCHIVE_FATAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ARCHIVE_FATAL@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
LBB0_11:
	ldr	w0, [x20, #8]
	cmn	w0, #1
	b.eq	LBB0_13
; %bb.12:
	bl	_close
LBB0_13:
	ldr	w0, [x20, #12]
	cmn	w0, #1
	b.eq	LBB0_15
; %bb.14:
	bl	_close
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20]
	add	x1, sp, #12
	mov	w2, #0
	bl	_waitpid
	ldr	x8, [x22]
	ldr	x9, [x23]
	cmn	w0, #1
	ccmp	x8, x9, #0, eq
	b.eq	LBB0_15
; %bb.16:
	str	xzr, [x20]
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_18
; %bb.17:
	ldr	w0, [x19, #4]
Lloh16:
	adrp	x8, _EIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh18:
	ldr	x1, [x8]
	ldr	w3, [x20, #16]
Lloh19:
	adrp	x2, l_.str.1@PAGE
Lloh20:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_archive_set_error
Lloh21:
	adrp	x8, _ARCHIVE_FATAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ARCHIVE_FATAL@GOTPAGEOFF]
Lloh23:
	ldr	w21, [x8]
LBB0_18:
	ldr	w0, [x19]
	bl	___archive_write_close_filter
	cmp	w0, w21
	csel	w0, w0, w21, lt
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
	.comm	_EPIPE,8,3                      ; @EPIPE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading from program: %s"

	.comm	_ARCHIVE_FATAL,4,2              ; @ARCHIVE_FATAL
	.comm	_ARCHIVE_OK,4,2                 ; @ARCHIVE_OK
	.comm	_EIO,8,3                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"Error closing program: %s"

.subsections_via_symbols
