	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __rap_read
___rap_read:                            ## @__rap_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	%rdx, %r14
	movq	%rsi, %rdi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_RIORAP_FD
	movq	%rax, %r15
	movq	_RMT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%ebx, %eax
	cmovll	%eax, %ebx
	movq	_RMT_READ@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, -80(%rbp)
	leaq	-76(%rbp), %rdi
	movl	%ebx, %esi
	callq	_r_write_be32
	leaq	-80(%rbp), %r12
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$5, %edx
	callq	_r_socket_write
	movq	%r15, %rdi
	callq	_r_socket_flush
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$5, %edx
	callq	_r_socket_read_block
	movq	_RMT_REPLY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	orl	(%r13), %r8d
	movl	-80(%rbp), %edx
	cmpl	$5, %eax
	jne	LBB0_2
## %bb.1:
	cmpl	%r8d, %edx
	jne	LBB0_2
## %bb.3:
	leaq	-80(%rbp), %rdi
	movl	$1, %esi
	callq	_r_read_at_be32
	cmpl	%ebx, %eax
	jle	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_eprintf
	movl	$-1, %ebx
	jmp	LBB0_6
LBB0_2:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	$2, %ecx
	xorl	%eax, %eax
	callq	_eprintf
	movl	$-1, %ebx
	jmp	LBB0_6
LBB0_5:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_r_socket_read_block
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RMT_MAX,4,2                    ## @RMT_MAX
	.comm	_RMT_READ,4,2                   ## @RMT_READ
	.comm	_RMT_REPLY,4,2                  ## @RMT_REPLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"__rap_read: Unexpected rap read reply (%d=0x%02x) expected (%d=0x%02x)\n"

L_.str.1:                               ## @.str.1
	.asciz	"__rap_read: Unexpected data size %d vs %d\n"

	.no_dead_strip	___rap_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __rap_read
___rap_read:                            ; @__rap_read
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x3
	mov	x20, x2
	mov	x0, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_RIORAP_FD
	mov	x21, x0
Lloh3:
	adrp	x8, _RMT_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RMT_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w19
	csel	w19, w8, w19, lt
Lloh6:
	adrp	x22, _RMT_READ@GOTPAGE
Lloh7:
	ldr	x22, [x22, _RMT_READ@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [sp, #20]
	add	x8, sp, #20
	add	x0, x8, #4
	mov	x1, x19
	bl	_r_write_be32
	add	x1, sp, #20
	mov	x0, x21
	mov	w2, #5
	bl	_r_socket_write
	mov	x0, x21
	bl	_r_socket_flush
	add	x1, sp, #20
	mov	x0, x21
	mov	w2, #5
	bl	_r_socket_read_block
	mov	x1, x0
	ldr	w2, [sp, #20]
	ldr	w8, [x22]
Lloh8:
	adrp	x9, _RMT_REPLY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _RMT_REPLY@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w8, w9, w8
	cmp	w0, #5
	b.ne	LBB0_4
; %bb.1:
	cmp	w2, w8
	b.ne	LBB0_4
; %bb.2:
	add	x0, sp, #20
	mov	w1, #1
	bl	_r_read_at_be32
	mov	x2, x0
	cmp	w0, w19
	b.le	LBB0_6
; %bb.3:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x2
	mov	x2, x19
	b	LBB0_5
LBB0_4:
	mov	w9, #2
	stp	x9, x8, [sp]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
LBB0_5:
	bl	_eprintf
	mov	w19, #-1
	b	LBB0_7
LBB0_6:
	mov	x0, x21
	mov	x1, x20
	bl	_r_socket_read_block
LBB0_7:
	ldr	x8, [sp, #40]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, 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
	add	sp, sp, #96
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_RMT_MAX,4,2                    ; @RMT_MAX
	.comm	_RMT_READ,4,2                   ; @RMT_READ
	.comm	_RMT_REPLY,4,2                  ; @RMT_REPLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"__rap_read: Unexpected rap read reply (%d=0x%02x) expected (%d=0x%02x)\n"

l_.str.1:                               ; @.str.1
	.asciz	"__rap_read: Unexpected data size %d vs %d\n"

	.no_dead_strip	___rap_read
.subsections_via_symbols
