	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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
	movl	$8216, %eax                     ## imm = 0x2018
	callq	____chkstk_darwin
	subq	%rax, %rsp
	popq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movl	%edi, %ebx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rsi), %rdi
	callq	_setprogname
	cmpl	$4, %ebx
	jne	LBB0_1
## %bb.4:
	movq	_PF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	%eax, %r14d
	cmpl	$-1, %eax
	jne	LBB0_6
## %bb.5:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_err
LBB0_6:
	leaq	-8256(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movl	$16, -8256(%rbp)
	movq	_AF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -8244(%rbp)
	movq	16(%r15), %rdi
	callq	_atoi
	movl	%eax, %edi
	callq	_htons
	movl	%eax, -8248(%rbp)
	movq	8(%r15), %rdi
	callq	_inet_addr
	movl	%eax, -8252(%rbp)
	movq	24(%r15), %rdi
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movq	_O_RDWR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movl	$420, %edx                      ## imm = 0x1A4
	callq	_open
	movl	%eax, %r12d
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_err
LBB0_8:
	movl	%r12d, %edi
	xorl	%esi, %esi
	callq	_ftruncate
	cmpl	$-1, %eax
	jne	LBB0_10
## %bb.9:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_err
LBB0_10:
	leaq	-8256(%rbp), %rsi
	movl	%r14d, %edi
	movl	$16, %edx
	callq	_connect
	cmpl	$-1, %eax
	jne	LBB0_12
## %bb.11:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_err
LBB0_12:
	movq	_GETSTR@GOTPCREL(%rip), %r15
	movq	(%r15), %rbx
	movq	%rbx, %rdi
	callq	_strlen
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_write
	movl	%eax, %ebx
	movq	(%r15), %rdi
	callq	_strlen
	cmpl	%eax, %ebx
	je	LBB0_15
## %bb.13:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_14
LBB0_1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_getprogname
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
	callq	_fprintf
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %eax
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_3
## %bb.22:
	addq	$8216, %rsp                     ## imm = 0x2018
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	callq	___stack_chk_fail
LBB0_14:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_err
LBB0_15:
	leaq	-8240(%rbp), %rbx
	leaq	L_.str.6(%rip), %r13
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	callq	_err
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	%r12d, %edi
	movq	%rbx, %rsi
	movl	%r15d, %edx
	callq	_write
	cmpl	%r15d, %eax
	jne	LBB0_21
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movl	$8192, %edx                     ## imm = 0x2000
	callq	_read
	movl	%eax, %r15d
	cmpl	$-1, %eax
	je	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	testl	%r15d, %r15d
	jne	LBB0_20
## %bb.18:
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_21:
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"usage: %s address port savefile\n"

	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.comm	_PF_INET,4,2                    ## @PF_INET
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
L_.str.1:                               ## @.str.1
	.asciz	"socket"

	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_RDWR,4,2                     ## @O_RDWR
L_.str.2:                               ## @.str.2
	.asciz	"open"

L_.str.3:                               ## @.str.3
	.asciz	"ftruncate savefile"

L_.str.4:                               ## @.str.4
	.asciz	"connect"

	.comm	_GETSTR,8,3                     ## @GETSTR
L_.str.5:                               ## @.str.5
	.asciz	"socket write"

L_.str.6:                               ## @.str.6
	.asciz	"socket read"

L_.str.7:                               ## @.str.7
	.asciz	"write file"

	.comm	_EXIT_SUCCESS,4,2               ## @EXIT_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -72
	.cfi_offset w28, -80
	mov	w9, #8224
Lloh0:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh1:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #2, lsl #12             ; =8192
	sub	sp, sp, #32
	mov	x20, x1
	mov	x19, x0
Lloh2:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	x0, [x1]
	bl	_setprogname
	cmp	w19, #4
	b.ne	LBB0_18
; %bb.1:
Lloh5:
	adrp	x8, _PF_INET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PF_INET@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	mov	x19, x0
	cmn	w0, #1
	b.ne	LBB0_3
; %bb.2:
Lloh11:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x1, l_.str.1@PAGE
Lloh15:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_err
LBB0_3:
	mov	w21, #16
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #16
	bl	_memset
Lloh16:
	adrp	x8, _AF_INET@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AF_INET@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w21, [sp, #8]
	str	w8, [sp, #20]
	ldr	x0, [x20, #16]
	bl	_atoi
	bl	_htons
	str	w0, [sp, #16]
	ldr	x0, [x20, #8]
	bl	_inet_addr
	str	w0, [sp, #12]
Lloh19:
	adrp	x8, _O_CREAT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _O_CREAT@GOTPAGEOFF]
	ldr	x0, [x20, #24]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _O_RDWR@GOTPAGE
Lloh23:
	ldr	x9, [x9, _O_RDWR@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w2, #420
	bl	_open
	mov	x20, x0
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.4:
Lloh25:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_err
LBB0_5:
	mov	x0, x20
	mov	w1, #0
	bl	_ftruncate
	cmn	w0, #1
	b.ne	LBB0_7
; %bb.6:
Lloh30:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_err
LBB0_7:
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #16
	bl	_connect
	cmn	w0, #1
	b.ne	LBB0_9
; %bb.8:
Lloh35:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
Lloh38:
	adrp	x1, l_.str.4@PAGE
Lloh39:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_err
LBB0_9:
Lloh40:
	adrp	x22, _GETSTR@GOTPAGE
Lloh41:
	ldr	x22, [x22, _GETSTR@GOTPAGEOFF]
	ldr	x21, [x22]
	mov	x0, x21
	bl	_strlen
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_write
	mov	x21, x0
	ldr	x0, [x22]
	bl	_strlen
	cmp	w21, w0
	b.eq	LBB0_12
; %bb.10:
Lloh42:
	adrp	x21, l_.str.5@PAGE
Lloh43:
	add	x21, x21, l_.str.5@PAGEOFF
LBB0_11:
Lloh44:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh45:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh46:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_err
LBB0_12:
Lloh47:
	adrp	x24, _EXIT_FAILURE@GOTPAGE
Lloh48:
	ldr	x24, [x24, _EXIT_FAILURE@GOTPAGEOFF]
Lloh49:
	adrp	x22, l_.str.6@PAGE
Lloh50:
	add	x22, x22, l_.str.6@PAGEOFF
Lloh51:
	adrp	x21, l_.str.7@PAGE
Lloh52:
	add	x21, x21, l_.str.7@PAGEOFF
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	w0, [x24]
	mov	x1, x22
	bl	_err
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	x1, sp, #24
	mov	x0, x20
	mov	x2, x23
	bl	_write
	cmp	w0, w23
	b.ne	LBB0_11
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	add	x1, sp, #24
	mov	x0, x19
	mov	w2, #8192
	bl	_read
	mov	x23, x0
	cmn	w0, #1
	b.eq	LBB0_13
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	cbnz	w23, LBB0_14
; %bb.17:
Lloh53:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh54:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
	b	LBB0_19
LBB0_18:
Lloh55:
	adrp	x8, _stderr@GOTPAGE
Lloh56:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh57:
	ldr	w19, [x8]
	bl	_getprogname
	mov	x2, x0
Lloh58:
	adrp	x1, l_.str@PAGE
Lloh59:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_fprintf
Lloh60:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh61:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
LBB0_19:
	ldr	w0, [x8]
	ldur	x8, [x29, #-72]
Lloh62:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh63:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh64:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.20:
	add	sp, sp, #2, lsl #12             ; =8192
	add	sp, sp, #32
	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
	ldp	x28, x27, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh51, Lloh52
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh60, Lloh61
	.loh AdrpAdd	Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"usage: %s address port savefile\n"

	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.comm	_PF_INET,4,2                    ; @PF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
l_.str.1:                               ; @.str.1
	.asciz	"socket"

	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_RDWR,4,2                     ; @O_RDWR
l_.str.2:                               ; @.str.2
	.asciz	"open"

l_.str.3:                               ; @.str.3
	.asciz	"ftruncate savefile"

l_.str.4:                               ; @.str.4
	.asciz	"connect"

	.comm	_GETSTR,8,3                     ; @GETSTR
l_.str.5:                               ; @.str.5
	.asciz	"socket write"

l_.str.6:                               ; @.str.6
	.asciz	"socket read"

l_.str.7:                               ; @.str.7
	.asciz	"write file"

	.comm	_EXIT_SUCCESS,4,2               ; @EXIT_SUCCESS
.subsections_via_symbols
