// File: /workspace/github_c_makefile_star2_O0/soso7885[P]OPCUA_example/demo_src/client.c
// Function: main
int main(int argc, char *argv[]) {
    UA_Client *client = UA_Client_new(UA_ClientConfig_standard);

    //listing endpoints
    UA_EndpointDescription* endpointArray = NULL;
    size_t endpointArraySize = 0;
    UA_StatusCode retval =
        UA_Client_getEndpoints(client, "opc.tcp://localhost:16664",
                               &endpointArraySize, &endpointArray);

    //freeing the endpointArray
    if(retval != UA_STATUSCODE_GOOD) {
        //cleanup array
        UA_Array_delete(endpointArray,endpointArraySize, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]);
        UA_Client_delete(client);
        return (int)retval;
    }

    printf("%i endpoints found\n", (int)endpointArraySize);
    for(size_t i=0;i<endpointArraySize;i++){
        printf("URL of endpoint %i is %.*s\n", (int)i, (int)endpointArray[i].endpointUrl.length, endpointArray[i].endpointUrl.data);
    }

    //cleanup array of enpoints
    UA_Array_delete(endpointArray,endpointArraySize, &UA_TYPES[UA_TYPES_ENDPOINTDESCRIPTION]);

    //connect to a server
    //anonymous connect would be: retval = UA_Client_connect(client, "opc.tcp://localhost:16664");
    retval = UA_Client_connect_username(client, "opc.tcp://localhost:16664", "user1", "password");

    if(retval != UA_STATUSCODE_GOOD) {
        UA_Client_delete(client);
        return (int)retval;
    }
    // Browse some objects
    printf("Browsing nodes in objects folder:\n");

    UA_BrowseRequest bReq;
    UA_BrowseRequest_init(&bReq);
    bReq.requestedMaxReferencesPerNode = 0;
    bReq.nodesToBrowse = UA_BrowseDescription_new();
    bReq.nodesToBrowseSize = 1;
    bReq.nodesToBrowse[0].nodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER); //browse objects folder
    bReq.nodesToBrowse[0].resultMask = UA_BROWSERESULTMASK_ALL; //return everything

    UA_BrowseResponse bResp = UA_Client_Service_browse(client, bReq);
    printf("%-9s %-16s %-16s %-16s\n", "NAMESPACE", "NODEID", "BROWSE NAME", "DISPLAY NAME");
    for (size_t i = 0; i < bResp.resultsSize; ++i) {
        for (size_t j = 0; j < bResp.results[i].referencesSize; ++j) {
            UA_ReferenceDescription *ref = &(bResp.results[i].references[j]);
            if(ref->nodeId.nodeId.identifierType == UA_NODEIDTYPE_NUMERIC) {
                printf("%-9d %-16d %-16.*s %-16.*s\n", ref->browseName.namespaceIndex,
                       ref->nodeId.nodeId.identifier.numeric, (int)ref->browseName.name.length,
                       ref->browseName.name.data, (int)ref->displayName.text.length,
                       ref->displayName.text.data);
            } else if(ref->nodeId.nodeId.identifierType == UA_NODEIDTYPE_STRING) {
                printf("%-9d %-16.*s %-16.*s %-16.*s\n", ref->browseName.namespaceIndex,
                       (int)ref->nodeId.nodeId.identifier.string.length, ref->nodeId.nodeId.identifier.string.data,
                       (int)ref->browseName.name.length, ref->browseName.name.data,
                       (int)ref->displayName.text.length, ref->displayName.text.data);
            }
            //TODO: distinguish further types
        }
    }
    UA_BrowseRequest_deleteMembers(&bReq);
    UA_BrowseResponse_deleteMembers(&bResp);
    
    // Same thing, this time using the node iterator...
    UA_NodeId *parent = UA_NodeId_new();
    *parent = UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER);
    UA_Client_forEachChildNodeCall(client, UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER), nodeIter, (void *) parent);
    UA_NodeId_delete(parent);
    
#ifdef UA_ENABLE_SUBSCRIPTIONS
    // Create a subscription with interval 0 (immediate)...
    UA_UInt32 subId=0;
    UA_Client_Subscriptions_new(client, UA_SubscriptionSettings_standard, &subId);
    if(subId)
        printf("Create subscription succeeded, id %u\n", subId);
    
    // .. and monitor TheAnswer
    UA_NodeId monitorThis = UA_NODEID_STRING(1, "the.answer");
    UA_UInt32 monId=0;
    UA_Client_Subscriptions_addMonitoredItem(client, subId, monitorThis,
                                             UA_ATTRIBUTEID_VALUE, &handler_TheAnswerChanged, NULL, &monId);
    if (monId)
        printf("Monitoring 'the.answer', id %u\n", subId);
    
    // First Publish always generates data (current value) and call out handler.
    UA_Client_Subscriptions_manuallySendPublishRequest(client);
    
    // This should not generate anything
    UA_Client_Subscriptions_manuallySendPublishRequest(client);
#endif
    
    UA_Int32 value = 0;
    // Read node's value
    printf("\nReading the value of node (1, \"the.answer\"):\n");
    UA_ReadRequest rReq;
    UA_ReadRequest_init(&rReq);
    rReq.nodesToRead =  UA_Array_new(1, &UA_TYPES[UA_TYPES_READVALUEID]);
    rReq.nodesToReadSize = 1;
    rReq.nodesToRead[0].nodeId = UA_NODEID_STRING_ALLOC(1, "the.answer"); /* assume this node exists */
    rReq.nodesToRead[0].attributeId = UA_ATTRIBUTEID_VALUE;

    UA_ReadResponse rResp = UA_Client_Service_read(client, rReq);
    if(rResp.responseHeader.serviceResult == UA_STATUSCODE_GOOD &&
       rResp.resultsSize > 0 && rResp.results[0].hasValue &&
       UA_Variant_isScalar(&rResp.results[0].value) &&
       rResp.results[0].value.type == &UA_TYPES[UA_TYPES_INT32]) {
        value = *(UA_Int32*)rResp.results[0].value.data;
        printf("the value is: %i\n", value);
    }

    UA_ReadRequest_deleteMembers(&rReq);
    UA_ReadResponse_deleteMembers(&rResp);

    value++;
    // Write node's value
    printf("\nWriting a value of node (1, \"the.answer\"):\n");
    UA_WriteRequest wReq;
    UA_WriteRequest_init(&wReq);
    wReq.nodesToWrite = UA_WriteValue_new();
    wReq.nodesToWriteSize = 1;
    wReq.nodesToWrite[0].nodeId = UA_NODEID_STRING_ALLOC(1, "the.answer"); /* assume this node exists */
    wReq.nodesToWrite[0].attributeId = UA_ATTRIBUTEID_VALUE;
    wReq.nodesToWrite[0].value.hasValue = true;
    wReq.nodesToWrite[0].value.value.type = &UA_TYPES[UA_TYPES_INT32];
    wReq.nodesToWrite[0].value.value.storageType = UA_VARIANT_DATA_NODELETE; //do not free the integer on deletion
    wReq.nodesToWrite[0].value.value.data = &value;
    
    UA_WriteResponse wResp = UA_Client_Service_write(client, wReq);
    if(wResp.responseHeader.serviceResult == UA_STATUSCODE_GOOD)
            printf("the new value is: %i\n", value);
    UA_WriteRequest_deleteMembers(&wReq);
    UA_WriteResponse_deleteMembers(&wResp);

    // Alternate Form, this time using the hl API
    value++;
    UA_Variant *myVariant = UA_Variant_new();
    UA_Variant_setScalarCopy(myVariant, &value, &UA_TYPES[UA_TYPES_INT32]);
    UA_Client_writeValueAttribute(client, UA_NODEID_STRING(1, "the.answer"), myVariant);
    UA_Variant_delete(myVariant);
    
#ifdef UA_ENABLE_SUBSCRIPTIONS
    // Take another look at the.answer... this should call the handler.
    UA_Client_Subscriptions_manuallySendPublishRequest(client);
    
    // Delete our subscription (which also unmonitors all items)
    if(!UA_Client_Subscriptions_remove(client, subId))
        printf("Subscription removed\n");
#endif
    
#ifdef UA_ENABLE_METHODCALLS
    /* Note:  This example requires Namespace 0 Node 11489 (ServerType -> GetMonitoredItems) 
       FIXME: Provide a namespace 0 independant example on the server side
     */
    UA_Variant input;
    UA_String argString = UA_STRING("Hello Server");
    UA_Variant_init(&input);
    UA_Variant_setScalarCopy(&input, &argString, &UA_TYPES[UA_TYPES_STRING]);
    
    size_t outputSize;
    UA_Variant *output;
    retval = UA_Client_call(client, UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER),
                            UA_NODEID_NUMERIC(1, 62541), 1, &input, &outputSize, &output);
    if(retval == UA_STATUSCODE_GOOD) {
        printf("Method call was successfull, and %lu returned values available.\n",
               (unsigned long)outputSize);
        UA_Array_delete(output, outputSize, &UA_TYPES[UA_TYPES_VARIANT]);
    } else {
        printf("Method call was unsuccessfull, and %x returned values available.\n", retval);
    }
    UA_Variant_deleteMembers(&input);

#endif

#ifdef UA_ENABLE_NODEMANAGEMENT 
    /* New ReferenceType */
    UA_NodeId ref_id;
    UA_ReferenceTypeAttributes ref_attr;
    UA_ReferenceTypeAttributes_init(&ref_attr);
    ref_attr.displayName = UA_LOCALIZEDTEXT("en_US", "NewReference");
    ref_attr.description = UA_LOCALIZEDTEXT("en_US", "References something that might or might not exist");
    ref_attr.inverseName = UA_LOCALIZEDTEXT("en_US", "IsNewlyReferencedBy");
    retval = UA_Client_addReferenceTypeNode(client,
                                            UA_NODEID_NUMERIC(1, 12133),
                                            UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
                                            UA_NODEID_NUMERIC(0, UA_NS0ID_HASSUBTYPE),
                                            UA_QUALIFIEDNAME(1, "NewReference"),
                                            ref_attr, &ref_id);
    if(retval == UA_STATUSCODE_GOOD )
        printf("Created 'NewReference' with numeric NodeID %u\n", ref_id.identifier.numeric);
    
    /* New ObjectType */
    UA_NodeId objt_id;
    UA_ObjectTypeAttributes objt_attr;
    UA_ObjectTypeAttributes_init(&objt_attr);
    objt_attr.displayName = UA_LOCALIZEDTEXT("en_US", "TheNewObjectType");
    objt_attr.description = UA_LOCALIZEDTEXT("en_US", "Put innovative description here");
    retval = UA_Client_addObjectTypeNode(client,
                                         UA_NODEID_NUMERIC(1, 12134),
                                         UA_NODEID_NUMERIC(0, UA_NS0ID_BASEOBJECTTYPE),
                                         UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
                                         UA_QUALIFIEDNAME(1, "NewObjectType"),
                                         objt_attr, &objt_id);
    if(retval == UA_STATUSCODE_GOOD)
        printf("Created 'NewObjectType' with numeric NodeID %u\n", objt_id.identifier.numeric);
    
    /* New Object */
    UA_NodeId obj_id;
    UA_ObjectAttributes obj_attr;
    UA_ObjectAttributes_init(&obj_attr);
    obj_attr.displayName = UA_LOCALIZEDTEXT("en_US", "TheNewGreatNode");
    obj_attr.description = UA_LOCALIZEDTEXT("de_DE", "Hier koennte Ihre Webung stehen!");
    retval = UA_Client_addObjectNode(client,
                                     UA_NODEID_NUMERIC(1, 0),
                                     UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER),
                                     UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
                                     UA_QUALIFIEDNAME(1, "TheGreatNode"),
                                     UA_NODEID_NUMERIC(1, 12134),
                                     obj_attr, &obj_id);
    if(retval == UA_STATUSCODE_GOOD )
        printf("Created 'NewObject' with numeric NodeID %u\n", obj_id.identifier.numeric);
    
    /* New Integer Variable */
    UA_NodeId var_id;
    UA_VariableAttributes var_attr;
    UA_VariableAttributes_init(&var_attr);
    var_attr.displayName = UA_LOCALIZEDTEXT("en_US", "TheNewVariableNode");
    var_attr.description =
        UA_LOCALIZEDTEXT("en_US", "This integer is just amazing - it has digits and everything.");
    UA_Int32 int_value = 1234;
    /* This does not copy the value */
    UA_Variant_setScalar(&var_attr.value, &int_value, &UA_TYPES[UA_TYPES_INT32]);
    var_attr.dataType = UA_TYPES[UA_TYPES_INT32].typeId;
    retval = UA_Client_addVariableNode(client,
                                       UA_NODEID_NUMERIC(1, 0), // Assign new/random NodeID  
                                       UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER),
                                       UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
                                       UA_QUALIFIEDNAME(0, "VariableNode"),
                                       UA_NODEID_NULL, // no variable type
                                       var_attr, &var_id);
    if(retval == UA_STATUSCODE_GOOD )
        printf("Created 'NewVariable' with numeric NodeID %u\n", var_id.identifier.numeric);
#endif
    UA_Client_disconnect(client);
    UA_Client_delete(client);
    return (int) UA_STATUSCODE_GOOD;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc10, %rsp            # imm = 0xC10
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x3d48(%rip), %rax      # 0x4fe8
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movq %rsp, %rax
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
callq 0x1070
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x1d27(%rip), %rsi      # 0x3004
leaq -0x28(%rbp), %rdx
leaq -0x20(%rbp), %rcx
callq 0x1060
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x1322
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq 0x3cde(%rip), %rdx      # 0x4fe0
addq $0x1720, %rdx           # imm = 0x1720
callq 0x1030
movq -0x18(%rbp), %rdi
callq 0x1110
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x249e
movq -0x28(%rbp), %rax
movl %eax, %esi
leaq 0x1cef(%rip), %rdi      # 0x301e
movb $0x0, %al
callq 0x10a0
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x28(%rbp), %rax
jae 0x1391
movq -0x38(%rbp), %rax
movl %eax, %esi
movq -0x20(%rbp), %rax
imulq $0xd8, -0x38(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rax
movl %eax, %edx
movq -0x20(%rbp), %rax
imulq $0xd8, -0x38(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
leaq 0x1cb6(%rip), %rdi      # 0x3032
movb $0x0, %al
callq 0x10a0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x133e
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq 0x3c40(%rip), %rdx      # 0x4fe0
addq $0x1720, %rdx           # imm = 0x1720
callq 0x1030
movq -0x18(%rbp), %rdi
leaq 0x1c4d(%rip), %rsi      # 0x3004
leaq 0x1c90(%rip), %rdx      # 0x304e
leaq 0x1c8f(%rip), %rcx      # 0x3054
callq 0x1150
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x13e7
movq -0x18(%rbp), %rdi
callq 0x1110
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x249e
leaq 0x1c6f(%rip), %rdi      # 0x305d
movb $0x0, %al
callq 0x10a0
leaq -0xe8(%rbp), %rdi
callq 0x24b0
movl $0x0, -0x50(%rbp)
callq 0x24e0
movq %rax, -0x40(%rbp)
movq $0x1, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0xa50(%rbp)
leaq -0x100(%rbp), %rdi
xorl %esi, %esi
movl $0x55, %edx
callq 0x2500
movq -0xa50(%rbp), %rax
movq -0x100(%rbp), %rcx
movq %rcx, (%rax)
movq -0xf8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0xf0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rax
movl $0x3f, 0x40(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0xa48(%rbp)
movq %rsp, %rdi
movl $0x16, %ecx
leaq -0xe8(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0xa48(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
callq 0x2530
leaq 0x1be0(%rip), %rdi      # 0x3080
leaq 0x1bf1(%rip), %rsi      # 0x3098
leaq 0x1bf4(%rip), %rdx      # 0x30a2
leaq 0x1bf4(%rip), %rcx      # 0x30a9
leaq 0x1bf9(%rip), %r8       # 0x30b5
movb $0x0, %al
callq 0x10a0
movq $0x0, -0x1b0(%rbp)
movq -0x1b0(%rbp), %rax
cmpq -0x120(%rbp), %rax
jae 0x1655
movq $0x0, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rax
movq -0x118(%rbp), %rcx
imulq $0x28, -0x1b0(%rbp), %rdx
addq %rdx, %rcx
cmpq 0x18(%rcx), %rax
jae 0x163c
movq -0x118(%rbp), %rax
imulq $0x28, -0x1b0(%rbp), %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
imulq $0xc0, -0x1b8(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x1c0(%rbp)
movq -0x1c0(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jne 0x15a5
movq -0x1c0(%rbp), %rax
movzwl 0x50(%rax), %esi
movq -0x1c0(%rbp), %rax
movl 0x28(%rax), %edx
movq -0x1c0(%rbp), %rax
movq 0x58(%rax), %rax
movl %eax, %ecx
movq -0x1c0(%rbp), %rax
movq 0x60(%rax), %r8
movq -0x1c0(%rbp), %rax
movq 0x78(%rax), %rax
movl %eax, %r9d
movq -0x1c0(%rbp), %rax
movq 0x80(%rax), %rax
leaq 0x1b2a(%rip), %rdi      # 0x30c2
movq %rax, (%rsp)
movb $0x0, %al
callq 0x10a0
jmp 0x1623
movq -0x1c0(%rbp), %rax
cmpl $0x3, 0x24(%rax)
jne 0x1621
movq -0x1c0(%rbp), %rax
movzwl 0x50(%rax), %esi
movq -0x1c0(%rbp), %rax
movq 0x28(%rax), %rax
movl %eax, %edx
movq -0x1c0(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x1c0(%rbp), %rax
movq 0x58(%rax), %rax
movl %eax, %r8d
movq -0x1c0(%rbp), %rax
movq 0x60(%rax), %r9
movq -0x1c0(%rbp), %rax
movq 0x78(%rax), %rax
movl %eax, %r10d
movq -0x1c0(%rbp), %rax
movq 0x80(%rax), %rax
leaq 0x1acd(%rip), %rdi      # 0x30de
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x10a0
jmp 0x1623
jmp 0x1625
movq -0x1b8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1b8(%rbp)
jmp 0x14ed
jmp 0x163e
movq -0x1b0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1b0(%rbp)
jmp 0x14ce
leaq -0xe8(%rbp), %rdi
callq 0x2580
leaq -0x1a8(%rbp), %rdi
callq 0x25b0
callq 0x25e0
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
movq %rax, -0xa70(%rbp)
leaq -0x1e0(%rbp), %rdi
xorl %esi, %esi
movl $0x55, %edx
callq 0x2500
movq -0xa70(%rbp), %rax
movq -0x1e0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x1d8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x1d0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0xa68(%rbp)
leaq -0x1f8(%rbp), %rdi
xorl %esi, %esi
movl $0x55, %edx
callq 0x2500
movq -0xa68(%rbp), %rdi
movq -0x1c8(%rbp), %rdx
leaq -0x1f8(%rbp), %rax
leaq 0xf05(%rip), %rsi       # 0x2600
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x1100
movq -0x1c8(%rbp), %rdi
callq 0x2670
movl $0x0, -0x1fc(%rbp)
leaq 0x19c6(%rip), %rdi      # 0x30fc
movb $0x0, %al
callq 0x10a0
leaq -0x290(%rbp), %rdi
callq 0x26a0
movl $0x1, %edi
movq 0x388b(%rip), %rsi      # 0x4fe0
addq $0xa78, %rsi            # imm = 0xA78
callq 0x1050
movq %rax, -0x208(%rbp)
movq $0x1, -0x210(%rbp)
movq -0x208(%rbp), %rax
movq %rax, -0xa60(%rbp)
leaq -0x2a8(%rbp), %rdi
movl $0x1, %esi
leaq 0x1997(%rip), %rdx      # 0x312b
callq 0x26d0
movq -0xa60(%rbp), %rax
movq -0x2a8(%rbp), %rcx
movq %rcx, (%rax)
movq -0x2a0(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x298(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x208(%rbp), %rax
movl $0xd, 0x18(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0xa58(%rbp)
movq %rsp, %rdi
movl $0x12, %ecx
leaq -0x290(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0xa58(%rbp), %rsi
leaq -0x350(%rbp), %rdi
callq 0x2730
cmpl $0x0, -0x344(%rbp)
jne 0x1878
cmpq $0x0, -0x2c8(%rbp)
jbe 0x1878
movq -0x2c0(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
testb $0x1, %al
je 0x1878
movq -0x2c0(%rbp), %rdi
addq $0x8, %rdi
callq 0x2780
testb $0x1, %al
jne 0x1836
jmp 0x1878
movq -0x2c0(%rbp), %rax
movq 0x379c(%rip), %rcx      # 0x4fe0
addq $0xc8, %rcx
cmpq %rcx, 0x8(%rax)
jne 0x1878
movq -0x2c0(%rbp), %rax
movq 0x20(%rax), %rax
movl (%rax), %eax
movl %eax, -0x1fc(%rbp)
movl -0x1fc(%rbp), %esi
leaq 0x18c5(%rip), %rdi      # 0x3136
movb $0x0, %al
callq 0x10a0
leaq -0x290(%rbp), %rdi
callq 0x27c0
leaq -0x350(%rbp), %rdi
callq 0x27f0
movl -0x1fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1fc(%rbp)
leaq 0x18a2(%rip), %rdi      # 0x3148
movb $0x0, %al
callq 0x10a0
leaq -0x3d0(%rbp), %rdi
callq 0x2820
callq 0x2850
movq %rax, -0x358(%rbp)
movq $0x1, -0x360(%rbp)
movq -0x358(%rbp), %rax
movq %rax, -0xa80(%rbp)
leaq -0x3e8(%rbp), %rdi
movl $0x1, %esi
leaq 0x183a(%rip), %rdx      # 0x312b
callq 0x26d0
movq -0xa80(%rbp), %rax
movq -0x3e8(%rbp), %rcx
movq %rcx, (%rax)
movq -0x3e0(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x3d8(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x358(%rbp), %rax
movl $0xd, 0x18(%rax)
movq -0x358(%rbp), %rax
movb 0x30(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x30(%rax)
movq -0x358(%rbp), %rax
movq 0x3694(%rip), %rcx      # 0x4fe0
addq $0xc8, %rcx
movq %rcx, 0x38(%rax)
movq -0x358(%rbp), %rax
movl $0x1, 0x40(%rax)
movq -0x358(%rbp), %rax
leaq -0x1fc(%rbp), %rcx
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rsi
movups -0x360(%rbp), %xmm0
movq %rsp, %rax
movq %rax, -0xa78(%rbp)
movups %xmm0, 0x70(%rax)
movups -0x370(%rbp), %xmm0
movups %xmm0, 0x60(%rax)
movups -0x380(%rbp), %xmm0
movups %xmm0, 0x50(%rax)
movups -0x390(%rbp), %xmm0
movups %xmm0, 0x40(%rax)
movups -0x3d0(%rbp), %xmm0
movups -0x3c0(%rbp), %xmm1
movups -0x3b0(%rbp), %xmm2
movups -0x3a0(%rbp), %xmm3
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq -0x490(%rbp), %rdi
callq 0x2870
cmpl $0x0, -0x484(%rbp)
jne 0x1a05
movl -0x1fc(%rbp), %esi
leaq 0x1777(%rip), %rdi      # 0x3175
movb $0x0, %al
callq 0x10a0
leaq -0x3d0(%rbp), %rdi
callq 0x28c0
leaq -0x490(%rbp), %rdi
callq 0x28f0
movl -0x1fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1fc(%rbp)
callq 0x2920
movq %rax, -0x498(%rbp)
movq -0x498(%rbp), %rdi
leaq -0x1fc(%rbp), %rsi
movq 0x3593(%rip), %rdx      # 0x4fe0
addq $0xc8, %rdx
callq 0x10f0
movq -0x18(%rbp), %rax
movq %rax, -0xa90(%rbp)
leaq -0x4b0(%rbp), %rdi
movl $0x1, %esi
leaq 0x16b4(%rip), %rdx      # 0x312b
callq 0x29a0
movq -0xa90(%rbp), %rdi
movq -0x498(%rbp), %rsi
leaq -0x4b0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x2940
movq -0x498(%rbp), %rdi
callq 0x2a00
leaq 0x16c9(%rip), %rdi      # 0x318b
callq 0x2a30
movq %rax, -0x4f0(%rbp)
movq %rdx, -0x4e8(%rbp)
leaq -0x4e0(%rbp), %rdi
callq 0x2a60
leaq -0x4e0(%rbp), %rdi
leaq -0x4f0(%rbp), %rsi
movq 0x34ea(%rip), %rdx      # 0x4fe0
addq $0x1b8, %rdx            # imm = 0x1B8
callq 0x10f0
movq -0x18(%rbp), %rax
movq %rax, -0xa88(%rbp)
leaq -0x518(%rbp), %rdi
xorl %esi, %esi
movl $0x55, %edx
callq 0x2500
leaq -0x530(%rbp), %rdi
movl $0x1, %esi
movl $0xf44d, %edx           # imm = 0xF44D
callq 0x2500
movq -0xa88(%rbp), %rdi
leaq -0x518(%rbp), %r9
leaq -0x530(%rbp), %rax
movl $0x1, %esi
leaq -0x4e0(%rbp), %rdx
leaq -0x4f8(%rbp), %rcx
leaq -0x500(%rbp), %r8
movq (%r9), %r10
movq %r10, (%rsp)
movq 0x8(%r9), %r10
movq %r10, 0x8(%rsp)
movq 0x10(%r9), %r9
movq %r9, 0x10(%rsp)
movq (%rax), %r9
movq %r9, 0x18(%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0x1170
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x1bde
movq -0x4f8(%rbp), %rsi
leaq 0x15e4(%rip), %rdi      # 0x3198
movb $0x0, %al
callq 0x10a0
movq -0x500(%rbp), %rdi
movq -0x4f8(%rbp), %rsi
movq 0x3410(%rip), %rdx      # 0x4fe0
addq $0x398, %rdx            # imm = 0x398
callq 0x1030
jmp 0x1bef
movl -0x2c(%rbp), %esi
leaq 0x15f1(%rip), %rdi      # 0x31d9
movb $0x0, %al
callq 0x10a0
leaq -0x4e0(%rbp), %rdi
callq 0x2a90
leaq -0x5c0(%rbp), %rdi
callq 0x2ac0
leaq -0x5e0(%rbp), %rdi
leaq 0x1606(%rip), %rsi      # 0x321b
leaq 0x1605(%rip), %rdx      # 0x3221
callq 0x2af0
movq -0x5e0(%rbp), %rax
movq %rax, -0x5b8(%rbp)
movq -0x5d8(%rbp), %rax
movq %rax, -0x5b0(%rbp)
movq -0x5d0(%rbp), %rax
movq %rax, -0x5a8(%rbp)
movq -0x5c8(%rbp), %rax
movq %rax, -0x5a0(%rbp)
leaq -0x600(%rbp), %rdi
leaq 0x15b4(%rip), %rsi      # 0x321b
leaq 0x15c0(%rip), %rdx      # 0x322e
callq 0x2af0
movq -0x600(%rbp), %rax
movq %rax, -0x598(%rbp)
movq -0x5f8(%rbp), %rax
movq %rax, -0x590(%rbp)
movq -0x5f0(%rbp), %rax
movq %rax, -0x588(%rbp)
movq -0x5e8(%rbp), %rax
movq %rax, -0x580(%rbp)
leaq -0x620(%rbp), %rdi
leaq 0x1562(%rip), %rsi      # 0x321b
leaq 0x15a1(%rip), %rdx      # 0x3261
callq 0x2af0
movq -0x620(%rbp), %rax
movq %rax, -0x568(%rbp)
movq -0x618(%rbp), %rax
movq %rax, -0x560(%rbp)
movq -0x610(%rbp), %rax
movq %rax, -0x558(%rbp)
movq -0x608(%rbp), %rax
movq %rax, -0x550(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xaa0(%rbp)
leaq -0x638(%rbp), %rdi
movl $0x1, %esi
movl $0x2f65, %edx           # imm = 0x2F65
callq 0x2500
leaq -0x650(%rbp), %rdi
xorl %esi, %esi
movl $0x23, %edx
callq 0x2500
leaq -0x668(%rbp), %rdi
xorl %esi, %esi
movl $0x2d, %edx
callq 0x2500
leaq -0x680(%rbp), %rdi
movl $0x1, %esi
leaq 0x14ca(%rip), %rdx      # 0x3221
callq 0x2c40
movq -0xaa0(%rbp), %rdi
movq -0x550(%rbp), %rcx
movq %rsp, %rax
movq %rax, -0xa98(%rbp)
movq %rcx, 0xd0(%rax)
movups -0x560(%rbp), %xmm0
movups %xmm0, 0xc0(%rax)
movups -0x570(%rbp), %xmm0
movups %xmm0, 0xb0(%rax)
movups -0x580(%rbp), %xmm0
movups %xmm0, 0xa0(%rax)
movups -0x5c0(%rbp), %xmm0
movups -0x5b0(%rbp), %xmm1
movups -0x5a0(%rbp), %xmm2
movups -0x590(%rbp), %xmm3
movups %xmm3, 0x90(%rax)
movups %xmm2, 0x80(%rax)
movups %xmm1, 0x70(%rax)
movups %xmm0, 0x60(%rax)
movq -0x670(%rbp), %rcx
movq %rcx, 0x58(%rax)
movups -0x680(%rbp), %xmm0
movups %xmm0, 0x48(%rax)
movq -0x658(%rbp), %rcx
movq %rcx, 0x40(%rax)
movups -0x668(%rbp), %xmm0
movups %xmm0, 0x30(%rax)
movq -0x640(%rbp), %rcx
movq %rcx, 0x28(%rax)
movups -0x650(%rbp), %xmm0
movups %xmm0, 0x18(%rax)
movq -0x628(%rbp), %rcx
movq %rcx, 0x10(%rax)
movups -0x638(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x548(%rbp), %rsi
callq 0x2b60
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x1e57
movl -0x540(%rbp), %esi
leaq 0x1425(%rip), %rdi      # 0x3275
movb $0x0, %al
callq 0x10a0
leaq -0x6f0(%rbp), %rdi
callq 0x2ca0
leaq -0x710(%rbp), %rdi
leaq 0x13aa(%rip), %rsi      # 0x321b
leaq 0x142c(%rip), %rdx      # 0x32a4
callq 0x2af0
movq -0x710(%rbp), %rax
movq %rax, -0x6e8(%rbp)
movq -0x708(%rbp), %rax
movq %rax, -0x6e0(%rbp)
movq -0x700(%rbp), %rax
movq %rax, -0x6d8(%rbp)
movq -0x6f8(%rbp), %rax
movq %rax, -0x6d0(%rbp)
leaq -0x730(%rbp), %rdi
leaq 0x1358(%rip), %rsi      # 0x321b
leaq 0x13eb(%rip), %rdx      # 0x32b5
callq 0x2af0
movq -0x730(%rbp), %rax
movq %rax, -0x6c8(%rbp)
movq -0x728(%rbp), %rax
movq %rax, -0x6c0(%rbp)
movq -0x720(%rbp), %rax
movq %rax, -0x6b8(%rbp)
movq -0x718(%rbp), %rax
movq %rax, -0x6b0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xab0(%rbp)
leaq -0x748(%rbp), %rdi
movl $0x1, %esi
movl $0x2f66, %edx           # imm = 0x2F66
callq 0x2500
leaq -0x760(%rbp), %rdi
xorl %esi, %esi
movl $0x3a, %edx
callq 0x2500
leaq -0x778(%rbp), %rdi
xorl %esi, %esi
movl $0x23, %edx
callq 0x2500
leaq -0x790(%rbp), %rdi
movl $0x1, %esi
leaq 0x1346(%rip), %rdx      # 0x32a7
callq 0x2c40
movq -0xab0(%rbp), %rdi
movq -0x6a0(%rbp), %rcx
movq %rsp, %rax
movq %rax, -0xaa8(%rbp)
movq %rcx, 0xb0(%rax)
movups -0x6b0(%rbp), %xmm0
movups %xmm0, 0xa0(%rax)
movups -0x6f0(%rbp), %xmm0
movups -0x6e0(%rbp), %xmm1
movups -0x6d0(%rbp), %xmm2
movups -0x6c0(%rbp), %xmm3
movups %xmm3, 0x90(%rax)
movups %xmm2, 0x80(%rax)
movups %xmm1, 0x70(%rax)
movups %xmm0, 0x60(%rax)
movq -0x780(%rbp), %rcx
movq %rcx, 0x58(%rax)
movups -0x790(%rbp), %xmm0
movups %xmm0, 0x48(%rax)
movq -0x768(%rbp), %rcx
movq %rcx, 0x40(%rax)
movups -0x778(%rbp), %xmm0
movups %xmm0, 0x30(%rax)
movq -0x750(%rbp), %rcx
movq %rcx, 0x28(%rax)
movups -0x760(%rbp), %xmm0
movups %xmm0, 0x18(%rax)
movq -0x738(%rbp), %rcx
movq %rcx, 0x10(%rax)
movups -0x748(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x698(%rbp), %rsi
callq 0x2cd0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x2045
movl -0x690(%rbp), %esi
leaq 0x1297(%rip), %rdi      # 0x32d5
movb $0x0, %al
callq 0x10a0
leaq -0x800(%rbp), %rdi
callq 0x2db0
leaq -0x820(%rbp), %rdi
leaq 0x11bc(%rip), %rsi      # 0x321b
leaq 0x129f(%rip), %rdx      # 0x3305
callq 0x2af0
movq -0x820(%rbp), %rax
movq %rax, -0x7f8(%rbp)
movq -0x818(%rbp), %rax
movq %rax, -0x7f0(%rbp)
movq -0x810(%rbp), %rax
movq %rax, -0x7e8(%rbp)
movq -0x808(%rbp), %rax
movq %rax, -0x7e0(%rbp)
leaq -0x840(%rbp), %rdi
leaq 0x1264(%rip), %rsi      # 0x3315
leaq 0x1263(%rip), %rdx      # 0x331b
callq 0x2af0
movq -0x840(%rbp), %rax
movq %rax, -0x7d8(%rbp)
movq -0x838(%rbp), %rax
movq %rax, -0x7d0(%rbp)
movq -0x830(%rbp), %rax
movq %rax, -0x7c8(%rbp)
movq -0x828(%rbp), %rax
movq %rax, -0x7c0(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xac0(%rbp)
leaq -0x858(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2500
leaq -0x870(%rbp), %rdi
xorl %esi, %esi
movl $0x55, %edx
callq 0x2500
leaq -0x888(%rbp), %rdi
xorl %esi, %esi
movl $0x23, %edx
callq 0x2500
leaq -0x8a0(%rbp), %rdi
movl $0x1, %esi
leaq 0x11f0(%rip), %rdx      # 0x333c
callq 0x2c40
leaq -0x8b8(%rbp), %rdi
movl $0x1, %esi
movl $0x2f66, %edx           # imm = 0x2F66
callq 0x2500
movq -0xac0(%rbp), %rdi
movq -0x7b0(%rbp), %rcx
movq %rsp, %rax
movq %rax, -0xab8(%rbp)
movq %rcx, 0xc8(%rax)
movups -0x7c0(%rbp), %xmm0
movups %xmm0, 0xb8(%rax)
movups -0x800(%rbp), %xmm0
movups -0x7f0(%rbp), %xmm1
movups -0x7e0(%rbp), %xmm2
movups -0x7d0(%rbp), %xmm3
movups %xmm3, 0xa8(%rax)
movups %xmm2, 0x98(%rax)
movups %xmm1, 0x88(%rax)
movups %xmm0, 0x78(%rax)
movq -0x8a8(%rbp), %rcx
movq %rcx, 0x70(%rax)
movups -0x8b8(%rbp), %xmm0
movups %xmm0, 0x60(%rax)
movq -0x890(%rbp), %rcx
movq %rcx, 0x58(%rax)
movups -0x8a0(%rbp), %xmm0
movups %xmm0, 0x48(%rax)
movq -0x878(%rbp), %rcx
movq %rcx, 0x40(%rax)
movups -0x888(%rbp), %xmm0
movups %xmm0, 0x30(%rax)
movq -0x860(%rbp), %rcx
movq %rcx, 0x28(%rax)
movups -0x870(%rbp), %xmm0
movups %xmm0, 0x18(%rax)
movq -0x848(%rbp), %rcx
movq %rcx, 0x10(%rax)
movups -0x858(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x7a8(%rbp), %rsi
callq 0x2de0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x225f
movl -0x7a0(%rbp), %esi
leaq 0x10f1(%rip), %rdi      # 0x3349
movb $0x0, %al
callq 0x10a0
leaq -0x998(%rbp), %rdi
callq 0x2ec0
leaq -0x9b8(%rbp), %rdi
leaq 0xfa2(%rip), %rsi       # 0x321b
leaq 0x10f5(%rip), %rdx      # 0x3375
callq 0x2af0
movq -0x9b8(%rbp), %rax
movq %rax, -0x990(%rbp)
movq -0x9b0(%rbp), %rax
movq %rax, -0x988(%rbp)
movq -0x9a8(%rbp), %rax
movq %rax, -0x980(%rbp)
movq -0x9a0(%rbp), %rax
movq %rax, -0x978(%rbp)
leaq -0x9d8(%rbp), %rdi
leaq 0xf50(%rip), %rsi       # 0x321b
leaq 0x10b6(%rip), %rdx      # 0x3388
callq 0x2af0
movq -0x9d8(%rbp), %rax
movq %rax, -0x970(%rbp)
movq -0x9d0(%rbp), %rax
movq %rax, -0x968(%rbp)
movq -0x9c8(%rbp), %rax
movq %rax, -0x960(%rbp)
movq -0x9c0(%rbp), %rax
movq %rax, -0x958(%rbp)
movl $0x4d2, -0x9dc(%rbp)    # imm = 0x4D2
leaq -0x998(%rbp), %rdi
addq $0x50, %rdi
leaq -0x9dc(%rbp), %rsi
movq 0x2cae(%rip), %rdx      # 0x4fe0
addq $0xc8, %rdx
callq 0x10c0
movq 0x2c9b(%rip), %rax      # 0x4fe0
movq 0xc8(%rax), %rcx
movq %rcx, -0x918(%rbp)
movq 0xd0(%rax), %rcx
movq %rcx, -0x910(%rbp)
movq 0xd8(%rax), %rax
movq %rax, -0x908(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xac8(%rbp)
leaq -0x9f8(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2500
leaq -0xa10(%rbp), %rdi
xorl %esi, %esi
movl $0x55, %edx
callq 0x2500
leaq -0xa28(%rbp), %rdi
xorl %esi, %esi
movl $0x23, %edx
callq 0x2500
leaq -0xa40(%rbp), %rdi
xorl %esi, %esi
leaq 0xfb8(%rip), %rdx       # 0x337b
callq 0x2c40
movq %rsp, %rax
movq %rax, -0xad0(%rbp)
movq %rax, %rdi
addq $0x78, %rdi
movl $0x19, %ecx
leaq -0x998(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0xac8(%rbp), %rdi
movq 0x2bda(%rip), %rcx      # 0x4fd0
movq 0x10(%rcx), %rdx
movq %rdx, 0x70(%rax)
movups (%rcx), %xmm0
movups %xmm0, 0x60(%rax)
movq -0xa30(%rbp), %rcx
movq %rcx, 0x58(%rax)
movups -0xa40(%rbp), %xmm0
movups %xmm0, 0x48(%rax)
movq -0xa18(%rbp), %rcx
movq %rcx, 0x40(%rax)
movups -0xa28(%rbp), %xmm0
movups %xmm0, 0x30(%rax)
movq -0xa00(%rbp), %rcx
movq %rcx, 0x28(%rax)
movups -0xa10(%rbp), %xmm0
movups %xmm0, 0x18(%rax)
movq -0x9e8(%rbp), %rcx
movq %rcx, 0x10(%rax)
movups -0x9f8(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x8d0(%rbp), %rsi
callq 0x2ef0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jne 0x2485
movl -0x8c8(%rbp), %esi
leaq 0xf47(%rip), %rdi       # 0x33c5
movb $0x0, %al
callq 0x10a0
movq -0x18(%rbp), %rdi
callq 0x10d0
movq -0x18(%rbp), %rdi
callq 0x1110
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc10, %rsp            # imm = 0xC10
popq %rbp
retq
nopw (%rax,%rax)