// File: /workspace/github_c_makefile_star2_O0/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
subq $0x4c0, %rsp            # imm = 0x4C0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x2, %edi
leaq 0x2eb(%rip), %rsi       # 0x14e0
callq 0x10a0
leaq -0x170(%rbp), %rdi
movq 0x2dd8(%rip), %rsi      # 0x3fe0
movl $0x160, %edx            # imm = 0x160
callq 0x1090
movq 0x2dd7(%rip), %rax      # 0x3ff0
movq (%rax), %rcx
movq %rcx, -0x1c0(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x1b8(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x1b0(%rbp)
leaq -0x1a8(%rbp), %rdi
leaq -0x1c0(%rbp), %rax
movl $0x4118, %esi           # imm = 0x4118
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl 0x10(%rax), %eax
movl %eax, 0x10(%rsp)
callq 0x1050
leaq -0x1a8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq $0x1, -0x80(%rbp)
movq %rsp, %rdi
movl $0x2c, %ecx
leaq -0x170(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x1030
movq %rax, -0x1c8(%rbp)
movl $0x2a, -0x1cc(%rbp)
leaq -0x1e8(%rbp), %rdi
movl $0x1, %esi
leaq 0xd50(%rip), %rdx       # 0x2004
callq 0x1520
leaq -0x200(%rbp), %rdi
movl $0x1, %esi
leaq 0xd43(%rip), %rdx       # 0x200f
callq 0x1580
leaq -0x1cc(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq 0x2fa(%rip), %rax       # 0x15e0
movq %rax, -0x210(%rbp)
leaq 0x3ac(%rip), %rax       # 0x16a0
movq %rax, -0x208(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0x1770
leaq -0x300(%rbp), %rdi
leaq 0xd05(%rip), %rsi       # 0x201a
leaq 0xcf3(%rip), %rdx       # 0x200f
callq 0x17a0
movq -0x300(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movq -0x2f8(%rbp), %rax
movq %rax, -0x2b0(%rbp)
movq -0x2f0(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq -0x2e8(%rbp), %rax
movq %rax, -0x2a0(%rbp)
leaq -0x320(%rbp), %rdi
leaq 0xcb3(%rip), %rsi       # 0x201a
leaq 0xca1(%rip), %rdx       # 0x200f
callq 0x17a0
movq -0x320(%rbp), %rax
movq %rax, -0x2d8(%rbp)
movq -0x318(%rbp), %rax
movq %rax, -0x2d0(%rbp)
movq -0x310(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movq -0x308(%rbp), %rax
movq %rax, -0x2c0(%rbp)
movq -0x1c8(%rbp), %rax
movq %rax, -0x360(%rbp)
leaq -0x338(%rbp), %rdi
xorl %esi, %esi
movl $0x55, %edx
callq 0x1810
leaq -0x350(%rbp), %rdi
xorl %esi, %esi
movl $0x23, %edx
callq 0x1810
xorl %eax, %eax
movq %rsp, %rax
movq %rax, %rdi
addq $0x78, %rdi
movl $0x19, %ecx
leaq -0x2e0(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x360(%rbp), %rdi
movq -0x208(%rbp), %rcx
movq %rcx, 0x150(%rax)
movups -0x218(%rbp), %xmm0
movups %xmm0, 0x140(%rax)
movq 0x2ba4(%rip), %rcx      # 0x3fc8
movq 0x10(%rcx), %rdx
movq %rdx, 0x70(%rax)
movups (%rcx), %xmm0
movups %xmm0, 0x60(%rax)
movq -0x1f0(%rbp), %rcx
movq %rcx, 0x58(%rax)
movups -0x200(%rbp), %xmm0
movups %xmm0, 0x48(%rax)
movq -0x340(%rbp), %rcx
movq %rcx, 0x40(%rax)
movups -0x350(%rbp), %xmm0
movups %xmm0, 0x30(%rax)
movq -0x328(%rbp), %rcx
movq %rcx, 0x28(%rax)
movups -0x338(%rbp), %xmm0
movups %xmm0, 0x18(%rax)
movq -0x1d8(%rbp), %rcx
movq %rcx, 0x10(%rax)
movups -0x1e8(%rbp), %xmm0
movups %xmm0, (%rax)
xorl %eax, %eax
movl %eax, %esi
callq 0x1040
movq -0x1c8(%rbp), %rdi
leaq 0x2bd7(%rip), %rsi      # 0x4078
callq 0x10b0
movl %eax, -0x354(%rbp)
movq -0x1c8(%rbp), %rdi
callq 0x10c0
leaq -0x1a8(%rbp), %rdi
callq *-0x178(%rbp)
movl -0x354(%rbp), %eax
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
nopw %cs:(%rax,%rax)