	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _scard_select_file
__scard_select_file:                    ## @_scard_select_file
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movq	%rcx, -128(%rbp)                ## 8-byte Spill
	movq	%rdx, %r15
	movl	%esi, %ebx
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movw	$0, -64(%rbp)
	movq	_SIM_CMD_SELECT@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -112(%rbp)
	movq	_SIM_CMD_GET_RESPONSE@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -120(%rbp)
	movl	$0, -119(%rbp)
	movq	_SCARD_USIM@GOTPCREL(%rip), %rax
	cmpq	%r8, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_USIM_CLA@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -112(%rbp)
	movb	$4, -109(%rbp)
	movb	%al, -120(%rbp)
LBB0_2:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movzwl	%bx, %edx
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_wpa_printf
	testq	%r14, %r14
	je	LBB0_5
## %bb.3:
	movq	%r13, -152(%rbp)                ## 8-byte Spill
	movq	%r15, -160(%rbp)                ## 8-byte Spill
	movq	16(%rbp), %r15
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdx
	movq	%r15, %rcx
	callq	_wpa_hexdump
	leaq	5(%r15), %rbx
	movl	$-1, %r13d
	cmpq	$50, %rbx
	ja	LBB0_27
## %bb.4:
	movb	$4, -110(%rbp)
	movb	%r15b, -108(%rbp)
	leaq	-107(%rbp), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_os_memcpy
	movq	-160(%rbp), %r15                ## 8-byte Reload
	movq	-152(%rbp), %r13                ## 8-byte Reload
	jmp	LBB0_6
LBB0_5:
	rolw	$8, %bx
	movw	%bx, -107(%rbp)
	movl	$7, %ebx
LBB0_6:
	movq	$3, -144(%rbp)
	leaq	-112(%rbp), %rsi
	leaq	-115(%rbp), %rcx
	leaq	-144(%rbp), %r8
	movq	%r13, %rdi
	movl	%ebx, %edx
	callq	_scard_transmit
	movq	_SCARD_S_SUCCESS@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_7
## %bb.8:
	movq	-144(%rbp), %rdx
	cmpq	$2, %rdx
	jne	LBB0_9
## %bb.10:
	movzbl	-115(%rbp), %edx
	movb	-114(%rbp), %al
	cmpl	$152, %edx
	jne	LBB0_13
## %bb.11:
	cmpb	$4, %al
	jne	LBB0_13
## %bb.12:
	movq	_MSG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
LBB0_21:
	xorl	%eax, %eax
	callq	_wpa_printf
	jmp	LBB0_26
LBB0_7:
	movq	_MSG_WARNING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_25:
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_wpa_printf
	jmp	LBB0_26
LBB0_9:
	movq	_MSG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
LBB0_17:
	xorl	%eax, %eax
	callq	_wpa_printf
LBB0_26:
	movl	$-1, %r13d
LBB0_27:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_29
## %bb.28:
	movl	%r13d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	cmpb	$107, %dl
	jg	LBB0_18
## %bb.14:
	cmpb	$-97, %dl
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rcx
	je	LBB0_22
## %bb.15:
	cmpb	$97, %dl
	je	LBB0_22
	jmp	LBB0_16
LBB0_18:
	cmpb	$108, %dl
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rcx
	je	LBB0_22
## %bb.19:
	cmpb	$110, %dl
	jne	LBB0_16
## %bb.20:
	movl	(%rcx), %edi
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_21
LBB0_22:
	movzbl	%al, %edx
	movb	%al, -116(%rbp)
	movl	(%rcx), %edi
	leaq	L_.str.7(%rip), %rsi
	movq	%r13, %r14
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	callq	_wpa_printf
	movq	-128(%rbp), %rax                ## 8-byte Reload
	movq	(%rax), %rax
	movq	%rax, -136(%rbp)
	leaq	-120(%rbp), %rsi
	leaq	-136(%rbp), %r8
	movq	%r14, %rdi
	movl	$5, %edx
	movq	%r15, %rcx
	callq	_scard_transmit
	cmpq	(%rbx), %rax
	jne	LBB0_24
## %bb.23:
	movzbl	-114(%rbp), %eax
	movq	-136(%rbp), %rcx
	cmpq	%rax, %rcx
	cmovbq	%rcx, %rax
	movq	-128(%rbp), %rcx                ## 8-byte Reload
	movq	%rax, (%rcx)
	jmp	LBB0_27
LBB0_24:
	movq	_MSG_WARNING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	leaq	L_.str.8(%rip), %rsi
	jmp	LBB0_25
LBB0_16:
	movq	_MSG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_17
LBB0_29:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SIM_CMD_SELECT,1,0             ## @SIM_CMD_SELECT
	.comm	_SIM_CMD_GET_RESPONSE,1,0       ## @SIM_CMD_GET_RESPONSE
	.comm	_SCARD_USIM,8,3                 ## @SCARD_USIM
	.comm	_USIM_CLA,1,0                   ## @USIM_CLA
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SCARD: select file %04x"

L_.str.1:                               ## @.str.1
	.asciz	"SCARD: select file by AID"

	.comm	_SCARD_S_SUCCESS,8,3            ## @SCARD_S_SUCCESS
	.comm	_MSG_WARNING,4,2                ## @MSG_WARNING
L_.str.2:                               ## @.str.2
	.asciz	"SCARD: SCardTransmit failed (err=0x%lx)"

L_.str.3:                               ## @.str.3
	.asciz	"SCARD: unexpected resp len %d (expected 2)"

L_.str.4:                               ## @.str.4
	.asciz	"SCARD: Security status not satisfied (PIN_WLAN)"

L_.str.5:                               ## @.str.5
	.asciz	"SCARD: used CLA not supported"

L_.str.6:                               ## @.str.6
	.asciz	"SCARD: unexpected response 0x%02x (expected 0x61, 0x6c, or 0x9f)"

L_.str.7:                               ## @.str.7
	.asciz	"SCARD: trying to get response (%d bytes)"

L_.str.8:                               ## @.str.8
	.asciz	"SCARD: SCardTransmit err=0x%lx\n"

	.no_dead_strip	__scard_select_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _scard_select_file
__scard_select_file:                    ; @_scard_select_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
	mov	x22, x6
	mov	x23, x5
	mov	x19, x3
	mov	x20, x2
	mov	x24, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	strb	wzr, [sp, #87]
	movi.2d	v0, #0000000000000000
	stur	q0, [sp, #71]
	stur	q0, [sp, #55]
Lloh3:
	adrp	x8, _SIM_CMD_SELECT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SIM_CMD_SELECT@GOTPAGEOFF]
	stur	q0, [sp, #39]
	ldrb	w8, [x8]
	strb	w8, [sp, #38]
Lloh5:
	adrp	x8, _SIM_CMD_GET_RESPONSE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SIM_CMD_GET_RESPONSE@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [sp, #30]
	stur	wzr, [sp, #31]
Lloh7:
	adrp	x8, _SCARD_USIM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SCARD_USIM@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x8, x4
	b.ne	LBB0_2
; %bb.1:
Lloh10:
	adrp	x8, _USIM_CLA@GOTPAGE
Lloh11:
	ldr	x8, [x8, _USIM_CLA@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [sp, #38]
	mov	w9, #4
	strb	w9, [sp, #41]
	strb	w8, [sp, #30]
LBB0_2:
Lloh12:
	adrp	x25, _MSG_DEBUG@GOTPAGE
Lloh13:
	ldr	x25, [x25, _MSG_DEBUG@GOTPAGEOFF]
	ldr	w0, [x25]
	mov	w8, w24
	str	x8, [sp]
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wpa_printf
	cbz	x23, LBB0_5
; %bb.3:
	ldr	w0, [x25]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x23
	mov	x3, x22
	bl	_wpa_hexdump
	add	x24, x22, #5
	cmp	x24, #50
	b.hi	LBB0_15
; %bb.4:
	mov	w8, #4
	strb	w8, [sp, #40]
	strb	w22, [sp, #42]
	add	x8, sp, #38
	add	x0, x8, #5
	mov	x1, x23
	mov	x2, x22
	bl	_os_memcpy
	b	LBB0_6
LBB0_5:
	rev16	w8, w24
	sturh	w8, [sp, #43]
	mov	w24, #7
LBB0_6:
	mov	w8, #3
	str	x8, [sp, #16]
	add	x1, sp, #38
	add	x3, sp, #35
	add	x4, sp, #16
	mov	x0, x21
	mov	x2, x24
	bl	_scard_transmit
Lloh18:
	adrp	x22, _SCARD_S_SUCCESS@GOTPAGE
Lloh19:
	ldr	x22, [x22, _SCARD_S_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.7:
	ldr	x8, [sp, #16]
	cmp	x8, #2
	b.ne	LBB0_13
; %bb.8:
	ldrb	w8, [sp, #35]
	ldrb	w9, [sp, #36]
	cmp	w8, #152
	b.ne	LBB0_18
; %bb.9:
	cmp	w9, #4
	b.ne	LBB0_18
; %bb.10:
Lloh20:
	adrp	x8, _MSG_WARNING@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MSG_WARNING@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
Lloh23:
	adrp	x1, l_.str.4@PAGE
Lloh24:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_14
LBB0_11:
Lloh25:
	adrp	x8, _MSG_WARNING@GOTPAGE
Lloh26:
	ldr	x8, [x8, _MSG_WARNING@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	str	x0, [sp]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_12:
	mov	x0, x8
	b	LBB0_14
LBB0_13:
Lloh30:
	adrp	x9, _MSG_WARNING@GOTPAGE
Lloh31:
	ldr	x9, [x9, _MSG_WARNING@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x9]
	str	x8, [sp]
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_14:
	bl	_wpa_printf
LBB0_15:
	mov	w0, #-1
LBB0_16:
	ldur	x8, [x29, #-72]
Lloh35:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh36:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_28
; %bb.17:
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_18:
	cmp	w8, #109
	b.gt	LBB0_21
; %bb.19:
	cmp	w8, #97
	b.eq	LBB0_24
; %bb.20:
	cmp	w8, #108
	b.eq	LBB0_24
	b	LBB0_27
LBB0_21:
	cmp	w8, #159
	b.eq	LBB0_24
; %bb.22:
	cmp	w8, #110
	b.ne	LBB0_27
; %bb.23:
	ldr	w0, [x25]
Lloh38:
	adrp	x1, l_.str.5@PAGE
Lloh39:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_14
LBB0_24:
	strb	w9, [sp, #34]
	ldr	w0, [x25]
	str	x9, [sp]
Lloh40:
	adrp	x1, l_.str.7@PAGE
Lloh41:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_wpa_printf
	ldr	x8, [x19]
	str	x8, [sp, #8]
	add	x1, sp, #30
	add	x4, sp, #8
	mov	x0, x21
	mov	w2, #5
	mov	x3, x20
	bl	_scard_transmit
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_26
; %bb.25:
	mov	w0, #0
	ldrb	w8, [sp, #36]
	ldr	x9, [sp, #8]
	cmp	x9, x8
	csel	x8, x9, x8, lo
	str	x8, [x19]
	b	LBB0_16
LBB0_26:
Lloh42:
	adrp	x8, _MSG_WARNING@GOTPAGE
Lloh43:
	ldr	x8, [x8, _MSG_WARNING@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	str	x0, [sp]
Lloh45:
	adrp	x1, l_.str.8@PAGE
Lloh46:
	add	x1, x1, l_.str.8@PAGEOFF
	b	LBB0_12
LBB0_27:
Lloh47:
	adrp	x9, _MSG_WARNING@GOTPAGE
Lloh48:
	ldr	x9, [x9, _MSG_WARNING@GOTPAGEOFF]
Lloh49:
	ldr	w0, [x9]
	str	x8, [sp]
Lloh50:
	adrp	x1, l_.str.6@PAGE
Lloh51:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_14
LBB0_28:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_SIM_CMD_SELECT,1,0             ; @SIM_CMD_SELECT
	.comm	_SIM_CMD_GET_RESPONSE,1,0       ; @SIM_CMD_GET_RESPONSE
	.comm	_SCARD_USIM,8,3                 ; @SCARD_USIM
	.comm	_USIM_CLA,1,0                   ; @USIM_CLA
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SCARD: select file %04x"

l_.str.1:                               ; @.str.1
	.asciz	"SCARD: select file by AID"

	.comm	_SCARD_S_SUCCESS,8,3            ; @SCARD_S_SUCCESS
	.comm	_MSG_WARNING,4,2                ; @MSG_WARNING
l_.str.2:                               ; @.str.2
	.asciz	"SCARD: SCardTransmit failed (err=0x%lx)"

l_.str.3:                               ; @.str.3
	.asciz	"SCARD: unexpected resp len %d (expected 2)"

l_.str.4:                               ; @.str.4
	.asciz	"SCARD: Security status not satisfied (PIN_WLAN)"

l_.str.5:                               ; @.str.5
	.asciz	"SCARD: used CLA not supported"

l_.str.6:                               ; @.str.6
	.asciz	"SCARD: unexpected response 0x%02x (expected 0x61, 0x6c, or 0x9f)"

l_.str.7:                               ; @.str.7
	.asciz	"SCARD: trying to get response (%d bytes)"

l_.str.8:                               ; @.str.8
	.asciz	"SCARD: SCardTransmit err=0x%lx\n"

	.no_dead_strip	__scard_select_file
.subsections_via_symbols
