	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wince_initialize
_wince_initialize:                      ## @wince_initialize
	.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	%r12
	pushq	%rbx
	subq	$336, %rsp                      ## imm = 0x150
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_connection_initialized@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	jne	LBB0_4
## %bb.1:
	xorl	%eax, %eax
	callq	_CeRapiInit
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	xorl	%eax, %eax
	callq	_CeRapiUninit
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
	jmp	LBB0_4
LBB0_2:
	movl	$1, (%rbx)
LBB0_4:
	movq	_WINCE_STUB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_upload_to_device
	movq	%rax, %r14
	leaq	-304(%rbp), %rdi
	movq	%rax, %rsi
	callq	_strcpy
	movq	_remote_add_host@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	leaq	-304(%rbp), %r15
	movq	%r15, %rdi
	callq	_strcat
	movq	%r15, %rdi
	callq	_strlen
	leaq	(%rax,%rbp), %rbx
	addq	$-304, %rbx                     ## imm = 0xFED0
	movq	%r15, %rdi
	callq	_strlen
	movl	$256, %esi                      ## imm = 0x100
	subq	%rax, %rsi
	movq	%rbx, %rdi
	callq	_gethostname
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_7:
	movq	_AF_INET@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_9
## %bb.8:
	leaq	L_.str.4(%rip), %rdi
	callq	_stub_error
LBB0_9:
	movl	$1, -308(%rbp)
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_REUSEADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-308(%rbp), %rcx
	movl	%r12d, %edi
	movl	$4, %r8d
	callq	_setsockopt
	leaq	-320(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movl	(%rbx), %eax
	movl	%eax, -316(%rbp)
	movl	$7000, %edi                     ## imm = 0x1B58
	callq	_htons
	movl	%eax, -320(%rbp)
	movl	%r12d, %edi
	movq	%r15, %rsi
	movl	$8, %edx
	callq	_bind
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_11:
	movl	%r12d, %edi
	movl	$1, %esi
	callq	_listen
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_13:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_towide
	movl	%eax, %ebx
	leaq	-304(%rbp), %rdi
	xorl	%esi, %esi
	callq	_towide
	leaq	-324(%rbp), %rcx
	movq	%rcx, 24(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsp)
	movq	$0, 16(%rsp)
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_CeCreateProcess
	testl	%eax, %eax
	jne	LBB0_15
## %bb.14:
	xorl	%eax, %eax
	callq	_CeGetLastError
	leaq	L_.str.7(%rip), %rdi
	movq	%r14, %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_error
LBB0_15:
	movl	%r12d, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_accept
	movq	_s@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	testl	%eax, %eax
	jns	LBB0_17
## %bb.16:
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_17:
	movl	%r12d, %edi
	callq	_close
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_19
## %bb.18:
	addq	$336, %rsp                      ## imm = 0x150
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_connection_initialized,4,2     ## @connection_initialized
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't initialize connection to remote device.\n"

L_.str.1:                               ## @.str.1
	.asciz	"wince-stub.exe"

	.comm	_WINCE_STUB,4,2                 ## @WINCE_STUB
	.comm	_remote_add_host,8,3            ## @remote_add_host
L_.str.2:                               ## @.str.2
	.asciz	" "

L_.str.3:                               ## @.str.3
	.asciz	"couldn't get hostname of this system."

	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
L_.str.4:                               ## @.str.4
	.asciz	"Couldn't connect to host system."

	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ## @SO_REUSEADDR
L_.str.5:                               ## @.str.5
	.asciz	"couldn't bind socket"

L_.str.6:                               ## @.str.6
	.asciz	"Couldn't open socket for listening.\n"

L_.str.7:                               ## @.str.7
	.asciz	"Unable to start remote stub '%s'.  Windows CE error %d."

	.comm	_s,4,2                          ## @s
L_.str.8:                               ## @.str.8
	.asciz	"couldn't set up server for connection."

	.no_dead_strip	_wince_initialize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wince_initialize
_wince_initialize:                      ; @wince_initialize
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #352
	.cfi_def_cfa_offset 352
	stp	x22, x21, [sp, #304]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #320]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #336]            ; 16-byte Folded Spill
	add	x29, sp, #336
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x19, _connection_initialized@GOTPAGE
Lloh4:
	ldr	x19, [x19, _connection_initialized@GOTPAGEOFF]
	ldr	w8, [x19]
	cbnz	w8, LBB0_4
; %bb.1:
	bl	_CeRapiInit
	cbz	w0, LBB0_3
; %bb.2:
	bl	_CeRapiUninit
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
	b	LBB0_4
LBB0_3:
	mov	w8, #1
	str	w8, [x19]
LBB0_4:
Lloh7:
	adrp	x8, _WINCE_STUB@GOTPAGE
Lloh8:
	ldr	x8, [x8, _WINCE_STUB@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_upload_to_device
	mov	x19, x0
	add	x20, sp, #40
	add	x0, sp, #40
	mov	x1, x19
	bl	_strcpy
Lloh12:
	adrp	x8, _remote_add_host@GOTPAGE
Lloh13:
	ldr	x8, [x8, _remote_add_host@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.5:
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x0, sp, #40
	bl	_strcat
	add	x0, sp, #40
	bl	_strlen
	add	x20, x20, x0
	add	x0, sp, #40
	bl	_strlen
	mov	w8, #256
	sub	x1, x8, x0
	mov	x0, x20
	bl	_gethostname
	cbz	x0, LBB0_7
; %bb.6:
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_error
LBB0_7:
Lloh19:
	adrp	x21, _AF_INET@GOTPAGE
Lloh20:
	ldr	x21, [x21, _AF_INET@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh21:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	mov	x20, x0
	tbz	w0, #31, LBB0_9
; %bb.8:
Lloh24:
	adrp	x0, l_.str.4@PAGE
Lloh25:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_stub_error
LBB0_9:
	mov	w8, #1
	str	w8, [sp, #36]
Lloh26:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x8, _SO_REUSEADDR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SO_REUSEADDR@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	add	x3, sp, #36
	mov	x0, x20
	mov	w4, #4
	bl	_setsockopt
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w8, [x21]
	str	w8, [sp, #28]
	mov	w0, #7000
	bl	_htons
	str	w0, [sp, #24]
	add	x1, sp, #24
	mov	x0, x20
	mov	w2, #8
	bl	_bind
	cbz	x0, LBB0_11
; %bb.10:
Lloh32:
	adrp	x0, l_.str.5@PAGE
Lloh33:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_error
LBB0_11:
	mov	x0, x20
	mov	w1, #1
	bl	_listen
	cbz	x0, LBB0_13
; %bb.12:
Lloh34:
	adrp	x0, l_.str.6@PAGE
Lloh35:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_error
LBB0_13:
	mov	x0, x19
	mov	x1, #0
	bl	_towide
	mov	x21, x0
	add	x0, sp, #40
	mov	x1, #0
	bl	_towide
	mov	x1, x0
	add	x8, sp, #20
	stp	xzr, x8, [sp]
	mov	x0, x21
	mov	x2, #0
	mov	x3, #0
	mov	w4, #0
	mov	w5, #0
	mov	x6, #0
	mov	x7, #0
	bl	_CeCreateProcess
	cbnz	w0, LBB0_15
; %bb.14:
	bl	_CeGetLastError
	stp	x19, x0, [sp]
Lloh36:
	adrp	x0, l_.str.7@PAGE
Lloh37:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_error
LBB0_15:
	mov	x0, x20
	mov	x1, #0
	mov	x2, #0
	bl	_accept
Lloh38:
	adrp	x8, _s@GOTPAGE
Lloh39:
	ldr	x8, [x8, _s@GOTPAGEOFF]
Lloh40:
	str	w0, [x8]
	tbz	w0, #31, LBB0_17
; %bb.16:
Lloh41:
	adrp	x0, l_.str.8@PAGE
Lloh42:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_error
LBB0_17:
	mov	x0, x20
	bl	_close
	ldur	x8, [x29, #-40]
Lloh43:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh44:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh45:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_19
; %bb.18:
	ldp	x29, x30, [sp, #336]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #320]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #304]            ; 16-byte Folded Reload
	add	sp, sp, #352
	ret
LBB0_19:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotStr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_connection_initialized,4,2     ; @connection_initialized
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't initialize connection to remote device.\n"

l_.str.1:                               ; @.str.1
	.asciz	"wince-stub.exe"

	.comm	_WINCE_STUB,4,2                 ; @WINCE_STUB
	.comm	_remote_add_host,8,3            ; @remote_add_host
l_.str.2:                               ; @.str.2
	.asciz	" "

l_.str.3:                               ; @.str.3
	.asciz	"couldn't get hostname of this system."

	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
l_.str.4:                               ; @.str.4
	.asciz	"Couldn't connect to host system."

	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ; @SO_REUSEADDR
l_.str.5:                               ; @.str.5
	.asciz	"couldn't bind socket"

l_.str.6:                               ; @.str.6
	.asciz	"Couldn't open socket for listening.\n"

l_.str.7:                               ; @.str.7
	.asciz	"Unable to start remote stub '%s'.  Windows CE error %d."

	.comm	_s,4,2                          ; @s
l_.str.8:                               ; @.str.8
	.asciz	"couldn't set up server for connection."

	.no_dead_strip	_wince_initialize
.subsections_via_symbols
