	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __rap_system
___rap_system:                          ## @__rap_system
	.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
	movq	%rdx, %rbx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	%rsi, %rdi
	callq	_RIORAP_FD
	movq	%rax, %r15
	movq	_RMT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	_RMT_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r12)
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_strlen
	movl	%eax, %r13d
	leal	1(%r13), %r14d
	movq	_RMT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	$-5, %eax
	cmpl	%eax, %r14d
	jbe	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rdi
LBB0_2:
	xorl	%eax, %eax
	callq	_eprintf
LBB0_26:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_28
## %bb.27:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	4(%r12), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %esi
	callq	_r_write_be32
	movq	%r12, %rdi
	addq	$20, %rdi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	%r14d, %edx
	callq	_memcpy
	addl	$6, %r13d
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%r13d, %edx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str.2(%rip), %rdi
	callq	_strdup
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %r13
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_eprintf
	movq	%r13, %rdi
	callq	_strlen
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_free
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_r_write_be32
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movq	%r13, %rdi
	callq	_free
	addl	$5, %ebx
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%ebx, %edx
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	callq	_r_socket_write
	movq	%r15, %rdi
	callq	_r_socket_flush
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_r_socket_read_block
	cmpl	$1, %eax
	jne	LBB0_26
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r12), %eax
	movq	_RMT_CMD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	_RMT_REPLY@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r12)
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	$4, %edx
	callq	_r_socket_read_block
	cmpl	$4, %eax
	jne	LBB0_26
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_r_read_at_be32
	movq	%rax, %rbx
	cmpl	$-1, %ebx
	movl	$0, %eax
	cmovel	%eax, %ebx
	leal	1(%rbx), %esi
	movl	$1, %edi
	callq	_calloc
	movq	%rax, %r14
	movq	%r15, %rdi
	movq	%rax, %rsi
	movl	%ebx, %edx
	callq	_r_socket_read_block
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_eprintf
	testq	%r14, %r14
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpb	$0, (%r14)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	16(%rax), %edi
	movq	%r14, %rsi
	callq	*(%rax)
	jmp	LBB0_11
LBB0_12:
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movl	$4, %edx
	callq	_r_socket_read_block
	cmpl	$4, %eax
	jne	LBB0_26
## %bb.13:
	movq	_RMT_REPLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_RMT_CMD@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	cmpl	%eax, (%r12)
	jne	LBB0_14
## %bb.15:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_r_read_at_be32
	movq	%rax, %r14
	movq	_ST32_MAX@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jae	LBB0_17
## %bb.16:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_2
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_2
LBB0_17:
	leal	1(%r14), %esi
	movl	$1, %edi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_26
## %bb.18:
	movq	%rax, %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movslq	%ebx, %rax
	leaq	(%r12,%rax,4), %rsi
	movl	%r14d, %edx
	subl	%eax, %edx
	movq	%r15, %rdi
	callq	_r_socket_read_block
	testl	%eax, %eax
	jle	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	addl	%eax, %ebx
	cmpl	%r14d, %ebx
	jb	LBB0_19
LBB0_21:
	movl	%r14d, %eax
	movb	$0, (%r12,%rax)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	testq	%rax, %rax
	je	LBB0_23
## %bb.22:
	leaq	L_.str.6(%rip), %rdi
	movq	%r12, %rsi
	callq	*%rax
	jmp	LBB0_25
LBB0_23:
	movl	$1, %edi
	movq	%r12, %rsi
	movl	%r14d, %edx
	callq	_write
	cmpl	%r14d, %eax
	je	LBB0_25
## %bb.24:
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_eprintf
LBB0_25:
	movq	%r12, %rdi
	callq	_free
	jmp	LBB0_26
LBB0_28:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RMT_MAX,4,2                    ## @RMT_MAX
	.comm	_RMT_CMD,4,2                    ## @RMT_CMD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Command too long\n"

	.comm	_RMT_REPLY,4,2                  ## @RMT_REPLY
L_.str.1:                               ## @.str.1
	.asciz	"RUN %d CMD(%s)\n"

L_.str.2:                               ## @.str.2
	.space	1

L_.str.3:                               ## @.str.3
	.asciz	"[%s]=>(%s)\n"

L_.str.4:                               ## @.str.4
	.asciz	"Unexpected rap cmd reply\n"

	.comm	_ST32_MAX,4,2                   ## @ST32_MAX
L_.str.5:                               ## @.str.5
	.asciz	"Invalid length\n"

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

L_.str.7:                               ## @.str.7
	.asciz	"Failed to write\n"

	.no_dead_strip	___rap_system
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __rap_system
___rap_system:                          ; @__rap_system
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x24, x2
	stur	x0, [x29, #-96]                 ; 8-byte Folded Spill
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	mov	x0, x1
	bl	_RIORAP_FD
	mov	x20, x0
Lloh3:
	adrp	x22, _RMT_MAX@GOTPAGE
Lloh4:
	ldr	x22, [x22, _RMT_MAX@GOTPAGEOFF]
	ldr	w8, [x22]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
Lloh7:
	adrp	x19, _RMT_CMD@GOTPAGE
Lloh8:
	ldr	x19, [x19, _RMT_CMD@GOTPAGEOFF]
	ldr	w8, [x19]
	str	w8, [x21]
	mov	x0, x24
	bl	_strlen
	add	w26, w0, #1
	ldr	w8, [x22]
	sub	w8, w8, #5
	cmp	w26, w8
	b.ls	LBB0_2
; %bb.1:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_eprintf
	b	LBB0_24
LBB0_2:
	mov	x25, x0
	add	x22, x21, #4
	mov	x0, x22
	mov	x1, x26
	bl	_r_write_be32
	add	x23, x21, #20
	mov	x0, x23
	mov	x1, x24
	mov	x2, x26
	bl	_memcpy
	add	w2, w25, #6
	mov	x0, x20
	mov	x1, x21
	bl	_r_socket_write
	mov	x0, x20
	bl	_r_socket_flush
	mov	x0, x20
	mov	x1, x21
	mov	w2, #1
	bl	_r_socket_read_block
	cmp	w0, #1
	b.ne	LBB0_24
; %bb.3:
Lloh11:
	adrp	x24, l_.str.1@PAGE
Lloh12:
	add	x24, x24, l_.str.1@PAGEOFF
Lloh13:
	adrp	x26, l_.str.3@PAGE
Lloh14:
	add	x26, x26, l_.str.3@PAGEOFF
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_strdup
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x28, x0
	stp	x27, x0, [sp, #-16]!
	mov	x0, x26
	bl	_eprintf
	add	sp, sp, #16
	mov	x0, x28
	bl	_strlen
	mov	x25, x0
	mov	x0, x27
	bl	_free
	mov	x0, x22
	mov	x1, x25
	bl	_r_write_be32
	mov	x0, x23
	mov	x1, x28
	mov	x2, x25
	bl	_memcpy
	mov	x0, x28
	bl	_free
	add	w2, w25, #5
	mov	x0, x20
	mov	x1, x21
	bl	_r_socket_write
	mov	x0, x20
	bl	_r_socket_flush
	mov	x0, x20
	mov	x1, x21
	mov	w2, #1
	bl	_r_socket_read_block
	cmp	w0, #1
	b.ne	LBB0_24
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21]
	ldr	w9, [x19]
	cmp	w8, w9
	b.ne	LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
Lloh17:
	adrp	x9, _RMT_REPLY@GOTPAGE
Lloh18:
	ldr	x9, [x9, _RMT_REPLY@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x21]
	mov	x0, x22
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	mov	x0, x20
	mov	x1, x22
	mov	w2, #4
	bl	_r_socket_read_block
	cmp	w0, #4
	b.ne	LBB0_24
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	mov	w1, #1
	bl	_r_read_at_be32
	cmn	w0, #1
	csel	w28, wzr, w0, eq
	add	w1, w28, #1
	mov	w0, #1
	bl	_calloc
	mov	x27, x0
	mov	x0, x20
	mov	x1, x27
	mov	x2, x28
	bl	_r_socket_read_block
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x0, x27, [sp, #-16]!
	mov	x0, x24
	bl	_eprintf
	add	sp, sp, #16
	cbz	x27, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldrb	w8, [x27]
	cbz	w8, LBB0_4
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldur	x9, [x29, #-96]                 ; 8-byte Folded Reload
	ldr	x8, [x9]
	ldr	w0, [x9, #16]
	mov	x1, x27
	blr	x8
	b	LBB0_5
LBB0_11:
	mov	x0, x20
	mov	x1, x22
	mov	w2, #4
	bl	_r_socket_read_block
	cmp	w0, #4
	b.ne	LBB0_24
; %bb.12:
	ldr	w8, [x21]
	ldr	w9, [x19]
Lloh20:
	adrp	x10, _RMT_REPLY@GOTPAGE
Lloh21:
	ldr	x10, [x10, _RMT_REPLY@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	orr	w9, w10, w9
	cmp	w8, w9
	b.ne	LBB0_15
; %bb.13:
	mov	x0, x21
	mov	w1, #1
	bl	_r_read_at_be32
	mov	x22, x0
Lloh23:
	adrp	x8, _ST32_MAX@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ST32_MAX@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	cmp	w8, w22
	b.hs	LBB0_16
; %bb.14:
Lloh26:
	adrp	x0, l_.str.5@PAGE
Lloh27:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_eprintf
	b	LBB0_24
LBB0_15:
Lloh28:
	adrp	x0, l_.str.4@PAGE
Lloh29:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_eprintf
	b	LBB0_24
LBB0_16:
	add	w1, w22, #1
	mov	w0, #1
	bl	_calloc
	cbz	x0, LBB0_24
; %bb.17:
	mov	x21, x0
	mov	w19, #0
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	add	x1, x21, w19, sxtw #2
	sub	w2, w22, w19
	mov	x0, x20
	bl	_r_socket_read_block
	add	w19, w0, w19
	cmp	w0, #1
	ccmp	w19, w22, #2, ge
	b.lo	LBB0_18
; %bb.19:
	strb	wzr, [x21, w22, uxtw]
	ldur	x8, [x29, #-96]                 ; 8-byte Folded Reload
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_21
; %bb.20:
Lloh30:
	adrp	x0, l_.str.6@PAGE
Lloh31:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x1, x21
	blr	x8
	b	LBB0_23
LBB0_21:
	mov	w0, #1
	mov	x1, x21
	mov	x2, x22
	bl	_write
	cmp	w0, w22
	b.eq	LBB0_23
; %bb.22:
Lloh32:
	adrp	x0, l_.str.7@PAGE
Lloh33:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_eprintf
LBB0_23:
	mov	x0, x21
	bl	_free
LBB0_24:
	ldur	x8, [x29, #-88]
Lloh34:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh35:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_26
; %bb.25:
	mov	x0, #0
	sub	sp, x29, #80
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_26:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_RMT_MAX,4,2                    ; @RMT_MAX
	.comm	_RMT_CMD,4,2                    ; @RMT_CMD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Command too long\n"

	.comm	_RMT_REPLY,4,2                  ; @RMT_REPLY
l_.str.1:                               ; @.str.1
	.asciz	"RUN %d CMD(%s)\n"

l_.str.2:                               ; @.str.2
	.space	1

l_.str.3:                               ; @.str.3
	.asciz	"[%s]=>(%s)\n"

l_.str.4:                               ; @.str.4
	.asciz	"Unexpected rap cmd reply\n"

	.comm	_ST32_MAX,4,2                   ; @ST32_MAX
l_.str.5:                               ; @.str.5
	.asciz	"Invalid length\n"

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

l_.str.7:                               ; @.str.7
	.asciz	"Failed to write\n"

	.no_dead_strip	___rap_system
.subsections_via_symbols
