	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tube_write_msg                 ## -- Begin function tube_write_msg
	.p2align	4, 0x90
_tube_write_msg:                        ## @tube_write_msg
	.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
	movq	%rsi, %r14
	movl	%edx, -44(%rbp)
	movl	(%rdi), %r12d
	testl	%ecx, %ecx
	je	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	leaq	-44(%rbp), %rsi
	movl	$4, %edx
	movl	%r12d, %edi
	xorl	%eax, %eax
	callq	_write
	cmpl	$-1, %eax
	je	LBB0_2
## %bb.6:
	movl	%eax, %r15d
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	callq	_fd_set_block
	testl	%eax, %eax
	je	LBB0_21
## %bb.7:
	movl	%r15d, %ebx
	cmpl	$4, %r15d
	jne	LBB0_8
LBB0_14:
	movq	_errno@GOTPCREL(%rip), %r13
	movq	_EAGAIN@GOTPCREL(%rip), %rbx
	xorl	%r14d, %r14d
LBB0_19:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	movslq	%r14d, %r15
	addq	-56(%rbp), %r15                 ## 8-byte Folded Reload
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_19 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-44(%rbp), %edx
	subl	%r14d, %edx
	je	LBB0_20
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=2
	movl	%r12d, %edi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_write
	cmpl	$-1, %eax
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=2
	movq	(%r13), %rdi
	cmpq	(%rbx), %rdi
	je	LBB0_15
	jmp	LBB0_12
LBB0_18:                                ##   in Loop: Header=BB0_19 Depth=1
	addl	%eax, %r14d
	jmp	LBB0_19
LBB0_5:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	callq	_fd_set_block
	xorl	%ebx, %ebx
	testl	%eax, %eax
	je	LBB0_21
LBB0_8:
	movq	_errno@GOTPCREL(%rip), %r14
	movq	_EAGAIN@GOTPCREL(%rip), %r15
LBB0_9:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movslq	%ebx, %rax
	leaq	(%rax,%rbp), %r13
	addq	$-44, %r13
	movl	$4, %ebx
	subq	%rax, %rbx
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_9 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r12d, %edi
	movq	%r13, %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_write
	cmpl	$-1, %eax
	jne	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	(%r14), %rdi
	cmpq	(%r15), %rdi
	je	LBB0_10
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	addl	%eax, %ebx
	cmpl	$4, %ebx
	jne	LBB0_9
	jmp	LBB0_14
LBB0_12:
	callq	_strerror
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_log_err
	movl	%r12d, %edi
	callq	_fd_set_nonblock
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_EINTR@GOTPCREL(%rip), %rax
	movl	$-1, %ebx
	cmpq	(%rax), %rdi
	je	LBB0_21
## %bb.3:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	je	LBB0_21
## %bb.4:
	callq	_strerror
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_log_err
	jmp	LBB0_21
LBB0_20:
	movl	%r12d, %edi
	callq	_fd_set_nonblock
	xorl	%ebx, %ebx
	testl	%eax, %eax
	setne	%bl
LBB0_21:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
	.comm	_EAGAIN,8,3                     ## @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tube msg write failed: %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tube_write_msg                 ; -- Begin function tube_write_msg
	.p2align	2
_tube_write_msg:                        ; @tube_write_msg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	str	w2, [sp, #28]
	ldr	w19, [x0]
	cbz	w3, LBB0_9
; %bb.1:
	mov	w8, #4
	add	x9, sp, #28
	stp	x9, x8, [sp]
	mov	x0, x19
	bl	_write
	cmn	w0, #1
	b.eq	LBB0_16
; %bb.2:
	mov	x21, x0
	mov	x0, x19
	bl	_fd_set_block
	cbz	w0, LBB0_20
; %bb.3:
	cmp	w21, #4
	b.ne	LBB0_10
LBB0_4:
	mov	w21, #0
Lloh0:
	adrp	x22, _errno@GOTPAGE
Lloh1:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
Lloh2:
	adrp	x23, _EAGAIN@GOTPAGE
Lloh3:
	ldr	x23, [x23, _EAGAIN@GOTPAGEOFF]
	add	x24, x20, wzr, sxtw
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp, #28]
	subs	w8, w8, w21
	b.eq	LBB0_19
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	stp	x24, x8, [sp]
	mov	x0, x19
	bl	_write
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x0, [x22]
	ldr	x8, [x23]
	cmp	x0, x8
	b.eq	LBB0_5
	b	LBB0_15
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w21, w0, w21
	add	x24, x20, w21, sxtw
	b	LBB0_5
LBB0_9:
	mov	x0, x19
	bl	_fd_set_block
	mov	x8, x0
	mov	w21, #0
	mov	w0, #0
	cbz	w8, LBB0_20
LBB0_10:
	add	x22, sp, #28
	mov	w23, #4
Lloh4:
	adrp	x24, _errno@GOTPAGE
Lloh5:
	ldr	x24, [x24, _errno@GOTPAGEOFF]
Lloh6:
	adrp	x25, _EAGAIN@GOTPAGE
Lloh7:
	ldr	x25, [x25, _EAGAIN@GOTPAGEOFF]
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_12 Depth 2
	sxtw	x8, w21
	add	x26, x22, x8
	sub	x27, x23, x8
LBB0_12:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	stp	x26, x27, [sp]
	mov	x0, x19
	bl	_write
	cmn	w0, #1
	b.ne	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	ldr	x0, [x24]
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_12
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_11 Depth=1
	add	w21, w0, w21
	cmp	w21, #4
	b.ne	LBB0_11
	b	LBB0_4
LBB0_15:
	bl	_strerror
	mov	x1, x0
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log_err
	mov	x0, x19
	bl	_fd_set_nonblock
	mov	w0, #0
	b	LBB0_20
LBB0_16:
Lloh10:
	adrp	x8, _errno@GOTPAGE
Lloh11:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh12:
	ldr	x0, [x8]
Lloh13:
	adrp	x8, _EINTR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
Lloh16:
	adrp	x9, _EAGAIN@GOTPAGE
Lloh17:
	ldr	x9, [x9, _EAGAIN@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x0, x8
	ccmp	x0, x9, #4, ne
	b.ne	LBB0_18
; %bb.17:
	mov	w0, #-1
	b	LBB0_20
LBB0_18:
	bl	_strerror
	mov	x1, x0
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log_err
	mov	w0, #-1
	b	LBB0_20
LBB0_19:
	mov	x0, x19
	bl	_fd_set_nonblock
	cmp	w0, #0
	cset	w0, ne
LBB0_20:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
	.comm	_EAGAIN,8,3                     ; @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tube msg write failed: %s"

.subsections_via_symbols
