// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x280(%rax), %rax
movq %rax, -0x38(%rbp)
cmpl $0x4, -0x1c(%rbp)
je 0x9aa8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
leaq 0x13eeb(%rip), %rsi     # 0x1d974
leaq 0x14070(%rip), %rcx     # 0x1db00
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x4500
movl $0x1, -0x4(%rbp)
jmp 0x9be5
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x3c(%rbp), %rdx
leaq -0x50(%rbp), %rcx
callq 0x4520
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x9ad5
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x9be5
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x9bb7
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x50(%rbp), %rax
movslq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
xorl %ecx, %ecx
callq 0x4450
cmpq $0x0, %rax
jne 0x9b2d
movq -0x18(%rbp), %rdi
leaq 0x13fff(%rip), %rsi     # 0x1db17
xorl %eax, %eax
movl %eax, %edx
callq 0x44e0
movl $0x1, -0x44(%rbp)
jmp 0x9bb7
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
xorl %eax, %eax
movl %eax, %r8d
xorl %ecx, %ecx
movq %r8, %rsi
callq 0x45b0
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x9ba7
cmpl $0x4, -0x44(%rbp)
jne 0x9b60
movl $0x0, -0x44(%rbp)
jmp 0x9ba5
cmpl $0x3, -0x44(%rbp)
jne 0x9b6f
movl $0x0, -0x44(%rbp)
jmp 0x9bb7
cmpl $0x1, -0x44(%rbp)
jne 0x9ba3
leaq -0xc0(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0x13fa8(%rip), %rsi     # 0x1db32
movb $0x0, %al
callq 0x45d0
movq -0x18(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x43f0
jmp 0x9bb7
jmp 0x9bb7
jmp 0x9ba7
jmp 0x9ba9
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x9adc
movq -0x38(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq 0x13e1e(%rip), %rdx     # 0x1d9e4
movl $0x259, %ecx            # imm = 0x259
callq 0x4260
cmpl $0x0, -0x44(%rbp)
jne 0x9bdf
movq -0x18(%rbp), %rdi
callq 0x42b0
movl -0x44(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)