	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_network_socket_to_read         ## -- Begin function network_socket_to_read
	.p2align	4, 0x90
_network_socket_to_read:                ## @network_socket_to_read
	.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	$-1, -28(%rbp)
	movl	12(%rdi), %edi
	movq	_FIONREAD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	callq	_ioctl
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_G_STRLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	12(%rbx), %ebx
	movq	_errno@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_g_strerror
	movl	(%r15), %r8d
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_g_critical
LBB0_5:
	movq	_NETWORK_SOCKET_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_2:
	movl	-28(%rbp), %ecx
	testl	%ecx, %ecx
	js	LBB0_4
## %bb.3:
	movl	%ecx, 8(%rbx)
	movq	_NETWORK_SOCKET_SUCCESS@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_G_STRLOC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%rbx), %edx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_g_critical
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_FIONREAD,4,2                   ## @FIONREAD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: ioctl(%d, FIONREAD, ...) failed: %s (%d)"

	.comm	_G_STRLOC,4,2                   ## @G_STRLOC
	.comm	_errno,4,2                      ## @errno
	.comm	_NETWORK_SOCKET_ERROR,4,2       ## @NETWORK_SOCKET_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"%s: ioctl(%d, FIONREAD, ...) succeeded, but is negative: %d"

	.comm	_NETWORK_SOCKET_SUCCESS,4,2     ## @NETWORK_SOCKET_SUCCESS
	.comm	_SOCK_DGRAM,8,3                 ## @SOCK_DGRAM
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_NREAD,4,2                   ## @SO_NREAD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_network_socket_to_read         ; -- Begin function network_socket_to_read
	.p2align	2
_network_socket_to_read:                ; @network_socket_to_read
	.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
	mov	w8, #-1
	str	w8, [sp, #12]
	ldr	w0, [x0, #12]
Lloh0:
	adrp	x8, _FIONREAD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FIONREAD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_ioctl
	cbz	x0, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _G_STRLOC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _G_STRLOC@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
	ldr	w19, [x19, #12]
Lloh6:
	adrp	x21, _errno@GOTPAGE
Lloh7:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_g_strerror
	mov	x3, x0
	ldr	w8, [x21]
	str	x8, [sp]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x19
LBB0_2:
	bl	_g_critical
Lloh10:
	adrp	x8, _NETWORK_SOCKET_ERROR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NETWORK_SOCKET_ERROR@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
	ldr	w3, [sp, #12]
	tbnz	w3, #31, LBB0_6
; %bb.4:
	str	w3, [x19, #8]
Lloh12:
	adrp	x8, _NETWORK_SOCKET_SUCCESS@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NETWORK_SOCKET_SUCCESS@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
	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_6:
Lloh14:
	adrp	x8, _G_STRLOC@GOTPAGE
Lloh15:
	ldr	x8, [x8, _G_STRLOC@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	ldr	w2, [x19, #12]
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_FIONREAD,4,2                   ; @FIONREAD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: ioctl(%d, FIONREAD, ...) failed: %s (%d)"

	.comm	_G_STRLOC,4,2                   ; @G_STRLOC
	.comm	_errno,4,2                      ; @errno
	.comm	_NETWORK_SOCKET_ERROR,4,2       ; @NETWORK_SOCKET_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"%s: ioctl(%d, FIONREAD, ...) succeeded, but is negative: %d"

	.comm	_NETWORK_SOCKET_SUCCESS,4,2     ; @NETWORK_SOCKET_SUCCESS
	.comm	_SOCK_DGRAM,8,3                 ; @SOCK_DGRAM
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_NREAD,4,2                   ; @SO_NREAD
.subsections_via_symbols
