// File: /workspace/github_c_makefile_star2_O1/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 0x228(%rip), %rsi       # 0x13ff
movl $0x2, %edi
callq 0x1090
movq 0x2df8(%rip), %rsi      # 0x3fe0
leaq -0x310(%rbp), %r14
movl $0x160, %edx            # imm = 0x160
movq %r14, %rdi
callq 0x1080
movq 0x2ded(%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)
movl $0x2c, %ecx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x1030
movq %rax, %r14
leaq -0x44(%rbp), %rax
movl $0x2a, (%rax)
movw $0x1, %cx
movw %cx, -0x40(%rbp)
movl $0x3, -0x3c(%rbp)
movl $0xa, %r12d
movq %r12, -0x38(%rbp)
leaq 0xd76(%rip), %rdx       # 0x2004
movq %rdx, -0x30(%rbp)
movw %cx, -0x78(%rbp)
movq %r12, -0x70(%rbp)
leaq 0xd6e(%rip), %r13       # 0x200f
movq %r13, -0x68(%rbp)
movq %rax, -0x60(%rbp)
leaq 0x17d(%rip), %rax       # 0x142d
movq %rax, -0x58(%rbp)
leaq 0x1f1(%rip), %rax       # 0x14ac
movq %rax, -0x50(%rbp)
xorl %ebx, %ebx
movl $0xc8, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x1060
movl $0x5, %eax
movq %rax, 0x28(%r15)
leaq 0xd3a(%rip), %rcx       # 0x201a
movq %rcx, 0x30(%r15)
movq %r12, 0x38(%r15)
movq %r13, 0x40(%r15)
movq %rax, 0x8(%r15)
movq %rcx, 0x10(%r15)
movq %r12, 0x18(%r15)
movq %r13, 0x20(%r15)
movw %bx, -0xa8(%rbp)
movabsq $0x5500000000, %rax     # imm = 0x5500000000
movq %rax, -0xa4(%rbp)
movw %bx, -0x90(%rbp)
movabsq $0x2300000000, %rax     # imm = 0x2300000000
movq %rax, -0x8c(%rbp)
leaq 0x78(%rsp), %rdi
movl $0x19, %ecx
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 0x2c6d(%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 0x2ca3(%rip), %rsi      # 0x4070
movq %r14, %rdi
callq 0x10a0
movl %eax, %r15d
movq %r14, %rdi
callq 0x10b0
leaq -0xe0(%rbp), %rdi
callq *0x30(%rdi)
movl %r15d, %eax
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq