// File: /workspace/github_cpp_makefile_star2_O1/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 $0x248, %rsp            # imm = 0x248
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, -0xf8(%rbp)
movl $0xffffffff, -0xf4(%rbp) # imm = 0xFFFFFFFF
leaq 0x138d0(%rip), %rdi     # 0x18400
callq 0x2310
testq %rax, %rax
je 0x4b4c
movzbl (%rax), %eax
orl $0x20, %eax
cmpl $0x79, %eax
jne 0x4b4c
movb $0x1, -0xf8(%rbp)
leaq -0xe0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xc0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x140(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x90(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
movq %rbx, %rdx
callq 0xa812
leaq -0x150(%rbp), %rdi
leaq -0x90(%rbp), %r15
movq %r15, %rsi
callq 0x2320
leaq 0x137fe(%rip), %rsi     # 0x183b2
movq %rax, %rdi
callq 0x20b0
movl %eax, %r14d
movq (%r15), %rdi
leaq -0x80(%rbp), %r12
cmpq %r12, %rdi
je 0x4bd0
callq 0x2220
testl %r14d, %r14d
je 0x5307
leaq -0x260(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11822(%rip), %rsi     # 0x1640d
leaq 0x11820(%rip), %rdx     # 0x16412
leaq -0x270(%rbp), %rdi
callq 0x137c4
leaq -0x50(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x270(%rbp), %rdx
callq 0xb168
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rdi
movaps %xmm0, (%rdi)
movaps -0x70(%rbp), %xmm0
movq -0x60(%rbp), %rax
leaq -0x50(%rbp), %rbx
movups (%rbx), %xmm1
movaps %xmm1, -0x70(%rbp)
movq 0x10(%rbx), %rcx
movq %rcx, -0x60(%rbp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%rbx)
movq $0x0, 0x10(%rbx)
callq 0xafd4
movq %rbx, %rdi
callq 0xafd4
movq -0x270(%rbp), %rdi
cmpq %r14, %rdi
je 0x4c70
callq 0x2220
movq -0x70(%rbp), %rax
leaq -0x120(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x130(%rbp), %rdi
callq 0x1372a
movq %r12, -0x90(%rbp)
movq $0x0, -0x88(%rbp)
movb $0x0, -0x80(%rbp)
cmpq $0x0, -0x128(%rbp)
je 0x4d08
xorl %r15d, %r15d
leaq -0x90(%rbp), %rbx
movq -0x130(%rbp), %rax
movb (%rax,%r15), %al
andb $0xf, %al
orb $0x30, %al
cmpb $0x39, %al
ja 0x4cdd
movzbl %al, %esi
movq %rbx, %rdi
callq 0x2200
movq -0x130(%rbp), %rax
movb (%rax,%r15), %al
shrb $0x4, %al
orb $0x30, %al
cmpb $0x39, %al
ja 0x4cfc
movzbl %al, %esi
movq %rbx, %rdi
callq 0x2200
incq %r15
cmpq -0x128(%rbp), %r15
jb 0x4cbf
movq -0x130(%rbp), %rdi
cmpq %r14, %rdi
je 0x4d19
callq 0x2220
movq 0x1a2a8(%rip), %rdi     # 0x1efc8
leaq 0x116ec(%rip), %rsi     # 0x16413
movl $0x7, %edx
callq 0x22c0
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq 0x1a282(%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 0x4dda
movq -0x90(%rbp), %rcx
xorl %edx, %edx
leaq 0x114ef(%rip), %rsi     # 0x16280
xorl %edi, %edi
movsbl -0x1(%rcx,%rax), %r8d
testb $0x1, %dl
je 0x4dab
movslq %r8d, %r8
movl -0xc0(%rsi,%r8,4), %r8d
jmp 0x4daf
addl $-0x30, %r8d
addl %r8d, %edi
xorb $0x1, %dl
decq %rax
jne 0x4d93
imull $0xcccccccd, %edi, %eax # imm = 0xCCCCCCCD
addl $0x19999998, %eax       # imm = 0x19999998
rorl %eax
cmpl $0x19999999, %eax       # imm = 0x19999999
jb 0x4dda
leaq 0x14059(%rip), %rdi     # 0x18e2e
callq 0x23c0
leaq -0xf8(%rbp), %rdi
callq 0xb842
movq 0x1a1db(%rip), %rdi     # 0x1efc8
leaq 0x11627(%rip), %rsi     # 0x1641b
movl $0xb, %edx
callq 0x22c0
leaq -0x220(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1154c(%rip), %rsi     # 0x1635c
leaq 0x11549(%rip), %rdx     # 0x16360
leaq -0x230(%rbp), %rdi
callq 0x137c4
leaq -0xa8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x230(%rbp), %rdx
callq 0xb168
movq -0xa8(%rbp), %rax
leaq -0x240(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x250(%rbp), %rdi
callq 0x1372a
leaq -0x50(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x250(%rbp), %rdx
callq 0xa914
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x1a13d(%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 0x4ecc
callq 0x2220
movq -0x250(%rbp), %rdi
cmpq %r13, %rdi
je 0x4edd
callq 0x2220
leaq -0xa8(%rbp), %rdi
callq 0xafd4
movq -0x230(%rbp), %rdi
cmpq %r14, %rdi
je 0x4efa
callq 0x2220
leaq -0x200(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x126f8(%rip), %rsi     # 0x17604
leaq 0x12715(%rip), %rdx     # 0x17628
leaq -0x210(%rbp), %rdi
callq 0x137c4
leaq -0xa8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x210(%rbp), %rdx
callq 0xb168
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movaps -0x70(%rbp), %xmm0
movq -0x60(%rbp), %rax
leaq -0xa8(%rbp), %rbx
movups (%rbx), %xmm1
movaps %xmm1, -0x70(%rbp)
movq 0x10(%rbx), %rcx
movq %rcx, -0x60(%rbp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%rbx)
movq $0x0, 0x10(%rbx)
callq 0xafd4
movq %rbx, %rdi
callq 0xafd4
movq -0x210(%rbp), %rdi
cmpq %r14, %rdi
je 0x4f94
callq 0x2220
leaq -0x1e0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x113c8(%rip), %rsi     # 0x1636e
leaq 0x113c7(%rip), %rdx     # 0x16374
leaq -0x1f0(%rbp), %rdi
callq 0x137c4
leaq -0xa8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x1f0(%rbp), %rdx
callq 0xb168
movq -0x1f0(%rbp), %rdi
cmpq %r14, %rdi
je 0x4fe4
callq 0x2220
movq 0x19fdd(%rip), %rdi     # 0x1efc8
leaq 0x11435(%rip), %rsi     # 0x16427
movl $0xd, %edx
callq 0x22c0
leaq -0x1a0(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x11360(%rip), %rsi     # 0x1636e
leaq 0x1135f(%rip), %rdx     # 0x16374
leaq -0x1b0(%rbp), %rdi
callq 0x137c4
leaq -0x110(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x1b0(%rbp), %rdx
callq 0xb168
movq -0x110(%rbp), %rax
leaq -0x1c0(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq -0x1d0(%rbp), %rdi
callq 0x1372a
leaq -0x50(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x1d0(%rbp), %rdx
callq 0xb022
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x19f3f(%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 0x50c6
callq 0x2220
movq -0x1d0(%rbp), %rdi
cmpq %r13, %rdi
je 0x50d7
callq 0x2220
leaq -0x110(%rbp), %rdi
callq 0xafd4
movq -0x1b0(%rbp), %rdi
cmpq %r14, %rdi
je 0x50f4
callq 0x2220
leaq -0x180(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x1132f(%rip), %rsi     # 0x16435
leaq 0x1133d(%rip), %rdx     # 0x1644a
leaq -0x190(%rbp), %rdi
callq 0x137c4
leaq -0x110(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x190(%rbp), %rdx
callq 0xb168
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movaps -0x70(%rbp), %xmm0
movq -0x60(%rbp), %rax
leaq -0x110(%rbp), %rbx
movups (%rbx), %xmm1
movaps %xmm1, -0x70(%rbp)
movq 0x10(%rbx), %rcx
movq %rcx, -0x60(%rbp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%rbx)
movq $0x0, 0x10(%rbx)
callq 0xafd4
movq %rbx, %rdi
callq 0xafd4
movq -0x190(%rbp), %rdi
cmpq %r14, %rdi
je 0x518e
callq 0x2220
movq 0x19e33(%rip), %rdi     # 0x1efc8
leaq 0x112af(%rip), %rsi     # 0x1644b
movl $0x1c, %edx
callq 0x22c0
movq -0x70(%rbp), %rsi
leaq -0x170(%rbp), %rdi
movl $0x1, %edx
movq $-0x1, %rcx
callq 0x2270
movq %r15, -0x50(%rbp)
movq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq -0x168(%rbp), %r13
testq %r13, %r13
je 0x5210
movq -0x170(%rbp), %r12
xorl %r15d, %r15d
leaq -0x50(%rbp), %rbx
movsbl (%r12,%r15), %r14d
movl %r14d, %edi
callq 0x2410
testl %eax, %eax
je 0x5208
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2200
incq %r15
cmpq %r15, %r13
jne 0x51ec
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq 0x19da9(%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
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
leaq -0x140(%rbp), %rbx
leaq -0x80(%rbp), %r14
leaq -0xe0(%rbp), %r15
leaq -0xc0(%rbp), %r12
je 0x5279
callq 0x2220
leaq -0x160(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x528e
callq 0x2220
leaq -0xa8(%rbp), %rdi
callq 0xafd4
movq -0x90(%rbp), %rdi
cmpq %r14, %rdi
je 0x52ab
callq 0x2220
movq -0x150(%rbp), %rdi
cmpq %rbx, %rdi
je 0x52bc
callq 0x2220
movq -0xd0(%rbp), %rdi
cmpq %r12, %rdi
je 0x52cd
callq 0x2220
movq -0xf0(%rbp), %rdi
cmpq %r15, %rdi
je 0x52de
callq 0x2220
leaq -0xf8(%rbp), %rdi
callq 0xb13c
leaq -0x70(%rbp), %rdi
callq 0xafd4
movb $0x1, %al
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x26a1
jmp 0x539f
movq %rax, %rbx
movq -0x190(%rbp), %rdi
jmp 0x53e1
jmp 0x539f
movq %rax, %rbx
jmp 0x53bd
movq %rax, %rbx
jmp 0x53ce
movq %rax, %rbx
jmp 0x53da
jmp 0x539f
movq %rax, %rbx
movq -0x1f0(%rbp), %rdi
jmp 0x5421
jmp 0x542d
movq %rax, %rbx
movq -0x210(%rbp), %rdi
jmp 0x5421
jmp 0x542d
movq %rax, %rbx
jmp 0x53fd
movq %rax, %rbx
jmp 0x540e
movq %rax, %rbx
jmp 0x541a
jmp 0x542d
jmp 0x5397
movq %rax, %rbx
movq -0x270(%rbp), %rdi
jmp 0x54cd
jmp 0x5397
movq %rax, %rbx
jmp 0x547d
movq %rax, %rbx
jmp 0x545c
jmp 0x5432
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x53bd
callq 0x2220
movq -0x1d0(%rbp), %rdi
cmpq %r13, %rdi
je 0x53ce
callq 0x2220
leaq -0x110(%rbp), %rdi
callq 0xafd4
movq -0x1b0(%rbp), %rdi
cmpq %r14, %rdi
jne 0x5457
jmp 0x545c
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x53fd
callq 0x2220
movq -0x250(%rbp), %rdi
cmpq %r13, %rdi
je 0x540e
callq 0x2220
leaq -0xa8(%rbp), %rdi
callq 0xafd4
movq -0x230(%rbp), %rdi
cmpq %r14, %rdi
je 0x5468
callq 0x2220
jmp 0x5468
movq %rax, %rbx
jmp 0x5468
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x5447
callq 0x2220
leaq -0x160(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x545c
callq 0x2220
leaq -0xa8(%rbp), %rdi
callq 0xafd4
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x547d
callq 0x2220
movq -0x150(%rbp), %rdi
leaq -0x140(%rbp), %rax
cmpq %rax, %rdi
je 0x5495
callq 0x2220
leaq -0xf8(%rbp), %rdi
callq 0xbc40
leaq -0x70(%rbp), %rdi
callq 0xafd4
movq %rbx, %rdi
callq 0x2400
movq %rax, %rbx
movq -0x90(%rbp), %rdi
cmpq %r12, %rdi
je 0x54c6
callq 0x2220
movq -0x130(%rbp), %rdi
cmpq %r14, %rdi
jne 0x5478
jmp 0x547d