	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_io_wait_dowork                 ## -- Begin function io_wait_dowork
	.p2align	4, 0x90
_io_wait_dowork:                        ## @io_wait_dowork
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	8(%rdi), %edi
	callq	_event_reset
	movq	_IOW_WAIT_SIGNAL@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_2
## %bb.1:
	movl	8(%r15), %edi
	leaq	_io_wait_dowork.err_shift(%rip), %rsi
	callq	_wait_signal
LBB0_2:
	movq	_IOW_TO_LINK@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_EVENT_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ecx, %ecx
	jmp	LBB0_9
LBB0_4:
	movq	_IOW_FRAG@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_6
## %bb.5:
	movq	%r15, %rdi
	callq	_TO_LINK_FRAG
	xorl	%ecx, %ecx
	movl	$0, %esi
	testq	%rax, %rax
	jne	LBB0_9
LBB0_6:
	movq	_IOW_READ_TUN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	%r14d, %ecx
	je	LBB0_8
## %bb.7:
	movq	_EVENT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_8:
	xorl	%esi, %esi
LBB0_9:
	movq	_IOW_TO_TUN@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_11
## %bb.10:
	movq	_EVENT_WRITE@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	jmp	LBB0_13
LBB0_11:
	movq	_IOW_READ_LINK@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_13
## %bb.12:
	movq	_EVENT_READ@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
LBB0_13:
	movq	_IOW_MBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	%r14d, %edx
	je	LBB0_15
## %bb.14:
	movq	_EVENT_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
LBB0_15:
	orl	%esi, %edx
	movq	_IOW_READ_TUN_FORCE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	%r14d, %ebx
	je	LBB0_17
## %bb.16:
	movq	_EVENT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_17:
	orl	%ecx, %ebx
	movl	8(%r15), %esi
	movl	12(%r15), %edi
	leaq	_io_wait_dowork.socket_shift(%rip), %rcx
	xorl	%r8d, %r8d
	callq	_socket_set
	movl	8(%r15), %esi
	movl	48(%r15), %edi
	leaq	_io_wait_dowork.tun_shift(%rip), %rcx
	movl	%ebx, %edx
	xorl	%r8d, %r8d
	callq	_tun_set
	movq	_ES_ERROR@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	movl	%eax, (%r15)
	movq	24(%r15), %rax
	cmpl	$0, (%rax)
	jne	LBB0_31
## %bb.18:
	movq	_IOW_CHECK_RESIDUAL@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	je	LBB0_21
## %bb.19:
	movl	12(%r15), %edi
	callq	_socket_read_residual
	testl	%eax, %eax
	je	LBB0_21
## %bb.20:
	movq	_SOCKET_READ@GOTPCREL(%rip), %rax
LBB0_30:
	movl	(%rax), %eax
	movl	%eax, (%r15)
	jmp	LBB0_31
LBB0_21:
	movl	8(%r15), %ebx
	leaq	4(%r15), %r14
	leaq	-112(%rbp), %r12
	movq	%r12, %rdi
	callq	_SIZE
	movl	%ebx, %edi
	movq	%r14, %rsi
	movq	%r12, %rdx
	movl	%eax, %ecx
	callq	_event_wait
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%eax, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_check_status
	testl	%r14d, %r14d
	jle	LBB0_28
## %bb.22:
	movl	$0, (%r15)
	movl	%r14d, %r8d
	cmpl	$1, %r14d
	jne	LBB0_24
## %bb.23:
	xorl	%edx, %edx
	jmp	LBB0_26
LBB0_28:
	jne	LBB0_31
## %bb.29:
	movq	_ES_TIMEOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_30
LBB0_24:
	movl	%r8d, %esi
	andl	$-2, %esi
	leaq	-88(%rbp), %rdi
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movl	-24(%rdi), %eax
	andl	$3, %eax
	movq	-16(%rdi), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %eax
	orl	%ebx, %eax
	movl	%eax, (%r15)
	movl	-8(%rdi), %ebx
	andl	$3, %ebx
	movq	(%rdi), %rcx
	movzbl	(%rcx), %ecx
	shll	%cl, %ebx
	orl	%eax, %ebx
	movl	%ebx, (%r15)
	addq	$2, %rdx
	addq	$32, %rdi
	cmpq	%rdx, %rsi
	jne	LBB0_25
LBB0_26:
	testb	$1, %r8b
	je	LBB0_31
## %bb.27:
	shlq	$4, %rdx
	movl	-112(%rbp,%rdx), %eax
	andl	$3, %eax
	movq	-104(%rbp,%rdx), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	orl	%eax, %ebx
	movl	%ebx, (%r15)
LBB0_31:
	xorl	%eax, %eax
	callq	_update_time
	movl	(%r15), %edx
	testl	%edx, (%r13)
	je	LBB0_33
## %bb.32:
	movq	24(%r15), %rdi
	callq	_get_signal
	movl	(%r15), %edx
LBB0_33:
	movq	_D_EVENT_WAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dmsg
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_35
## %bb.34:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_35:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_io_wait_dowork.socket_shift,4,2 ## @io_wait_dowork.socket_shift
	.section	__DATA,__data
	.p2align	2                               ## @io_wait_dowork.tun_shift
_io_wait_dowork.tun_shift:
	.long	2                               ## 0x2

	.p2align	2                               ## @io_wait_dowork.err_shift
_io_wait_dowork.err_shift:
	.long	4                               ## 0x4

	.comm	_IOW_WAIT_SIGNAL,4,2            ## @IOW_WAIT_SIGNAL
	.comm	_IOW_TO_LINK,4,2                ## @IOW_TO_LINK
	.comm	_IOW_SHAPER,4,2                 ## @IOW_SHAPER
	.comm	_EVENT_WRITE,4,2                ## @EVENT_WRITE
	.comm	_IOW_FRAG,4,2                   ## @IOW_FRAG
	.comm	_IOW_READ_TUN,4,2               ## @IOW_READ_TUN
	.comm	_EVENT_READ,4,2                 ## @EVENT_READ
	.comm	_IOW_TO_TUN,4,2                 ## @IOW_TO_TUN
	.comm	_IOW_READ_LINK,4,2              ## @IOW_READ_LINK
	.comm	_IOW_MBUF,4,2                   ## @IOW_MBUF
	.comm	_IOW_READ_TUN_FORCE,4,2         ## @IOW_READ_TUN_FORCE
	.comm	_ES_ERROR,4,2                   ## @ES_ERROR
	.comm	_IOW_CHECK_RESIDUAL,4,2         ## @IOW_CHECK_RESIDUAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"event_wait"

	.comm	_ES_TIMEOUT,4,2                 ## @ES_TIMEOUT
	.comm	_SOCKET_READ,4,2                ## @SOCKET_READ
	.comm	_D_EVENT_WAIT,4,2               ## @D_EVENT_WAIT
L_.str.1:                               ## @.str.1
	.asciz	"I/O WAIT status=0x%04x"

	.comm	_MODE_SERVER,8,3                ## @MODE_SERVER
	.comm	_management,8,3                 ## @management
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_io_wait_dowork                 ; -- Begin function io_wait_dowork
	.p2align	2
_io_wait_dowork:                        ; @io_wait_dowork
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	ldr	w0, [x0, #8]
	bl	_event_reset
Lloh3:
	adrp	x8, _IOW_WAIT_SIGNAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IOW_WAIT_SIGNAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_2
; %bb.1:
	ldr	w0, [x19, #8]
Lloh6:
	adrp	x1, _io_wait_dowork.err_shift@PAGE
Lloh7:
	add	x1, x1, _io_wait_dowork.err_shift@PAGEOFF
	bl	_wait_signal
LBB0_2:
Lloh8:
	adrp	x8, _IOW_TO_LINK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IOW_TO_LINK@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x22, _EVENT_WRITE@GOTPAGE
Lloh12:
	ldr	x22, [x22, _EVENT_WRITE@GOTPAGEOFF]
Lloh13:
	adrp	x21, _EVENT_READ@GOTPAGE
Lloh14:
	ldr	x21, [x21, _EVENT_READ@GOTPAGEOFF]
	tst	w8, w20
	b.eq	LBB0_4
; %bb.3:
	mov	w8, #0
	ldr	w9, [x22]
	b	LBB0_8
LBB0_4:
Lloh15:
	adrp	x8, _IOW_FRAG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _IOW_FRAG@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_7
; %bb.5:
	mov	x0, x19
	bl	_TO_LINK_FRAG
	cbz	x0, LBB0_7
; %bb.6:
	mov	w8, #0
	mov	w9, #0
	b	LBB0_8
LBB0_7:
	mov	w9, #0
Lloh18:
	adrp	x8, _IOW_READ_TUN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _IOW_READ_TUN@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	ldr	w10, [x21]
	tst	w8, w20
	csel	w8, wzr, w10, eq
LBB0_8:
Lloh21:
	adrp	x10, _IOW_TO_TUN@GOTPAGE
Lloh22:
	ldr	x10, [x10, _IOW_TO_TUN@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	tst	w10, w20
	b.eq	LBB0_10
; %bb.9:
	ldr	w10, [x22]
	orr	w8, w10, w8
	b	LBB0_12
LBB0_10:
Lloh24:
	adrp	x10, _IOW_READ_LINK@GOTPAGE
Lloh25:
	ldr	x10, [x10, _IOW_READ_LINK@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	tst	w10, w20
	b.eq	LBB0_12
; %bb.11:
	ldr	w10, [x21]
	orr	w9, w10, w9
LBB0_12:
Lloh27:
	adrp	x10, _IOW_MBUF@GOTPAGE
Lloh28:
	ldr	x10, [x10, _IOW_MBUF@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	ldr	w11, [x22]
	tst	w10, w20
	csel	w10, wzr, w11, eq
	orr	w2, w10, w9
Lloh30:
	adrp	x9, _IOW_READ_TUN_FORCE@GOTPAGE
Lloh31:
	ldr	x9, [x9, _IOW_READ_TUN_FORCE@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	ldr	w10, [x21]
	tst	w9, w20
	csel	w9, wzr, w10, eq
	orr	w21, w9, w8
	ldp	w1, w0, [x19, #8]
Lloh33:
	adrp	x3, _io_wait_dowork.socket_shift@PAGE
Lloh34:
	add	x3, x3, _io_wait_dowork.socket_shift@PAGEOFF
	mov	x4, #0
	bl	_socket_set
	ldr	w0, [x19, #48]
	ldr	w1, [x19, #8]
Lloh35:
	adrp	x3, _io_wait_dowork.tun_shift@PAGE
Lloh36:
	add	x3, x3, _io_wait_dowork.tun_shift@PAGEOFF
	mov	x2, x21
	mov	x4, #0
	bl	_tun_set
Lloh37:
	adrp	x22, _ES_ERROR@GOTPAGE
Lloh38:
	ldr	x22, [x22, _ES_ERROR@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [x19]
	ldr	x8, [x19, #24]
	ldr	w8, [x8]
	cbnz	w8, LBB0_21
; %bb.13:
Lloh39:
	adrp	x8, _IOW_CHECK_RESIDUAL@GOTPAGE
Lloh40:
	ldr	x8, [x8, _IOW_CHECK_RESIDUAL@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_17
; %bb.14:
	ldr	w0, [x19, #12]
	bl	_socket_read_residual
	cbz	w0, LBB0_17
; %bb.15:
Lloh42:
	adrp	x8, _SOCKET_READ@GOTPAGE
Lloh43:
	ldr	x8, [x8, _SOCKET_READ@GOTPAGEOFF]
LBB0_16:
	ldr	w8, [x8]
	str	w8, [x19]
	b	LBB0_21
LBB0_17:
	ldr	w20, [x19, #8]
	add	x21, x19, #4
	add	x23, sp, #8
	add	x0, sp, #8
	bl	_SIZE
	mov	x3, x0
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x21
	bl	_event_wait
	mov	x20, x0
Lloh44:
	adrp	x1, l_.str@PAGE
Lloh45:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, #0
	mov	x3, #0
	bl	_check_status
	cmp	w20, #1
	b.lt	LBB0_20
; %bb.18:
	mov	w8, #0
	str	wzr, [x19]
	mov	w9, w20
	add	x10, x23, #8
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldur	w11, [x10, #-8]
	and	w11, w11, #0x3
	ldr	x12, [x10], #16
	ldr	w12, [x12]
	lsl	w11, w11, w12
	orr	w8, w8, w11
	str	w8, [x19]
	subs	x9, x9, #1
	b.ne	LBB0_19
	b	LBB0_21
LBB0_20:
	cbz	w20, LBB0_25
LBB0_21:
	bl	_update_time
	ldr	w2, [x19]
	ldr	w8, [x22]
	tst	w8, w2
	b.eq	LBB0_23
; %bb.22:
	ldr	x0, [x19, #24]
	bl	_get_signal
	ldr	w2, [x19]
LBB0_23:
Lloh46:
	adrp	x8, _D_EVENT_WAIT@GOTPAGE
Lloh47:
	ldr	x8, [x8, _D_EVENT_WAIT@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
Lloh49:
	adrp	x1, l_.str.1@PAGE
Lloh50:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dmsg
	ldur	x8, [x29, #-56]
Lloh51:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh52:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh53:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_26
; %bb.24:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_25:
Lloh54:
	adrp	x8, _ES_TIMEOUT@GOTPAGE
Lloh55:
	ldr	x8, [x8, _ES_TIMEOUT@GOTPAGEOFF]
	b	LBB0_16
LBB0_26:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh54, Lloh55
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_io_wait_dowork.socket_shift,4,2 ; @io_wait_dowork.socket_shift
	.section	__DATA,__data
	.p2align	2                               ; @io_wait_dowork.tun_shift
_io_wait_dowork.tun_shift:
	.long	2                               ; 0x2

	.p2align	2                               ; @io_wait_dowork.err_shift
_io_wait_dowork.err_shift:
	.long	4                               ; 0x4

	.comm	_IOW_WAIT_SIGNAL,4,2            ; @IOW_WAIT_SIGNAL
	.comm	_IOW_TO_LINK,4,2                ; @IOW_TO_LINK
	.comm	_IOW_SHAPER,4,2                 ; @IOW_SHAPER
	.comm	_EVENT_WRITE,4,2                ; @EVENT_WRITE
	.comm	_IOW_FRAG,4,2                   ; @IOW_FRAG
	.comm	_IOW_READ_TUN,4,2               ; @IOW_READ_TUN
	.comm	_EVENT_READ,4,2                 ; @EVENT_READ
	.comm	_IOW_TO_TUN,4,2                 ; @IOW_TO_TUN
	.comm	_IOW_READ_LINK,4,2              ; @IOW_READ_LINK
	.comm	_IOW_MBUF,4,2                   ; @IOW_MBUF
	.comm	_IOW_READ_TUN_FORCE,4,2         ; @IOW_READ_TUN_FORCE
	.comm	_ES_ERROR,4,2                   ; @ES_ERROR
	.comm	_IOW_CHECK_RESIDUAL,4,2         ; @IOW_CHECK_RESIDUAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"event_wait"

	.comm	_ES_TIMEOUT,4,2                 ; @ES_TIMEOUT
	.comm	_SOCKET_READ,4,2                ; @SOCKET_READ
	.comm	_D_EVENT_WAIT,4,2               ; @D_EVENT_WAIT
l_.str.1:                               ; @.str.1
	.asciz	"I/O WAIT status=0x%04x"

	.comm	_MODE_SERVER,8,3                ; @MODE_SERVER
	.comm	_management,8,3                 ; @management
.subsections_via_symbols
