// File: /workspace/github_c_makefile_star2_O0/soso7885[P]OPCUA_example/demo_src/server_variable.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_VariableAttributes attr;
    UA_VariableAttributes_init(&attr);
    UA_Int32 myInteger = 42;
    UA_Variant_setScalar(&attr.value, &myInteger, &UA_TYPES[UA_TYPES_INT32]);
    attr.description = UA_LOCALIZEDTEXT("en_US","the answer");
    attr.displayName = UA_LOCALIZEDTEXT("en_US","the answer");
    UA_NodeId myIntegerNodeId = UA_NODEID_STRING(1, "the.answer");
    UA_QualifiedName myIntegerName = UA_QUALIFIEDNAME(1, "the answer");
    UA_NodeId parentNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER);
    UA_NodeId parentReferenceNodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES);
    UA_Server_addVariableNode(server, myIntegerNodeId, parentNodeId,
                              parentReferenceNodeId, myIntegerName,
                              UA_NODEID_NULL, attr, NULL, NULL);

    UA_ValueCallback callback = {(void*)7, onRead, onWrite};
    UA_Server_setVariableNode_valueCallback(server, myIntegerNodeId, callback);

    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 0x33b(%rip), %rsi       # 0x1540
callq 0x1090
leaq -0x170(%rbp), %rdi
movq 0x2dc8(%rip), %rsi      # 0x3fe0
movl $0x160, %edx            # imm = 0x160
callq 0x1080
movq 0x2dc7(%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 0x1040
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)
leaq -0x290(%rbp), %rdi
callq 0x1580
movl $0x2a, -0x294(%rbp)
leaq -0x290(%rbp), %rdi
addq $0x50, %rdi
leaq -0x294(%rbp), %rsi
movq 0x2d02(%rip), %rdx      # 0x3fd8
addq $0xc8, %rdx
callq 0x1070
leaq -0x2b8(%rbp), %rdi
leaq 0xd14(%rip), %rsi       # 0x2004
leaq 0xd13(%rip), %rdx       # 0x200a
callq 0x15b0
movq -0x2b8(%rbp), %rax
movq %rax, -0x268(%rbp)
movq -0x2b0(%rbp), %rax
movq %rax, -0x260(%rbp)
movq -0x2a8(%rbp), %rax
movq %rax, -0x258(%rbp)
movq -0x2a0(%rbp), %rax
movq %rax, -0x250(%rbp)
leaq -0x2d8(%rbp), %rdi
leaq 0xcc2(%rip), %rsi       # 0x2004
leaq 0xcc1(%rip), %rdx       # 0x200a
callq 0x15b0
movq -0x2d8(%rbp), %rax
movq %rax, -0x288(%rbp)
movq -0x2d0(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x2c8(%rbp), %rax
movq %rax, -0x278(%rbp)
movq -0x2c0(%rbp), %rax
movq %rax, -0x270(%rbp)
leaq -0x2f0(%rbp), %rdi
movl $0x1, %esi
leaq 0xc7c(%rip), %rdx       # 0x2015
callq 0x1620
leaq -0x308(%rbp), %rdi
movl $0x1, %esi
leaq 0xc59(%rip), %rdx       # 0x200a
callq 0x1680
leaq -0x320(%rbp), %rdi
xorl %esi, %esi
movl $0x55, %edx
callq 0x16e0
leaq -0x338(%rbp), %rdi
xorl %esi, %esi
movl $0x23, %edx
callq 0x16e0
movq -0x1c8(%rbp), %rax
movq %rax, -0x360(%rbp)
xorl %eax, %eax
movq %rsp, %rax
movq %rax, %rdi
addq $0x78, %rdi
movl $0x19, %ecx
leaq -0x290(%rbp), %rsi
rep  movsq (%rsi), %es:(%rdi)
movq -0x360(%rbp), %rdi
movq 0x2bb5(%rip), %rcx      # 0x3fc8
movq 0x10(%rcx), %rdx
movq %rdx, 0x70(%rax)
movups (%rcx), %xmm0
movups %xmm0, 0x60(%rax)
movq -0x2f8(%rbp), %rcx
movq %rcx, 0x58(%rax)
movups -0x308(%rbp), %xmm0
movups %xmm0, 0x48(%rax)
movq -0x328(%rbp), %rcx
movq %rcx, 0x40(%rax)
movups -0x338(%rbp), %xmm0
movups %xmm0, 0x30(%rax)
movq -0x310(%rbp), %rcx
movq %rcx, 0x28(%rax)
movups -0x320(%rbp), %xmm0
movups %xmm0, 0x18(%rax)
movq -0x2e0(%rbp), %rcx
movq %rcx, 0x10(%rax)
movups -0x2f0(%rbp), %xmm0
movups %xmm0, (%rax)
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x1710
movq 0x2924(%rip), %rax      # 0x3db0
movq %rax, -0x350(%rbp)
movq 0x291e(%rip), %rax      # 0x3db8
movq %rax, -0x348(%rbp)
movq 0x2918(%rip), %rax      # 0x3dc0
movq %rax, -0x340(%rbp)
movq -0x1c8(%rbp), %rdi
leaq -0x2f0(%rbp), %rcx
leaq -0x350(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, (%rsp)
movq 0x8(%rcx), %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rcx), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rcx
movq %rcx, 0x18(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x20(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x28(%rsp)
callq 0x10c0
movq -0x1c8(%rbp), %rdi
leaq 0x2b76(%rip), %rsi      # 0x4080
callq 0x10a0
movl %eax, -0x354(%rbp)
movq -0x1c8(%rbp), %rdi
callq 0x10d0
leaq -0x1a8(%rbp), %rdi
callq *-0x178(%rbp)
movl -0x354(%rbp), %eax
addq $0x4c0, %rsp            # imm = 0x4C0
popq %rbp
retq
nopl (%rax)