#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*/ _ada_phc_solver(int, int, int *, int, int *, int, double *);
int /*<<< orphan*/ adafinal();
int /*<<< orphan*/ adainit();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
void read_data_system(int n, int m, int monsum, int moncnt[m]) {
  int dimsup = n * monsum;
  int dimcff = 2 * monsum;
  int sup[dimsup];
  double cff[dimcff];
  int i, j, k, indsup, indcff;
  indsup = 0;
  indcff = 0;
  for (i = 0; i < m; i++) {
    printf("Reading the support and coefficients");
    printf(" of polynomial %d ...\n", i + 1);
    for (j = 0; j < moncnt[i]; j++) {
      printf("  give exponents of monomial %d : ", j + 1);
      for (k = 0; k < n; k++)
        scanf("%d", &sup[indsup++]);
      printf("  give two doubles : ");
      scanf("%lf", &cff[indcff++]);
      scanf("%lf", &cff[indcff++]);
    }
  }
  adainit();
  _ada_phc_solver(n, m, moncnt, dimsup, sup, dimcff, cff);
  adafinal();
}


x86 assembly (clang, -O0):
<read_data_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
add    %eax,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12f4 <read_data_system+0x1a4>
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%esi
add    $0x1,%esi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    -0x18(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jge    12e1 <read_data_system+0x191>
mov    -0x40(%rbp),%esi
add    $0x1,%esi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1279 <read_data_system+0x129>
mov    -0x60(%rbp),%rsi
mov    -0x48(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x48(%rbp)
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1239 <read_data_system+0xe9>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%rsi
mov    -0x4c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4c(%rbp)
cltq
shl    $0x3,%rax
add    %rax,%rsi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x58(%rbp),%rsi
mov    -0x4c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4c(%rbp)
cltq
shl    $0x3,%rax
add    %rax,%rsi
lea    0xdac(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    120a <read_data_system+0xba>
jmp    12e6 <read_data_system+0x196>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11d5 <read_data_system+0x85>
mov    $0x0,%al
call   1070 <adainit@plt>
mov    -0x60(%rbp),%r8
mov    -0x58(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r9d
sub    $0x10,%rsp
mov    %rax,(%rsp)
call   1030 <_ada_phc_solver@plt>
add    $0x10,%rsp
mov    $0x0,%al
call   1050 <adafinal@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data_system>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rcx,-0x40(%rbp)
mov    %edx,%eax
mov    %edi,-0x2c(%rbp)
imul   %edi,%eax
add    %edx,%edx
mov    %rax,-0x68(%rbp)
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rcx
sub    %rax,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rsp,%rcx
mov    %rdx,-0x70(%rbp)
lea    0x0(,%rdx,8),%rax
sub    %rax,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %esi,-0x30(%rbp)
test   %esi,%esi
jle    12d6 <read_data_system+0x186>
mov    -0x30(%rbp),%eax
mov    %rax,-0x78(%rbp)
mov    -0x2c(%rbp),%r12d
neg    %r12d
lea    0xe9a(%rip),%r14
xor    %eax,%eax
xor    %r13d,%r13d
movl   $0x0,-0x34(%rbp)
jmp    11ee <read_data_system+0x9e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0x50(%rbp),%rax
cmp    -0x78(%rbp),%rax
je     12d6 <read_data_system+0x186>
mov    %rax,%rbx
lea    0xe08(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%rbx),%rsi
lea    0xe1b(%rip),%rdi
mov    %rsi,-0x50(%rbp)
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
mov    %rbx,-0x80(%rbp)
cmpl   $0x0,(%rax,%rbx,4)
jle    11e0 <read_data_system+0x90>
movslq %r13d,%r13
xor    %ebx,%ebx
jmp    1281 <read_data_system+0x131>
nopw   0x0(%rax,%rax,1)
lea    0xe2b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x60(%rbp),%rbx
lea    (%rbx,%r13,8),%rsi
lea    0xe2b(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    (%rbx,%r13,8),%rsi
add    $0x8,%rsi
add    $0x2,%r13
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    -0x40(%rbp),%rax
mov    -0x80(%rbp),%rcx
mov    -0x44(%rbp),%ebx
cmp    (%rax,%rcx,4),%ebx
jge    11e0 <read_data_system+0x90>
add    $0x1,%ebx
lea    0xdb1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
mov    %ebx,-0x44(%rbp)
jle    1230 <read_data_system+0xe0>
mov    %r13,%rbx
movslq -0x34(%rbp),%rax
mov    -0x58(%rbp),%rcx
lea    (%rcx,%rax,4),%r13
xor    %r15d,%r15d
nop
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
add    $0x4,%r13
add    $0xffffffff,%r15d
cmp    %r15d,%r12d
jne    12b0 <read_data_system+0x160>
sub    %r15d,-0x34(%rbp)
mov    %rbx,%r13
jmp    1230 <read_data_system+0xe0>
xor    %eax,%eax
call   1070 <adainit@plt>
sub    $0x8,%rsp
mov    -0x2c(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x58(%rbp),%r8
mov    -0x70(%rbp),%r9
push   -0x60(%rbp)
call   1030 <_ada_phc_solver@plt>
add    $0x10,%rsp
xor    %eax,%eax
call   1050 <adafinal@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Reading the support and coefficients\00"
@.str.1 = [23 x i8] c" of polynomial %d ...\0A\00"
@.str.2 = [35 x i8] c" give exponents of monomial %d : \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [22 x i8] c" give two doubles : \00"
@.str.5 = [4 x i8] c"%lf\00"
define void @read_data_system(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%19 = load i32, i32* %6
%20 = zext i32 %19 to i64
%21 = load i32, i32* %5
%22 = load i32, i32* %7
%23 = mul nsw i32 %21, %22
store i32 %23, i32* %9
%24 = load i32, i32* %7
%25 = mul nsw i32 2, %24
store i32 %25, i32* %10
%26 = load i32, i32* %9
%27 = zext i32 %26 to i64
%28 = call i8* @llvm.stacksave()
store i8* %28, i8** %11
%29 = alloca i32, i64 %27
store i64 %27, i64* %12
%30 = load i32, i32* %10
%31 = zext i32 %30 to i64
%32 = alloca double, i64 %31
store i64 %31, i64* %13
store i32 0, i32* %17
store i32 0, i32* %18
store i32 0, i32* %14
br label %33
33: ; preds = %83, %4
%34 = load i32, i32* %14
%35 = load i32, i32* %6
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %86
37: ; preds = %33
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%39 = load i32, i32* %14
%40 = add nsw i32 %39, 1
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %40)
store i32 0, i32* %15
br label %42
42: ; preds = %79, %37
%43 = load i32, i32* %15
%44 = load i32*, i32** %8
%45 = load i32, i32* %14
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i32, i32* %44, i64 %46
%48 = load i32, i32* %47
%49 = icmp slt i32 %43, %48
br i1 %49, label %50, label %82
50: ; preds = %42
%51 = load i32, i32* %15
%52 = add nsw i32 %51, 1
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %52)
store i32 0, i32* %16
br label %54
54: ; preds = %64, %50
%55 = load i32, i32* %16
%56 = load i32, i32* %5
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %67
58: ; preds = %54
%59 = load i32, i32* %17
%60 = add nsw i32 %59, 1
store i32 %60, i32* %17
%61 = sext i32 %59 to i64
%62 = getelementptr inbounds i32, i32* %29, i64 %61
%63 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %62)
br label %64
64: ; preds = %58
%65 = load i32, i32* %16
%66 = add nsw i32 %65, 1
store i32 %66, i32* %16
br label %54
67: ; preds = %54
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%69 = load i32, i32* %18
%70 = add nsw i32 %69, 1
store i32 %70, i32* %18
%71 = sext i32 %69 to i64
%72 = getelementptr inbounds double, double* %32, i64 %71
%73 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double* %72)
%74 = load i32, i32* %18
%75 = add nsw i32 %74, 1
store i32 %75, i32* %18
%76 = sext i32 %74 to i64
%77 = getelementptr inbounds double, double* %32, i64 %76
%78 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double* %77)
br label %79
79: ; preds = %67
%80 = load i32, i32* %15
%81 = add nsw i32 %80, 1
store i32 %81, i32* %15
br label %42
82: ; preds = %42
br label %83
83: ; preds = %82
%84 = load i32, i32* %14
%85 = add nsw i32 %84, 1
store i32 %85, i32* %14
br label %33
86: ; preds = %33
%87 = call i32 (...) @adainit()
%88 = load i32, i32* %5
%89 = load i32, i32* %6
%90 = load i32*, i32** %8
%91 = load i32, i32* %9
%92 = load i32, i32* %10
%93 = call i32 @_ada_phc_solver(i32 %88, i32 %89, i32* %90, i32 %91, i32* %29, i32 %92, double* %32)
%94 = call i32 (...) @adafinal()
%95 = load i8*, i8** %11
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Reading the support and coefficients\00"
@.str.1 = [23 x i8] c" of polynomial %d ...\0A\00"
@.str.2 = [35 x i8] c" give exponents of monomial %d : \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [22 x i8] c" give two doubles : \00"
@.str.5 = [4 x i8] c"%lf\00"
define void @read_data_system(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = mul nsw i32 %2, %0
%6 = shl nsw i32 %2, 1
%7 = zext i32 %5 to i64
%8 = alloca i32, i64 %7
%9 = zext i32 %6 to i64
%10 = alloca double, i64 %9
%11 = icmp sgt i32 %1, 0
br i1 %11, label %12, label %63
12: ; preds = %4
%13 = icmp sgt i32 %0, 0
%14 = zext i32 %1 to i64
br label %21
15: ; preds = %52
%16 = trunc i64 %58 to i32
br label %17
17: ; preds = %15, %21
%18 = phi i32 [ %24, %21 ], [ %53, %15 ]
%19 = phi i32 [ %23, %21 ], [ %16, %15 ]
%20 = icmp eq i64 %26, %14
br i1 %20, label %63, label %21
21: ; preds = %12, %17
%22 = phi i64 [ 0, %12 ], [ %26, %17 ]
%23 = phi i32 [ 0, %12 ], [ %19, %17 ]
%24 = phi i32 [ 0, %12 ], [ %18, %17 ]
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%26 = add nuw nsw i64 %22, 1
%27 = trunc i64 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds i32, i32* %3, i64 %22
%30 = load i32, i32* %29
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %17
32: ; preds = %21
%33 = sext i32 %23 to i64
br label %34
34: ; preds = %32, %52
%35 = phi i64 [ %33, %32 ], [ %58, %52 ]
%36 = phi i32 [ %24, %32 ], [ %53, %52 ]
%37 = phi i32 [ 0, %32 ], [ %38, %52 ]
%38 = add nuw nsw i32 %37, 1
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %38)
br i1 %13, label %40, label %52
40: ; preds = %34
%41 = sext i32 %36 to i64
br label %42
42: ; preds = %40, %42
%43 = phi i64 [ %41, %40 ], [ %45, %42 ]
%44 = phi i32 [ 0, %40 ], [ %48, %42 ]
%45 = add nsw i64 %43, 1
%46 = getelementptr inbounds i32, i32* %8, i64 %43
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %46)
%48 = add nuw nsw i32 %44, 1
%49 = icmp eq i32 %48, %0
br i1 %49, label %50, label %42
50: ; preds = %42
%51 = trunc i64 %45 to i32
br label %52
52: ; preds = %50, %34
%53 = phi i32 [ %36, %34 ], [ %51, %50 ]
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%55 = add nsw i64 %35, 1
%56 = getelementptr inbounds double, double* %10, i64 %35
%57 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double* %56)
%58 = add nsw i64 %35, 2
%59 = getelementptr inbounds double, double* %10, i64 %55
%60 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double* %59)
%61 = load i32, i32* %29
%62 = icmp slt i32 %38, %61
br i1 %62, label %34, label %15
63: ; preds = %17, %4
%64 = call i32 (...) @adainit()
%65 = call i32 @_ada_phc_solver(i32 %0, i32 %1, i32* %3, i32 %5, i32* %8, i32 %6, double* %10)
%66 = call i32 (...) @adafinal()
ret void
}