	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ClosePipeToProgram
_ClosePipeToProgram:                    ## @ClosePipeToProgram
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	20(%rdi), %edi
	callq	_Assert
	movl	16(%rbx), %edi
	callq	_ClosePipeStream
	testl	%eax, %eax
	je	LBB0_8
## %bb.1:
	movl	%eax, %r14d
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.2:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_errcode_for_file_access
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%ebx, %edi
	jmp	LBB0_3
LBB0_4:
	cmpq	$0, 8(%rbx)
	je	LBB0_7
## %bb.5:
	cmpl	$0, 4(%rbx)
	jne	LBB0_7
## %bb.6:
	movq	_SIGPIPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_wait_result_is_signal
	testq	%rax, %rax
	je	LBB0_7
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_ERRCODE_EXTERNAL_ROUTINE_EXCEPTION@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_errcode
	movl	(%rbx), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_errmsg
	movl	%r14d, %edi
	callq	_wait_result_to_str
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_errdetail_internal
	movl	%r15d, %edi
LBB0_3:
	movl	%eax, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ereport                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not close pipe to external command: %m"

	.comm	_SIGPIPE,4,2                    ## @SIGPIPE
	.comm	_ERRCODE_EXTERNAL_ROUTINE_EXCEPTION,4,2 ## @ERRCODE_EXTERNAL_ROUTINE_EXCEPTION
L_.str.1:                               ## @.str.1
	.asciz	"program \"%s\" failed"

L_.str.2:                               ## @.str.2
	.asciz	"%s"

	.no_dead_strip	_ClosePipeToProgram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ClosePipeToProgram
_ClosePipeToProgram:                    ; @ClosePipeToProgram
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
	ldr	w0, [x0, #20]
	bl	_Assert
	ldr	w0, [x19, #16]
	bl	_ClosePipeStream
	cbz	w0, LBB0_6
; %bb.1:
	mov	x20, x0
	cmn	w0, #1
	b.ne	LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	bl	_errcode_for_file_access
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_errmsg
	mov	x1, x0
	mov	x0, x19
	b	LBB0_8
LBB0_3:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_7
; %bb.4:
	ldr	w8, [x19, #4]
	cbnz	w8, LBB0_7
; %bb.5:
Lloh5:
	adrp	x8, _SIGPIPE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SIGPIPE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_wait_result_is_signal
	cbz	x0, LBB0_7
LBB0_6:
	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
	add	sp, sp, #64
	ret
LBB0_7:
Lloh8:
	adrp	x8, _ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
Lloh11:
	adrp	x8, _ERRCODE_EXTERNAL_ROUTINE_EXCEPTION@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERRCODE_EXTERNAL_ROUTINE_EXCEPTION@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_errcode
	ldr	w8, [x19]
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_errmsg
	mov	x0, x20
	bl	_wait_result_to_str
	mov	x1, x0
Lloh16:
	adrp	x0, l_.str.2@PAGE
Lloh17:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_errdetail_internal
	mov	x1, x0
	mov	x0, x21
LBB0_8:
	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
	add	sp, sp, #64
	b	_ereport
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not close pipe to external command: %m"

	.comm	_SIGPIPE,4,2                    ; @SIGPIPE
	.comm	_ERRCODE_EXTERNAL_ROUTINE_EXCEPTION,4,2 ; @ERRCODE_EXTERNAL_ROUTINE_EXCEPTION
l_.str.1:                               ; @.str.1
	.asciz	"program \"%s\" failed"

l_.str.2:                               ; @.str.2
	.asciz	"%s"

	.no_dead_strip	_ClosePipeToProgram
.subsections_via_symbols
