// File: /workspace/github_c_makefile_star2_O1/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 0x15e8
leaq 0x4c18(%rip), %rdi      # 0x600f
leaq 0x4c19(%rip), %rdx      # 0x6017
xorl %esi, %esi
callq 0x16f5
testq %rax, %rax
je 0x15f0
movq %rax, %rbx
leaq 0x4c33(%rip), %rsi      # 0x604b
movq %rsi, 0x7d71(%rip)      # 0x9190
leaq 0x7d6a(%rip), %r14      # 0x9190
leaq 0x4c24(%rip), %rax      # 0x6051
movq %rax, 0x7d64(%rip)      # 0x9198
movl $0x0, 0x7d92(%rip)      # 0x91d0
leaq 0x4c18(%rip), %rax      # 0x605d
movq %rax, 0x7d54(%rip)      # 0x91a0
leaq 0x4c2f(%rip), %r12      # 0x6082
movq %r12, 0x7d4e(%rip)      # 0x91a8
movl $0x1, 0x7d78(%rip)      # 0x91dc
leaq 0x4c1e(%rip), %r13      # 0x6089
movq %r13, 0x7d3e(%rip)      # 0x91b0
leaq 0x4c11(%rip), %rbp      # 0x608a
movq %rbp, 0x7d38(%rip)      # 0x91b8
movq $0x1, 0x7d49(%rip) # 0x91d4
leaq 0x1da(%rip), %r15       # 0x166c
movq %r15, 0x7d27(%rip)      # 0x91c0
movq %r14, 0x7d28(%rip)      # 0x91c8
leaq 0x4be7(%rip), %rdi      # 0x608e
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d7f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ef8
testl %eax, %eax
jne 0x160f
leaq 0x4bdc(%rip), %rsi      # 0x60ae
movq %rsi, 0x7d07(%rip)      # 0x91e0
leaq 0x7d00(%rip), %r14      # 0x91e0
leaq 0x4b6a(%rip), %rax      # 0x6051
movq %rax, 0x7cfa(%rip)      # 0x91e8
movl $0x0, 0x7d28(%rip)      # 0x9220
leaq 0x4bb6(%rip), %rax      # 0x60b5
movq %rax, 0x7cea(%rip)      # 0x91f0
movq %r12, 0x7ceb(%rip)      # 0x91f8
movl $0x1, 0x7d15(%rip)      # 0x922c
movq %r13, 0x7ce2(%rip)      # 0x9200
movq %rbp, 0x7ce3(%rip)      # 0x9208
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x7cee(%rip)      # 0x9224
movq %r15, 0x7cd3(%rip)      # 0x9210
movq %r14, 0x7cd4(%rip)      # 0x9218
leaq 0x4b43(%rip), %rdi      # 0x608e
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1d7f
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ef8
testl %eax, %eax
jne 0x162e
leaq 0x7c1a(%rip), %r14      # 0x9190
movq 0x7c13(%rip), %rsi      # 0x9190
leaq 0x4b56(%rip), %rdi      # 0x60da
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1e3c
movq %rbx, %rdi
xorl %esi, %esi
callq 0x1ef8
testl %eax, %eax
jne 0x164d
leaq 0x7c31(%rip), %r14      # 0x91e0
movq 0x7c2a(%rip), %rsi      # 0x91e0
leaq 0x4b1d(%rip), %rdi      # 0x60da
xorl %eax, %eax
callq 0x1120
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1e3c
movq %rbx, %rdi
callq 0x1cee
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rdi
callq 0x12c0
leaq 0x4a2c(%rip), %rdi      # 0x6023
leaq 0x4a2c(%rip), %rsi      # 0x602a
leaq 0x4a2f(%rip), %rcx      # 0x6034
movl $0x46, %edx
callq 0x1170
leaq 0x4a8b(%rip), %rdi      # 0x60a1
leaq 0x4a0d(%rip), %rsi      # 0x602a
leaq 0x4a10(%rip), %rcx      # 0x6034
movl $0x58, %edx
callq 0x1170
leaq 0x4a6c(%rip), %rdi      # 0x60a1
leaq 0x49ee(%rip), %rsi      # 0x602a
leaq 0x49f1(%rip), %rcx      # 0x6034
movl $0x6a, %edx
callq 0x1170
leaq 0x4a4d(%rip), %rdi      # 0x60a1
leaq 0x49cf(%rip), %rsi      # 0x602a
leaq 0x49d2(%rip), %rcx      # 0x6034
movl $0x6f, %edx
callq 0x1170