// File: FFY00[P]uicc/src/program_uicc.c
// Function: readSIMvalues(char*)
bool readSIMvalues(char *port) {
    SIM SIMcard;
    string ATR;
    Assert((ATR=SIMcard.open(port))!="", "Failed to open %s", port);
    //dump_hex("ATR", ATR);
    vector<string> res;
    cout << "GSM IMSI: " << SIMcard.decodeIMSI(SIMcard.readFile("IMSI")[0]) << endl;
    // Show only the first isdn (might be several)
    cout << "GSM MSISDN: " << SIMcard.decodeISDN(SIMcard.readFile("MSISDN")[0]) <<endl;
    SIMcard.close();
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
leaq -0x20(%rbp), %rdi
callq 0xe960
leaq -0x40(%rbp), %rdi
callq 0x33f0
movq -0x8(%rbp), %rdx
leaq -0x60(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xe9b0
jmp 0x4154
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3390
movq %rax, %rdi
leaq 0x21af9(%rip), %rsi     # 0x25c64
callq 0xe980
movb %al, -0x182(%rbp)
jmp 0x4178
movb -0x182(%rbp), %al
xorb $-0x1, %al
movb %al, -0x183(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x31a0
movb -0x183(%rbp), %al
testb $0x1, %al
jne 0x419e
jmp 0x4248
movq 0x2ae2b(%rip), %rax     # 0x2efd0
movq (%rax), %rax
movq %rax, -0x190(%rbp)
callq 0x3040
movl (%rax), %edi
callq 0x30d0
movq -0x190(%rbp), %rdi
movq %rax, %r9
movq -0x8(%rbp), %rcx
movq %rsp, %rax
movq %rcx, (%rax)
leaq 0x1f124(%rip), %rsi     # 0x232fa
leaq 0x1f1a5(%rip), %rdx     # 0x23382
leaq 0x1f1ac(%rip), %rcx     # 0x23390
xorl %eax, %eax
movl $0x2c, %r8d
callq 0x3410
movq 0x2ada8(%rip), %rax     # 0x2efa0
movq (%rax), %rdi
callq 0x3350
jmp 0x4202
movq 0x2adc7(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
callq 0x3350
jmp 0x4213
movl $0x1, %edi
callq 0x3370
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x45c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x31a0
jmp 0x45c6
jmp 0x424a
jmp 0x424c
leaq -0x88(%rbp), %rdi
callq 0xec50
movq 0x2ad69(%rip), %rdi     # 0x2efc8
leaq 0x1f13d(%rip), %rsi     # 0x233a3
callq 0x3290
movq %rax, -0x198(%rbp)
jmp 0x4274
leaq -0x101(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0x34d0
movq -0x1a0(%rbp), %rdx
leaq 0x1f119(%rip), %rsi     # 0x233ae
leaq -0x100(%rbp), %rdi
callq 0x33e0
jmp 0x42a3
leaq -0xe0(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x100(%rbp), %rdx
callq 0xed40
jmp 0x42bc
xorl %eax, %eax
movl %eax, %esi
leaq -0xe0(%rbp), %rdi
callq 0xf690
movq %rax, %rsi
leaq -0xc8(%rbp), %rdi
callq 0x3120
jmp 0x42dd
leaq -0xa8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
callq 0xec70
jmp 0x42f6
movq -0x198(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x3260
movq %rax, -0x1a8(%rbp)
jmp 0x4312
movq -0x1a8(%rbp), %rdi
movq 0x2ac90(%rip), %rsi     # 0x2efb0
callq 0x32e0
jmp 0x4327
leaq -0xa8(%rbp), %rdi
callq 0x31a0
leaq -0xc8(%rbp), %rdi
callq 0x31a0
leaq -0xe0(%rbp), %rdi
callq 0xf6b0
leaq -0x100(%rbp), %rdi
callq 0x31a0
leaq -0x101(%rbp), %rdi
callq 0x3300
movq 0x2ac5e(%rip), %rdi     # 0x2efc8
leaq 0x1f042(%rip), %rsi     # 0x233b3
callq 0x3290
movq %rax, -0x1b0(%rbp)
jmp 0x437f
leaq -0x181(%rbp), %rdi
movq %rdi, -0x1b8(%rbp)
callq 0x34d0
movq -0x1b8(%rbp), %rdx
leaq 0x1f020(%rip), %rsi     # 0x233c0
leaq -0x180(%rbp), %rdi
callq 0x33e0
jmp 0x43ae
leaq -0x160(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x180(%rbp), %rdx
callq 0xed40
jmp 0x43c7
xorl %eax, %eax
movl %eax, %esi
leaq -0x160(%rbp), %rdi
callq 0xf690
movq %rax, %rsi
leaq -0x148(%rbp), %rdi
callq 0x3120
jmp 0x43e8
leaq -0x128(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0xf710
jmp 0x4401
movq -0x1b0(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0x3260
movq %rax, -0x1c0(%rbp)
jmp 0x441d
movq -0x1c0(%rbp), %rdi
movq 0x2ab85(%rip), %rsi     # 0x2efb0
callq 0x32e0
jmp 0x4432
leaq -0x128(%rbp), %rdi
callq 0x31a0
leaq -0x148(%rbp), %rdi
callq 0x31a0
leaq -0x160(%rbp), %rdi
callq 0xf6b0
leaq -0x180(%rbp), %rdi
callq 0x31a0
leaq -0x181(%rbp), %rdi
callq 0x3300
leaq -0x20(%rbp), %rdi
callq 0xf810
jmp 0x4479
leaq -0x88(%rbp), %rdi
callq 0xf6b0
leaq -0x40(%rbp), %rdi
callq 0x31a0
leaq -0x20(%rbp), %rdi
callq 0xf850
movb $0x1, %al
andb $0x1, %al
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x45ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x4529
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x451d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x4511
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x4505
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x31a0
leaq -0xc8(%rbp), %rdi
callq 0x31a0
leaq -0xe0(%rbp), %rdi
callq 0xf6b0
leaq -0x100(%rbp), %rdi
callq 0x31a0
leaq -0x101(%rbp), %rdi
callq 0x3300
jmp 0x45ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x45ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x45a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x4596
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x458a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x31a0
leaq -0x148(%rbp), %rdi
callq 0x31a0
leaq -0x160(%rbp), %rdi
callq 0xf6b0
leaq -0x180(%rbp), %rdi
callq 0x31a0
leaq -0x181(%rbp), %rdi
callq 0x3300
leaq -0x88(%rbp), %rdi
callq 0xf6b0
leaq -0x40(%rbp), %rdi
callq 0x31a0
leaq -0x20(%rbp), %rdi
callq 0xf850
movq -0x68(%rbp), %rdi
callq 0x34b0
nopw %cs:(%rax,%rax)