// File: /workspace/github_cpp_makefile_star2_O3/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 0x2869f(%rip), %rsi     # 0x345d0
leaq 0x286a6(%rip), %rdx     # 0x345de
leaq 0x8(%rsp), %rdi
callq 0x9760
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe76a
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xbf69
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
testq %r15, %r15
je 0xbfaf
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x28653(%rip), %rsi     # 0x345d0
leaq 0x2865a(%rip), %rdx     # 0x345de
callq 0x9760
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xdfae
movb %al, (%rbx)
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xbfaf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x28621(%rip), %rsi     # 0x345df
leaq 0x28626(%rip), %rdx     # 0x345eb
callq 0x9760
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe76a
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xbff1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
testq %r15, %r15
je 0xc04e
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x285da(%rip), %rsi     # 0x345df
leaq 0x285df(%rip), %rdx     # 0x345eb
callq 0x9760
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe030
movl %eax, %r15d
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc038
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
movl $0xffff0000, %eax       # imm = 0xFFFF0000
leal (%r15,%rax), %ecx
cmpl %eax, %ecx
jbe 0xc26e
movw %r15w, 0x2(%rbx)
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x28593(%rip), %rsi     # 0x345f0
leaq 0x285a3(%rip), %rdx     # 0x34607
callq 0x9760
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe76a
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc090
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
testq %r15, %r15
je 0xc0e1
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x2854c(%rip), %rsi     # 0x345f0
leaq 0x2855c(%rip), %rdx     # 0x34607
callq 0x9760
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe030
movl %eax, %ebp
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc0d6
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
testl %ebp, %ebp
js 0xc2f4
movl %ebp, 0x4(%rbx)
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x28520(%rip), %rsi     # 0x34610
leaq 0x28528(%rip), %rdx     # 0x3461f
callq 0x9760
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe76a
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc123
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
testq %r15, %r15
je 0xc1cb
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x284d5(%rip), %rsi     # 0x34610
leaq 0x284dd(%rip), %rdx     # 0x3461f
callq 0x9760
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe030
movl %eax, %ebp
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc16d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
testl %ebp, %ebp
jle 0xc353
cmpl $0x270f, %ebp           # imm = 0x270F
ja 0xc1c8
leaq 0x3a904(%rip), %rax     # 0x46a88
movl (%rax), %eax
xorl %esi, %esi
testl %eax, %eax
setg %sil
leaq 0x28416(%rip), %rdx     # 0x345ab
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x96e6
cmpb $0x1, (%r15)
jne 0xc1be
movq 0x10(%rsp), %rdi
leaq 0x28234(%rip), %rsi     # 0x343e8
movl $0x17, %edx
callq 0x7570
leaq 0x8(%rsp), %rdi
callq 0x8f4e
movl %ebp, 0x8(%rbx)
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x28446(%rip), %rsi     # 0x34620
leaq 0x28454(%rip), %rdx     # 0x34635
callq 0x9760
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe76a
movq %rax, %r15
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc20d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
testq %r15, %r15
je 0xc25f
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x283ff(%rip), %rsi     # 0x34620
leaq 0x2840d(%rip), %rdx     # 0x34635
callq 0x9760
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0xe030
movl %eax, %ebp
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc253
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
cmpl $0x9, %ebp
jle 0xc3af
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 0x28354(%rip), %rsi     # 0x345df
leaq 0x28359(%rip), %rdx     # 0x345eb
leaq 0x28(%rsp), %rdi
callq 0x9760
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0xe174
leaq 0x280f4(%rip), %rsi     # 0x343a4
leaq 0x8(%rsp), %rdi
movq %rax, %rdx
callq 0xa064
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x7610
leaq 0x39114(%rip), %rax     # 0x453e8
movq %rax, (%r15)
xorl %ebp, %ebp
leaq 0x39060(%rip), %rsi     # 0x45340
movq 0x39ca1(%rip), %rdx     # 0x45f88
movq %r15, %rdi
callq 0x7960
jmp 0xc409
movl $0x10, %edi
callq 0x7220
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x2809f(%rip), %rsi     # 0x343af
leaq 0x280bc(%rip), %rdx     # 0x343d3
callq 0x9760
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x7610
leaq 0x390b5(%rip), %rax     # 0x453e8
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x39001(%rip), %rsi     # 0x45340
movq 0x39c42(%rip), %rdx     # 0x45f88
movq %r14, %rdi
callq 0x7960
jmp 0xc409
movl $0x10, %edi
callq 0x7220
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x28065(%rip), %rsi     # 0x343d4
leaq 0x28071(%rip), %rdx     # 0x343e7
callq 0x9760
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x7610
leaq 0x39056(%rip), %rax     # 0x453e8
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x38fa2(%rip), %rsi     # 0x45340
movq 0x39be3(%rip), %rdx     # 0x45f88
movq %r14, %rdi
callq 0x7960
jmp 0xc409
movl $0x10, %edi
callq 0x7220
movq %rax, %r14
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x28035(%rip), %rsi     # 0x34400
leaq 0x28051(%rip), %rdx     # 0x34423
callq 0x9760
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x7610
leaq 0x38ffa(%rip), %rax     # 0x453e8
movq %rax, (%r14)
xorl %ebp, %ebp
leaq 0x38f46(%rip), %rsi     # 0x45340
movq 0x39b87(%rip), %rdx     # 0x45f88
movq %r14, %rdi
callq 0x7960
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc423
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xc43a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7500
testb %bpl, %bpl
jne 0xc4a6
jmp 0xc4f3
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x8f4e
jmp 0xc4f3
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0xc4a6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x7500
jmp 0xc4a6
jmp 0xc47a
jmp 0xc49b
jmp 0xc47a
jmp 0xc49b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc494
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
testb %bpl, %bpl
jne 0xc49e
jmp 0xc4f3
movq %rax, %rbx
movq %r14, %rdi
jmp 0xc4a9
movq %rax, %rbx
movq %r15, %rdi
callq 0x7370
jmp 0xc4f3
jmp 0xc4d4
jmp 0xc4f0
jmp 0xc4d4
jmp 0xc4f0
jmp 0xc4d4
jmp 0xc4f0
jmp 0xc4d4
jmp 0xc4f0
jmp 0xc4d4
jmp 0xc4f0
jmp 0xc4d4
jmp 0xc4f0
jmp 0xc4d4
jmp 0xc4f0
jmp 0xc4d4
jmp 0xc4f0
jmp 0xc4d4
jmp 0xc4f0
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0xc4f3
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x7500
jmp 0xc4f3
movq %rax, %rbx
movq %rbx, %rdi
callq 0x79a0
nop