// File: lega911[P]ijson/src/connect.cpp
// Function: Connect::read_header(Slice&)
void Connect::read_header(Slice &data) {
    if(data.starts_with_lc("content-length: ")) {
        data.remove(16);
        content_length = data.atoi();
    } else if(data.starts_with_lc("type: ")) {
        data.remove(6);
        _set_type(data);
    } else if(data.starts_with_lc("x-type: ")) {
        data.remove(8);
        _set_type(data);
    } else if(data.starts_with_lc("name: ")) {
        data.remove(6);
        name.set(data);
    } else if(data.starts_with_lc("id: ")) {
        data.remove(4);
        id.set(data);
    } else if(data.starts_with_lc("option: ")) {
        data.remove(8);
        header_option = data;
    } else if(data.starts_with_lc("priority: ")) {
        data.remove(10);
        priority = data.atoi();
    } else if(data.starts_with_lc("worker-id: ")) {
        data.remove(11);
        required_worker.set(data);
    } else if(data.starts_with_lc("set-id: ")) {
        data.remove(8);
        connection_id.set(data);
    } else if(data.starts_with_lc("timeout: ")) {
        data.remove(9);
        ping = data.atoi();
        ping_timeout = get_time_sec() + ping;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1c7c2(%rip), %rsi     # 0x381c5
callq 0x1eeb0
testb $0x1, %al
jne 0x1ba0e
jmp 0x1ba34
movq -0x10(%rbp), %rdi
movl $0x10, %esi
callq 0x1ef50
movq -0x10(%rbp), %rdi
callq 0x1efb0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movl %ecx, 0x7c(%rax)
jmp 0x1bc77
movq -0x10(%rbp), %rdi
leaq 0x1c799(%rip), %rsi     # 0x381d8
callq 0x1eeb0
testb $0x1, %al
jne 0x1ba4a
jmp 0x1ba6a
movq -0x10(%rbp), %rdi
movl $0x6, %esi
callq 0x1ef50
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1bc80
jmp 0x1bc75
movq -0x10(%rbp), %rdi
leaq 0x1c761(%rip), %rsi     # 0x381d6
callq 0x1eeb0
testb $0x1, %al
jne 0x1ba80
jmp 0x1baa0
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x1ef50
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1bc80
jmp 0x1bc73
movq -0x10(%rbp), %rdi
leaq 0x1c734(%rip), %rsi     # 0x381df
callq 0x1eeb0
testb $0x1, %al
jne 0x1bab6
jmp 0x1badd
movq -0x10(%rbp), %rdi
movl $0x6, %esi
callq 0x1ef50
movq -0x18(%rbp), %rdi
addq $0xb8, %rdi
movq -0x10(%rbp), %rsi
callq 0x1ed20
jmp 0x1bc71
movq -0x10(%rbp), %rdi
leaq 0x1c719(%rip), %rsi     # 0x38201
callq 0x1eeb0
testb $0x1, %al
jne 0x1baf3
jmp 0x1bb1a
movq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0x1ef50
movq -0x18(%rbp), %rdi
addq $0xe0, %rdi
movq -0x10(%rbp), %rsi
callq 0x1ed20
jmp 0x1bc6f
movq -0x10(%rbp), %rdi
leaq 0x1c6c1(%rip), %rsi     # 0x381e6
callq 0x1eeb0
testb $0x1, %al
jne 0x1bb30
jmp 0x1bb5e
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x1ef50
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, 0xa8(%rax)
movl 0x8(%rcx), %ecx
movl %ecx, 0xb0(%rax)
jmp 0x1bc6d
movq -0x10(%rbp), %rdi
leaq 0x1c686(%rip), %rsi     # 0x381ef
callq 0x1eeb0
testb $0x1, %al
jne 0x1bb74
jmp 0x1bb9d
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x1ef50
movq -0x10(%rbp), %rdi
callq 0x1efb0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movl %ecx, 0xf4(%rax)
jmp 0x1bc6b
movq -0x10(%rbp), %rdi
leaq 0x1c652(%rip), %rsi     # 0x381fa
callq 0x1eeb0
testb $0x1, %al
jne 0x1bbb3
jmp 0x1bbda
movq -0x10(%rbp), %rdi
movl $0xb, %esi
callq 0x1ef50
movq -0x18(%rbp), %rdi
addq $0x110, %rdi            # imm = 0x110
movq -0x10(%rbp), %rsi
callq 0x1ed20
jmp 0x1bc69
movq -0x10(%rbp), %rdi
leaq 0x1c621(%rip), %rsi     # 0x38206
callq 0x1eeb0
testb $0x1, %al
jne 0x1bbf0
jmp 0x1bc14
movq -0x10(%rbp), %rdi
movl $0x8, %esi
callq 0x1ef50
movq -0x18(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
movq -0x10(%rbp), %rsi
callq 0x1ed20
jmp 0x1bc67
movq -0x10(%rbp), %rdi
leaq 0x1c5f0(%rip), %rsi     # 0x3820f
callq 0x1eeb0
testb $0x1, %al
jne 0x1bc2a
jmp 0x1bc65
movq -0x10(%rbp), %rdi
movl $0x9, %esi
callq 0x1ef50
movq -0x10(%rbp), %rdi
callq 0x1efb0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movl %ecx, 0xf8(%rax)
callq 0x36940
movl %eax, %ecx
movq -0x18(%rbp), %rax
addl 0xf8(%rax), %ecx
movl %ecx, 0xfc(%rax)
jmp 0x1bc67
jmp 0x1bc69
jmp 0x1bc6b
jmp 0x1bc6d
jmp 0x1bc6f
jmp 0x1bc71
jmp 0x1bc73
jmp 0x1bc75
jmp 0x1bc77
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)