// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x38(%rdi), %eax
leal -0x1(%rax), %edx
movq 0x40(%rdi), %rcx
pushq $0x3
popq %rsi
xorl %r14d, %r14d
pushq $0x1
popq %rdi
xorl %ebp, %ebp
xorl %r15d, %r15d
cmpl %eax, %esi
jge 0x4354e
movslq %esi, %r9
cmpl %edx, %esi
jne 0x433f2
xorl %r8d, %r8d
jmp 0x433f7
movq 0x8(%rcx,%r9,8), %r8
movq (%rcx,%r9,8), %r9
movq 0x8(%r9), %r9
movzbl (%r9), %r10d
cmpl $0x45, %r10d
je 0x434c8
cmpl $0x4e, %r10d
je 0x43447
cmpl $0x50, %r10d
je 0x434e4
cmpl $0x58, %r10d
je 0x4348e
cmpl $0x65, %r10d
je 0x434c8
cmpl $0x78, %r10d
je 0x4348e
cmpl $0x70, %r10d
je 0x434e4
cmpl $0x6e, %r10d
jne 0x4352c
movzbl 0x1(%r9), %r11d
orl $0x20, %r11d
cmpl $0x78, %r11d
jne 0x43478
cmpb $0x0, 0x2(%r9)
sete %r11b
testb $0x2, %bpl
sete %r12b
andb %r11b, %r12b
cmpb $0x1, %r12b
jne 0x43478
orl $0x1, %ebp
jmp 0x43510
cmpl $0x50, %r10d
je 0x434e4
cmpl $0x65, %r10d
je 0x434c8
cmpl $0x58, %r10d
jne 0x4352c
movzbl 0x1(%r9), %r11d
orl $0x20, %r11d
cmpl $0x78, %r11d
jne 0x434bc
cmpb $0x0, 0x2(%r9)
sete %r11b
testb $0x1, %bpl
sete %r12b
andb %r11b, %r12b
cmpb $0x1, %r12b
jne 0x434bc
orl $0x2, %ebp
jmp 0x43510
cmpl $0x70, %r10d
je 0x434e4
cmpl $0x65, %r10d
jne 0x4352c
movzbl 0x1(%r9), %r11d
orl $0x20, %r11d
cmpl $0x78, %r11d
jne 0x434de
cmpb $0x0, 0x2(%r9)
je 0x43517
cmpl $0x50, %r10d
jne 0x4352c
movzbl 0x1(%r9), %r10d
orl $0x20, %r10d
cmpl $0x78, %r10d
jne 0x4352c
cmpb $0x0, 0x2(%r9)
jne 0x4352c
testb $0x4, %bpl
jne 0x4352c
testq %r8, %r8
je 0x4352c
orl $0x8, %ebp
incl %esi
movl %edi, %r14d
movq %r8, %r15
incl %esi
jmp 0x433de
testb $0x8, %bpl
jne 0x434de
testq %r8, %r8
je 0x434de
orl $0x4, %ebp
incl %esi
xorl %r14d, %r14d
jmp 0x4350d
leaq 0xb6ddd(%rip), %rax     # 0xfa310
movq 0x80(%rax), %rsi
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x36987
movq 0x10(%rcx), %rdi
callq 0x3a3ad
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 0x43248
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq