// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/rrdtest.c
// Function: main
int
main(int argc, char **argv)
{
    RRD_PLUGIN     *plugin;
    int             rc;

    if (argc != 1) {
        fprintf(stderr, "usage: %s\n", basename(argv[0]));
        exit(1);
    }

    plugin = rrd_open("rrdtest", RRD_LOCAL_DOMAIN, "rrdtest.rrd");
    assert(plugin);

    src[0].name = "first";
    src[0].description = "description";
    src[0].owner = RRD_HOST;
    src[0].owner_uuid = "4cc1f2e0-5405-11e6-8c2f-572fc76ac144";
    src[0].rrd_units = "points";
    src[0].scale = RRD_GAUGE;
    src[0].type = RRD_INT64;
    src[0].min = "-inf";
    src[0].max = "inf";
    src[0].rrd_default = 1;
    src[0].sample = sample;
    src[0].userdata = &src[0];

    printf("adding source: %s\n", src[0].name);
    rrd_add_src(plugin, &src[0]);
    rc = rrd_sample(plugin, NULL);
    assert(rc == RRD_OK);

    src[1].name = "second";
    src[1].description = "description";
    src[1].owner = RRD_HOST;
    src[1].owner_uuid = "e8969702-5414-11e6-8cf5-47824be728c3";
    src[1].rrd_units = "points";
    src[1].scale = RRD_ABSOLUTE;
    src[1].type = RRD_INT64;
    src[1].min = "-inf";
    src[1].max = "inf";
    src[1].rrd_default = 1;
    src[1].sample = sample;
    src[1].userdata = &src[1];

    printf("adding source: %s\n", src[1].name);
    rrd_add_src(plugin, &src[1]);
    rc = rrd_sample(plugin, NULL);
    assert(rc == RRD_OK);

    printf("removing source: %s\n", src[0].name);
    rrd_del_src(plugin, &src[0]);
    rc = rrd_sample(plugin, NULL);
    assert(rc == RRD_OK);

    printf("removing source: %s\n", src[1].name);
    rrd_del_src(plugin, &src[1]);
    rrd_close(plugin);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x1, %edi
jne 0x15b0
leaq 0x4c54(%rip), %rdi      # 0x603b
leaq 0x4c55(%rip), %rdx      # 0x6043
xorl %esi, %esi
callq 0x16bd
testq %rax, %rax
je 0x15b8
movq %rax, %rbx
leaq 0x4c6f(%rip), %rsi      # 0x6077
movq %rsi, 0x7d71(%rip)      # 0x9180
leaq 0x7d6a(%rip), %r14      # 0x9180
leaq 0x4c60(%rip), %rax      # 0x607d
movq %rax, 0x7d64(%rip)      # 0x9188
leaq 0x4c5e(%rip), %rax      # 0x6089
movq %rax, 0x7d5e(%rip)      # 0x9190
leaq 0x4c75(%rip), %r12      # 0x60ae
movq %r12, 0x7d58(%rip)      # 0x9198
leaq 0x4c6e(%rip), %r13      # 0x60b5
movq %r13, 0x7d52(%rip)      # 0x91a0
leaq 0x4c61(%rip), %rbp      # 0x60b6
movq %rbp, 0x7d4c(%rip)      # 0x91a8
movaps 0x4bad(%rip), %xmm0     # 0x6010
movaps %xmm0, 0x7d56(%rip)     # 0x91c0
leaq 0x1c3(%rip), %r15       # 0x1634
movq %r15, 0x7d38(%rip)      # 0x91b0
movq %r14, 0x7d39(%rip)      # 0x91b8
leaq 0x4c34(%rip), %rdi      # 0x60ba
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d0b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1e4a
testl %eax, %eax
jne 0x15d7
leaq 0x4c29(%rip), %rsi      # 0x60da
movq %rsi, 0x7d18(%rip)      # 0x91d0
leaq 0x7d11(%rip), %r14      # 0x91d0
leaq 0x4bb7(%rip), %rax      # 0x607d
movq %rax, 0x7d0b(%rip)      # 0x91d8
leaq 0x4c0d(%rip), %rax      # 0x60e1
movq %rax, 0x7d05(%rip)      # 0x91e0
movq %r12, 0x7d06(%rip)      # 0x91e8
movq %r13, 0x7d07(%rip)      # 0x91f0
movq %rbp, 0x7d08(%rip)      # 0x91f8
movaps 0x4b29(%rip), %xmm0     # 0x6020
movaps %xmm0, 0x7d12(%rip)     # 0x9210
movq %r15, 0x7cfb(%rip)      # 0x9200
movq %r14, 0x7cfc(%rip)      # 0x9208
leaq 0x4ba7(%rip), %rdi      # 0x60ba
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d0b
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1e4a
testl %eax, %eax
jne 0x15f6
leaq 0x7c42(%rip), %r14      # 0x9180
movq 0x7c3b(%rip), %rsi      # 0x9180
leaq 0x4bba(%rip), %rdi      # 0x6106
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1dbf
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1e4a
testl %eax, %eax
jne 0x1615
leaq 0x7c59(%rip), %r14      # 0x91d0
movq 0x7c52(%rip), %rsi      # 0x91d0
leaq 0x4b81(%rip), %rdi      # 0x6106
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1dbf
movq %rbx, %rdi
callq 0x1c81
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rdi
callq 0x12b0
leaq 0x4a90(%rip), %rdi      # 0x604f
leaq 0x4a90(%rip), %rsi      # 0x6056
leaq 0x4a93(%rip), %rcx      # 0x6060
movl $0x46, %edx
callq 0x1170
leaq 0x4aef(%rip), %rdi      # 0x60cd
leaq 0x4a71(%rip), %rsi      # 0x6056
leaq 0x4a74(%rip), %rcx      # 0x6060
movl $0x58, %edx
callq 0x1170
leaq 0x4ad0(%rip), %rdi      # 0x60cd
leaq 0x4a52(%rip), %rsi      # 0x6056
leaq 0x4a55(%rip), %rcx      # 0x6060
movl $0x6a, %edx
callq 0x1170
leaq 0x4ab1(%rip), %rdi      # 0x60cd
leaq 0x4a33(%rip), %rsi      # 0x6056
leaq 0x4a36(%rip), %rcx      # 0x6060
movl $0x6f, %edx
callq 0x1170