// File: /workspace/github_cpp_makefile_star2_O3/FFY00[P]uicc/src/program_uicc.c
// Function: readUSIMvalues(char*)
bool readUSIMvalues(char *port) {
    vector<string> res;
    USIM USIMcard;
    string ATR;
    Assert((ATR=USIMcard.open(port))!="", "Failed to open %s", port);
    //dump_hex("ATR", ATR);
    res=USIMcard.readFile("ICCID");
    string iccid=bcdToAscii(res[0]);
    cout << "ICCID: " << iccid <<endl;

    if (!luhn( iccid))
        printf("WARNING: iccid luhn encoding of last digit not done \n");

    USIMcard.openUSIM();
    cout << "USIM IMSI: " << USIMcard.decodeIMSI(USIMcard.readFile("IMSI")[0]) << endl;
    res=USIMcard.readFile("PLMN selector with Access Technology");
    //cout << "USIM PLMN selector: " << bcdToAscii(res[0]) <<endl;
    // Show only the first isdn (might be several)
    vector<string> x=USIMcard.readFile("MSISDN");
    cout << "USIM MSISDN: " << USIMcard.decodeISDN(USIMcard.readFile("MSISDN")[0]) <<endl;
    res=USIMcard.readFile("Service Provider Name");
    cout << "USIM Service Provider Name: " << printable(res[0].substr(1)) <<endl;
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, -0x100(%rbp)
movl $0xffffffff, -0xfc(%rbp) # imm = 0xFFFFFFFF
leaq 0x138d1(%rip), %rdi     # 0x18400
callq 0x2310
testq %rax, %rax
je 0x4b4b
movzbl (%rax), %eax
orl $0x20, %eax
cmpl $0x79, %eax
jne 0x4b4b
movb $0x1, -0x100(%rbp)
leaq -0xe8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xc8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x150(%rbp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq -0x90(%rbp), %rdi
leaq -0x100(%rbp), %rsi
movq %rbx, %rdx
callq 0xaaf4
leaq -0x160(%rbp), %rdi
leaq -0x90(%rbp), %r15
movq %r15, %rsi
callq 0x2320
leaq 0x137fb(%rip), %rsi     # 0x183b2
movq %rax, %rdi
callq 0x20b0
movl %eax, %r14d
movq (%r15), %rdi
leaq -0x80(%rbp), %r13
cmpq %r13, %rdi
je 0x4bd3
callq 0x2220
testl %r14d, %r14d
je 0x5304
leaq -0x270(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1181f(%rip), %rsi     # 0x1640d
leaq 0x1181d(%rip), %rdx     # 0x16412
leaq -0x280(%rbp), %rdi
callq 0x139ec
leaq -0x50(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x280(%rbp), %rdx
callq 0xb46e
movaps -0x70(%rbp), %xmm0
movq -0x60(%rbp), %rax
leaq -0x50(%rbp), %rbx
movaps (%rbx), %xmm1
movaps %xmm1, -0x70(%rbp)
movq 0x10(%rbx), %rcx
movq %rcx, -0x60(%rbp)
leaq -0x90(%rbp), %rdi
movups %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
callq 0xb2cc
movq %rbx, %rdi
callq 0xb2cc
movq -0x280(%rbp), %rdi
cmpq %r14, %rdi
je 0x4c6d
callq 0x2220
movq -0x70(%rbp), %rax
leaq -0x130(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x140(%rbp), %rdi
callq 0x1394e
movq %r13, -0x90(%rbp)
movq $0x0, -0x88(%rbp)
movb $0x0, -0x80(%rbp)
cmpq $0x0, -0x138(%rbp)
je 0x4d0a
xorl %r15d, %r15d
leaq -0x90(%rbp), %rbx
movq -0x140(%rbp), %rax
movb (%rax,%r15), %al
movl %eax, %ecx
andb $0xf, %cl
orb $0x30, %cl
cmpb $0x39, %cl
ja 0x4cea
movzbl %cl, %esi
movq %rbx, %rdi
callq 0x2200
movq -0x140(%rbp), %rax
movb (%rax,%r15), %al
shrb $0x4, %al
orb $0x30, %al
cmpb $0x39, %al
ja 0x4cfe
movzbl %al, %esi
movq %rbx, %rdi
callq 0x2200
incq %r15
cmpq -0x138(%rbp), %r15
jb 0x4cbc
movq -0x140(%rbp), %rdi
cmpq %r14, %rdi
je 0x4d1b
callq 0x2220
movq 0x1a2a6(%rip), %rdi     # 0x1efc8
leaq 0x116ea(%rip), %rsi     # 0x16413
movl $0x7, %edx
callq 0x22c0
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq 0x1a280(%rip), %rdi     # 0x1efc8
callq 0x22c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2190
movq -0x88(%rbp), %rax
testq %rax, %rax
je 0x4ddc
movq -0x90(%rbp), %rcx
xorl %edx, %edx
leaq 0x114ed(%rip), %rsi     # 0x16280
xorl %edi, %edi
movsbl -0x1(%rcx,%rax), %r8d
testb $0x1, %dl
je 0x4dad
movslq %r8d, %r8
movl -0xc0(%rsi,%r8,4), %r8d
jmp 0x4db1
addl $-0x30, %r8d
addl %r8d, %edi
xorb $0x1, %dl
decq %rax
jne 0x4d95
imull $0xcccccccd, %edi, %eax # imm = 0xCCCCCCCD
addl $0x19999998, %eax       # imm = 0x19999998
rorl %eax
cmpl $0x19999999, %eax       # imm = 0x19999999
jb 0x4ddc
leaq 0x14057(%rip), %rdi     # 0x18e2e
callq 0x23c0
leaq -0x100(%rbp), %rdi
callq 0xbb04
movq 0x1a1d9(%rip), %rdi     # 0x1efc8
leaq 0x11625(%rip), %rsi     # 0x1641b
movl $0xb, %edx
callq 0x22c0
leaq -0x230(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1154a(%rip), %rsi     # 0x1635c
leaq 0x11547(%rip), %rdx     # 0x16360
leaq -0x240(%rbp), %rdi
callq 0x139ec
leaq -0xb0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x240(%rbp), %rdx
callq 0xb46e
movq -0xb0(%rbp), %rax
leaq -0x250(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x260(%rbp), %rdi
callq 0x1394e
leaq -0x50(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x260(%rbp), %rdx
callq 0xabf6
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x1a13b(%rip), %rdi     # 0x1efc8
callq 0x22c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2190
leaq -0x40(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x4ece
callq 0x2220
movq -0x260(%rbp), %rdi
cmpq %r13, %rdi
je 0x4edf
callq 0x2220
leaq -0xb0(%rbp), %rdi
callq 0xb2cc
movq -0x240(%rbp), %rdi
cmpq %r14, %rdi
je 0x4efc
callq 0x2220
leaq -0x210(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x126f6(%rip), %rsi     # 0x17604
leaq 0x12713(%rip), %rdx     # 0x17628
leaq -0x220(%rbp), %rdi
callq 0x139ec
leaq -0xb0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0xb46e
movaps -0x70(%rbp), %xmm0
movq -0x60(%rbp), %rax
leaq -0xb0(%rbp), %rbx
movaps (%rbx), %xmm1
movaps %xmm1, -0x70(%rbp)
movq 0x10(%rbx), %rcx
movq %rcx, -0x60(%rbp)
leaq -0x50(%rbp), %rdi
movups %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
callq 0xb2cc
movq %rbx, %rdi
callq 0xb2cc
movq -0x220(%rbp), %rdi
cmpq %r14, %rdi
je 0x4f90
callq 0x2220
leaq -0x1f0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x113cc(%rip), %rsi     # 0x1636e
leaq 0x113cb(%rip), %rdx     # 0x16374
leaq -0x200(%rbp), %rdi
callq 0x139ec
leaq -0xb0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x200(%rbp), %rdx
callq 0xb46e
movq -0x200(%rbp), %rdi
cmpq %r14, %rdi
je 0x4fe0
callq 0x2220
movq 0x19fe1(%rip), %rdi     # 0x1efc8
leaq 0x11439(%rip), %rsi     # 0x16427
movl $0xd, %edx
callq 0x22c0
leaq -0x1b0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11364(%rip), %rsi     # 0x1636e
leaq 0x11363(%rip), %rdx     # 0x16374
leaq -0x1c0(%rbp), %rdi
callq 0x139ec
leaq -0x120(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x1c0(%rbp), %rdx
callq 0xb46e
movq -0x120(%rbp), %rax
leaq -0x1d0(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x1e0(%rbp), %rdi
callq 0x1394e
leaq -0x50(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq 0xb324
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x19f43(%rip), %rdi     # 0x1efc8
callq 0x22c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2190
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x50c2
callq 0x2220
movq -0x1e0(%rbp), %rdi
cmpq %r13, %rdi
je 0x50d3
callq 0x2220
leaq -0x120(%rbp), %rdi
callq 0xb2cc
movq -0x1c0(%rbp), %rdi
cmpq %r14, %rdi
je 0x50f0
callq 0x2220
leaq -0x190(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11333(%rip), %rsi     # 0x16435
leaq 0x11341(%rip), %rdx     # 0x1644a
leaq -0x1a0(%rbp), %rdi
callq 0x139ec
leaq -0x120(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
callq 0xb46e
movaps -0x70(%rbp), %xmm0
movq -0x60(%rbp), %rax
leaq -0x120(%rbp), %rbx
movaps (%rbx), %xmm1
movaps %xmm1, -0x70(%rbp)
movq 0x10(%rbx), %rcx
movq %rcx, -0x60(%rbp)
leaq -0x50(%rbp), %rdi
movups %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
callq 0xb2cc
movq %rbx, %rdi
callq 0xb2cc
movq -0x1a0(%rbp), %rdi
cmpq %r14, %rdi
je 0x5184
callq 0x2220
movq 0x19e3d(%rip), %rdi     # 0x1efc8
leaq 0x112b9(%rip), %rsi     # 0x1644b
movl $0x1c, %edx
callq 0x22c0
movq -0x70(%rbp), %rsi
leaq -0x180(%rbp), %rdi
movl $0x1, %edx
movq $-0x1, %rcx
callq 0x2270
movq %r15, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq -0x178(%rbp), %r13
testq %r13, %r13
je 0x521b
movq -0x180(%rbp), %r12
xorl %r15d, %r15d
leaq -0x50(%rbp), %rbx
movsbl (%r12,%r15), %r14d
movl %r14d, %edi
callq 0x2410
testl %eax, %eax
je 0x51fe
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2200
incq %r15
cmpq %r15, %r13
jne 0x51e2
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x150(%rbp), %r12
leaq -0x40(%rbp), %r15
jmp 0x5220
xorl %edx, %edx
movq %r15, %rsi
movq 0x19da1(%rip), %rdi     # 0x1efc8
leaq -0x80(%rbp), %r14
callq 0x22c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2230
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2190
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x5268
callq 0x2220
leaq -0x170(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x527d
callq 0x2220
leaq -0xb0(%rbp), %rdi
callq 0xb2cc
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x529a
callq 0x2220
movq -0x160(%rbp), %rdi
cmpq %r12, %rdi
je 0x52ab
callq 0x2220
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x52c3
callq 0x2220
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0x52db
callq 0x2220
leaq -0x100(%rbp), %rdi
callq 0xb442
leaq -0x70(%rbp), %rdi
callq 0xb2cc
movb $0x1, %al
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x26a1
jmp 0x539c
movq %rax, %rbx
movq -0x1a0(%rbp), %rdi
jmp 0x53ee
jmp 0x539c
movq %rax, %rbx
jmp 0x53ca
movq %rax, %rbx
jmp 0x53db
movq %rax, %rbx
jmp 0x53e7
jmp 0x539c
movq %rax, %rbx
movq -0x200(%rbp), %rdi
jmp 0x542e
jmp 0x543a
movq %rax, %rbx
movq -0x220(%rbp), %rdi
jmp 0x542e
jmp 0x543a
movq %rax, %rbx
jmp 0x540a
movq %rax, %rbx
jmp 0x541b
movq %rax, %rbx
jmp 0x5427
jmp 0x543a
jmp 0x5394
movq %rax, %rbx
movq -0x280(%rbp), %rdi
jmp 0x54da
jmp 0x5394
movq %rax, %rbx
jmp 0x548a
movq %rax, %rbx
jmp 0x5469
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
jne 0x544f
jmp 0x5454
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x53ca
callq 0x2220
movq -0x1e0(%rbp), %rdi
cmpq %r13, %rdi
je 0x53db
callq 0x2220
leaq -0x120(%rbp), %rdi
callq 0xb2cc
movq -0x1c0(%rbp), %rdi
cmpq %r14, %rdi
jne 0x5464
jmp 0x5469
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x540a
callq 0x2220
movq -0x260(%rbp), %rdi
cmpq %r13, %rdi
je 0x541b
callq 0x2220
leaq -0xb0(%rbp), %rdi
callq 0xb2cc
movq -0x240(%rbp), %rdi
cmpq %r14, %rdi
je 0x5475
callq 0x2220
jmp 0x5475
movq %rax, %rbx
jmp 0x5475
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5454
callq 0x2220
leaq -0x170(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5469
callq 0x2220
leaq -0xb0(%rbp), %rdi
callq 0xb2cc
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x548a
callq 0x2220
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0x54a2
callq 0x2220
leaq -0x100(%rbp), %rdi
callq 0xbefc
leaq -0x70(%rbp), %rdi
callq 0xb2cc
movq %rbx, %rdi
callq 0x2400
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x54d3
callq 0x2220
movq -0x140(%rbp), %rdi
cmpq %r14, %rdi
jne 0x5485
jmp 0x548a