// File: /workspace/github_c_makefile_star2_O2/soso7885[P]OPCUA_example/demo_src/server_datasource.c
// Function: main
int main(int argc, char** argv) {
    signal(SIGINT, stopHandler); /* catches ctrl-c */

    UA_ServerConfig config = UA_ServerConfig_standard;
    UA_ServerNetworkLayer nl = UA_ServerNetworkLayerTCP(UA_ConnectionConfig_standard, 16664);
    config.networkLayers = &nl;
    config.networkLayersSize = 1;
    UA_Server *server = UA_Server_new(config);

    /* add a variable node to the address space */
    UA_Int32 myInteger = 42;
    UA_NodeId myIntegerNodeId = UA_NODEID_STRING(1, "the.answer");
    UA_QualifiedName myIntegerName = UA_QUALIFIEDNAME(1, "the answer");
    UA_DataSource dateDataSource = (UA_DataSource) {
        .handle = &myInteger, .read = readInteger, .write = writeInteger};
    UA_VariableAttributes attr;
    UA_VariableAttributes_init(&attr);
    attr.description = UA_LOCALIZEDTEXT("en_US","the answer");
    attr.displayName = UA_LOCALIZEDTEXT("en_US","the answer");

    UA_Server_addDataSourceVariableNode(server, myIntegerNodeId,
                                        UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER),
                                        UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
                                        myIntegerName, UA_NODEID_NULL, attr, dateDataSource, NULL);

    UA_StatusCode retval = UA_Server_run(server, &running);
    UA_Server_delete(server);
    nl.deleteMembers(&nl);

    return (int)retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
leaq 0x213(%rip), %rsi       # 0x13fa
pushq $0x2
popq %rdi
callq 0x10a0
movq 0x2dea(%rip), %rsi      # 0x3fe0
leaq -0x310(%rbp), %r14
movl $0x160, %edx            # imm = 0x160
movq %r14, %rdi
callq 0x1090
movq 0x2ddf(%rip), %rax      # 0x3ff0
movl 0x10(%rax), %ecx
leaq -0x1b0(%rbp), %r15
movl %ecx, 0x10(%r15)
movups (%rax), %xmm0
movaps %xmm0, (%r15)
movl 0x10(%r15), %eax
movl %eax, 0x10(%rsp)
movaps (%r15), %xmm0
movups %xmm0, (%rsp)
leaq -0xe0(%rbp), %rbx
movq %rbx, %rdi
movl $0x4118, %esi           # imm = 0x4118
callq 0x1050
movq %rbx, 0xf8(%r14)
movq $0x1, 0xf0(%r14)
pushq $0x2c
popq %rcx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x1030
movq %rax, %r14
leaq -0x44(%rbp), %r12
movl $0x2a, (%r12)
movw $0x1, %r13w
movw %r13w, -0x40(%rbp)
movl $0x3, -0x3c(%rbp)
leaq 0xd70(%rip), %rdi       # 0x2004
callq 0x1557
movq %rax, -0x38(%rbp)
movq %rdx, -0x30(%rbp)
movw %r13w, -0x78(%rbp)
leaq 0xd62(%rip), %rdi       # 0x200f
callq 0x1557
movq %rax, -0x70(%rbp)
movq %rdx, -0x68(%rbp)
movq %r12, -0x60(%rbp)
leaq 0x15f(%rip), %rax       # 0x1424
movq %rax, -0x58(%rbp)
leaq 0x1cb(%rip), %rax       # 0x149b
movq %rax, -0x50(%rbp)
movl $0xc8, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x1070
leaq -0x188(%rbp), %rdi
callq 0x151d
leaq -0x1a8(%rbp), %rdi
callq 0x151d
andw $0x0, -0xa8(%rbp)
andw $0x0, -0x90(%rbp)
movabsq $0x5500000000, %rax     # imm = 0x5500000000
movq %rax, -0xa4(%rbp)
movabsq $0x2300000000, %rax     # imm = 0x2300000000
movq %rax, -0x8c(%rbp)
leaq 0x78(%rsp), %rdi
pushq $0x19
popq %rcx
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x50(%rbp), %rax
movq %rax, 0x150(%rsp)
movups -0x60(%rbp), %xmm0
movups %xmm0, 0x140(%rsp)
movq 0x2c6e(%rip), %rax      # 0x3fc8
movq 0x10(%rax), %rcx
movq %rcx, 0x70(%rsp)
movups (%rax), %xmm0
movups %xmm0, 0x60(%rsp)
movq -0x68(%rbp), %rax
movq %rax, 0x58(%rsp)
movups -0x78(%rbp), %xmm0
movups %xmm0, 0x48(%rsp)
movq -0x80(%rbp), %rax
movq %rax, 0x40(%rsp)
movups -0x90(%rbp), %xmm0
movups %xmm0, 0x30(%rsp)
movq -0x98(%rbp), %rax
movq %rax, 0x28(%rsp)
movups -0xa8(%rbp), %xmm0
movups %xmm0, 0x18(%rsp)
movq -0x30(%rbp), %rax
movq %rax, 0x10(%rsp)
movups -0x40(%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x1040
leaq 0x2cac(%rip), %rsi      # 0x4078
movq %r14, %rdi
callq 0x10b0
movl %eax, %r15d
movq %r14, %rdi
callq 0x10c0
movq %rbx, %rdi
callq *0x30(%rbx)
movl %r15d, %eax
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq