// File: /workspace/github_cpp_makefile_star2_O2/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, -0x90(%rbp)
andq $0x0, -0x80(%rbp)
leaq -0x138(%rbp), %r14
movq %r14, %rdi
callq 0x8b4a
leaq -0x268(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x70(%rbp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x83ae
leaq -0x278(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2300
leaq 0x1032f(%rip), %rsi     # 0x13392
movq %rax, %rdi
callq 0x83a1
movl %eax, %r14d
leaq -0x70(%rbp), %rdi
callq 0x2120
testb %r14b, %r14b
je 0x34e2
leaq 0xe366(%rip), %rsi      # 0x113ed
leaq -0x258(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x20f0
leaq -0x70(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x258(%rbp), %rdx
callq 0x8b82
leaq -0x90(%rbp), %rbx
leaq -0x70(%rbp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xf880
movq %r14, %rdi
callq 0x8a5a
leaq -0x258(%rbp), %rdi
callq 0x2120
movq (%rbx), %rsi
leaq -0x238(%rbp), %rdi
callq 0x2330
leaq -0x70(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x36b4
leaq -0x238(%rbp), %rdi
callq 0x2120
movq 0x15ebe(%rip), %rdi     # 0x18fc8
leaq 0xe2e2(%rip), %rsi      # 0x113f3
callq 0x2230
leaq -0x70(%rbp), %rsi
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x2130
movq -0x70(%rbp), %rcx
movq -0x68(%rbp), %rdx
xorl %esi, %esi
leaq 0xe125(%rip), %rdi      # 0x11260
xorl %eax, %eax
testq %rdx, %rdx
je 0x316b
movsbl -0x1(%rcx,%rdx), %r8d
testb $0x1, %sil
je 0x315b
movslq %r8d, %r8
movl -0xc0(%rdi,%r8,4), %r8d
jmp 0x315f
addl $-0x30, %r8d
xorb $0x1, %sil
addl %r8d, %eax
decq %rdx
jmp 0x313d
pushq $0xa
popq %rcx
cltd
idivl %ecx
testl %edx, %edx
je 0x3181
leaq 0x10c92(%rip), %rdi     # 0x13e0e
callq 0x23c0
leaq -0x138(%rbp), %rdi
callq 0x90a2
movq 0x15e34(%rip), %rdi     # 0x18fc8
leaq 0xe260(%rip), %rsi      # 0x113fb
callq 0x2230
movq %rax, %rbx
leaq 0xe192(%rip), %rsi      # 0x1133c
leaq -0x1f8(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0x20f0
leaq -0xa8(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x1f8(%rbp), %rdx
callq 0x8b82
movq -0xa8(%rbp), %rsi
leaq -0x218(%rbp), %rdi
callq 0x2330
leaq -0x50(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x218(%rbp), %rdx
callq 0x8570
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x2130
leaq -0x50(%rbp), %rdi
callq 0x2120
leaq -0x218(%rbp), %rdi
callq 0x2120
leaq -0xa8(%rbp), %rdi
callq 0x8a5a
leaq -0x1f8(%rbp), %rdi
callq 0x2120
leaq 0xf39b(%rip), %rsi      # 0x125e4
leaq -0x1d8(%rbp), %rdi
leaq -0xa8(%rbp), %rdx
callq 0x20f0
leaq -0x50(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x1d8(%rbp), %rdx
callq 0x8b82
leaq -0x90(%rbp), %rdi
leaq -0x50(%rbp), %rbx
movq %rbx, %rsi
callq 0xf880
movq %rbx, %rdi
callq 0x8a5a
leaq -0x1d8(%rbp), %rdi
callq 0x2120
leaq 0xe0ad(%rip), %rsi      # 0x1134e
leaq -0x1b8(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x20f0
leaq -0xa8(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x1b8(%rbp), %rdx
callq 0x8b82
leaq -0x1b8(%rbp), %rdi
callq 0x2120
movq 0x15cea(%rip), %rdi     # 0x18fc8
leaq 0xe122(%rip), %rsi      # 0x11407
callq 0x2230
movq %rax, %rbx
leaq 0xe05a(%rip), %rsi      # 0x1134e
leaq -0x178(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0x20f0
leaq -0xc0(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0x8b82
movq -0xc0(%rbp), %rsi
leaq -0x198(%rbp), %rdi
callq 0x2330
leaq -0x50(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x198(%rbp), %rdx
callq 0x8a86
leaq -0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x2130
leaq -0x50(%rbp), %rdi
callq 0x2120
leaq -0x198(%rbp), %rdi
callq 0x2120
leaq -0xc0(%rbp), %rdi
callq 0x8a5a
leaq -0x178(%rbp), %rdi
callq 0x2120
leaq 0xe085(%rip), %rsi      # 0x11415
leaq -0x158(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0x20f0
leaq -0x50(%rbp), %rdi
leaq -0x138(%rbp), %rsi
leaq -0x158(%rbp), %rdx
callq 0x8b82
leaq -0x90(%rbp), %rdi
leaq -0x50(%rbp), %rbx
movq %rbx, %rsi
callq 0xf880
movq %rbx, %rdi
callq 0x8a5a
leaq -0x158(%rbp), %rdi
callq 0x2120
movq 0x15be0(%rip), %rdi     # 0x18fc8
leaq 0xe03c(%rip), %rsi      # 0x1142b
callq 0x2230
movq %rax, %rbx
movq -0x90(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
pushq $0x1
popq %rdx
pushq $-0x1
popq %rcx
callq 0x2260
movq %rbx, -0xc8(%rbp)
leaq 0xff74(%rip), %rsi      # 0x13392
leaq -0x50(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0x20f0
movq -0xe8(%rbp), %r12
movq -0xe0(%rbp), %r13
xorl %ebx, %ebx
leaq -0x50(%rbp), %r14
cmpq %rbx, %r13
je 0x3468
movsbl (%r12,%rbx), %r15d
movl %r15d, %edi
callq 0x2410
testl %eax, %eax
je 0x3463
movq %r14, %rdi
movl %r15d, %esi
callq 0x21f0
incq %rbx
jmp 0x3442
leaq -0x50(%rbp), %rsi
movq -0xc8(%rbp), %rdi
callq 0x2210
movq %rax, %rdi
callq 0x2130
leaq -0x50(%rbp), %rdi
callq 0x2120
leaq -0xe8(%rbp), %rdi
callq 0x2120
leaq -0xa8(%rbp), %rdi
callq 0x8a5a
leaq -0x70(%rbp), %rdi
callq 0x2120
leaq -0x278(%rbp), %rdi
callq 0x2120
leaq -0x138(%rbp), %rdi
callq 0x9366
leaq -0x90(%rbp), %rdi
callq 0x8a5a
movb $0x1, %al
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x15ae7(%rip), %r15     # 0x18fd0
movq (%r15), %r14
callq 0x2040
movl (%rax), %edi
callq 0x20c0
movq %rbx, (%rsp)
leaq 0xde52(%rip), %rsi      # 0x11355
leaq 0xded4(%rip), %rdx      # 0x113de
leaq 0xde0d(%rip), %rcx      # 0x1131e
pushq $0x3a
popq %r8
movq %r14, %rdi
movq %rax, %r9
xorl %eax, %eax
callq 0x2360
movq 0x15a7f(%rip), %rax     # 0x18fa8
movq (%rax), %rdi
callq 0x22c0
movq (%r15), %rdi
callq 0x22c0
pushq $0x1
popq %rdi
callq 0x22e0
movq %rax, %rbx
jmp 0x3667
jmp 0x361f
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
jmp 0x366e
jmp 0x361f
movq %rax, %rbx
jmp 0x35fe
movq %rax, %rbx
jmp 0x360a
movq %rax, %rbx
jmp 0x3616
jmp 0x361f
movq %rax, %rbx
leaq -0x1b8(%rbp), %rdi
jmp 0x364f
jmp 0x3656
movq %rax, %rbx
leaq -0x1d8(%rbp), %rdi
jmp 0x364f
jmp 0x3656
movq %rax, %rbx
jmp 0x3630
movq %rax, %rbx
jmp 0x363c
movq %rax, %rbx
jmp 0x3648
jmp 0x3656
movq %rax, %rbx
leaq -0x238(%rbp), %rdi
jmp 0x3683
jmp 0x35e8
movq %rax, %rbx
leaq -0x258(%rbp), %rdi
jmp 0x3683
jmp 0x35e8
jmp 0x3656
movq %rax, %rbx
jmp 0x3688
jmp 0x365b
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2120
leaq -0x198(%rbp), %rdi
callq 0x2120
leaq -0xc0(%rbp), %rdi
callq 0x8a5a
leaq -0x178(%rbp), %rdi
jmp 0x366e
movq %rax, %rbx
jmp 0x3673
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2120
leaq -0x218(%rbp), %rdi
callq 0x2120
leaq -0xa8(%rbp), %rdi
callq 0x8a5a
leaq -0x1f8(%rbp), %rdi
callq 0x2120
jmp 0x367f
movq %rax, %rbx
jmp 0x367f
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x2120
leaq -0xe8(%rbp), %rdi
callq 0x2120
leaq -0xa8(%rbp), %rdi
callq 0x8a5a
leaq -0x70(%rbp), %rdi
callq 0x2120
leaq -0x278(%rbp), %rdi
callq 0x2120
leaq -0x138(%rbp), %rdi
callq 0x9366
leaq -0x90(%rbp), %rdi
callq 0x8a5a
movq %rbx, %rdi
callq 0x2400