// File: /workspace/github_c_makefile_star2_O3/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 0x7dab
movq 0x280(%rbx), %r14
movq 0x10(%r15), %rsi
leaq 0x4(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
callq 0x4530
movl %eax, %ebp
testl %eax, %eax
jne 0x7dce
cmpl $0x0, 0x4(%rsp)
jle 0x7d86
xorl %r12d, %r12d
leaq 0xca95(%rip), %r13      # 0x147c4
movq 0x8(%r15), %rsi
movq 0x8(%rsp), %rax
movq (%rax,%r12,8), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x4460
testq %rax, %rax
je 0x7ddf
movq 0x18(%r15), %rdx
movq %rbx, %rdi
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x45c0
movl %eax, %ebp
cmpl $0x4, %eax
ja 0x7df2
movl %ebp, %eax
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
incq %r12
movslq 0x4(%rsp), %rax
cmpq %rax, %r12
jl 0x7d2f
movq 0x8(%rsp), %rsi
leaq 0xcb3e(%rip), %rdx      # 0x148d0
movq %r14, %rdi
movl $0x259, %ecx            # imm = 0x259
callq 0x4280
movq %rbx, %rdi
callq 0x42d0
xorl %ebp, %ebp
jmp 0x7dce
movq (%r15), %rdx
leaq 0xcaab(%rip), %rsi      # 0x14860
leaq 0xcc30(%rip), %rcx      # 0x149ec
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4510
movl $0x1, %ebp
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xcc1d(%rip), %rsi      # 0x14a03
movq %rbx, %rdi
xorl %edx, %edx
callq 0x44f0
jmp 0x7e31
movq 0x8(%rsp), %rsi
leaq 0xcad2(%rip), %rdx      # 0x148d0
movq %r14, %rdi
movl $0x259, %ecx            # imm = 0x259
callq 0x4280
jmp 0x7dce
movl 0x10(%rbx), %edx
leaq 0xcc07(%rip), %rsi      # 0x14a1e
leaq 0x10(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x45e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4410
movq 0x8(%rsp), %rsi
leaq 0xca93(%rip), %rdx      # 0x148d0
movq %r14, %rdi
movl $0x259, %ecx            # imm = 0x259
callq 0x4280
jmp 0x7dc9