// File: /workspace/github_cpp_makefile_star2_O2/cybozu[P]yrmcds/src/config.cpp
// Function: yrmcds::counter_config::load(cybozu::config_parser const&)
void counter_config::load(const cybozu::config_parser& cp) {
    if( cp.exists(COUNTER_ENABLE) )
        m_enable = cp.get_as_bool(COUNTER_ENABLE);

    if( cp.exists(COUNTER_PORT) ) {
        int n = cp.get_as_int(COUNTER_PORT);
        if( n < 1 || n > 65535 )
            throw config::bad_config("Bad port: " + cp.get(COUNTER_PORT));
        m_port = static_cast<std::uint16_t>(n);
    }

    if( cp.exists(COUNTER_MAX_CONNECTIONS) ) {
        int conns = cp.get_as_int(COUNTER_MAX_CONNECTIONS);
        if( conns < 0 )
            throw config::bad_config("counter.max_connections must be >= 0");
        m_max_connections = conns;
    }

    if( cp.exists(COUNTER_BUCKETS) ) {
        int buckets = cp.get_as_int(COUNTER_BUCKETS);
        if( buckets < 1 )
            throw config::bad_config("buckets must be > 0");
        if( buckets < 10000 )
            cybozu::logger::warning() << "Too small bucket count!";
        m_buckets = buckets;
    }

    if( cp.exists(COUNTER_STAT_INTERVAL) ) {
        int n = cp.get_as_int(COUNTER_STAT_INTERVAL);
        if( n < 10 )
            throw config::bad_config("counter.stat_interval must be >= 10");
        m_stat_interval = n;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x1af91(%rip), %rsi     # 0x265f0
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcee2
movl %eax, %ebp
movq %rsp, %rdi
callq 0x71d0
testb %bpl, %bpl
je 0xb6b0
leaq 0x1af63(%rip), %rsi     # 0x265f0
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcef0
movb %al, (%r14)
movq %rsp, %rdi
callq 0x71d0
leaq 0x1af48(%rip), %rsi     # 0x265ff
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcee2
movl %eax, %ebp
movq %rsp, %rdi
callq 0x71d0
testb %bpl, %bpl
je 0xb71e
leaq 0x1af1a(%rip), %rsi     # 0x265ff
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcf6e
movl %eax, %r15d
movq %rsp, %rdi
callq 0x71d0
movl $0xffff0000, %eax       # imm = 0xFFFF0000
leal (%r15,%rax), %ecx
cmpl %eax, %ecx
jbe 0xb87d
movw %r15w, 0x2(%r14)
leaq 0x1aeeb(%rip), %rsi     # 0x26610
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcee2
movl %eax, %ebp
movq %rsp, %rdi
callq 0x71d0
testb %bpl, %bpl
je 0xb781
leaq 0x1aebd(%rip), %rsi     # 0x26610
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcf6e
movl %eax, %ebp
movq %rsp, %rdi
callq 0x71d0
testl %ebp, %ebp
js 0xb8e8
movl %ebp, 0x4(%r14)
leaq 0x1aea8(%rip), %rsi     # 0x26630
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcee2
movl %eax, %ebp
movq %rsp, %rdi
callq 0x71d0
testb %bpl, %bpl
je 0xb80e
leaq 0x1ae7a(%rip), %rsi     # 0x26630
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcf6e
movl %eax, %ebp
movq %rsp, %rdi
callq 0x71d0
testl %ebp, %ebp
jle 0xb932
cmpl $0x270f, %ebp           # imm = 0x270F
ja 0xb80a
movq %rsp, %r15
movq %r15, %rdi
callq 0xd0b4
leaq 0x1ac0e(%rip), %rsi     # 0x26408
movq %r15, %rdi
callq 0xd0da
movq %rsp, %rdi
callq 0x86e4
movl %ebp, 0x8(%r14)
leaq 0x1ae2b(%rip), %rsi     # 0x26640
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcee2
movl %eax, %ebp
movq %rsp, %rdi
callq 0x71d0
testb %bpl, %bpl
je 0xb872
leaq 0x1adfd(%rip), %rsi     # 0x26640
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xcf6e
movl %eax, %ebx
movq %rsp, %rdi
callq 0x71d0
cmpl $0x9, %ebx
jle 0xb979
movl %ebx, 0xc(%r14)
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %r14
leaq 0x1ad70(%rip), %rsi     # 0x265ff
leaq 0x28(%rsp), %rdi
leaq 0x27(%rsp), %rdx
callq 0x84d8
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0xd042
leaq 0x1ab12(%rip), %rsi     # 0x263c4
movq %rsp, %rdi
movq %rax, %rdx
callq 0x9655
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0xd09e
xorl %ebp, %ebp
leaq 0x2ea6c(%rip), %rsi     # 0x3a340
movq 0x2f6a5(%rip), %rdx     # 0x3af80
movq %r14, %rdi
callq 0x7950
jmp 0xb9be
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %r14
leaq 0x1aad5(%rip), %rsi     # 0x263cf
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0xd09e
xorl %ebp, %ebp
leaq 0x2ea22(%rip), %rsi     # 0x3a340
movq 0x2f65b(%rip), %rdx     # 0x3af80
movq %r14, %rdi
callq 0x7950
jmp 0xb9be
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %r14
leaq 0x1aab0(%rip), %rsi     # 0x263f4
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0xd09e
xorl %ebp, %ebp
leaq 0x2e9d8(%rip), %rsi     # 0x3a340
movq 0x2f611(%rip), %rdx     # 0x3af80
movq %r14, %rdi
callq 0x7950
jmp 0xb9be
pushq $0x10
popq %rdi
callq 0x7240
movq %rax, %r14
leaq 0x1aa95(%rip), %rsi     # 0x26420
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x84d8
movb $0x1, %bpl
movq %rsp, %rsi
movq %r14, %rdi
callq 0xd09e
xorl %ebp, %ebp
leaq 0x2e991(%rip), %rsi     # 0x3a340
movq 0x2f5ca(%rip), %rdx     # 0x3af80
movq %r14, %rdi
callq 0x7950
movq %rax, %rbx
movq %rsp, %rdi
callq 0x71d0
jmp 0xb9d1
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x28(%rsp), %rdi
jmp 0xb9f3
jmp 0xb9ed
jmp 0xba01
movq %rax, %rbx
movq %rsp, %rdi
callq 0x86e4
jmp 0xba42
jmp 0xb9ed
jmp 0xba01
movq %rax, %rbx
movq %rsp, %rdi
callq 0x71d0
testb %bpl, %bpl
jne 0xba04
jmp 0xba42
jmp 0xba01
movq %rax, %rbx
movq %r14, %rdi
callq 0x7390
jmp 0xba42
jmp 0xba32
jmp 0xba3f
jmp 0xba32
jmp 0xba3f
jmp 0xba32
jmp 0xba3f
jmp 0xba32
jmp 0xba3f
jmp 0xba32
jmp 0xba3f
jmp 0xba32
jmp 0xba3f
jmp 0xba32
jmp 0xba3f
jmp 0xba32
jmp 0xba3f
jmp 0xba32
jmp 0xba3f
movq %rax, %rbx
movq %rsp, %rdi
callq 0x71d0
jmp 0xba42
movq %rax, %rbx
movq %rbx, %rdi
callq 0x7990