	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function client_open
_client_open:                           ## @client_open
	.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
	movl	%edi, %r14d
	leaq	L_.str(%rip), %rdi
	callq	_printf
	xorl	%edi, %edi
	callq	_fflush
	movq	_src_file@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_open
	movq	%rax, %rbx
	movq	_fd@GOTPCREL(%rip), %r13
	movq	%rax, (%r13)
	testq	%rax, %rax
	js	LBB0_12
## %bb.1:
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_fstat
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movq	-48(%rbp), %rsi
	movq	_bytes@GOTPCREL(%rip), %rax
	movq	%rsi, (%rax)
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	(%r13), %r8
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	callq	_mmap
	movq	_file_addr@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	cmpq	$-1, %rax
	je	LBB0_4
## %bb.5:
	movq	_dst_file@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_strlen
	movq	%rax, %r12
	addl	$24, %r12d
	andl	$-8, %r12d
	movl	$1, %edi
	movl	%r12d, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r15
	movq	_CMD_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movl	%r12d, (%r15)
	movl	-56(%rbp), %eax
	movl	%eax, 4(%r15)
	movl	12(%r15), %edi
	movl	(%rbx), %esi
	callq	_strcpy
	xorl	%ebx, %ebx
	movl	%r14d, %edi
	movq	%r15, %rsi
	movl	%r12d, %edx
	xorl	%ecx, %ecx
	callq	_rsend
	movl	%eax, %r12d
	cmpl	(%r15), %eax
	jne	LBB0_9
## %bb.8:
	movq	_CMD_OPEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	_msg_get_resp
	movl	%eax, %r12d
	testl	%eax, %eax
	je	LBB0_12
LBB0_9:
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_10
LBB0_2:
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_6:
	movl	$-1, %r12d
LBB0_10:
	movq	_file_addr@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_bytes@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_munmap
	movl	%r12d, %ebx
LBB0_11:
	movq	(%r13), %rdi
	callq	_close
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"opening..."

	.comm	_src_file,4,2                   ## @src_file
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_fd,8,3                         ## @fd
	.comm	_bytes,8,3                      ## @bytes
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_file_addr,8,3                  ## @file_addr
	.comm	_errno,4,2                      ## @errno
	.comm	_dst_file,4,2                   ## @dst_file
	.comm	_CMD_OPEN,4,2                   ## @CMD_OPEN
	.no_dead_strip	_client_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function client_open
_client_open:                           ; @client_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	mov	x0, #0
	bl	_fflush
Lloh2:
	adrp	x8, _src_file@GOTPAGE
Lloh3:
	ldr	x8, [x8, _src_file@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_open
	mov	x20, x0
Lloh8:
	adrp	x22, _fd@GOTPAGE
Lloh9:
	ldr	x22, [x22, _fd@GOTPAGEOFF]
	str	x0, [x22]
	tbnz	x0, #63, LBB0_12
; %bb.1:
	mov	x1, sp
	mov	x0, x20
	bl	_fstat
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	x1, [sp, #8]
Lloh10:
	adrp	x23, _bytes@GOTPAGE
Lloh11:
	ldr	x23, [x23, _bytes@GOTPAGEOFF]
Lloh12:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
	str	x1, [x23]
Lloh14:
	ldr	w2, [x8]
Lloh15:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh17:
	ldr	w3, [x8]
	ldr	x4, [x22]
	mov	x0, #0
	mov	w5, #0
	bl	_mmap
Lloh18:
	adrp	x24, _file_addr@GOTPAGE
Lloh19:
	ldr	x24, [x24, _file_addr@GOTPAGEOFF]
	str	x0, [x24]
	cmn	x0, #1
	b.eq	LBB0_8
; %bb.3:
Lloh20:
	adrp	x26, _dst_file@GOTPAGE
Lloh21:
	ldr	x26, [x26, _dst_file@GOTPAGEOFF]
	ldr	w0, [x26]
	bl	_strlen
	add	w8, w0, #24
	and	w20, w8, #0xfffffff8
	mov	w0, #1
	mov	x1, x20
	bl	_calloc
	cbz	x0, LBB0_9
; %bb.4:
	mov	x21, x0
Lloh22:
	adrp	x25, _CMD_OPEN@GOTPAGE
Lloh23:
	ldr	x25, [x25, _CMD_OPEN@GOTPAGEOFF]
	ldr	w9, [x25]
	ldr	x8, [sp]
	str	w20, [x0]
	stp	w8, w9, [x0, #4]
	ldr	w0, [x0, #12]
	ldr	w1, [x26]
	bl	_strcpy
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	w3, #0
	bl	_rsend
	mov	x20, x0
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.5:
	ldr	w2, [x25]
	mov	x0, x19
	mov	x1, x21
	bl	_msg_get_resp
	mov	x20, x0
	cbz	w0, LBB0_12
LBB0_6:
	mov	x0, x21
	bl	_free
	b	LBB0_10
LBB0_7:
	mov	x20, x0
	b	LBB0_11
LBB0_8:
Lloh24:
	adrp	x8, _errno@GOTPAGE
Lloh25:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh26:
	ldr	w20, [x8]
	b	LBB0_11
LBB0_9:
	mov	w20, #-1
LBB0_10:
	ldr	x0, [x24]
	ldr	x1, [x23]
	bl	_munmap
LBB0_11:
	ldr	x0, [x22]
	bl	_close
LBB0_12:
	mov	x0, x20
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"opening..."

	.comm	_src_file,4,2                   ; @src_file
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_fd,8,3                         ; @fd
	.comm	_bytes,8,3                      ; @bytes
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_file_addr,8,3                  ; @file_addr
	.comm	_errno,4,2                      ; @errno
	.comm	_dst_file,4,2                   ; @dst_file
	.comm	_CMD_OPEN,4,2                   ; @CMD_OPEN
	.no_dead_strip	_client_open
.subsections_via_symbols
