// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxUnixAZ.c
// Function: Hax_TimeCmd
int
Hax_TimeCmd(
    ClientData clientData,		/* Unix ClientData */
    Hax_Interp *interp,			/* Current interpreter. */
    int argc,				/* Number of arguments. */
    char **argv				/* Argument strings. */)
{
    long long int count, i, result;
    double timePer;
    struct timeval start, stop;
    struct timezone tz;
    int micros;

    if (argc == 2) {
	count = 1;
    } else if (argc == 3) {
	if (Hax_GetLongLong(interp, argv[2], &count) != HAX_OK) {
	    return HAX_ERROR;
	}
    } else {
	Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		" command ?count?\"", (char *) NULL);
	return HAX_ERROR;
    }
    gettimeofday(&start, &tz);
    for (i = count ; i > 0; i--) {
	result = Hax_Eval(interp, NULL, argv[1], 0, (char **) NULL);
	if (result != HAX_OK) {
	    if (result == HAX_ERROR) {
		char msg[60];
		sprintf(msg, "\n    (\"time\" body line %d)",
			interp->errorLine);
		Hax_AddErrorInfo(interp, msg);
	    }
	    return result;
	}
    }
    gettimeofday(&stop, &tz);
    micros = (stop.tv_sec - start.tv_sec)*1000000
	    + (stop.tv_usec - start.tv_usec);
    timePer = micros;

    Hax_ResetResult(interp);
    sprintf(interp->result, "%.0f microseconds per iteration", timePer/count);
    return HAX_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
cmpl $0x2, -0x1c(%rbp)
jne 0x807a
movq $0x1, -0x30(%rbp)
jmp 0x80db
cmpl $0x3, -0x1c(%rbp)
jne 0x80a8
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x30(%rbp), %rdx
callq 0x35c0
cmpl $0x0, %eax
je 0x80a6
movl $0x1, -0x4(%rbp)
jmp 0x81d3
jmp 0x80d9
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
leaq 0x3089(%rip), %rsi      # 0xb143
leaq 0x3610(%rip), %rcx      # 0xb6d1
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x3510
movl $0x1, -0x4(%rbp)
jmp 0x81d3
jmp 0x80db
leaq -0x58(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3230
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jle 0x816b
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
xorl %eax, %eax
movl %eax, %r8d
xorl %ecx, %ecx
movq %r8, %rsi
callq 0x3590
cltq
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x815b
cmpq $0x1, -0x40(%rbp)
jne 0x8152
leaq -0xb0(%rbp), %rdi
movq -0x18(%rbp), %rax
movl 0x10(%rax), %edx
leaq 0x35a8(%rip), %rsi      # 0xb6e3
movb $0x0, %al
callq 0x35a0
movq -0x18(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x3400
movq -0x40(%rbp), %rax
movl %eax, -0x4(%rbp)
jmp 0x81d3
jmp 0x815d
movq -0x38(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x80f0
leaq -0x68(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x3230
movq -0x68(%rbp), %rax
subq -0x58(%rbp), %rax
imulq $0xf4240, %rax, %rax    # imm = 0xF4240
movq -0x60(%rbp), %rcx
subq -0x50(%rbp), %rcx
addq %rcx, %rax
movl %eax, -0x74(%rbp)
cvtsi2sdl -0x74(%rbp), %xmm0
movsd %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3270
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movsd -0x48(%rbp), %xmm0
cvtsi2sdq -0x30(%rbp), %xmm1
divsd %xmm1, %xmm0
leaq 0x3539(%rip), %rsi      # 0xb6fe
movb $0x1, %al
callq 0x35a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nop