#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);
int solve_standard_system(int *root_count, int silent, int *nrcs, char *rocos,
                          int nbtasks, int mvfocus, int vrb) {
  int fail, i;
  int a[2];
  int b[1024];
  double *c;
  b[0] = silent;
  b[1] = nbtasks;
  b[2] = mvfocus;
  fail = _ada_use_c2phc(77, a, b, c, vrb);
  *root_count = a[0];
  if (silent == 0) {
    *nrcs = a[1];
    for (i = 0; i < (*nrcs); i++)
      rocos[i] = (char)b[i];
    rocos[*nrcs] = '\0';
  }
  return fail;
}


x86 assembly (clang, -O0):
<solve_standard_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1050,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1040(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x103c(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x1038(%rbp)
lea    -0x38(%rbp),%rsi
lea    -0x1040(%rbp),%rdx
mov    -0x1048(%rbp),%rcx
mov    0x10(%rbp),%r8d
mov    $0x4d,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x38(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0xc(%rbp)
jne    11da <solve_standard_system+0xca>
mov    -0x34(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    11cb <solve_standard_system+0xbb>
movslq -0x30(%rbp),%rax
mov    -0x1040(%rbp,%rax,4),%eax
mov    %al,%dl
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1196 <solve_standard_system+0x86>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x1050,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_standard_system>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1018,%rsp
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r15
mov    0x1040(%rsp),%eax
mov    %esi,0x10(%rsp)
mov    %r8d,0x14(%rsp)
mov    %r9d,0x18(%rsp)
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0x4d,%edi
mov    %eax,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    0x8(%rsp),%ecx
mov    %ecx,(%r15)
test   %ebp,%ebp
jne    118d <solve_standard_system+0x7d>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
test   %ecx,%ecx
jle    1185 <solve_standard_system+0x75>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl 0x10(%rsp,%rdx,4),%ecx
mov    %cl,(%r14,%rdx,1)
add    $0x1,%rdx
movslq (%rbx),%rcx
cmp    %rcx,%rdx
jl     1170 <solve_standard_system+0x60>
movslq %ecx,%rcx
movb   $0x0,(%r14,%rcx,1)
add    $0x1018,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @solve_standard_system(i32* %0, i32 %1, i32* %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [2 x i32]
%18 = alloca [1024 x i32]
%19 = alloca double*
store i32* %0, i32** %8
store i32 %1, i32* %9
store i32* %2, i32** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%20 = load i32, i32* %9
%21 = getelementptr inbounds [1024 x i32], [1024 x i32]* %18, i64 0, i64 0
store i32 %20, i32* %21
%22 = load i32, i32* %12
%23 = getelementptr inbounds [1024 x i32], [1024 x i32]* %18, i64 0, i64 1
store i32 %22, i32* %23
%24 = load i32, i32* %13
%25 = getelementptr inbounds [1024 x i32], [1024 x i32]* %18, i64 0, i64 2
store i32 %24, i32* %25
%26 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 0
%27 = getelementptr inbounds [1024 x i32], [1024 x i32]* %18, i64 0, i64 0
%28 = load double*, double** %19
%29 = load i32, i32* %14
%30 = call i32 @_ada_use_c2phc(i32 77, i32* %26, i32* %27, double* %28, i32 %29)
store i32 %30, i32* %15
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 0
%32 = load i32, i32* %31
%33 = load i32*, i32** %8
store i32 %32, i32* %33
%34 = load i32, i32* %9
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %64
36: ; preds = %7
%37 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 1
%38 = load i32, i32* %37
%39 = load i32*, i32** %10
store i32 %38, i32* %39
store i32 0, i32* %16
br label %40
40: ; preds = %55, %36
%41 = load i32, i32* %16
%42 = load i32*, i32** %10
%43 = load i32, i32* %42
%44 = icmp slt i32 %41, %43
br i1 %44, label %45, label %58
45: ; preds = %40
%46 = load i32, i32* %16
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [1024 x i32], [1024 x i32]* %18, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %11
%52 = load i32, i32* %16
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %51, i64 %53
store i8 %50, i8* %54
br label %55
55: ; preds = %45
%56 = load i32, i32* %16
%57 = add nsw i32 %56, 1
store i32 %57, i32* %16
br label %40
58: ; preds = %40
%59 = load i8*, i8** %11
%60 = load i32*, i32** %10
%61 = load i32, i32* %60
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %59, i64 %62
store i8 0, i8* %63
br label %64
64: ; preds = %58, %7
%65 = load i32, i32* %15
ret i32 %65
}

LLVM IR (-O2):
define i32 @solve_standard_system(i32* nocapture writeonly %0, i32 %1, i32* nocapture %2, i8* nocapture writeonly %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca [2 x i32]
%9 = alloca [1024 x i32]
%10 = bitcast [2 x i32]* %8 to i8*
%11 = bitcast [1024 x i32]* %9 to i8*
%12 = getelementptr inbounds [1024 x i32], [1024 x i32]* %9, i64 0, i64 0
store i32 %1, i32* %12
%13 = getelementptr inbounds [1024 x i32], [1024 x i32]* %9, i64 0, i64 1
store i32 %4, i32* %13
%14 = getelementptr inbounds [1024 x i32], [1024 x i32]* %9, i64 0, i64 2
store i32 %5, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 0
%16 = call i32 @_ada_use_c2phc(i32 77, i32* %15, i32* %12, double* undef, i32 %6)
%17 = load i32, i32* %15
store i32 %17, i32* %0
%18 = icmp eq i32 %1, 0
br i1 %18, label %19, label %37
19: ; preds = %7
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%21 = load i32, i32* %20
store i32 %21, i32* %2
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %33
23: ; preds = %19, %23
%24 = phi i64 [ %29, %23 ], [ 0, %19 ]
%25 = getelementptr inbounds [1024 x i32], [1024 x i32]* %9, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = trunc i32 %26 to i8
%28 = getelementptr inbounds i8, i8* %3, i64 %24
store i8 %27, i8* %28
%29 = add nuw nsw i64 %24, 1
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = icmp slt i64 %29, %31
br i1 %32, label %23, label %33
33: ; preds = %23, %19
%34 = phi i32 [ %21, %19 ], [ %30, %23 ]
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %3, i64 %35
store i8 0, i8* %36
br label %37
37: ; preds = %33, %7
ret i32 %16
}