	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_hangup                 ## -- Begin function netplay_hangup
	.p2align	4, 0x90
_netplay_hangup:                        ## @netplay_hangup
	.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	%rbx
	subq	$536, %rsp                      ## imm = 0x218
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	testq	%rdi, %rdi
	je	LBB0_24
## %bb.1:
	movq	%rsi, %r14
	cmpl	$0, (%rsi)
	je	LBB0_24
## %bb.2:
	movq	%rdi, %rbx
	movb	$0, -33(%rbp)
	movb	$0, -544(%rbp)
	cmpq	$0, 72(%rdi)
	je	LBB0_6
## %bb.3:
	movq	40(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.4:
	leaq	-544(%rbp), %r15
	movq	_MSG_NETPLAY_SERVER_NAMED_HANGUP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movq	40(%r14), %rcx
	movq	%r15, %rdi
	movl	$511, %esi                      ## imm = 0x1FF
	movq	%rax, %rdx
	callq	_snprintf
	jmp	LBB0_7
LBB0_6:
	movq	_MSG_NETPLAY_CLIENT_HANGUP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movq	%rax, %r15
	movl	$0, (%rbx)
	jmp	LBB0_7
LBB0_5:
	movq	_MSG_NETPLAY_SERVER_HANGUP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msg_hash_to_str
	movq	%rax, %r15
LBB0_7:
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	callq	_RARCH_LOG
	movq	_MESSAGE_QUEUE_ICON_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_MESSAGE_QUEUE_CATEGORY_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	%r15, %rdi
	movl	$1, %esi
	movl	$180, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_runloop_msg_queue_push
	movl	36(%r14), %edi
	callq	_socket_close
	movl	$0, (%r14)
	leaq	32(%r14), %rdi
	callq	_netplay_deinit_socket_buffer
	leaq	28(%r14), %rdi
	callq	_netplay_deinit_socket_buffer
	cmpq	$0, 72(%rbx)
	je	LBB0_8
## %bb.17:
	movq	8(%r14), %rax
	movq	_NETPLAY_CONNECTION_PLAYING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_19
## %bb.18:
	movq	_NETPLAY_CONNECTION_SLAVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_22
LBB0_19:
	movq	%r14, %rax
	subq	56(%rbx), %rax
	sarq	$4, %rax
	movabsq	$-6148914691236517205, %rdx     ## imm = 0xAAAAAAAAAAAAAAAB
	imulq	%rax, %rdx
	leaq	1(%rdx), %rcx
	movq	_NETPLAY_CONNECTION_DELAYED_DISCONNECT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r14)
	movq	48(%rbx), %rax
	movl	4(%rax,%rdx,4), %esi
	movq	$-2, %rax
                                        ## kill: def $cl killed $cl killed $rcx
	rolq	%cl, %rax
	movl	%esi, 24(%r14)
	andq	%rax, 8(%rbx)
	andq	%rax, 32(%rbx)
	movq	40(%rbx), %rcx
	movq	$0, 8(%rcx,%rdx,8)
	movq	_MAX_INPUT_DEVICES@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_22
## %bb.20:
	movq	24(%rbx), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	andq	%rax, (%rdx,%rsi,8)
	incq	%rsi
	cmpq	(%rcx), %rsi
	jb	LBB0_21
	jmp	LBB0_22
LBB0_8:
	movq	_NETPLAY_CONNECTION_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 68(%rbx)
	movq	16(%rbx), %rcx
	movl	$1, %eax
	shlq	%cl, %rax
	andq	%rax, 8(%rbx)
	movq	_MAX_CLIENTS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	testq	%rdx, %rdx
	je	LBB0_13
## %bb.9:
	xorl	%esi, %esi
	cmpq	%rcx, %rsi
	je	LBB0_12
	.p2align	4, 0x90
LBB0_11:
	movq	40(%rbx), %rcx
	movq	$0, (%rcx,%rsi,8)
	movq	(%rax), %rdx
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	incq	%rsi
	cmpq	%rdx, %rsi
	jae	LBB0_13
## %bb.26:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	16(%rbx), %rcx
	cmpq	%rcx, %rsi
	jne	LBB0_11
	jmp	LBB0_12
LBB0_13:
	movq	_MAX_INPUT_DEVICES@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_16
## %bb.14:
	movq	24(%rbx), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movzbl	16(%rbx), %ecx
	movl	$1, %edi
	shlq	%cl, %rdi
	andq	%rdi, (%rdx,%rsi,8)
	incq	%rsi
	cmpq	(%rax), %rsi
	jb	LBB0_15
LBB0_16:
	movq	_NETPLAY_STALL_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 64(%rbx)
LBB0_22:
	cmpq	$0, 16(%r14)
	je	LBB0_24
## %bb.23:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_remote_unpaused
LBB0_24:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_27
## %bb.25:
	addq	$536, %rsp                      ## imm = 0x218
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MSG_NETPLAY_SERVER_NAMED_HANGUP,4,2 ## @MSG_NETPLAY_SERVER_NAMED_HANGUP
	.comm	_MSG_NETPLAY_SERVER_HANGUP,4,2  ## @MSG_NETPLAY_SERVER_HANGUP
	.comm	_MSG_NETPLAY_CLIENT_HANGUP,4,2  ## @MSG_NETPLAY_CLIENT_HANGUP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[netplay] %s\n"

	.comm	_MESSAGE_QUEUE_ICON_DEFAULT,4,2 ## @MESSAGE_QUEUE_ICON_DEFAULT
	.comm	_MESSAGE_QUEUE_CATEGORY_INFO,4,2 ## @MESSAGE_QUEUE_CATEGORY_INFO
	.comm	_NETPLAY_CONNECTION_NONE,4,2    ## @NETPLAY_CONNECTION_NONE
	.comm	_MAX_CLIENTS,8,3                ## @MAX_CLIENTS
	.comm	_MAX_INPUT_DEVICES,8,3          ## @MAX_INPUT_DEVICES
	.comm	_NETPLAY_STALL_NONE,4,2         ## @NETPLAY_STALL_NONE
	.comm	_NETPLAY_CONNECTION_PLAYING,8,3 ## @NETPLAY_CONNECTION_PLAYING
	.comm	_NETPLAY_CONNECTION_SLAVE,8,3   ## @NETPLAY_CONNECTION_SLAVE
	.comm	_NETPLAY_CONNECTION_DELAYED_DISCONNECT,8,3 ## @NETPLAY_CONNECTION_DELAYED_DISCONNECT
	.comm	_CMD_EVENT_DISCORD_UPDATE,4,2   ## @CMD_EVENT_DISCORD_UPDATE
	.comm	_DISCORD_PRESENCE_NETPLAY_NETPLAY_STOPPED,4,2 ## @DISCORD_PRESENCE_NETPLAY_NETPLAY_STOPPED
	.comm	_discord_is_inited,8,3          ## @discord_is_inited
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_hangup                 ; -- Begin function netplay_hangup
	.p2align	2
_netplay_hangup:                        ; @netplay_hangup
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	sub	sp, sp, #528
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	cbz	x0, LBB0_23
; %bb.1:
	mov	x19, x1
	ldr	w8, [x1]
	cbz	w8, LBB0_23
; %bb.2:
	mov	x20, x0
	strb	wzr, [sp, #519]
	strb	wzr, [sp, #8]
	ldr	x8, [x0, #72]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x8, [x19, #40]
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.4:
	add	x21, sp, #8
Lloh3:
	adrp	x8, _MSG_NETPLAY_SERVER_NAMED_HANGUP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MSG_NETPLAY_SERVER_NAMED_HANGUP@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	mov	x2, x0
	ldr	x3, [x19, #40]
	add	x0, sp, #8
	mov	w1, #511
	bl	_snprintf
	b	LBB0_7
LBB0_5:
Lloh6:
	adrp	x8, _MSG_NETPLAY_CLIENT_HANGUP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MSG_NETPLAY_CLIENT_HANGUP@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	mov	x21, x0
	str	wzr, [x20]
	b	LBB0_7
LBB0_6:
Lloh9:
	adrp	x8, _MSG_NETPLAY_SERVER_HANGUP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MSG_NETPLAY_SERVER_HANGUP@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_msg_hash_to_str
	mov	x21, x0
LBB0_7:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_RARCH_LOG
Lloh14:
	adrp	x8, _MESSAGE_QUEUE_ICON_DEFAULT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MESSAGE_QUEUE_ICON_DEFAULT@GOTPAGEOFF]
Lloh16:
	ldr	w5, [x8]
Lloh17:
	adrp	x8, _MESSAGE_QUEUE_CATEGORY_INFO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MESSAGE_QUEUE_CATEGORY_INFO@GOTPAGEOFF]
Lloh19:
	ldr	w6, [x8]
	mov	x0, x21
	mov	w1, #1
	mov	w2, #180
	mov	w3, #0
	mov	x4, #0
	bl	_runloop_msg_queue_push
	ldr	w0, [x19, #36]
	bl	_socket_close
	str	wzr, [x19]
	add	x0, x19, #32
	bl	_netplay_deinit_socket_buffer
	add	x0, x19, #28
	bl	_netplay_deinit_socket_buffer
	ldr	x8, [x20, #72]
	cbz	x8, LBB0_12
; %bb.8:
	ldr	x8, [x19, #8]
Lloh20:
	adrp	x9, _NETPLAY_CONNECTION_PLAYING@GOTPAGE
Lloh21:
	ldr	x9, [x9, _NETPLAY_CONNECTION_PLAYING@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
Lloh23:
	adrp	x10, _NETPLAY_CONNECTION_SLAVE@GOTPAGE
Lloh24:
	ldr	x10, [x10, _NETPLAY_CONNECTION_SLAVE@GOTPAGEOFF]
Lloh25:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_21
; %bb.9:
	ldr	x8, [x20, #56]
	sub	x8, x19, x8
	asr	x8, x8, #4
	mov	x9, #-6148914691236517206
	movk	x9, #43691
	orr	x10, xzr, #0x1
	madd	x8, x8, x9, x10
Lloh26:
	adrp	x9, _NETPLAY_CONNECTION_DELAYED_DISCONNECT@GOTPAGE
Lloh27:
	ldr	x9, [x9, _NETPLAY_CONNECTION_DELAYED_DISCONNECT@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	str	x9, [x19, #8]
	ldr	x9, [x20, #48]
	ldr	w9, [x9, x8, lsl #2]
	str	w9, [x19, #24]
	mov	w9, #1
	lsl	x10, x9, x8
	ldr	x9, [x20, #8]
	bic	x9, x9, x10
	str	x9, [x20, #8]
	ldp	x9, x11, [x20, #32]
	bic	x9, x9, x10
	str	x9, [x20, #32]
	str	xzr, [x11, x8, lsl #3]
Lloh29:
	adrp	x8, _MAX_INPUT_DEVICES@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MAX_INPUT_DEVICES@GOTPAGEOFF]
	ldr	x9, [x8]
	cbz	x9, LBB0_21
; %bb.10:
	mov	x9, #0
	mvn	x10, x10
	ldr	x11, [x20, #24]
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	lsl	x12, x9, #3
	ldr	x13, [x11, x12]
	and	x13, x13, x10
	str	x13, [x11, x12]
	add	x9, x9, #1
	ldr	x12, [x8]
	cmp	x9, x12
	b.lo	LBB0_11
	b	LBB0_21
LBB0_12:
Lloh31:
	adrp	x8, _NETPLAY_CONNECTION_NONE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _NETPLAY_CONNECTION_NONE@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	str	w8, [x20, #68]
	mov	w8, #1
	ldp	x9, x11, [x20, #8]
	lsl	x8, x8, x11
	and	x8, x9, x8
	str	x8, [x20, #8]
Lloh34:
	adrp	x8, _MAX_CLIENTS@GOTPAGE
Lloh35:
	ldr	x8, [x8, _MAX_CLIENTS@GOTPAGEOFF]
	ldr	x9, [x8]
	cbz	x9, LBB0_17
; %bb.13:
	mov	x10, #0
	cmp	x10, x11
	b.eq	LBB0_15
LBB0_14:
	ldr	x9, [x20, #40]
	str	xzr, [x9, x10, lsl #3]
	ldr	x9, [x8]
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	add	x10, x10, #1
	cmp	x10, x9
	b.hs	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x11, [x20, #16]
	cmp	x10, x11
	b.ne	LBB0_14
	b	LBB0_15
LBB0_17:
Lloh36:
	adrp	x8, _MAX_INPUT_DEVICES@GOTPAGE
Lloh37:
	ldr	x8, [x8, _MAX_INPUT_DEVICES@GOTPAGEOFF]
	ldr	x9, [x8]
	cbz	x9, LBB0_20
; %bb.18:
	mov	x9, #0
	ldr	x10, [x20, #24]
	mov	w11, #1
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x20, #16]
	lsl	x12, x11, x12
	lsl	x13, x9, #3
	ldr	x14, [x10, x13]
	and	x12, x14, x12
	str	x12, [x10, x13]
	add	x9, x9, #1
	ldr	x12, [x8]
	cmp	x9, x12
	b.lo	LBB0_19
LBB0_20:
Lloh38:
	adrp	x8, _NETPLAY_STALL_NONE@GOTPAGE
Lloh39:
	ldr	x8, [x8, _NETPLAY_STALL_NONE@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	str	w8, [x20, #64]
LBB0_21:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_23
; %bb.22:
	mov	x0, x20
	mov	x1, x19
	bl	_remote_unpaused
LBB0_23:
	ldur	x8, [x29, #-40]
Lloh41:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh42:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_25
; %bb.24:
	add	sp, sp, #528
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_25:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_MSG_NETPLAY_SERVER_NAMED_HANGUP,4,2 ; @MSG_NETPLAY_SERVER_NAMED_HANGUP
	.comm	_MSG_NETPLAY_SERVER_HANGUP,4,2  ; @MSG_NETPLAY_SERVER_HANGUP
	.comm	_MSG_NETPLAY_CLIENT_HANGUP,4,2  ; @MSG_NETPLAY_CLIENT_HANGUP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[netplay] %s\n"

	.comm	_MESSAGE_QUEUE_ICON_DEFAULT,4,2 ; @MESSAGE_QUEUE_ICON_DEFAULT
	.comm	_MESSAGE_QUEUE_CATEGORY_INFO,4,2 ; @MESSAGE_QUEUE_CATEGORY_INFO
	.comm	_NETPLAY_CONNECTION_NONE,4,2    ; @NETPLAY_CONNECTION_NONE
	.comm	_MAX_CLIENTS,8,3                ; @MAX_CLIENTS
	.comm	_MAX_INPUT_DEVICES,8,3          ; @MAX_INPUT_DEVICES
	.comm	_NETPLAY_STALL_NONE,4,2         ; @NETPLAY_STALL_NONE
	.comm	_NETPLAY_CONNECTION_PLAYING,8,3 ; @NETPLAY_CONNECTION_PLAYING
	.comm	_NETPLAY_CONNECTION_SLAVE,8,3   ; @NETPLAY_CONNECTION_SLAVE
	.comm	_NETPLAY_CONNECTION_DELAYED_DISCONNECT,8,3 ; @NETPLAY_CONNECTION_DELAYED_DISCONNECT
	.comm	_CMD_EVENT_DISCORD_UPDATE,4,2   ; @CMD_EVENT_DISCORD_UPDATE
	.comm	_DISCORD_PRESENCE_NETPLAY_NETPLAY_STOPPED,4,2 ; @DISCORD_PRESENCE_NETPLAY_NETPLAY_STOPPED
	.comm	_discord_is_inited,8,3          ; @discord_is_inited
.subsections_via_symbols
