// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0xa651
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x135b4(%rip), %rsi     # 0x1dbe6
leaq 0x1362d(%rip), %rcx     # 0x1dc66
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x4500
movl $0x1, -0x4(%rbp)
jmp 0xa7f4
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x34(%rbp), %rdx
callq 0x4640
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0xa67e
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xa7f4
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0xa6b5
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x13568(%rip), %rsi     # 0x1dc0a
callq 0x4300
cmpl $0x0, %eax
jne 0xa6b5
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0xa6f8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x13536(%rip), %rsi     # 0x1dc0f
leaq 0x13586(%rip), %rcx     # 0x1dc66
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x4500
movl $0x1, -0x4(%rbp)
jmp 0xa7f4
cmpl $0x0, -0x34(%rbp)
je 0xa725
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
xorl %eax, %eax
movl %eax, %r8d
xorl %ecx, %ecx
movq %r8, %rsi
callq 0x45b0
movl %eax, -0x4(%rbp)
jmp 0xa7f4
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0xa742
movl $0x0, -0x4(%rbp)
jmp 0xa7f4
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x65, %eax
jne 0xa781
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x134ca(%rip), %rsi     # 0x1dc33
callq 0x4300
cmpl $0x0, %eax
jne 0xa781
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xa60e
jmp 0xa783
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x134a4(%rip), %rsi     # 0x1dc3a
callq 0x4300
cmpl $0x0, %eax
jne 0xa7d2
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0xa7d0
movq -0x18(%rbp), %rdi
leaq 0x13483(%rip), %rsi     # 0x1dc3f
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0x4500
movl $0x1, -0x4(%rbp)
jmp 0xa7f4
jmp 0xa7d2
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
xorl %eax, %eax
movl %eax, %r8d
xorl %ecx, %ecx
movq %r8, %rsi
callq 0x45b0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)