// File: mukul-mehta[P]meta/tokenizer.cc
// Function: tokenize[abi:cxx11](char*)
vector<string> tokenize(char* line) {
    vector<string> tokens;
    if (line == NULL) {
        return {};
    }

    static char token[MAXTOKEN];
    memset(token, '\0', MAXTOKEN);
    size_t n = 0;
    size_t len = strlen(line);

    const int MODE_NORMAL = 0, MODE_SQUOTE = 1, MODE_DQUOTE = 2;
    int mode = MODE_NORMAL;

    for (size_t i = 0; i < len; i++) {
        char c = line[i];
        if (mode == MODE_NORMAL) {
            if (c == '\'') {
                mode = MODE_SQUOTE;
            } else if (c == '"') {
                mode = MODE_DQUOTE;
            } else if (c == '\\') {
                if (i + 1 < len) {
                    token[n++] = line[++i];
                }
            } else if (isspace(c)) {
                if (n > 0) {
                    token[n] = '\0';
                    char* temp = (char*)malloc(n + 1);
                    strncpy(temp, token, n + 1);
                    string word = temp;
                    tokens.push_back(word);
                    n = 0;
                    memset(token, '\0', MAXTOKEN);
                }
            } else {
                token[n++] = c;
            }
        } else if (mode == MODE_SQUOTE) {
            if (c == '\'') {
                mode = MODE_NORMAL;
            } else if (c == '\\') {
                if (i + 1 < len) {
                    token[n++] = line[++i];
                }
            } else {
                token[n++] = c;
            }
        } else if (mode == MODE_DQUOTE) {
            if (c == '"') {
                mode = MODE_NORMAL;
            } else if (c == '\\') {
                if (i + 1 < len) {
                    token[n++] = line[++i];
                }
            } else {
                token[n++] = c;
            }
        }
        if (n + 1 >= MAXTOKEN)
            abort();
    }

    if (n > 0) {
        string temp = token;
        tokens.push_back(temp);
        n = 0;
    }
    return tokens;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0xd8(%rbp)
movq %rdi, %rax
movq %rax, -0xd0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5230
cmpq $0x0, -0x10(%rbp)
jne 0x700f
movq -0xd8(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x31a0
movq -0xd8(%rbp), %rdi
callq 0x5230
movl $0x1, -0x2c(%rbp)
jmp 0x7437
leaq 0x932a(%rip), %rdi      # 0x10340
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x31a0
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3140
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x1, -0x48(%rbp)
movl $0x2, -0x4c(%rbp)
movl $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x7372
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x59(%rbp)
cmpl $0x0, -0x50(%rbp)
jne 0x7241
movsbl -0x59(%rbp), %eax
cmpl $0x27, %eax
jne 0x7096
movl $0x1, -0x50(%rbp)
jmp 0x723c
movsbl -0x59(%rbp), %eax
cmpl $0x22, %eax
jne 0x70ab
movl $0x2, -0x50(%rbp)
jmp 0x723a
movsbl -0x59(%rbp), %eax
cmpl $0x5c, %eax
jne 0x70f7
movq -0x58(%rbp), %rax
addq $0x1, %rax
cmpq -0x40(%rbp), %rax
jae 0x70f2
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x58(%rbp)
movb 0x1(%rax,%rcx), %dl
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x9251(%rip), %rax      # 0x10340
movb %dl, (%rax,%rcx)
jmp 0x7238
movsbl -0x59(%rbp), %edi
callq 0x3060
cmpl $0x0, %eax
je 0x721a
cmpq $0x0, -0x38(%rbp)
jbe 0x7218
movq -0x38(%rbp), %rax
leaq 0x9221(%rip), %rcx      # 0x10340
movq %rcx, -0xf0(%rbp)
movb $0x0, (%rax,%rcx)
movq -0x38(%rbp), %rdi
incq %rdi
callq 0x3460
movq -0xf0(%rbp), %rsi
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
movq -0x38(%rbp), %rdx
incq %rdx
callq 0x3180
movq -0x68(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0x89(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x3580
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0x4ec0
jmp 0x718b
leaq -0x89(%rbp), %rdi
callq 0x3350
leaq -0x28(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x75a0
jmp 0x71a9
movq $0x0, -0x38(%rbp)
leaq 0x9188(%rip), %rdi      # 0x10340
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x31a0
leaq -0x88(%rbp), %rdi
callq 0x31e0
jmp 0x7218
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x89(%rbp), %rdi
callq 0x3350
jmp 0x7450
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x31e0
jmp 0x7450
jmp 0x7236
movb -0x59(%rbp), %dl
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x910d(%rip), %rax      # 0x10340
movb %dl, (%rax,%rcx)
jmp 0x7238
jmp 0x723a
jmp 0x723c
jmp 0x734a
cmpl $0x1, -0x50(%rbp)
jne 0x72c5
movsbl -0x59(%rbp), %eax
cmpl $0x27, %eax
jne 0x7259
movl $0x0, -0x50(%rbp)
jmp 0x72c0
movsbl -0x59(%rbp), %eax
cmpl $0x5c, %eax
jne 0x72a2
movq -0x58(%rbp), %rax
addq $0x1, %rax
cmpq -0x40(%rbp), %rax
jae 0x72a0
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x58(%rbp)
movb 0x1(%rax,%rcx), %dl
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x90a3(%rip), %rax      # 0x10340
movb %dl, (%rax,%rcx)
jmp 0x72be
movb -0x59(%rbp), %dl
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x9085(%rip), %rax      # 0x10340
movb %dl, (%rax,%rcx)
jmp 0x72c0
jmp 0x7348
cmpl $0x2, -0x50(%rbp)
jne 0x7346
movsbl -0x59(%rbp), %eax
cmpl $0x22, %eax
jne 0x72dd
movl $0x0, -0x50(%rbp)
jmp 0x7344
movsbl -0x59(%rbp), %eax
cmpl $0x5c, %eax
jne 0x7326
movq -0x58(%rbp), %rax
addq $0x1, %rax
cmpq -0x40(%rbp), %rax
jae 0x7324
movq -0x10(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x58(%rbp)
movb 0x1(%rax,%rcx), %dl
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x901f(%rip), %rax      # 0x10340
movb %dl, (%rax,%rcx)
jmp 0x7342
movb -0x59(%rbp), %dl
movq -0x38(%rbp), %rcx
movq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
leaq 0x9001(%rip), %rax      # 0x10340
movb %dl, (%rax,%rcx)
jmp 0x7344
jmp 0x7346
jmp 0x7348
jmp 0x734a
movq -0x38(%rbp), %rax
addq $0x1, %rax
cmpq $0x400, %rax            # imm = 0x400
jb 0x735f
callq 0x31b0
jmp 0x7361
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x705b
cmpq $0x0, -0x38(%rbp)
jbe 0x7420
leaq -0xc1(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x3580
movq -0xf8(%rbp), %rdx
leaq 0x8fa2(%rip), %rsi      # 0x10340
leaq -0xc0(%rbp), %rdi
callq 0x4ec0
jmp 0x73ac
leaq -0xc1(%rbp), %rdi
callq 0x3350
leaq -0x28(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x75a0
jmp 0x73ca
movq $0x0, -0x38(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x31e0
jmp 0x7420
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xc1(%rbp), %rdi
callq 0x3350
jmp 0x7450
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x31e0
jmp 0x7450
movq -0xd8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x7610
movl $0x1, -0x2c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5250
movq -0xd0(%rbp), %rax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x5250
movq -0x98(%rbp), %rdi
callq 0x3570
nopw %cs:(%rax,%rax)