	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scard_read_file
_scard_read_file:                       ## @scard_read_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_SIM_CMD_READ_BIN@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -45(%rbp)
	movl	$0, -44(%rbp)
	leaq	3(%rdx), %rdi
	movq	%rdi, -56(%rbp)
	movb	%r13b, -41(%rbp)
	callq	_os_malloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	(%r12), %rax
	movq	_SCARD_USIM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movq	_USIM_CLA@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -45(%rbp)
LBB0_4:
	leaq	-45(%rbp), %rsi
	leaq	-56(%rbp), %r8
	movq	%r12, %rdi
	movl	$5, %edx
	movq	%r14, %rcx
	callq	_scard_transmit
	movq	_SCARD_S_SUCCESS@GOTPCREL(%rip), %rcx
	movl	$-2, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.5:
	movq	-56(%rbp), %rcx
	leaq	2(%r13), %rax
	cmpq	%rax, %rcx
	jne	LBB0_6
## %bb.7:
	movb	(%r14,%r13), %al
	movb	1(%r14,%r13), %cl
	cmpb	$-112, %al
	jne	LBB0_9
## %bb.8:
	testb	%cl, %cl
	jne	LBB0_9
## %bb.10:
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%r13, %rdx
	callq	_os_memcpy
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_1:
	movl	$-1, %ebx
	jmp	LBB0_12
LBB0_6:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	movzbl	%cl, %edx
	movzbl	%al, %ecx
	leaq	L_.str(%rip), %rsi
	callq	_wpa_printf
	movl	$-3, %ebx
	jmp	LBB0_11
LBB0_9:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edi
	movzbl	%al, %edx
	movzbl	%cl, %ecx
	leaq	L_.str.1(%rip), %rsi
	callq	_wpa_printf
	movl	$-4, %ebx
LBB0_11:
	movq	%r14, %rdi
	callq	_os_free
LBB0_12:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIM_CMD_READ_BIN,1,0           ## @SIM_CMD_READ_BIN
	.comm	_SCARD_USIM,8,3                 ## @SCARD_USIM
	.comm	_USIM_CLA,1,0                   ## @USIM_CLA
	.comm	_SCARD_S_SUCCESS,8,3            ## @SCARD_S_SUCCESS
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SCARD: file read returned unexpected length %ld (expected %ld)"

L_.str.1:                               ## @.str.1
	.asciz	"SCARD: file read returned unexpected status %02x %02x (expected 90 00)"

	.no_dead_strip	_scard_read_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scard_read_file
_scard_read_file:                       ; @scard_read_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _SIM_CMD_READ_BIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SIM_CMD_READ_BIN@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [sp, #11]
	stur	wzr, [sp, #12]
	add	x0, x2, #3
	str	x0, [sp]
	strb	w20, [sp, #15]
	bl	_os_malloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	x8, [x22]
Lloh2:
	adrp	x9, _SCARD_USIM@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SCARD_USIM@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
Lloh5:
	adrp	x8, _USIM_CLA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _USIM_CLA@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [sp, #11]
LBB0_3:
	add	x1, sp, #11
	mov	x4, sp
	mov	x0, x22
	mov	w2, #5
	mov	x3, x19
	bl	_scard_transmit
Lloh7:
	adrp	x8, _SCARD_S_SUCCESS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _SCARD_S_SUCCESS@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.4:
	ldr	x9, [sp]
	add	x8, x20, #2
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.5:
	add	x8, x19, x20
	ldrb	w2, [x8]
	ldrb	w3, [x8, #1]
	cmp	w2, #144
	ccmp	w3, #0, #0, eq
	b.eq	LBB0_10
; %bb.6:
Lloh10:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_wpa_printf
	mov	w20, #-4
	b	LBB0_11
LBB0_7:
	mov	w20, #-1
	b	LBB0_12
LBB0_8:
	mov	w20, #-2
	b	LBB0_11
LBB0_9:
Lloh15:
	adrp	x10, _MSG_DEBUG@GOTPAGE
Lloh16:
	ldr	x10, [x10, _MSG_DEBUG@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x10]
	and	w2, w9, #0xff
	and	w3, w8, #0xff
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	bl	_wpa_printf
	mov	w20, #-3
	b	LBB0_11
LBB0_10:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_os_memcpy
	mov	w20, #0
LBB0_11:
	mov	x0, x19
	bl	_os_free
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_SIM_CMD_READ_BIN,1,0           ; @SIM_CMD_READ_BIN
	.comm	_SCARD_USIM,8,3                 ; @SCARD_USIM
	.comm	_USIM_CLA,1,0                   ; @USIM_CLA
	.comm	_SCARD_S_SUCCESS,8,3            ; @SCARD_S_SUCCESS
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SCARD: file read returned unexpected length %ld (expected %ld)"

l_.str.1:                               ; @.str.1
	.asciz	"SCARD: file read returned unexpected status %02x %02x (expected 90 00)"

	.no_dead_strip	_scard_read_file
.subsections_via_symbols
