// File: /workspace/github_c_makefile_star2_O0/Cotix[P]cReddit/libreddit/token.c
// Function: performIdentAction
int performIdentAction(TokenParser *p, TokenIdent *identifiers, int i, va_list args)
{
    char *tmp = NULL;
    int performedAction = 0, len;

    time_t created_time_t;
    struct tm *localtime_internal_data;
    struct tm *created_struct_tm;
    char *formatted_time_string;

    READ_TOKEN_TO_TMP(p->block->memory, tmp, p->tokens[p->currentToken]);

    if (TOKEN_EQUALS(tmp, identifiers[i].name)) {
        switch(identifiers[i].action) {
        case TOKEN_CHECK_CALL:
            (p->currentToken)++;
            CALL_TOKEN_FUNC(identifiers[i].funcCallback, p, identifiers, args);
            performedAction = 1;
            break;

        case TOKEN_SET_PARSE:
            (p->currentToken)++;
            if (identifiers[i].freeFlag) {
                free(*((char**)identifiers[i].value));
                free(*(identifiers[i].parseStrWide));
                free(*(identifiers[i].parseStr));
            }

            *((char**)identifiers[i].value) = getCopyOfToken(p->block->memory, p->tokens[p->currentToken]);

            len = p->tokens[p->currentToken].end - p->tokens[p->currentToken].start;

            *(identifiers[i].parseStr)     = redditParseEscCodes    (*((char**)identifiers[i].value), len);
            *(identifiers[i].parseStrWide) = redditParseEscCodesWide(*((char**)identifiers[i].value), len);

            break;

        case TOKEN_SET:
            (p->currentToken)++;
            READ_TOKEN_TO_TMP(p->block->memory, tmp, p->tokens[p->currentToken]);
            switch(identifiers[i].type) {
            case TOKEN_BOOL:
                if (TOKEN_IS_TRUE(p->block->memory, p->tokens[p->currentToken]))
                    *((unsigned int *)identifiers[i].value) |= identifiers[i].bitMask;
                else
                    *((unsigned int *)identifiers[i].value) &= ~identifiers[i].bitMask;

                break;
            case TOKEN_INT:
                *((int*)(identifiers[i].value)) = atoi(tmp);
                break;
            case TOKEN_STRING:
            case TOKEN_OBJECT:
                if (identifiers[i].freeFlag)
                    free(*((char**)identifiers[i].value));

                *((char**)identifiers[i].value) = getCopyOfToken(p->block->memory, p->tokens[p->currentToken]);
                break;
            case TOKEN_DATE:
                // Process the tmp char* string as a date
                created_time_t = atol(tmp);
                created_struct_tm = (struct tm *)(rmalloc(sizeof(struct tm)));
                formatted_time_string = (char *)(rmalloc(CREATE_DATE_FORMAT_BYTE_COUNT));
                
                // Convert created_time_t (seconds since epoch) to 
                // the struct tm object of localtime_internal_data. After we get
                // the value, copy the internal data (static data)to a newly created
                // struct tm object.
                localtime_internal_data = localtime(&created_time_t);
                if (localtime_internal_data != NULL)
                {
                    memcpy(created_struct_tm, localtime_internal_data, sizeof(struct tm));

                    // Use strftime to convert the struct tm to a formatted string. The
                    // format for the string is specified by CREATE_DATE_FORMAT
                    if (0 != strftime(formatted_time_string, CREATE_DATE_FORMAT_BYTE_COUNT, 
                                CREATE_DATE_FORMAT, created_struct_tm))
                    {
                        *((char**)identifiers[i].value) = formatted_time_string;
                    }
                }

                // Free only created_struct_tm, don't free formatted_time_string
                // because that data is now pointed to by identifiers[i].value
                free(created_struct_tm);
                break;
            }
            performedAction = 1;

            break;
        }
    }

    free(tmp);
    return performedAction;
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movl %edx, 0xc4(%rsp)
movq %rcx, 0xb8(%rsp)
movq $0x0, 0xb0(%rsp)
movl $0x0, 0xac(%rsp)
movq 0xb0(%rsp), %rdi
movq 0xd0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0xd0(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0xd0(%rsp), %rdx
movslq 0x14(%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x43e0
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rdi
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rsi
movq 0xd0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rax
addq %rax, %rsi
movq 0xd0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0xd0(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0xd0(%rsp), %rdx
movslq 0x14(%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
movslq %eax, %rdx
callq 0x2180
movq 0xb0(%rsp), %rax
movq 0xd0(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0xd0(%rsp), %rdx
movslq 0x14(%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movq 0xd0(%rsp), %rdx
movq 0x8(%rdx), %rdx
movq 0xd0(%rsp), %rsi
movslq 0x14(%rsi), %rsi
imulq $0x1c, %rsi, %rsi
addq %rsi, %rdx
subl 0x4(%rdx), %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq 0xb0(%rsp), %rdi
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x2160
cmpl $0x0, %eax
jne 0x67b5
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
movl 0xc(%rax,%rcx), %eax
movl %eax, 0x2c(%rsp)
testl %eax, %eax
je 0x6384
jmp 0x60dd
movl 0x2c(%rsp), %eax
subl $0x1, %eax
je 0x616e
jmp 0x60ec
movl 0x2c(%rsp), %eax
subl $0x2, %eax
jne 0x67b3
jmp 0x60fb
movq 0xd0(%rsp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
leaq 0x70(%rsp), %rax
movq 0xb8(%rsp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x30(%rax), %rax
movq 0xd0(%rsp), %rdi
movq 0xc8(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq *%rax
leaq 0x70(%rsp), %rax
movl $0x1, 0xac(%rsp)
jmp 0x67b3
movq 0xd0(%rsp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
testb $0x1, 0x2c(%rax)
je 0x6205
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
callq 0x2040
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movq (%rax), %rdi
callq 0x2040
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rax
movq (%rax), %rdi
callq 0x2040
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rdi
movq 0xd0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, 0x50(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x58(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x60(%rsp)
movl 0x18(%rax), %eax
movl %eax, 0x68(%rsp)
leaq 0x50(%rsp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movl 0x18(%rax), %eax
movl %eax, 0x18(%rsp)
callq 0x5de0
movq %rax, %rcx
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
movq 0xd0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0xd0(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0xd0(%rsp), %rdx
movslq 0x14(%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
movl %eax, 0xa8(%rsp)
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
movl 0xa8(%rsp), %esi
callq 0x2280
movq %rax, %rcx
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq 0x18(%rax), %rax
movq %rcx, (%rax)
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
movl 0xa8(%rsp), %esi
callq 0x2030
movq %rax, %rcx
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq 0x20(%rax), %rax
movq %rcx, (%rax)
jmp 0x67b3
movq 0xd0(%rsp), %rax
movl 0x14(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x14(%rax)
movq 0xb0(%rsp), %rdi
movq 0xd0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0xd0(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0xd0(%rsp), %rdx
movslq 0x14(%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x43e0
movq %rax, 0xb0(%rsp)
movq 0xb0(%rsp), %rdi
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rsi
movq 0xd0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rax
addq %rax, %rsi
movq 0xd0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq 0xd0(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0xd0(%rsp), %rdx
movslq 0x14(%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
subl 0x4(%rcx), %eax
movslq %eax, %rdx
callq 0x2180
movq 0xb0(%rsp), %rax
movq 0xd0(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0xd0(%rsp), %rdx
movslq 0x14(%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl 0x8(%rcx), %ecx
movq 0xd0(%rsp), %rdx
movq 0x8(%rdx), %rdx
movq 0xd0(%rsp), %rsi
movslq 0x14(%rsi), %rsi
imulq $0x1c, %rsi, %rsi
addq %rsi, %rdx
subl 0x4(%rdx), %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
movl 0x8(%rax,%rcx), %eax
movq %rax, 0x20(%rsp)
subq $0x4, %rax
ja 0x67a8
movq 0x20(%rsp), %rax
leaq 0x1e22(%rip), %rcx      # 0x8324
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rax
movq 0xd0(%rsp), %rcx
movq 0x8(%rcx), %rcx
movq 0xd0(%rsp), %rdx
movslq 0x14(%rdx), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movslq 0x4(%rcx), %rcx
movsbl (%rax,%rcx), %edi
callq 0x2080
cmpl $0x54, %eax
jne 0x6585
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x28(%rax), %ecx
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
orl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x65c1
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movl 0x28(%rax), %ecx
xorl $-0x1, %ecx
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
andl (%rax), %ecx
movl %ecx, (%rax)
jmp 0x67a8
movq 0xb0(%rsp), %rdi
callq 0x2250
movl %eax, %ecx
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movl %ecx, (%rax)
jmp 0x67a8
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
testb $0x1, 0x2c(%rax)
je 0x6637
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rcx
imulq $0x38, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq (%rax), %rdi
callq 0x2040
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq (%rax), %rdi
movq 0xd0(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xd0(%rsp), %rcx
movslq 0x14(%rcx), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, 0x30(%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x38(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x40(%rsp)
movl 0x18(%rax), %eax
movl %eax, 0x48(%rsp)
leaq 0x30(%rsp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rcx
movq %rcx, 0x10(%rsp)
movl 0x18(%rax), %eax
movl %eax, 0x18(%rsp)
callq 0x5de0
movq %rax, %rcx
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
jmp 0x67a8
movq 0xb0(%rsp), %rdi
callq 0x2220
movq %rax, 0xa0(%rsp)
movl $0x38, %edi
callq 0x43a0
movq %rax, 0x90(%rsp)
movl $0x20, %edi
callq 0x43a0
movq %rax, 0x88(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x2050
movq %rax, 0x98(%rsp)
cmpq $0x0, 0x98(%rsp)
je 0x679b
movq 0x90(%rsp), %rdi
movq 0x98(%rsp), %rsi
movl $0x38, %edx
callq 0x2180
movq 0x88(%rsp), %rdi
movq 0x90(%rsp), %rcx
movl $0x20, %esi
leaq 0x1d76(%rip), %rdx      # 0x84da
callq 0x2200
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x6799
movq 0x88(%rsp), %rcx
movq 0xc8(%rsp), %rax
movslq 0xc4(%rsp), %rdx
imulq $0x38, %rdx, %rdx
addq %rdx, %rax
movq 0x10(%rax), %rax
movq %rcx, (%rax)
jmp 0x679b
movq 0x90(%rsp), %rdi
callq 0x2040
movl $0x1, 0xac(%rsp)
jmp 0x67b5
movq 0xb0(%rsp), %rdi
callq 0x2040
movl 0xac(%rsp), %eax
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)