#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int syscon_retrieve_standard_term(int, int, int, int *, double *);
int standard_tableau_form(int neq, int nvr, int *nbterms, double *coefficients,
                          int *exponents, int verbose) {
  int wrk[nvr];
  double cff[2];
  int cffidx = 0;
  int expidx = 0;
  int fail, idx, idxtrm, k;
  if (verbose > 0)
    printf("%d\n", neq);
  for (idx = 0; idx < neq; idx++) {
    if (verbose > 0)
      printf("%d\n", nbterms[idx]);
    for (idxtrm = 1; idxtrm <= nbterms[idx]; idxtrm++) {
      fail = syscon_retrieve_standard_term(idx + 1, idxtrm, neq, wrk, cff);
      coefficients[cffidx++] = cff[0];
      coefficients[cffidx++] = cff[1];
      if (verbose > 0) {
        printf("%22.15e  %22.15e", cff[0], cff[1]);
        for (k = 0; k < nvr; k++)
          printf(" %d", wrk[k]);
        printf("\n");
      }
      for (k = 0; k < nvr; k++)
        exponents[expidx++] = wrk[k];
    }
  }
  return fail;
}


x86 assembly (clang, -O0):
<standard_tableau_form>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    118e <standard_tableau_form+0x6e>
mov    -0x4(%rbp),%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x60(%rbp)
mov    -0x60(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1304 <standard_tableau_form+0x1e4>
cmpl   $0x0,-0x24(%rbp)
jle    11c4 <standard_tableau_form+0xa4>
mov    -0x10(%rbp),%rax
movslq -0x60(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x60(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jg     12f1 <standard_tableau_form+0x1d1>
mov    -0x70(%rbp),%rcx
mov    -0x60(%rbp),%edi
add    $0x1,%edi
mov    -0x64(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    -0x50(%rbp),%r8
call   1040 <syscon_retrieve_standard_term@plt>
mov    %eax,-0x5c(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x54(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x48(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x54(%rbp)
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
cmpl   $0x0,-0x24(%rbp)
jle    129d <standard_tableau_form+0x17d>
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
lea    0xdb6(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    128f <standard_tableau_form+0x16f>
mov    -0x70(%rbp),%rax
movslq -0x68(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    125c <standard_tableau_form+0x13c>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x68(%rbp)
mov    -0x68(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12de <standard_tableau_form+0x1be>
mov    -0x70(%rbp),%rax
movslq -0x68(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
mov    -0x58(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x58(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
jmp    12a4 <standard_tableau_form+0x184>
jmp    12e3 <standard_tableau_form+0x1c3>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11cb <standard_tableau_form+0xab>
jmp    12f6 <standard_tableau_form+0x1d6>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    1195 <standard_tableau_form+0x75>
mov    -0x5c(%rbp),%eax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_tableau_form>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r8,-0x78(%rbp)
mov    %rcx,-0x80(%rbp)
mov    %rdx,%r12
mov    %esi,%ebx
mov    %edi,%r14d
mov    %esi,%r13d
mov    %rsp,%r15
lea    0xf(,%r13,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    %r9d,-0x30(%rbp)
test   %r9d,%r9d
jle    1193 <standard_tableau_form+0x53>
lea    0xe77(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    131c <standard_tableau_form+0x1dc>
mov    %ebx,-0x34(%rbp)
lea    0x0(,%r13,4),%rax
mov    %rax,-0x70(%rbp)
mov    %r14d,%eax
mov    %rax,-0x68(%rbp)
xor    %eax,%eax
xor    %ebx,%ebx
xor    %edx,%edx
mov    %r12,-0x48(%rbp)
mov    %r14d,-0x2c(%rbp)
jmp    11e5 <standard_tableau_form+0xa5>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x48(%rbp),%r12
mov    -0x60(%rbp),%rcx
mov    %rcx,%rax
cmp    -0x68(%rbp),%rcx
je     131c <standard_tableau_form+0x1dc>
cmpl   $0x0,-0x30(%rbp)
mov    %rax,-0x40(%rbp)
jle    1213 <standard_tableau_form+0xd3>
mov    -0x40(%rbp),%rax
mov    (%r12,%rax,4),%esi
lea    0xe02(%rip),%rdi
xor    %eax,%eax
mov    %rdx,%r12
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
mov    %r12,%rdx
mov    -0x48(%rbp),%r12
lea    0x1(%rax),%rcx
mov    %rcx,-0x60(%rbp)
cmpl   $0x0,(%r12,%rax,4)
jle    11d4 <standard_tableau_form+0x94>
movslq %edx,%rdx
mov    $0x1,%r12d
jmp    124e <standard_tableau_form+0x10e>
nopl   (%rax)
mov    -0x2c(%rbp),%r14d
mov    -0x40(%rbp),%rsi
add    $0x2,%rdx
lea    0x1(%r12),%eax
mov    -0x48(%rbp),%rcx
cmp    (%rcx,%rsi,4),%r12d
mov    %eax,%r12d
jge    11d0 <standard_tableau_form+0x90>
mov    %rdx,-0x50(%rbp)
mov    -0x60(%rbp),%rdi
mov    %r12d,%esi
mov    %r14d,%edx
mov    %r15,%rcx
lea    -0xa0(%rbp),%r8
call   1050 <syscon_retrieve_standard_term@plt>
mov    -0x50(%rbp),%rdx
mov    %eax,-0x54(%rbp)
movaps -0xa0(%rbp),%xmm0
mov    -0x80(%rbp),%rax
movups %xmm0,(%rax,%rdx,8)
cmpl   $0x0,-0x30(%rbp)
jle    12ec <standard_tableau_form+0x1ac>
mov    %rbx,-0x88(%rbp)
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
lea    0xd68(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x34(%rbp)
lea    0xd67(%rip),%rbx
jle    12d7 <standard_tableau_form+0x197>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r15,%r14,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%r13
jne    12c0 <standard_tableau_form+0x180>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x88(%rbp),%rbx
mov    -0x50(%rbp),%rdx
mov    -0x34(%rbp),%r14d
test   %r14d,%r14d
jle    1230 <standard_tableau_form+0xf0>
movslq %ebx,%rbx
mov    -0x78(%rbp),%rax
lea    (%rax,%rbx,4),%rdi
mov    %r15,%rsi
mov    -0x70(%rbp),%rdx
call   1060 <memcpy@plt>
mov    -0x50(%rbp),%rdx
add    %r14d,%ebx
jmp    1230 <standard_tableau_form+0xf0>
mov    -0x54(%rbp),%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [17 x i8] c"%22.15e %22.15e\00"
@.str.2 = [4 x i8] c" %d\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @standard_tableau_form(i32 %0, i32 %1, i32* %2, double* %3, i32* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca double*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i64
%15 = alloca [2 x double]
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store double* %3, double** %10
store i32* %4, i32** %11
store i32 %5, i32* %12
%22 = load i32, i32* %8
%23 = zext i32 %22 to i64
%24 = call i8* @llvm.stacksave()
store i8* %24, i8** %13
%25 = alloca i32, i64 %23
store i64 %23, i64* %14
store i32 0, i32* %16
store i32 0, i32* %17
%26 = load i32, i32* %12
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %6
%29 = load i32, i32* %7
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28, %6
store i32 0, i32* %19
br label %32
32: ; preds = %122, %31
%33 = load i32, i32* %19
%34 = load i32, i32* %7
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %125
36: ; preds = %32
%37 = load i32, i32* %12
%38 = icmp sgt i32 %37, 0
br i1 %38, label %39, label %46
39: ; preds = %36
%40 = load i32*, i32** %9
%41 = load i32, i32* %19
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %40, i64 %42
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %44)
br label %46
46: ; preds = %39, %36
store i32 1, i32* %20
br label %47
47: ; preds = %118, %46
%48 = load i32, i32* %20
%49 = load i32*, i32** %9
%50 = load i32, i32* %19
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %49, i64 %51
%53 = load i32, i32* %52
%54 = icmp sle i32 %48, %53
br i1 %54, label %55, label %121
55: ; preds = %47
%56 = load i32, i32* %19
%57 = add nsw i32 %56, 1
%58 = load i32, i32* %20
%59 = load i32, i32* %7
%60 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 0, i64 0
%61 = call i32 @syscon_retrieve_standard_term(i32 %57, i32 %58, i32 %59, i32* %25, double* %60)
store i32 %61, i32* %18
%62 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 0, i64 0
%63 = load double, double* %62
%64 = load double*, double** %10
%65 = load i32, i32* %16
%66 = add nsw i32 %65, 1
store i32 %66, i32* %16
%67 = sext i32 %65 to i64
%68 = getelementptr inbounds double, double* %64, i64 %67
store double %63, double* %68
%69 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 0, i64 1
%70 = load double, double* %69
%71 = load double*, double** %10
%72 = load i32, i32* %16
%73 = add nsw i32 %72, 1
store i32 %73, i32* %16
%74 = sext i32 %72 to i64
%75 = getelementptr inbounds double, double* %71, i64 %74
store double %70, double* %75
%76 = load i32, i32* %12
%77 = icmp sgt i32 %76, 0
br i1 %77, label %78, label %99
78: ; preds = %55
%79 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 0, i64 0
%80 = load double, double* %79
%81 = getelementptr inbounds [2 x double], [2 x double]* %15, i64 0, i64 1
%82 = load double, double* %81
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %80, double %82)
store i32 0, i32* %21
br label %84
84: ; preds = %94, %78
%85 = load i32, i32* %21
%86 = load i32, i32* %8
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %97
88: ; preds = %84
%89 = load i32, i32* %21
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i32, i32* %25, i64 %90
%92 = load i32, i32* %91
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %92)
br label %94
94: ; preds = %88
%95 = load i32, i32* %21
%96 = add nsw i32 %95, 1
store i32 %96, i32* %21
br label %84
97: ; preds = %84
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %99
99: ; preds = %97, %55
store i32 0, i32* %21
br label %100
100: ; preds = %114, %99
%101 = load i32, i32* %21
%102 = load i32, i32* %8
%103 = icmp slt i32 %101, %102
br i1 %103, label %104, label %117
104: ; preds = %100
%105 = load i32, i32* %21
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i32, i32* %25, i64 %106
%108 = load i32, i32* %107
%109 = load i32*, i32** %11
%110 = load i32, i32* %17
%111 = add nsw i32 %110, 1
store i32 %111, i32* %17
%112 = sext i32 %110 to i64
%113 = getelementptr inbounds i32, i32* %109, i64 %112
store i32 %108, i32* %113
br label %114
114: ; preds = %104
%115 = load i32, i32* %21
%116 = add nsw i32 %115, 1
store i32 %116, i32* %21
br label %100
117: ; preds = %100
br label %118
118: ; preds = %117
%119 = load i32, i32* %20
%120 = add nsw i32 %119, 1
store i32 %120, i32* %20
br label %47
121: ; preds = %47
br label %122
122: ; preds = %121
%123 = load i32, i32* %19
%124 = add nsw i32 %123, 1
store i32 %124, i32* %19
br label %32
125: ; preds = %32
%126 = load i32, i32* %18
%127 = load i8*, i8** %13
ret i32 %126
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [17 x i8] c"%22.15e %22.15e\00"
@.str.2 = [4 x i8] c" %d\00"
define i32 @standard_tableau_form(i32 %0, i32 %1, i32* nocapture %2, double* nocapture writeonly %3, i32* nocapture writeonly %4, i32 %5) {
%7 = alloca <2 x double>
%8 = zext i32 %1 to i64
%9 = alloca i32, i64 %8
%10 = bitcast i32* %9 to i8*
%11 = bitcast <2 x double>* %7 to i8*
%12 = icmp sgt i32 %5, 0
br i1 %12, label %13, label %15
13: ; preds = %6
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %15
15: ; preds = %13, %6
%16 = icmp sgt i32 %0, 0
br i1 %16, label %17, label %79
17: ; preds = %15
%18 = getelementptr inbounds <2 x double>, <2 x double>* %7, i64 0, i64 0
%19 = icmp sgt i32 %1, 0
%20 = shl nuw nsw i64 %8, 2
%21 = zext i32 %0 to i64
br label %22
22: ; preds = %17, %74
%23 = phi i64 [ 0, %17 ], [ %35, %74 ]
%24 = phi i32 [ undef, %17 ], [ %77, %74 ]
%25 = phi i32 [ 0, %17 ], [ %76, %74 ]
%26 = phi i32 [ 0, %17 ], [ %75, %74 ]
br i1 %12, label %27, label %31
27: ; preds = %22
%28 = getelementptr inbounds i32, i32* %2, i64 %23
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %27, %22
%32 = getelementptr inbounds i32, i32* %2, i64 %23
%33 = load i32, i32* %32
%34 = icmp slt i32 %33, 1
%35 = add nuw nsw i64 %23, 1
br i1 %34, label %74, label %36
36: ; preds = %31
%37 = sext i32 %26 to i64
%38 = trunc i64 %35 to i32
br label %39
39: ; preds = %36, %67
%40 = phi i64 [ %37, %36 ], [ %46, %67 ]
%41 = phi i32 [ 1, %36 ], [ %69, %67 ]
%42 = phi i32 [ %25, %36 ], [ %68, %67 ]
%43 = call i32 @syscon_retrieve_standard_term(i32 %38, i32 %41, i32 %0, i32* %9, double* %18)
%44 = getelementptr inbounds double, double* %3, i64 %40
%45 = load <2 x double>, <2 x double>* %7
%46 = add nsw i64 %40, 2
%47 = bitcast double* %44 to <2 x double>*
store <2 x double> %45, <2 x double>* %47
br i1 %12, label %48, label %61
48: ; preds = %39
%49 = extractelement <2 x double> %45, i64 0
%50 = extractelement <2 x double> %45, i64 1
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %49, double %50)
br i1 %19, label %52, label %59
52: ; preds = %48, %52
%53 = phi i64 [ %57, %52 ], [ 0, %48 ]
%54 = getelementptr inbounds i32, i32* %9, i64 %53
%55 = load i32, i32* %54
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %55)
%57 = add nuw nsw i64 %53, 1
%58 = icmp eq i64 %57, %8
br i1 %58, label %59, label %52
59: ; preds = %52, %48
%60 = call i32 @putchar(i32 10)
br label %61
61: ; preds = %59, %39
br i1 %19, label %62, label %67
62: ; preds = %61
%63 = sext i32 %42 to i64
%64 = getelementptr i32, i32* %4, i64 %63
%65 = bitcast i32* %64 to i8*
%66 = add i32 %42, %1
br label %67
67: ; preds = %62, %61
%68 = phi i32 [ %42, %61 ], [ %66, %62 ]
%69 = add nuw nsw i32 %41, 1
%70 = load i32, i32* %32
%71 = icmp slt i32 %41, %70
br i1 %71, label %39, label %72
72: ; preds = %67
%73 = trunc i64 %46 to i32
br label %74
74: ; preds = %31, %72
%75 = phi i32 [ %73, %72 ], [ %26, %31 ]
%76 = phi i32 [ %68, %72 ], [ %25, %31 ]
%77 = phi i32 [ %43, %72 ], [ %24, %31 ]
%78 = icmp eq i64 %35, %21
br i1 %78, label %79, label %22
79: ; preds = %74, %15
%80 = phi i32 [ undef, %15 ], [ %77, %74 ]
ret i32 %80
}