// File: /workspace/github_c_makefile_star2_O1/haxlang[P]hax/haxCmdAH.c
// Function: Hax_ForeachCmd
int
Hax_ForeachCmd(
    ClientData dummy,			/* Not used. */
    Hax_Interp *interp,			/* Current interpreter. */
    int argc,				/* Number of arguments. */
    char **argv				/* Argument strings. */)
{
    Interp *iPtr = (Interp *) interp;
    Hax_Memoryp *memoryp = iPtr->memoryp;
    int listArgc, i, result;
    char **listArgv;

    if (argc != 4) {
	Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		" varName list command\"", (char *) NULL);
	return HAX_ERROR;
    }

    /*
     * Break the list up into elements, and execute the command once
     * for each value of the element.
     */

    result = Hax_SplitList(interp, argv[2], &listArgc, &listArgv);
    if (result != HAX_OK) {
	return result;
    }
    for (i = 0; i < listArgc; i++) {
	if (Hax_SetVar(interp, argv[1], listArgv[i], 0) == NULL) {
	    Hax_SetResult(interp, (char *) "couldn't set loop variable",
		    HAX_STATIC);
	    result = HAX_ERROR;
	    break;
	}

	result = Hax_Eval(interp, NULL, argv[3], 0, (char **) NULL);
	if (result != HAX_OK) {
	    if (result == HAX_CONTINUE) {
		result = HAX_OK;
	    } else if (result == HAX_BREAK) {
		result = HAX_OK;
		break;
	    } else if (result == HAX_ERROR) {
		char msg[100];
		sprintf(msg, "\n    (\"foreach\" body line %d)",
			interp->errorLine);
		Hax_AddErrorInfo(interp, msg);
		break;
	    } else {
		break;
	    }
	}
    }
    ckfree(memoryp, (char *) listArgv);
    if (result == HAX_OK) {
	Hax_ResetResult(interp);
    }
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r15
movq %rsi, %rbx
cmpl $0x4, %edx
jne 0x7f5c
movq 0x280(%rbx), %r14
movq 0x10(%r15), %rsi
leaq 0x4(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
callq 0x4520
movl %eax, %r12d
testl %eax, %eax
jne 0x7f80
cmpl $0x0, 0x4(%rsp)
jle 0x7f92
xorl %r13d, %r13d
leaq 0xd8ce(%rip), %rbp      # 0x157d8
movq 0x8(%r15), %rsi
movq 0x8(%rsp), %rax
movq (%rax,%r13,8), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x4450
testq %rax, %rax
je 0x7f97
movq 0x18(%r15), %rdx
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45b0
cmpl $0x4, %eax
ja 0x7faa
movl %eax, %ecx
movslq (%rbp,%rcx,4), %rcx
addq %rbp, %rcx
jmpq *%rcx
incq %r13
movslq 0x4(%rsp), %rax
cmpq %rax, %r13
jl 0x7f0a
jmp 0x7fd9
movq (%r15), %rdx
leaq 0xd90e(%rip), %rsi      # 0x15874
leaq 0xda93(%rip), %rcx      # 0x15a00
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4500
movl $0x1, %r12d
movl %r12d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
jmp 0x7fd9
leaq 0xda79(%rip), %rsi      # 0x15a17
movq %rbx, %rdi
xorl %edx, %edx
callq 0x44e0
jmp 0x7fd3
movl %eax, %r12d
jmp 0x7fd9
movl 0x10(%rbx), %edx
leaq 0xda79(%rip), %rsi      # 0x15a32
leaq 0x10(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x45d0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4400
movl $0x1, %r12d
movq 0x8(%rsp), %rsi
leaq 0xd8ff(%rip), %rdx      # 0x158e4
movq %r14, %rdi
movl $0x259, %ecx            # imm = 0x259
callq 0x4280
testl %r12d, %r12d
jne 0x7f80
movq %rbx, %rdi
callq 0x42d0
jmp 0x7f80