	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function exec_command_write
_exec_command_write:                    ## @exec_command_write
	.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
	movq	_PSQL_CMD_SKIP_LINE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%esi, %esi
	je	LBB0_22
## %bb.1:
	movq	%r8, %r14
	movq	%rcx, %r13
	movq	%rdx, %rbx
	movq	_OT_FILEPIPE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_psql_scan_slash_option
	movq	%rax, -48(%rbp)
	testq	%r13, %r13
	je	LBB0_2
## %bb.4:
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	leaq	-48(%rbp), %rdi
	callq	_expand_tilde
	movq	-48(%rbp), %rdi
	movb	(%rdi), %bl
	cmpb	$124, %bl
	jne	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	callq	_disable_sigpipe_trap
	movq	-48(%rbp), %rdi
	incq	%rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_popen
	jmp	LBB0_9
LBB0_22:
	callq	_ignore_slash_filepipe
	jmp	LBB0_23
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_pg_log_error
	jmp	LBB0_3
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_pg_log_error
LBB0_3:
	movq	_PSQL_CMD_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_21
LBB0_8:
	callq	_canonicalize_path
	movq	-48(%rbp), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_fopen
LBB0_9:
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_18
## %bb.10:
	cmpq	$0, (%r13)
	jle	LBB0_11
LBB0_13:
	movq	8(%r13), %rdx
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	callq	_fprintf
LBB0_14:
	movq	%r12, %rdi
	cmpb	$124, %bl
	jne	LBB0_16
## %bb.15:
	callq	_pclose
	jmp	LBB0_17
LBB0_16:
	callq	_fclose
LBB0_17:
	movq	_EOF@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_19
LBB0_18:
	movq	-48(%rbp), %rsi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_pg_log_error
	movq	_PSQL_CMD_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_19:
	cmpb	$124, %bl
	jne	LBB0_21
## %bb.20:
	xorl	%eax, %eax
	callq	_restore_sigpipe_trap
LBB0_21:
	movq	-48(%rbp), %rdi
	callq	_free
LBB0_23:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	testq	%r14, %r14
	je	LBB0_14
## %bb.12:
	cmpq	$0, (%r14)
	movq	%r14, %r13
	jg	LBB0_13
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_PSQL_CMD_SKIP_LINE,4,2         ## @PSQL_CMD_SKIP_LINE
	.comm	_OT_FILEPIPE,4,2                ## @OT_FILEPIPE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no query buffer"

	.comm	_PSQL_CMD_ERROR,4,2             ## @PSQL_CMD_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"\\%s: missing required argument"

L_.str.2:                               ## @.str.2
	.asciz	"w"

L_.str.3:                               ## @.str.3
	.asciz	"%s: %m"

L_.str.4:                               ## @.str.4
	.asciz	"%s\n"

	.comm	_EOF,4,2                        ## @EOF
	.no_dead_strip	_exec_command_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function exec_command_write
_exec_command_write:                    ; @exec_command_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _PSQL_CMD_SKIP_LINE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PSQL_CMD_SKIP_LINE@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	cbz	w1, LBB0_5
; %bb.1:
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
Lloh3:
	adrp	x8, _OT_FILEPIPE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OT_FILEPIPE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x2, #0
	mov	w3, #1
	bl	_psql_scan_slash_option
	str	x0, [sp, #8]
	cbz	x21, LBB0_6
; %bb.2:
	cbz	x0, LBB0_7
; %bb.3:
	add	x0, sp, #8
	bl	_expand_tilde
	ldr	x0, [sp, #8]
	ldrb	w23, [x0]
	cmp	w23, #124
	b.ne	LBB0_9
; %bb.4:
	bl	_disable_sigpipe_trap
	ldr	x8, [sp, #8]
	add	x0, x8, #1
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_popen
	mov	x22, x0
	cbnz	x0, LBB0_10
	b	LBB0_16
LBB0_5:
	bl	_ignore_slash_filepipe
	b	LBB0_20
LBB0_6:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_8
LBB0_7:
	str	x22, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_8:
	bl	_pg_log_error
Lloh12:
	adrp	x8, _PSQL_CMD_ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PSQL_CMD_ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w19, [x8]
	b	LBB0_19
LBB0_9:
	bl	_canonicalize_path
	ldr	x0, [sp, #8]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fopen
	mov	x22, x0
	cbz	x0, LBB0_16
LBB0_10:
	ldr	x8, [x21]
	cmp	x8, #0
	b.le	LBB0_21
LBB0_11:
	ldr	x2, [x21, #8]
Lloh17:
	adrp	x1, l_.str.4@PAGE
Lloh18:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x22
	bl	_fprintf
LBB0_12:
	mov	x0, x22
	cmp	w23, #124
	b.ne	LBB0_14
; %bb.13:
	bl	_pclose
	b	LBB0_15
LBB0_14:
	bl	_fclose
LBB0_15:
Lloh19:
	adrp	x8, _EOF@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EOF@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_17
LBB0_16:
	ldr	x8, [sp, #8]
	str	x8, [sp]
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pg_log_error
Lloh24:
	adrp	x8, _PSQL_CMD_ERROR@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PSQL_CMD_ERROR@GOTPAGEOFF]
Lloh26:
	ldr	w19, [x8]
LBB0_17:
	cmp	w23, #124
	b.ne	LBB0_19
; %bb.18:
	bl	_restore_sigpipe_trap
LBB0_19:
	ldr	x0, [sp, #8]
	bl	_free
LBB0_20:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_21:
	cbz	x20, LBB0_12
; %bb.22:
	ldr	x8, [x20]
	mov	x21, x20
	cmp	x8, #1
	b.ge	LBB0_11
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_PSQL_CMD_SKIP_LINE,4,2         ; @PSQL_CMD_SKIP_LINE
	.comm	_OT_FILEPIPE,4,2                ; @OT_FILEPIPE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no query buffer"

	.comm	_PSQL_CMD_ERROR,4,2             ; @PSQL_CMD_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"\\%s: missing required argument"

l_.str.2:                               ; @.str.2
	.asciz	"w"

l_.str.3:                               ; @.str.3
	.asciz	"%s: %m"

l_.str.4:                               ; @.str.4
	.asciz	"%s\n"

	.comm	_EOF,4,2                        ; @EOF
	.no_dead_strip	_exec_command_write
.subsections_via_symbols
