// File: /workspace/github_c_makefile_star2_O2/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 0x1570
leaq 0x3c94(%rip), %rdi      # 0x503b
leaq 0x3c95(%rip), %rdx      # 0x5043
xorl %esi, %esi
callq 0x167d
testq %rax, %rax
je 0x159e
movq %rax, %rbx
leaq 0x3caf(%rip), %rsi      # 0x5077
movq %rsi, 0x7db1(%rip)      # 0x9180
leaq 0x7daa(%rip), %r14      # 0x9180
leaq 0x3ca0(%rip), %rax      # 0x507d
movq %rax, 0x7da4(%rip)      # 0x9188
leaq 0x3c9e(%rip), %rax      # 0x5089
movq %rax, 0x7d9e(%rip)      # 0x9190
leaq 0x3cb5(%rip), %r12      # 0x50ae
movq %r12, 0x7d98(%rip)      # 0x9198
leaq 0x3cae(%rip), %r13      # 0x50b5
movq %r13, 0x7d92(%rip)      # 0x91a0
leaq 0x3ca1(%rip), %rbp      # 0x50b6
movq %rbp, 0x7d8c(%rip)      # 0x91a8
movaps 0x3bed(%rip), %xmm0     # 0x5010
movaps %xmm0, 0x7d96(%rip)     # 0x91c0
leaq 0x1d5(%rip), %r15       # 0x1606
movq %r15, 0x7d78(%rip)      # 0x91b0
movq %r14, 0x7d79(%rip)      # 0x91b8
leaq 0x3c74(%rip), %rdi      # 0x50ba
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1cb1
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1d75
testl %eax, %eax
jne 0x15b7
leaq 0x3c69(%rip), %rsi      # 0x50da
movq %rsi, 0x7d58(%rip)      # 0x91d0
leaq 0x7d51(%rip), %r14      # 0x91d0
leaq 0x3bf7(%rip), %rax      # 0x507d
movq %rax, 0x7d4b(%rip)      # 0x91d8
leaq 0x3c4d(%rip), %rax      # 0x50e1
movq %rax, 0x7d45(%rip)      # 0x91e0
movq %r12, 0x7d46(%rip)      # 0x91e8
movq %r13, 0x7d47(%rip)      # 0x91f0
movq %rbp, 0x7d48(%rip)      # 0x91f8
movaps 0x3b69(%rip), %xmm0     # 0x5020
movaps %xmm0, 0x7d52(%rip)     # 0x9210
movq %r15, 0x7d3b(%rip)      # 0x9200
movq %r14, 0x7d3c(%rip)      # 0x9208
leaq 0x3be7(%rip), %rdi      # 0x50ba
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1cb1
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1d75
testl %eax, %eax
jne 0x15d0
leaq 0x7c82(%rip), %r14      # 0x9180
movq 0x7c7b(%rip), %rsi      # 0x9180
leaq 0x3bfa(%rip), %rdi      # 0x5106
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d25
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1d75
testl %eax, %eax
jne 0x15e9
leaq 0x7c99(%rip), %r14      # 0x91d0
movq 0x7c92(%rip), %rsi      # 0x91d0
leaq 0x3bc1(%rip), %rdi      # 0x5106
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d25
movq %rbx, %rdi
callq 0x1c47
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7a81(%rip), %rax      # 0x8ff8
movq (%rax), %rbx
movq (%rsi), %rdi
callq 0x11f0
leaq 0x3aa7(%rip), %rsi      # 0x5030
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x11c0
pushq $0x1
popq %rdi
callq 0x1260
leaq 0x3aaa(%rip), %rdi      # 0x504f
leaq 0x3aaa(%rip), %rsi      # 0x5056
leaq 0x3aad(%rip), %rcx      # 0x5060
pushq $0x46
jmp 0x1600
leaq 0x3b0f(%rip), %rdi      # 0x50cd
leaq 0x3a91(%rip), %rsi      # 0x5056
leaq 0x3a94(%rip), %rcx      # 0x5060
pushq $0x58
jmp 0x1600
leaq 0x3af6(%rip), %rdi      # 0x50cd
leaq 0x3a78(%rip), %rsi      # 0x5056
leaq 0x3a7b(%rip), %rcx      # 0x5060
pushq $0x6a
jmp 0x1600
leaq 0x3add(%rip), %rdi      # 0x50cd
leaq 0x3a5f(%rip), %rsi      # 0x5056
leaq 0x3a62(%rip), %rcx      # 0x5060
pushq $0x6f
popq %rdx
callq 0x1170