	.file	"extr_webinspector.c_wi_connect.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"No device found, is it plugged in?\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"ios_webkit_debug_proxy"
	.section	.rodata.str1.8
	.align 8
.LC2:
	.string	"Could not connect to lockdownd, error code %d. Exiting.\n"
	.section	.rodata.str1.1
.LC3:
	.string	"UniqueDeviceID"
.LC4:
	.string	"DeviceName"
.LC5:
	.string	"ProductVersion"
.LC6:
	.string	"%d.%d.%d"
.LC7:
	.string	"com.apple.webinspector"
	.section	.rodata.str1.8
	.align 8
.LC8:
	.string	"Could not start com.apple.webinspector!"
	.section	.rodata.str1.1
.LC9:
	.string	"idevice_connect failed!"
.LC10:
	.string	"ssl connection failed!"
	.section	.rodata.str1.8
	.align 8
.LC11:
	.string	"Unable to get connection file descriptor."
	.align 8
.LC12:
	.string	"Could not set socket to non-blocking"
	.align 8
.LC13:
	.string	"Could not set socket receive timeout"
	.text
	.p2align 4
	.globl	wi_connect
	.type	wi_connect, @function
wi_connect:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r10, rdi
	mov	r14, r8
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	movsx	r13, r9d
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rsi
	mov	rsi, r10
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rcx
	sub	rsp, 112
	.cfi_def_cfa_offset 160
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 104[rsp], rax
	xor	eax, eax
	lea	rdi, 16[rsp]
	mov	DWORD PTR 12[rsp], -1
	mov	QWORD PTR 16[rsp], 0
	mov	QWORD PTR 24[rsp], 0
	mov	QWORD PTR 32[rsp], 0
	mov	QWORD PTR 40[rsp], 0
	mov	QWORD PTR 48[rsp], 0
	mov	QWORD PTR 56[rsp], 0
	call	idevice_new@PLT
	test	rax, rax
	jne	.L55
	mov	rdi, QWORD PTR 16[rsp]
	lea	rsi, 40[rsp]
	lea	rdx, .LC1[rip]
	call	lockdownd_client_new_with_handshake@PLT
	cmp	DWORD PTR LOCKDOWN_E_SUCCESS[rip], eax
	jne	.L56
	mov	rdi, QWORD PTR 40[rsp]
	test	r12, r12
	je	.L5
	xor	esi, esi
	lea	rcx, 24[rsp]
	lea	rdx, .LC3[rip]
	call	lockdownd_get_value@PLT
	test	eax, eax
	je	.L6
.L50:
	mov	rdi, QWORD PTR 40[rsp]
.L5:
	test	rbp, rbp
	je	.L7
	xor	esi, esi
	lea	rcx, 24[rsp]
	lea	rdx, .LC4[rip]
	call	lockdownd_get_value@PLT
	test	eax, eax
	je	.L8
.L51:
	mov	rdi, QWORD PTR 40[rsp]
.L7:
	test	rbx, rbx
	je	.L9
	lea	rcx, 24[rsp]
	lea	rdx, .LC5[rip]
	xor	esi, esi
	call	lockdownd_get_value@PLT
	mov	ebp, eax
	test	eax, eax
	je	.L10
.L53:
	mov	rdi, QWORD PTR 40[rsp]
.L9:
	lea	rdx, 32[rsp]
	lea	rsi, .LC7[rip]
	call	lockdownd_start_service@PLT
	test	rax, rax
	jne	.L13
	mov	rax, QWORD PTR 32[rsp]
	mov	esi, DWORD PTR 4[rax]
	test	esi, esi
	jne	.L14
.L13:
	lea	rdi, .LC8[rip]
	call	perror@PLT
	mov	edi, DWORD PTR 12[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L56:
	mov	edi, DWORD PTR stderr[rip]
	mov	edx, eax
	lea	rsi, .LC2[rip]
	xor	eax, eax
	call	fprintf@PLT
	mov	edi, DWORD PTR 12[rsp]
.L3:
	mov	r12d, -1
	test	edi, edi
	jle	.L27
	call	close@PLT
.L27:
	mov	rdi, QWORD PTR 48[rsp]
	call	free@PLT
	mov	rdi, QWORD PTR 40[rsp]
	call	lockdownd_client_free@PLT
	mov	rdi, QWORD PTR 16[rsp]
	call	idevice_free@PLT
	mov	rax, QWORD PTR 104[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L57
	add	rsp, 112
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L55:
	.cfi_restore_state
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	xor	eax, eax
	call	fprintf@PLT
	mov	edi, DWORD PTR 12[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rdi, QWORD PTR 16[rsp]
	lea	rdx, 48[rsp]
	call	idevice_connect@PLT
	test	rax, rax
	jne	.L58
	mov	rax, QWORD PTR 32[rsp]
	cmp	DWORD PTR [rax], 1
	je	.L59
.L16:
	mov	rdi, QWORD PTR 40[rsp]
	test	rdi, rdi
	je	.L19
	call	lockdownd_client_free@PLT
	mov	QWORD PTR 40[rsp], 0
.L19:
	mov	rdi, QWORD PTR 48[rsp]
	lea	rsi, 12[rsp]
	call	idevice_connection_get_fd@PLT
	test	rax, rax
	jne	.L60
	mov	edi, DWORD PTR 12[rsp]
	test	r13d, r13d
	js	.L61
	jne	.L62
	xor	eax, eax
	mov	ecx, 5
.L25:
	mov	edx, DWORD PTR SO_RCVTIMEO[rip]
	mov	esi, DWORD PTR SOL_SOCKET[rip]
	mov	DWORD PTR 64[rsp], ecx
	mov	r8d, 16
	lea	rcx, 64[rsp]
	mov	QWORD PTR 72[rsp], rax
	call	setsockopt@PLT
	test	rax, rax
	jne	.L63
.L24:
	mov	r12d, DWORD PTR 12[rsp]
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdi, QWORD PTR 24[rsp]
	lea	rsi, 64[rsp]
	mov	QWORD PTR 92[rsp], 0
	mov	DWORD PTR 100[rsp], 0
	mov	QWORD PTR 64[rsp], 0
	call	plist_get_string_val@PLT
	mov	rdi, QWORD PTR 64[rsp]
	test	rdi, rdi
	je	.L11
	lea	rdx, 92[rsp]
	lea	rcx, 96[rsp]
	lea	r8, 100[rsp]
	lea	rsi, .LC6[rip]
	call	sscanf@PLT
	cmp	eax, 1
	jle	.L52
	mov	ebp, DWORD PTR 92[rsp]
	mov	eax, DWORD PTR 96[rsp]
	sal	ebp, 16
	sal	eax, 8
	movzx	eax, ax
	and	ebp, 16711680
	or	ebp, eax
	movzx	eax, BYTE PTR 100[rsp]
	or	ebp, eax
.L52:
	mov	rdi, QWORD PTR 64[rsp]
.L11:
	mov	DWORD PTR [rbx], ebp
	call	free@PLT
	mov	rdi, QWORD PTR 24[rsp]
	call	plist_free@PLT
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, QWORD PTR 24[rsp]
	mov	rsi, rbp
	call	plist_get_string_val@PLT
	mov	rdi, QWORD PTR 24[rsp]
	call	plist_free@PLT
	mov	QWORD PTR 24[rsp], 0
	jmp	.L51
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, QWORD PTR 24[rsp]
	mov	rsi, r12
	call	plist_get_string_val@PLT
	mov	rdi, QWORD PTR 24[rsp]
	call	plist_free@PLT
	mov	QWORD PTR 24[rsp], 0
	jmp	.L50
	.p2align 4,,10
	.p2align 3
.L62:
	movabs	rcx, 2361183241434822607
	mov	rdx, r13
	shr	rdx, 3
	mov	rax, rdx
	mul	rcx
	shr	rdx, 4
	mov	ecx, edx
	imul	edx, edx, 1000
	movsx	rdx, edx
	sub	r13, rdx
	imul	rax, r13, 1000
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L59:
	test	r14, r14
	je	.L18
	mov	rdi, QWORD PTR 48[rsp]
	call	idevice_connection_enable_ssl@PLT
	test	rax, rax
	jne	.L18
	mov	rdi, QWORD PTR 48[rsp]
	lea	rsi, 56[rsp]
	call	idevice_connection_get_ssl_session@PLT
	test	rax, rax
	jne	.L18
	mov	rax, QWORD PTR 56[rsp]
	mov	QWORD PTR [r14], rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L58:
	lea	rdi, .LC9[rip]
	call	perror@PLT
	mov	edi, DWORD PTR 12[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L18:
	lea	rdi, .LC10[rip]
	call	perror@PLT
	mov	edi, DWORD PTR 12[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L61:
	mov	esi, DWORD PTR F_GETFL[rip]
	xor	eax, eax
	call	fcntl@PLT
	test	eax, eax
	je	.L23
	or	eax, DWORD PTR O_NONBLOCK[rip]
	mov	esi, DWORD PTR F_SETFL[rip]
	mov	edi, DWORD PTR 12[rsp]
	mov	edx, eax
	xor	eax, eax
	call	fcntl@PLT
	test	eax, eax
	jns	.L24
.L23:
	lea	rdi, .LC12[rip]
	call	perror@PLT
	mov	edi, DWORD PTR 12[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L60:
	lea	rdi, .LC11[rip]
	call	perror@PLT
	mov	edi, DWORD PTR 12[rsp]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L63:
	lea	rdi, .LC13[rip]
	call	perror@PLT
	mov	edi, DWORD PTR 12[rsp]
	jmp	.L3
.L57:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	wi_connect, .-wi_connect
	.comm	stderr,4,4
	.comm	SO_RCVTIMEO,4,4
	.comm	SOL_SOCKET,4,4
	.comm	O_NONBLOCK,4,4
	.comm	LOCKDOWN_E_SUCCESS,4,4
	.comm	INVALID_SOCKET,4,4
	.comm	F_SETFL,4,4
	.comm	F_GETFL,4,4
	.comm	FIONBIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_webinspector.c_wi_connect.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"No device found, is it plugged in?\012\000"
	.align	2
.LC1:
	.ascii	"ios_webkit_debug_proxy\000"
	.align	2
.LC2:
	.ascii	"Could not connect to lockdownd, error code %d. Exit"
	.ascii	"ing.\012\000"
	.align	2
.LC3:
	.ascii	"UniqueDeviceID\000"
	.align	2
.LC4:
	.ascii	"DeviceName\000"
	.align	2
.LC5:
	.ascii	"ProductVersion\000"
	.align	2
.LC6:
	.ascii	"%d.%d.%d\000"
	.align	2
.LC7:
	.ascii	"com.apple.webinspector\000"
	.align	2
.LC8:
	.ascii	"Could not start com.apple.webinspector!\000"
	.align	2
.LC9:
	.ascii	"idevice_connect failed!\000"
	.align	2
.LC10:
	.ascii	"ssl connection failed!\000"
	.align	2
.LC11:
	.ascii	"Unable to get connection file descriptor.\000"
	.align	2
.LC12:
	.ascii	"Could not set socket to non-blocking\000"
	.align	2
.LC13:
	.ascii	"Could not set socket receive timeout\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC14:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	wi_connect
	.syntax unified
	.arm
	.fpu softvfp
	.type	wi_connect, %function
wi_connect:
	@ args = 8, pretend = 0, frame = 56
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	ip, #0
	mvn	lr, #0
	sub	sp, sp, #64
	mov	r5, r3
	ldr	r3, .L62
	mov	r7, r1
	mov	r1, r0
	add	r0, sp, #12
	ldr	r3, [r3]
	str	r3, [sp, #60]
	mov	r3,#0
	mov	r6, r2
	ldr	r8, [sp, #88]
	str	ip, [sp, #12]
	str	ip, [sp, #16]
	str	ip, [sp, #20]
	str	ip, [sp, #24]
	str	ip, [sp, #28]
	str	ip, [sp, #36]
	str	lr, [sp, #32]
	bl	idevice_new
	subs	r4, r0, #0
	bne	.L52
	ldr	r2, .L62+4
	ldr	r0, [sp, #12]
	add	r1, sp, #24
	bl	lockdownd_client_new_with_handshake
	ldr	r3, .L62+8
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L53
	cmp	r7, #0
	ldr	r0, [sp, #24]
	beq	.L5
	mov	r1, r4
	ldr	r2, .L62+12
	add	r3, sp, #16
	bl	lockdownd_get_value
	subs	r4, r0, #0
	beq	.L6
	ldr	r0, [sp, #24]
.L5:
	cmp	r6, #0
	beq	.L7
	mov	r1, #0
	ldr	r2, .L62+16
	add	r3, sp, #16
	bl	lockdownd_get_value
	subs	r4, r0, #0
	beq	.L8
	ldr	r0, [sp, #24]
.L7:
	cmp	r5, #0
	beq	.L9
	mov	r1, #0
	ldr	r2, .L62+20
	add	r3, sp, #16
	bl	lockdownd_get_value
	subs	r4, r0, #0
	beq	.L10
.L50:
	ldr	r0, [sp, #24]
.L9:
	ldr	r1, .L62+24
	add	r2, sp, #20
	bl	lockdownd_start_service
	cmp	r0, #0
	bne	.L13
	ldr	r3, [sp, #20]
	ldr	r1, [r3, #4]
	cmp	r1, #0
	bne	.L14
.L13:
	ldr	r0, .L62+28
	bl	perror
	ldr	r0, [sp, #32]
	b	.L3
.L53:
	ldr	r3, .L62+32
	mov	r2, r0
	ldr	r1, .L62+36
	ldr	r0, [r3]
	bl	fprintf
	ldr	r0, [sp, #32]
.L3:
	cmp	r0, #0
	mvnle	r4, #0
	ble	.L27
	bl	close
	mvn	r4, #0
.L27:
	ldr	r0, [sp, #28]
	bl	free
	ldr	r0, [sp, #24]
	bl	lockdownd_client_free
	ldr	r0, [sp, #12]
	bl	idevice_free
	ldr	r3, .L62
	ldr	r2, [r3]
	ldr	r3, [sp, #60]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L54
	mov	r0, r4
	add	sp, sp, #64
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L52:
	ldr	r3, .L62+32
	ldr	r1, .L62+40
	ldr	r0, [r3]
	bl	fprintf
	ldr	r0, [sp, #32]
	b	.L3
.L14:
	ldr	r0, [sp, #12]
	add	r2, sp, #28
	bl	idevice_connect
	cmp	r0, #0
	bne	.L55
	ldr	r3, [sp, #20]
	ldr	r3, [r3]
	cmp	r3, #1
	beq	.L56
.L16:
	ldr	r0, [sp, #24]
	cmp	r0, #0
	beq	.L19
	bl	lockdownd_client_free
	mov	r3, #0
	str	r3, [sp, #24]
.L19:
	ldr	r0, [sp, #28]
	add	r1, sp, #32
	bl	idevice_connection_get_fd
	cmp	r0, #0
	bne	.L57
	ldr	r3, [sp, #92]
	ldr	r0, [sp, #32]
	cmp	r3, #0
	blt	.L58
	bne	.L59
	mov	lr, #5
	ldr	ip, [sp, #92]
.L25:
	mov	r1, #8
	ldr	r3, .L62+44
	ldr	r2, .L62+48
	str	r1, [sp]
	ldr	r1, [r3]
	ldr	r2, [r2]
	add	r3, sp, #40
	str	lr, [sp, #40]
	str	ip, [sp, #44]
	bl	setsockopt
	cmp	r0, #0
	bne	.L60
.L24:
	ldr	r4, [sp, #32]
	b	.L27
.L10:
	ldr	r0, [sp, #16]
	add	r1, sp, #40
	str	r4, [sp, #48]
	str	r4, [sp, #52]
	str	r4, [sp, #56]
	str	r4, [sp, #40]
	bl	plist_get_string_val
	ldr	r0, [sp, #40]
	cmp	r0, #0
	beq	.L11
	add	r3, sp, #56
	str	r3, [sp]
	ldr	r1, .L62+52
	add	r3, sp, #52
	add	r2, sp, #48
	bl	sscanf
	cmp	r0, #1
	ble	.L61
	ldr	r4, [sp, #48]
	ldr	r3, [sp, #52]
	ldr	r0, .L62+56
	lsl	r4, r4, #16
	and	r0, r0, r3, lsl #8
	and	r4, r4, #16711680
	ldrb	r3, [sp, #56]	@ zero_extendqisi2
	orr	r4, r4, r0
	ldr	r0, [sp, #40]
	orr	r4, r4, r3
.L11:
	str	r4, [r5]
	bl	free
	ldr	r0, [sp, #16]
	bl	plist_free
	b	.L50
.L6:
	mov	r1, r7
	ldr	r0, [sp, #16]
	bl	plist_get_string_val
	ldr	r0, [sp, #16]
	bl	plist_free
	ldr	r0, [sp, #24]
	str	r4, [sp, #16]
	b	.L5
.L8:
	mov	r1, r6
	ldr	r0, [sp, #16]
	bl	plist_get_string_val
	ldr	r0, [sp, #16]
	bl	plist_free
	ldr	r0, [sp, #24]
	str	r4, [sp, #16]
	b	.L7
.L59:
	ldr	r3, .L62+60
	ldr	r2, [sp, #92]
	asr	lr, r2, #31
	smull	r1, r2, r3, r2
	rsb	lr, lr, r2, asr #6
	rsb	ip, lr, lr, lsl #22
	ldr	r3, [sp, #92]
	add	ip, lr, ip, lsl #6
	add	ip, lr, ip, lsl #1
	add	ip, r3, ip, lsl #3
	rsb	r3, ip, ip, lsl #5
	add	ip, ip, r3, lsl #2
	lsl	ip, ip, #3
	b	.L25
.L56:
	cmp	r8, #0
	beq	.L18
	ldr	r0, [sp, #28]
	bl	idevice_connection_enable_ssl
	cmp	r0, #0
	bne	.L18
	ldr	r0, [sp, #28]
	add	r1, sp, #36
	bl	idevice_connection_get_ssl_session
	cmp	r0, #0
	bne	.L18
	ldr	r3, [sp, #36]
	str	r3, [r8]
	b	.L16
.L55:
	ldr	r0, .L62+64
	bl	perror
	ldr	r0, [sp, #32]
	b	.L3
.L18:
	ldr	r0, .L62+68
	bl	perror
	ldr	r0, [sp, #32]
	b	.L3
.L58:
	ldr	r3, .L62+72
	ldr	r1, [r3]
	bl	fcntl
	cmp	r0, #0
	beq	.L23
	ldr	r2, .L62+76
	ldr	r3, .L62+80
	ldr	r2, [r2]
	ldr	r1, [r3]
	orr	r2, r0, r2
	ldr	r0, [sp, #32]
	bl	fcntl
	cmp	r0, #0
	bge	.L24
.L23:
	ldr	r0, .L62+84
	bl	perror
	ldr	r0, [sp, #32]
	b	.L3
.L57:
	ldr	r0, .L62+88
	bl	perror
	ldr	r0, [sp, #32]
	b	.L3
.L61:
	ldr	r0, [sp, #40]
	b	.L11
.L60:
	ldr	r0, .L62+92
	bl	perror
	ldr	r0, [sp, #32]
	b	.L3
.L54:
	bl	__stack_chk_fail
.L63:
	.align	2
.L62:
	.word	.LC14
	.word	.LC1
	.word	LOCKDOWN_E_SUCCESS
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC7
	.word	.LC8
	.word	stderr
	.word	.LC2
	.word	.LC0
	.word	SOL_SOCKET
	.word	SO_RCVTIMEO
	.word	.LC6
	.word	65535
	.word	274877907
	.word	.LC9
	.word	.LC10
	.word	F_GETFL
	.word	O_NONBLOCK
	.word	F_SETFL
	.word	.LC12
	.word	.LC11
	.word	.LC13
	.size	wi_connect, .-wi_connect
	.comm	stderr,4,4
	.comm	SO_RCVTIMEO,4,4
	.comm	SOL_SOCKET,4,4
	.comm	O_NONBLOCK,4,4
	.comm	LOCKDOWN_E_SUCCESS,4,4
	.comm	INVALID_SOCKET,4,4
	.comm	F_SETFL,4,4
	.comm	F_GETFL,4,4
	.comm	FIONBIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
