// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x28637(%rip), %rsi     # 0x345d0
leaq 0x2863e(%rip), %rdx     # 0x345de
leaq 0x8(%rsp), %rdi
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe78e
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xbfd1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
testq %r15, %r15
je 0xc017
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x285eb(%rip), %rsi     # 0x345d0
leaq 0x285f2(%rip), %rdx     # 0x345de
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xdfd8
movb %al, (%rbx)
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc017
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x285b9(%rip), %rsi     # 0x345df
leaq 0x285be(%rip), %rdx     # 0x345eb
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe78e
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc059
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
testq %r15, %r15
je 0xc0b6
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x28572(%rip), %rsi     # 0x345df
leaq 0x28577(%rip), %rdx     # 0x345eb
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe05a
movl %eax, %r15d
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc0a0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
movl $0xffff0000, %eax       # imm = 0xFFFF0000
leal (%r15,%rax), %ecx
cmpl %eax, %ecx
jbe 0xc2d6
movw %r15w, 0x2(%rbx)
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x2852b(%rip), %rsi     # 0x345f0
leaq 0x2853b(%rip), %rdx     # 0x34607
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe78e
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc0f8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
testq %r15, %r15
je 0xc149
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x284e4(%rip), %rsi     # 0x345f0
leaq 0x284f4(%rip), %rdx     # 0x34607
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe05a
movl %eax, %ebp
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc13e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
testl %ebp, %ebp
js 0xc35c
movl %ebp, 0x4(%rbx)
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x284b8(%rip), %rsi     # 0x34610
leaq 0x284c0(%rip), %rdx     # 0x3461f
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe78e
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc18b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
testq %r15, %r15
je 0xc233
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x2846d(%rip), %rsi     # 0x34610
leaq 0x28475(%rip), %rdx     # 0x3461f
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe05a
movl %eax, %ebp
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc1d5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
testl %ebp, %ebp
jle 0xc3bb
cmpl $0x270f, %ebp           # imm = 0x270F
jg 0xc230
leaq 0x3a8ac(%rip), %rax     # 0x46a98
movl (%rax), %eax
xorl %esi, %esi
testl %eax, %eax
setg %sil
leaq 0x283ae(%rip), %rdx     # 0x345ab
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x9718
cmpb $0x1, (%r15)
jne 0xc226
movq 0x10(%rsp), %rdi
leaq 0x281cc(%rip), %rsi     # 0x343e8
movl $0x17, %edx
callq 0x7580
leaq 0x8(%rsp), %rdi
callq 0x8f94
movl %ebp, 0x8(%rbx)
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x283de(%rip), %rsi     # 0x34620
leaq 0x283ec(%rip), %rdx     # 0x34635
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe78e
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc275
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
testq %r15, %r15
je 0xc2c7
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x28397(%rip), %rsi     # 0x34620
leaq 0x283a5(%rip), %rdx     # 0x34635
callq 0x97a0
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe05a
movl %eax, %ebp
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc2bb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
cmpl $0x9, %ebp
jle 0xc417
movl %ebp, 0xc(%rbx)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x7220
movq %rax, %r15
leaq 0x38(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x282ec(%rip), %rsi     # 0x345df
leaq 0x282f1(%rip), %rdx     # 0x345eb
leaq 0x28(%rsp), %rdi
callq 0x97a0
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0xe19e
leaq 0x2808c(%rip), %rsi     # 0x343a4
leaq 0x8(%rsp), %rdi
movq %rax, %rdx
callq 0xa085
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x7620
leaq 0x390ac(%rip), %rax     # 0x453e8
movq %rax, (%r15)
xorl %ebp, %ebp
leaq 0x38ff8(%rip), %rsi     # 0x45340
movq 0x39c39(%rip), %rdx     # 0x45f88
movq %r15, %rdi
callq 0x7970
jmp 0xc471
movl $0x10, %edi
callq 0x7220
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x28037(%rip), %rsi     # 0x343af
leaq 0x28054(%rip), %rdx     # 0x343d3
callq 0x97a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x7620
leaq 0x3904d(%rip), %rax     # 0x453e8
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x38f99(%rip), %rsi     # 0x45340
movq 0x39bda(%rip), %rdx     # 0x45f88
movq %r14, %rdi
callq 0x7970
jmp 0xc471
movl $0x10, %edi
callq 0x7220
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x27ffd(%rip), %rsi     # 0x343d4
leaq 0x28009(%rip), %rdx     # 0x343e7
callq 0x97a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x7620
leaq 0x38fee(%rip), %rax     # 0x453e8
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x38f3a(%rip), %rsi     # 0x45340
movq 0x39b7b(%rip), %rdx     # 0x45f88
movq %r14, %rdi
callq 0x7970
jmp 0xc471
movl $0x10, %edi
callq 0x7220
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x27fcd(%rip), %rsi     # 0x34400
leaq 0x27fe9(%rip), %rdx     # 0x34423
callq 0x97a0
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x7620
leaq 0x38f92(%rip), %rax     # 0x453e8
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x38ede(%rip), %rsi     # 0x45340
movq 0x39b1f(%rip), %rdx     # 0x45f88
movq %r14, %rdi
callq 0x7970
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc4a5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
jmp 0xc4a5
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x8f94
jmp 0xc54a
movq %rax, %rbx
movb $0x1, %bpl
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xc4f8
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7510
jmp 0xc4f8
jmp 0xc4c6
jmp 0xc4e2
jmp 0xc4c6
jmp 0xc4e2
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc4e8
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
jmp 0xc4e8
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0xc54a
movq %r14, %rdi
jmp 0xc500
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0xc54a
movq %r15, %rdi
callq 0x7370
jmp 0xc54a
jmp 0xc52b
jmp 0xc547
jmp 0xc52b
jmp 0xc547
jmp 0xc52b
jmp 0xc547
jmp 0xc52b
jmp 0xc547
jmp 0xc52b
jmp 0xc547
jmp 0xc52b
jmp 0xc547
jmp 0xc52b
jmp 0xc547
jmp 0xc52b
jmp 0xc547
jmp 0xc52b
jmp 0xc547
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc54a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7510
jmp 0xc54a
movq %rax, %rbx
movq %rbx, %rdi
callq 0x79b0