	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function server_write
_server_write:                          ## @server_write
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movl	%edi, %r14d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	xorl	%edi, %edi
	callq	_fflush
	movq	_fd@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	jle	LBB0_7
## %bb.1:
	movl	(%r12), %esi
	cmpl	$4, %esi
	jne	LBB0_8
## %bb.2:
	movq	_bytes@GOTPCREL(%rip), %r15
	movl	$8, %edx
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	__recv
	movq	%rax, %rbx
	cmpl	$8, %ebx
	jne	LBB0_11
## %bb.3:
	movq	(%r13), %rdi
	movq	(%r15), %rsi
	callq	_ftruncate
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:
	movq	(%r15), %rsi
	movq	_PROT_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	(%r13), %r8
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	callq	_mmap
	movq	_file_addr@GOTPCREL(%rip), %r13
	movq	%rax, (%r13)
	cmpq	$-1, %rax
	je	LBB0_12
## %bb.5:
	movq	(%r15), %rsi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	xorl	%edi, %edi
	callq	_fflush
	movq	(%r13), %rsi
	movq	(%r15), %rdx
	movl	%r14d, %edi
	callq	__recv
	cmpq	%rax, (%r15)
	je	LBB0_11
## %bb.6:
	movq	%rax, %r13
	leaq	L_str(%rip), %rdi
	callq	_puts
	movl	%r13d, %ebx
	jmp	LBB0_11
LBB0_7:
	leaq	L_str.7(%rip), %rdi
	callq	_puts
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
LBB0_9:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %ebx
LBB0_11:
	movl	%r14d, %edi
	movq	%r12, %rsi
	movl	%ebx, %edx
	callq	_msg_send_resp
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_str.6(%rip), %rdi
	callq	_puts
	movq	_errno@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"transferring"

	.comm	_fd,8,3                         ## @fd
	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"...invalid message length %d\n"

	.comm	_bytes,8,3                      ## @bytes
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_file_addr,8,3                  ## @file_addr
	.comm	_errno,4,2                      ## @errno
L_.str.4:                               ## @.str.4
	.asciz	"...%lld bytes..."

L_str:                                  ## @str
	.asciz	"...error receiving data"

L_str.6:                                ## @str.6
	.asciz	"...error mapping file"

L_str.7:                                ## @str.7
	.asciz	"...file not opened"

	.no_dead_strip	_server_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function server_write
_server_write:                          ; @server_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	mov	x0, #0
	bl	_fflush
Lloh2:
	adrp	x23, _fd@GOTPAGE
Lloh3:
	ldr	x23, [x23, _fd@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x8, #0
	b.le	LBB0_7
; %bb.1:
	ldr	w8, [x19]
	cmp	w8, #4
	b.ne	LBB0_8
; %bb.2:
Lloh4:
	adrp	x21, _bytes@GOTPAGE
Lloh5:
	ldr	x21, [x21, _bytes@GOTPAGEOFF]
	mov	x0, x20
	mov	x1, x21
	mov	w2, #8
	bl	__recv
	mov	x22, x0
	cmp	w22, #8
	b.ne	LBB0_11
; %bb.3:
	ldr	x0, [x23]
	ldr	x1, [x21]
	bl	_ftruncate
	mov	x22, x0
	cbnz	w0, LBB0_11
; %bb.4:
Lloh6:
	adrp	x8, _PROT_WRITE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PROT_WRITE@GOTPAGEOFF]
	ldr	x1, [x21]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	ldr	x4, [x23]
	mov	x0, #0
	mov	w5, #0
	bl	_mmap
Lloh12:
	adrp	x22, _file_addr@GOTPAGE
Lloh13:
	ldr	x22, [x22, _file_addr@GOTPAGEOFF]
	str	x0, [x22]
	cmn	x0, #1
	b.eq	LBB0_12
; %bb.5:
	ldr	x8, [x21]
	str	x8, [sp]
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
	mov	x0, #0
	bl	_fflush
	ldr	x1, [x22]
	ldr	x2, [x21]
	mov	x0, x20
	bl	__recv
	ldr	x8, [x21]
	cmp	x8, x0
	b.ne	LBB0_13
; %bb.6:
	mov	w22, #0
	b	LBB0_11
LBB0_7:
Lloh16:
	adrp	x0, l_str.7@PAGE
Lloh17:
	add	x0, x0, l_str.7@PAGEOFF
	bl	_puts
	b	LBB0_9
LBB0_8:
	str	x8, [sp]
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
LBB0_9:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w22, [x8]
LBB0_11:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x22
	bl	_msg_send_resp
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_12:
Lloh22:
	adrp	x0, l_str.6@PAGE
Lloh23:
	add	x0, x0, l_str.6@PAGEOFF
	bl	_puts
Lloh24:
	adrp	x8, _errno@GOTPAGE
Lloh25:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
	b	LBB0_10
LBB0_13:
	mov	x22, x0
Lloh26:
	adrp	x0, l_str@PAGE
Lloh27:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	b	LBB0_11
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"transferring"

	.comm	_fd,8,3                         ; @fd
	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"...invalid message length %d\n"

	.comm	_bytes,8,3                      ; @bytes
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_file_addr,8,3                  ; @file_addr
	.comm	_errno,4,2                      ; @errno
l_.str.4:                               ; @.str.4
	.asciz	"...%lld bytes..."

l_str:                                  ; @str
	.asciz	"...error receiving data"

l_str.6:                                ; @str.6
	.asciz	"...error mapping file"

l_str.7:                                ; @str.7
	.asciz	"...file not opened"

	.no_dead_strip	_server_write
.subsections_via_symbols
