#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 _ada_use_c2phc(int, int *, int *, double *);
int /*<<< orphan*/ printf(char *, ...);
int solcon_write_standard_solutions();
int syscon_write_standard_system();
int read_witness_set(int *n, int *dim, int *deg) {
  int fail, m;
  double *c;
  int d[2];
  fail = _ada_use_c2phc(41, n, d, c);
  *dim = d[0];
  *deg = d[1];
  if (0 > 0)
    printf("The ambient dimension is %d.\n", *n);
  if (0 > 0)
    printf("The dimension of the solution set is %d.\n", d[0]);
  if (0 > 0)
    printf("The degree of the solution set is %d.\n", d[1]);
  if (0 > 1) {
    printf("The embedded system :\n");
    fail = syscon_write_standard_system();
  }
  if (0 > 1) {
    printf("The following solutions are in container :\n");
    fail = solcon_write_standard_solutions();
  }
  return fail;
}


x86 assembly (clang, -O0):
<read_witness_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x29,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x30(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_witness_set>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%rdx
mov    $0x29,%edi
call   1030 <_ada_use_c2phc@plt>
mov    (%rsp),%ecx
mov    %ecx,(%rbx)
mov    0x4(%rsp),%ecx
mov    %ecx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @read_witness_set(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca [2 x i32]
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%11 = load i32*, i32** %4
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%13 = load double*, double** %9
%14 = call i32 @_ada_use_c2phc(i32 41, i32* %11, i32* %12, double* %13)
store i32 %14, i32* %7
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%16 = load i32, i32* %15
%17 = load i32*, i32** %5
store i32 %16, i32* %17
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
store i32 %19, i32* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @read_witness_set(i32* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%7 = call i32 @_ada_use_c2phc(i32 41, i32* %0, i32* %6, double* undef)
%8 = load i32, i32* %6
store i32 %8, i32* %1
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
%10 = load i32, i32* %9
store i32 %10, i32* %2
ret i32 %7
}