// File: /workspace/github_cpp_makefile_star2_O2/FFY00[P]uicc/include/uicc.h
// Function: USIM::openUSIM()
bool openUSIM() {
        vector<string> res;
        // Read card description
        res=readFile("EFDIR");
        string Appli=extractTLV(res[0], "Application Template");
        string AID=extractTLV(Appli, "AID");
        //Instead of first AID, we should look for AID starting by: a000000087 (3GPP) 1002 (USIM)
        //dump_hex("AID", AID);
        //printf("card supplier id: %s\n", extractTLV(Appli, "Card").c_str());
        string order(u8"\x00\xa4\x04\x0c",4);
        order+=(char)AID.size();
        order+=AID;
        string answer (u8"\x90\x00",2);
        return send_check(order, answer);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
andq $0x0, -0x60(%rbp)
leaq 0xa6b4(%rip), %rsi      # 0x1377c
leaq -0x190(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x20f0
leaq -0x90(%rbp), %rdi
leaq -0x190(%rbp), %rdx
movq %rbx, %rsi
callq 0x8b82
leaq -0x70(%rbp), %r14
leaq -0x90(%rbp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xf880
movq %r15, %rdi
callq 0x8a5a
leaq -0x190(%rbp), %rdi
callq 0x2120
movq (%r14), %rsi
leaq -0x170(%rbp), %rdi
callq 0x2330
leaq 0xaaac(%rip), %rsi      # 0x13bda
leaq -0x150(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x20f0
leaq -0x90(%rbp), %rdi
leaq -0x170(%rbp), %rsi
leaq -0x150(%rbp), %rdx
callq 0x805b
leaq -0x150(%rbp), %rdi
callq 0x2120
leaq -0x170(%rbp), %rdi
callq 0x2120
leaq -0x130(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2330
leaq 0xaa65(%rip), %rsi      # 0x13bef
leaq -0x110(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0x20f0
leaq -0x58(%rbp), %rdi
leaq -0x130(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0x805b
leaq -0x110(%rbp), %rdi
callq 0x2120
leaq -0x130(%rbp), %rdi
callq 0x2120
leaq -0x28(%rbp), %rax
movq %rax, -0x10(%rax)
movl $0xc04a400, (%rax)      # imm = 0xC04A400
movq $0x4, -0x8(%rax)
movb $0x0, 0x4(%rax)
movsbl -0x50(%rbp), %esi
leaq -0x38(%rbp), %rdi
callq 0x21f0
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x2470
leaq -0xe0(%rbp), %rax
movq %rax, -0x10(%rax)
movw $0x90, (%rax)
movq $0x2, -0x8(%rax)
movb $0x0, 0x2(%rax)
leaq -0xd0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2330
leaq -0xb0(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x2330
leaq -0xd0(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
movq %rbx, %rdi
callq 0xb426
movl %eax, %ebx
leaq -0xb0(%rbp), %rdi
callq 0x2120
leaq -0xd0(%rbp), %rdi
callq 0x2120
leaq -0xf0(%rbp), %rdi
callq 0x2120
leaq -0x38(%rbp), %rdi
callq 0x2120
leaq -0x58(%rbp), %rdi
callq 0x2120
leaq -0x90(%rbp), %rdi
callq 0x2120
leaq -0x70(%rbp), %rdi
callq 0x8a5a
movl %ebx, %eax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x2120
jmp 0x92c3
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0x2120
jmp 0x92d4
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x2120
jmp 0x9337
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x2120
jmp 0x92f6
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
jmp 0x9344
movq %rax, %rbx
jmp 0x9349
movq %rax, %rbx
leaq -0x150(%rbp), %rdi
callq 0x2120
jmp 0x9318
movq %rax, %rbx
leaq -0x170(%rbp), %rdi
jmp 0x9350
jmp 0x932f
movq %rax, %rbx
leaq -0x190(%rbp), %rdi
jmp 0x9350
movq %rax, %rbx
jmp 0x9355
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x2120
leaq -0x58(%rbp), %rdi
callq 0x2120
leaq -0x90(%rbp), %rdi
callq 0x2120
leaq -0x70(%rbp), %rdi
callq 0x8a5a
movq %rbx, %rdi
callq 0x2400