// File: /workspace/github_c_makefile_star2_O2/haxlang[P]hax/haxCmdIL.c
// Function: Hax_IfCmd
int
Hax_IfCmd(
    ClientData dummy,			/* Not used. */
    Hax_Interp *interp,			/* Current interpreter. */
    int argc,				/* Number of arguments. */
    char **argv				/* Argument strings. */)
{
    int i, result, value;

    i = 1;
    while (1) {
	/*
	 * At this point in the loop, argv and argc refer to an expression
	 * to test, either for the main expression or an expression
	 * following an "elseif".  The arguments after the expression must
	 * be "then" (optional) and a script to execute if the expression is
	 * true.
	 */

	if (i >= argc) {
	    Hax_AppendResult(interp, "wrong # args: no expression after \"",
		    argv[i-1], "\" argument", (char *) NULL);
	    return HAX_ERROR;
	}
	result = Hax_ExprBoolean(interp, argv[i], &value);
	if (result != HAX_OK) {
	    return result;
	}
	i++;
	if ((i < argc) && (strcmp(argv[i], "then") == 0)) {
	    i++;
	}
	if (i >= argc) {
	    Hax_AppendResult(interp, "wrong # args: no script following \"",
		    argv[i-1], "\" argument", (char *) NULL);
	    return HAX_ERROR;
	}
	if (value) {
	    return Hax_Eval(interp, NULL, argv[i], 0, (char **) NULL);
	}

	/*
	 * The expression evaluated to false.  Skip the command, then
	 * see if there is an "else" or "elseif" clause.
	 */

	i++;
	if (i >= argc) {
	    return HAX_OK;
	}
	if ((argv[i][0] == 'e') && (strcmp(argv[i], "elseif") == 0)) {
	    i++;
	    continue;
	}
	break;
    }

    /*
     * Couldn't find a "then" or "elseif" clause to execute.  Check now
     * for an "else" clause.  We know that there's at least one more
     * argument when we get here.
     */

    if (strcmp(argv[i], "else") == 0) {
	i++;
	if (i >= argc) {
	    Hax_AppendResult(interp,
		    "wrong # args: no script following \"else\" argument",
		    (char *) NULL);
	    return HAX_ERROR;
	}
    }
    return Hax_Eval(interp, NULL, argv[i], 0, (char **) NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movl %edx, %ebp
movq %rsi, %rbx
pushq $0x1
popq %r12
leaq 0x4(%rsp), %r15
movslq %r12d, %rax
cmpl %ebp, %r12d
jge 0x7f0c
movq (%r14,%rax,8), %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x4670
testl %eax, %eax
jne 0x7f5c
leal 0x1(%r12), %r13d
cmpl %ebp, %r13d
jge 0x7e97
movslq %r13d, %rax
movq (%r14,%rax,8), %rdi
leaq 0xbcc9(%rip), %rsi      # 0x13b50
callq 0x4330
testl %eax, %eax
jne 0x7e97
addl $0x2, %r12d
movl %r12d, %r13d
cmpl %ebp, %r13d
jge 0x7f1a
cmpl $0x0, 0x4(%rsp)
jne 0x7f42
leal 0x1(%r13), %eax
cmpl %ebp, %eax
jge 0x7f5a
cltq
movq (%r14,%rax,8), %r12
cmpb $0x65, (%r12)
jne 0x7edf
movq %r12, %rdi
leaq 0xbcaf(%rip), %rsi      # 0x13b79
callq 0x4330
testl %eax, %eax
jne 0x7edf
addl $0x2, %r13d
movl %r13d, %r12d
jmp 0x7e4c
leaq 0xbc9a(%rip), %rsi      # 0x13b80
movq %r12, %rdi
callq 0x4330
testl %eax, %eax
jne 0x7f02
addl $0x2, %r13d
cmpl %ebp, %r13d
jge 0x7f6b
movslq %r13d, %rax
movq (%r14,%rax,8), %r12
movq %rbx, %rdi
xorl %esi, %esi
movq %r12, %rdx
jmp 0x7f4e
movq -0x8(%r14,%rax,8), %rdx
leaq 0xbc14(%rip), %rsi      # 0x13b2c
jmp 0x7f29
movslq %r13d, %rax
movq -0x8(%r14,%rax,8), %rdx
leaq 0xbc2c(%rip), %rsi      # 0x13b55
leaq 0xbc7c(%rip), %rcx      # 0x13bac
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4520
pushq $0x1
popq %rax
jmp 0x7f5c
movslq %r13d, %rax
movq (%r14,%rax,8), %rdx
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45d0
jmp 0x7f5c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbc13(%rip), %rsi      # 0x13b85
movq %rbx, %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x4520
jmp 0x7f3d