// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/t_string.c
// Function: setCommand
void setCommand(client *c) {
    int j;
    robj *expire = NULL;
    int unit = UNIT_SECONDS;
    int flags = OBJ_SET_NO_FLAGS;

    for (j = 3; j < c->argc; j++) {
        char *a = c->argv[j]->ptr;
        robj *next = (j == c->argc-1) ? NULL : c->argv[j+1];

        if ((a[0] == 'n' || a[0] == 'N') &&
            (a[1] == 'x' || a[1] == 'X') && a[2] == '\0' &&
            !(flags & OBJ_SET_XX))
        {
            flags |= OBJ_SET_NX;
        } else if ((a[0] == 'x' || a[0] == 'X') &&
                   (a[1] == 'x' || a[1] == 'X') && a[2] == '\0' &&
                   !(flags & OBJ_SET_NX))
        {
            flags |= OBJ_SET_XX;
        } else if ((a[0] == 'e' || a[0] == 'E') &&
                   (a[1] == 'x' || a[1] == 'X') && a[2] == '\0' &&
                   !(flags & OBJ_SET_PX) && next)
        {
            flags |= OBJ_SET_EX;
            unit = UNIT_SECONDS;
            expire = next;
            j++;
        } else if ((a[0] == 'p' || a[0] == 'P') &&
                   (a[1] == 'x' || a[1] == 'X') && a[2] == '\0' &&
                   !(flags & OBJ_SET_EX) && next)
        {
            flags |= OBJ_SET_PX;
            unit = UNIT_MILLISECONDS;
            expire = next;
            j++;
        } else {
            addReply(c,shared.syntaxerr);
            return;
        }
    }

    c->argv[2] = tryObjectEncoding(c->argv[2]);
    setGenericCommand(c,flags,c->argv[1],c->argv[2],expire,unit,NULL,NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl 0x38(%rdi), %eax
cmpl $0x4, %eax
jl 0x4ebfa
xorl %r15d, %r15d
movl $0x3, %r12d
leaq 0xb8872(%rip), %r13     # 0x1072b0
xorl %ebp, %ebp
xorl %r14d, %r14d
movq 0x40(%rbx), %rcx
movslq %r12d, %rdx
decl %eax
cmpl %eax, %edx
jne 0x4ea54
xorl %eax, %eax
jmp 0x4ea59
movq 0x8(%rcx,%rdx,8), %rax
movq (%rcx,%rdx,8), %rcx
movq 0x8(%rcx), %rcx
movzbl (%rcx), %edx
cmpl $0x64, %edx
jg 0x4ea81
cmpl $0x4f, %edx
jg 0x4eac5
cmpl $0x45, %edx
je 0x4eb6e
cmpl $0x4e, %edx
je 0x4ea98
jmp 0x4eb9a
cmpl $0x6f, %edx
jg 0x4ead8
cmpl $0x65, %edx
je 0x4eb6e
cmpl $0x6e, %edx
jne 0x4eb9a
movzbl 0x1(%rcx), %esi
orl $0x20, %esi
cmpl $0x78, %esi
jne 0x4eaeb
cmpb $0x0, 0x2(%rcx)
sete %sil
testb $0x2, %bpl
sete %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x4eaeb
orl $0x1, %ebp
jmp 0x4eb4f
cmpl $0x50, %edx
je 0x4eb88
cmpl $0x58, %edx
je 0x4eb27
jmp 0x4eb9a
cmpl $0x70, %edx
je 0x4eb88
cmpl $0x78, %edx
je 0x4eb27
jmp 0x4eb9a
leal -0x45(%rdx), %esi
cmpl $0x33, %esi
ja 0x4eb9a
movabsq $0x100000001, %rdi      # imm = 0x100000001
btq %rsi, %rdi
jb 0x4eb6e
movabsq $0x80000000800, %rdi    # imm = 0x80000000800
btq %rsi, %rdi
jb 0x4eb88
movabsq $0x8000000080000, %rdi  # imm = 0x8000000080000
btq %rsi, %rdi
jae 0x4eb9a
movzbl 0x1(%rcx), %esi
orl $0x20, %esi
cmpl $0x78, %esi
jne 0x4eb53
cmpb $0x0, 0x2(%rcx)
sete %sil
testb $0x1, %bpl
sete %dil
andb %sil, %dil
cmpb $0x1, %dil
jne 0x4eb53
orl $0x2, %ebp
movb $0x1, %cl
jmp 0x4ebab
cmpl $0x64, %edx
jg 0x4eb64
cmpl $0x45, %edx
je 0x4eb6e
cmpl $0x50, %edx
je 0x4eb88
jmp 0x4eb9a
cmpl $0x70, %edx
je 0x4eb88
cmpl $0x65, %edx
jne 0x4eb9a
movzbl 0x1(%rcx), %esi
orl $0x20, %esi
cmpl $0x78, %esi
jne 0x4eb80
cmpb $0x0, 0x2(%rcx)
je 0x4ebdf
orl $0x20, %edx
cmpl $0x70, %edx
jne 0x4eb9a
movzbl 0x1(%rcx), %edx
orl $0x20, %edx
cmpl $0x78, %edx
jne 0x4eb9a
cmpb $0x0, 0x2(%rcx)
je 0x4ebc4
movq 0x80(%r13), %rsi
movq %rbx, %rdi
callq 0x3fc19
xorl %ecx, %ecx
testb %cl, %cl
je 0x4ec3a
incl %r12d
movl 0x38(%rbx), %eax
cmpl %eax, %r12d
jl 0x4ea43
jmp 0x4ec02
testb $0x4, %bpl
jne 0x4eb9a
testq %rax, %rax
je 0x4eb9a
orl $0x8, %ebp
incl %r12d
movb $0x1, %cl
movl $0x1, %r14d
jmp 0x4ebf5
testb $0x8, %bpl
jne 0x4eb80
testq %rax, %rax
je 0x4eb80
orl $0x4, %ebp
incl %r12d
movb $0x1, %cl
xorl %r14d, %r14d
movq %rax, %r15
jmp 0x4ebab
xorl %r14d, %r14d
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rdi
callq 0x4426d
movq 0x40(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rcx
xorps %xmm0, %xmm0
movups %xmm0, (%rsp)
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %r8
movl %r14d, %r9d
callq 0x4e898
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq