	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iso_connect                    ## -- Begin function iso_connect
	.p2align	4, 0x90
_iso_connect:                           ## @iso_connect
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_True@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_g_negotiate_rdp_protocol@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_PROTOCOL_SSL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_PROTOCOL_RDP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movl	%eax, (%r9)
	movq	$0, -48(%rbp)
	callq	_tcp_connect
	movq	_False@GOTPCREL(%rip), %rbx
	testl	%eax, %eax
	je	LBB0_15
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_iso_send_connection_request
	leaq	-48(%rbp), %rdi
	xorl	%esi, %esi
	callq	_iso_recv_msg
	testq	%rax, %rax
	je	LBB0_15
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %r13
	movq	-48(%rbp), %rsi
	movq	_ISO_PDU_CC@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jne	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_g_rdp_version@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_RDP_V5@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r13, %rdi
	movl	$8, %esi
	callq	_s_check_rem
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_in_uint8
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_in_uint8
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_in_uint16
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_in_uint32
	movq	_RDP_NEG_FAILURE@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rbx), %r13
	xorl	%eax, %eax
	callq	_tcp_disconnect
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	testq	%r13, %r13
	je	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.8(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	(%rbx), %rax
	movq	_g_negotiate_rdp_protocol@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_PROTOCOL_RDP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	movq	$0, -48(%rbp)
	movq	%r14, %rdi
	callq	_tcp_connect
	testl	%eax, %eax
	jne	LBB0_1
	jmp	LBB0_15
LBB0_10:
	movq	_True@GOTPCREL(%rip), %rbx
	jmp	LBB0_15
LBB0_8:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_error
	xorl	%eax, %eax
	callq	_tcp_disconnect
	jmp	LBB0_15
LBB0_11:
	movq	_RDP_NEG_RSP@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_16
## %bb.12:
	xorl	%eax, %eax
	callq	_tcp_disconnect
	leaq	L_.str.10(%rip), %rdi
LBB0_13:
	xorl	%esi, %esi
	callq	_error
	jmp	LBB0_15
LBB0_14:
	leaq	L_.str.9(%rip), %rsi
	leaq	L_.str.7(%rip), %rdx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_15:
	movq	(%rbx), %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_PROTOCOL_SSL@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_19
## %bb.17:
	movq	_PROTOCOL_RDP@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_20
## %bb.18:
	xorl	%eax, %eax
	callq	_tcp_disconnect
	leaq	L_.str.13(%rip), %rdi
	jmp	LBB0_13
LBB0_19:
	leaq	L_.str.11(%rip), %rsi
	jmp	LBB0_21
LBB0_20:
	leaq	L_.str.12(%rip), %rsi
LBB0_21:
	movq	_True@GOTPCREL(%rip), %rbx
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%eax, %eax
	callq	_fprintf
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_True,8,3                       ## @True
	.comm	_g_negotiate_rdp_protocol,8,3   ## @g_negotiate_rdp_protocol
	.comm	_PROTOCOL_SSL,4,2               ## @PROTOCOL_SSL
	.comm	_PROTOCOL_RDP,4,2               ## @PROTOCOL_RDP
	.comm	_False,8,3                      ## @False
	.comm	_ISO_PDU_CC,8,3                 ## @ISO_PDU_CC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"expected CC, got 0x%x\n"

	.comm	_g_rdp_version,8,3              ## @g_rdp_version
	.comm	_RDP_V5,8,3                     ## @RDP_V5
	.comm	_RDP_NEG_FAILURE,8,3            ## @RDP_NEG_FAILURE
L_.str.7:                               ## @.str.7
	.asciz	"unknown reason"

	.comm	_stderr,4,2                     ## @stderr
L_.str.8:                               ## @.str.8
	.asciz	"Failed to negotiate protocol, retrying with plain RDP.\n"

L_.str.9:                               ## @.str.9
	.asciz	"Failed to connect, %s.\n"

	.comm	_RDP_NEG_RSP,8,3                ## @RDP_NEG_RSP
L_.str.10:                              ## @.str.10
	.asciz	"Expected RDP_NEG_RSP, got type = 0x%x\n"

L_.str.11:                              ## @.str.11
	.asciz	"SSL not compiled in.\n"

L_.str.12:                              ## @.str.12
	.asciz	"Connection established using plain RDP.\n"

L_.str.13:                              ## @.str.13
	.asciz	"Unexpected protocol in negotiation response, got data = 0x%x.\n"

	.comm	_PROTOCOL_HYBRID,4,2            ## @PROTOCOL_HYBRID
	.comm	_g_encryption,8,3               ## @g_encryption
	.comm	_g_sc_card_name,8,3             ## @g_sc_card_name
	.comm	_g_sc_container_name,8,3        ## @g_sc_container_name
	.comm	_g_sc_csp_name,8,3              ## @g_sc_csp_name
	.comm	_g_sc_reader_name,8,3           ## @g_sc_reader_name
	.comm	_g_use_password_as_pin,4,2      ## @g_use_password_as_pin
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iso_connect                    ; -- Begin function iso_connect
	.p2align	2
_iso_connect:                           ; @iso_connect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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 w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x5
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _True@GOTPAGE
Lloh1:
	ldr	x8, [x8, _True@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x28, _g_negotiate_rdp_protocol@GOTPAGE
Lloh4:
	ldr	x28, [x28, _g_negotiate_rdp_protocol@GOTPAGEOFF]
	str	x8, [x28]
Lloh5:
	adrp	x8, _PROTOCOL_SSL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PROTOCOL_SSL@GOTPAGEOFF]
Lloh7:
	ldr	w22, [x8]
Lloh8:
	adrp	x26, _PROTOCOL_RDP@GOTPAGE
Lloh9:
	ldr	x26, [x26, _PROTOCOL_RDP@GOTPAGEOFF]
	ldr	w8, [x26]
	str	w8, [x5]
	str	xzr, [sp, #8]
	bl	_tcp_connect
Lloh10:
	adrp	x25, _False@GOTPAGE
Lloh11:
	ldr	x25, [x25, _False@GOTPAGEOFF]
	cbz	w0, LBB0_22
; %bb.1:
Lloh12:
	adrp	x27, _ISO_PDU_CC@GOTPAGE
Lloh13:
	ldr	x27, [x27, _ISO_PDU_CC@GOTPAGEOFF]
Lloh14:
	adrp	x23, _RDP_V5@GOTPAGE
Lloh15:
	ldr	x23, [x23, _RDP_V5@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_iso_send_connection_request
	add	x0, sp, #8
	mov	x1, #0
	bl	_iso_recv_msg
	cbz	x0, LBB0_22
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x1, [sp, #8]
	ldr	x8, [x27]
	cmp	x1, x8
	b.ne	LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh16:
	adrp	x8, _g_rdp_version@GOTPAGE
Lloh17:
	ldr	x8, [x8, _g_rdp_version@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	x9, [x23]
	cmp	x8, x9
	b.lt	LBB0_21
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, x0
	mov	w1, #8
	bl	_s_check_rem
	cbz	x0, LBB0_21
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x24
	mov	x1, #0
	bl	_in_uint8
	mov	x0, x24
	mov	x1, #0
	bl	_in_uint8
	mov	x0, x24
	mov	x1, #0
	bl	_in_uint16
	mov	x0, x24
	mov	w1, #0
	bl	_in_uint32
Lloh19:
	adrp	x8, _RDP_NEG_FAILURE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _RDP_NEG_FAILURE@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	cbnz	x8, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x24, [x25]
	bl	_tcp_disconnect
Lloh22:
	adrp	x8, _stderr@GOTPAGE
Lloh23:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	cbz	x24, LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh25:
	adrp	x1, l_.str.8@PAGE
Lloh26:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_fprintf
	ldr	x8, [x25]
	str	x8, [x28]
	ldr	w8, [x26]
	str	w8, [x19]
	str	xzr, [sp, #8]
	mov	x0, x21
	bl	_tcp_connect
	cbnz	w0, LBB0_2
	b	LBB0_22
LBB0_9:
Lloh27:
	adrp	x0, l_.str@PAGE
Lloh28:
	add	x0, x0, l_.str@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_error
	bl	_tcp_disconnect
	b	LBB0_14
LBB0_10:
Lloh29:
	adrp	x8, _RDP_NEG_RSP@GOTPAGE
Lloh30:
	ldr	x8, [x8, _RDP_NEG_RSP@GOTPAGEOFF]
Lloh31:
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.11:
	bl	_tcp_disconnect
Lloh32:
	adrp	x0, l_.str.10@PAGE
Lloh33:
	add	x0, x0, l_.str.10@PAGEOFF
LBB0_12:
	mov	w1, #0
	bl	_error
	b	LBB0_14
LBB0_13:
Lloh34:
	adrp	x8, l_.str.7@PAGE
Lloh35:
	add	x8, x8, l_.str.7@PAGEOFF
	str	x8, [sp]
Lloh36:
	adrp	x1, l_.str.9@PAGE
Lloh37:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_fprintf
LBB0_14:
Lloh38:
	adrp	x25, _False@GOTPAGE
Lloh39:
	ldr	x25, [x25, _False@GOTPAGEOFF]
	b	LBB0_22
LBB0_15:
Lloh40:
	adrp	x8, _PROTOCOL_SSL@GOTPAGE
Lloh41:
	ldr	x8, [x8, _PROTOCOL_SSL@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	cbz	w8, LBB0_18
; %bb.16:
	ldr	w8, [x26]
	cbz	w8, LBB0_19
; %bb.17:
	bl	_tcp_disconnect
Lloh43:
	adrp	x0, l_.str.13@PAGE
Lloh44:
	add	x0, x0, l_.str.13@PAGEOFF
	b	LBB0_12
LBB0_18:
Lloh45:
	adrp	x1, l_.str.11@PAGE
Lloh46:
	add	x1, x1, l_.str.11@PAGEOFF
	b	LBB0_20
LBB0_19:
Lloh47:
	adrp	x1, l_.str.12@PAGE
Lloh48:
	add	x1, x1, l_.str.12@PAGEOFF
LBB0_20:
Lloh49:
	adrp	x8, _stderr@GOTPAGE
Lloh50:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh51:
	ldr	w0, [x8]
	bl	_fprintf
	str	wzr, [x19]
LBB0_21:
Lloh52:
	adrp	x25, _True@GOTPAGE
Lloh53:
	ldr	x25, [x25, _True@GOTPAGEOFF]
LBB0_22:
	ldr	x0, [x25]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh52, Lloh53
	.cfi_endproc
                                        ; -- End function
	.comm	_True,8,3                       ; @True
	.comm	_g_negotiate_rdp_protocol,8,3   ; @g_negotiate_rdp_protocol
	.comm	_PROTOCOL_SSL,4,2               ; @PROTOCOL_SSL
	.comm	_PROTOCOL_RDP,4,2               ; @PROTOCOL_RDP
	.comm	_False,8,3                      ; @False
	.comm	_ISO_PDU_CC,8,3                 ; @ISO_PDU_CC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"expected CC, got 0x%x\n"

	.comm	_g_rdp_version,8,3              ; @g_rdp_version
	.comm	_RDP_V5,8,3                     ; @RDP_V5
	.comm	_RDP_NEG_FAILURE,8,3            ; @RDP_NEG_FAILURE
l_.str.7:                               ; @.str.7
	.asciz	"unknown reason"

	.comm	_stderr,4,2                     ; @stderr
l_.str.8:                               ; @.str.8
	.asciz	"Failed to negotiate protocol, retrying with plain RDP.\n"

l_.str.9:                               ; @.str.9
	.asciz	"Failed to connect, %s.\n"

	.comm	_RDP_NEG_RSP,8,3                ; @RDP_NEG_RSP
l_.str.10:                              ; @.str.10
	.asciz	"Expected RDP_NEG_RSP, got type = 0x%x\n"

l_.str.11:                              ; @.str.11
	.asciz	"SSL not compiled in.\n"

l_.str.12:                              ; @.str.12
	.asciz	"Connection established using plain RDP.\n"

l_.str.13:                              ; @.str.13
	.asciz	"Unexpected protocol in negotiation response, got data = 0x%x.\n"

	.comm	_PROTOCOL_HYBRID,4,2            ; @PROTOCOL_HYBRID
	.comm	_g_encryption,8,3               ; @g_encryption
	.comm	_g_sc_card_name,8,3             ; @g_sc_card_name
	.comm	_g_sc_container_name,8,3        ; @g_sc_container_name
	.comm	_g_sc_csp_name,8,3              ; @g_sc_csp_name
	.comm	_g_sc_reader_name,8,3           ; @g_sc_reader_name
	.comm	_g_use_password_as_pin,4,2      ; @g_use_password_as_pin
.subsections_via_symbols
