#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*/ adafinal();
int /*<<< orphan*/ adainit();
int call_Littlewood_Richardson_homotopies(int, int, int, int *, int, int, int,
                                          int *);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ printf(char *, ...);
int resolve_Schubert_conditions(int, int, int, int *, int, int *);
int /*<<< orphan*/ scanf(char *, ...);
int main(int argc, char *argv[]) {
  int fail, n, k, c, i, j, r;
  int *brackets;
  int verbose = 0;
  int verify = 0;
  char ans;
  int precision, size;
  printf("\nresolving a general Schubert intersection condition ...\n");
  printf("  give the ambient dimension of the space : ");
  scanf("%d", &n);
  printf("  give the dimension of the solution planes : ");
  scanf("%d", &k);
  printf("  give the number of intersection conditions : ");
  scanf("%d", &c);
  printf("\nreading %d conditions on %d-planes in %d-space ...\n", c, k, n);
  brackets = (int *)calloc(c * k, sizeof(int));
  for (i = 0; i < c; i++) {
    printf("  give %d integers for condition %d : ", k, i + 1);
    for (j = 0; j < k; j++)
      scanf("%d", &brackets[i * k + j]);
  }
  printf("\nthe intersection conditions :\n");
  for (i = 0; i < c; i++) {
    printf("[%d", brackets[i * k]);
    for (j = 1; j < k; j++)
      printf(" %d", brackets[i * k + j]);
    printf("]");
  }
  printf("\n");
  scanf("%c", &ans);
  printf("Run the Littlewood-Richardson homotopies ? (y/n) ");
  scanf("%c", &ans);
  adainit();
  if (ans != 'y')
    fail = resolve_Schubert_conditions(n, k, c, brackets, verbose, &r);
  else {
    printf("\nMENU for the precision : \n");
    printf("  0. standard double precision; \n");
    printf("  1. double double precision; \n");
    printf("  2. quad double precision; \n");
    printf("Type 0, 1, or 2 to select the precision : ");
    scanf("%d", &precision);
    if (precision == 0)
      size = 2 * (c - 2) * n * n;
    if (precision == 1)
      size = 4 * (c - 2) * n * n;
    if (precision == 2)
      size = 8 * (c - 2) * n * n;
    fail = call_Littlewood_Richardson_homotopies(n, k, c, brackets, verbose,
                                                 verify, size, &r);
  }
  printf("The formal root count : %d\n", r);
  adafinal();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf90(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf70(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf50(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%edi
imul   -0x1c(%rbp),%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    12b1 <main+0x141>
mov    -0x1c(%rbp),%esi
mov    -0x24(%rbp),%edx
add    $0x1,%edx
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    129e <main+0x12e>
mov    -0x38(%rbp),%rsi
mov    -0x24(%rbp),%eax
imul   -0x1c(%rbp),%eax
add    -0x28(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    125f <main+0xef>
jmp    12a3 <main+0x133>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1235 <main+0xc5>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1350 <main+0x1e0>
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1334 <main+0x1c4>
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12f8 <main+0x188>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12c6 <main+0x156>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xde7(%rip),%rdi
lea    -0x41(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc7(%rip),%rdi
lea    -0x41(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    $0x0,%al
call   1080 <adainit@plt>
movsbl -0x41(%rbp),%eax
cmp    $0x79,%eax
je     13c6 <main+0x256>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
lea    -0x2c(%rbp),%r9
call   1090 <resolve_Schubert_conditions@plt>
mov    %eax,-0x14(%rbp)
jmp    14a6 <main+0x336>
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd34(%rip),%rdi
lea    -0x48(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
cmpl   $0x0,-0x48(%rbp)
jne    143c <main+0x2cc>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
shl    $0x1,%eax
imul   -0x18(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x1,-0x48(%rbp)
jne    145a <main+0x2ea>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
shl    $0x2,%eax
imul   -0x18(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x2,-0x48(%rbp)
jne    1478 <main+0x308>
mov    -0x20(%rbp),%eax
sub    $0x2,%eax
shl    $0x3,%eax
imul   -0x18(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    -0x40(%rbp),%r9d
mov    -0x4c(%rbp),%r10d
lea    -0x2c(%rbp),%rax
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <call_Littlewood_Richardson_homotopies@plt>
mov    %eax,-0x14(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <adafinal@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xfc7(%rip),%rdi
call   1050 <puts@plt>
lea    0xe4f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf2e(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xe58(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xe6a(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    (%rsp),%esi
mov    0x4(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xe74(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%edi
imul   (%rsp),%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,%r13
cmpl   $0x0,(%rsp)
jle    12bc <main+0x12c>
mov    0x4(%rsp),%esi
lea    0xe78(%rip),%r14
lea    0xe9d(%rip),%r15
xor    %r12d,%r12d
jmp    1266 <main+0xd6>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    (%rsp),%r12d
jge    12bc <main+0x12c>
mov    %r12d,%ebp
lea    0x1(%rbp),%r12d
mov    %r14,%rdi
mov    %r12d,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    1260 <main+0xd0>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
imul   %ebp,%esi
movslq %esi,%rax
add    %rbx,%rax
lea    0x0(,%rax,4),%rsi
add    %r13,%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x4(%rsp),%esi
add    $0x1,%rbx
cmp    %esi,%ebx
jl     1290 <main+0x100>
jmp    1260 <main+0xd0>
lea    0xee2(%rip),%rdi
call   1050 <puts@plt>
cmpl   $0x0,(%rsp)
jle    1345 <main+0x1b5>
lea    0xe13(%rip),%r14
lea    0xe10(%rip),%r15
xor    %ebp,%ebp
jmp    12f2 <main+0x162>
mov    $0x5d,%edi
call   1040 <putchar@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jge    1345 <main+0x1b5>
movslq 0x4(%rsp),%rax
movslq %ebp,%rcx
imul   %rax,%rcx
mov    0x0(%r13,%rcx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
jl     12e0 <main+0x150>
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
imul   %ebp,%eax
cltq
add    %rbx,%rax
mov    0x0(%r13,%rax,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rsp),%eax
add    $0x1,%rbx
cmp    %eax,%ebx
jl     1320 <main+0x190>
jmp    12e0 <main+0x150>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xd9a(%rip),%r14
lea    0xb(%rsp),%rbp
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xd84(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
xor    %eax,%eax
call   10a0 <adainit@plt>
cmpb   $0x79,0xb(%rsp)
jne    13fc <main+0x26c>
lea    0xe2c(%rip),%rdi
call   1050 <puts@plt>
lea    0xe3b(%rip),%rdi
call   1050 <puts@plt>
lea    0xe50(%rip),%rdi
call   1050 <puts@plt>
lea    0xe63(%rip),%rdi
call   1050 <puts@plt>
lea    0xd5d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd17(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    $0x2,%eax
je     1419 <main+0x289>
cmp    $0x1,%eax
jne    1425 <main+0x295>
mov    (%rsp),%edx
lea    -0x8(,%rdx,4),%ecx
jmp    142e <main+0x29e>
mov    0xc(%rsp),%edi
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0x10(%rsp),%r9
mov    %r13,%rcx
xor    %r8d,%r8d
call   10b0 <resolve_Schubert_conditions@plt>
jmp    1457 <main+0x2c7>
mov    (%rsp),%edx
lea    -0x10(,%rdx,8),%ecx
jmp    142e <main+0x29e>
mov    (%rsp),%edx
lea    (%rdx,%rdx,1),%ecx
add    $0xfffffffc,%ecx
mov    0xc(%rsp),%edi
mov    %edi,%eax
imul   %eax,%eax
imul   %ecx,%eax
mov    0x4(%rsp),%esi
lea    0x10(%rsp),%rbp
mov    %r13,%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rbp
push   %rax
call   1030 <call_Littlewood_Richardson_homotopies@plt>
add    $0x10,%rsp
mov    0x10(%rsp),%esi
lea    0xcee(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1080 <adafinal@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [58 x i8] c"\0Aresolving a general Schubert intersection condition ...\0A\00"
@.str.1 = [45 x i8] c" give the ambient dimension of the space : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [47 x i8] c" give the dimension of the solution planes : \00"
@.str.4 = [48 x i8] c" give the number of intersection conditions : \00"
@.str.5 = [53 x i8] c"\0Areading %d conditions on %d-planes in %d-space ...\0A\00"
@.str.6 = [39 x i8] c" give %d integers for condition %d : \00"
@.str.7 = [32 x i8] c"\0Athe intersection conditions :\0A\00"
@.str.8 = [4 x i8] c"[%d\00"
@.str.9 = [4 x i8] c" %d\00"
@.str.10 = [2 x i8] c"]\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [3 x i8] c"%c\00"
@.str.13 = [50 x i8] c"Run the Littlewood-Richardson homotopies ? (y/n) \00"
@.str.14 = [28 x i8] c"\0AMENU for the precision : \0A\00"
@.str.15 = [34 x i8] c" 0. standard double precision; \0A\00"
@.str.16 = [32 x i8] c" 1. double double precision; \0A\00"
@.str.17 = [30 x i8] c" 2. quad double precision; \0A\00"
@.str.18 = [43 x i8] c"Type 0, 1, or 2 to select the precision : \00"
@.str.19 = [28 x i8] c"The formal root count : %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %14
store i32 0, i32* %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %9)
%26 = load i32, i32* %9
%27 = load i32, i32* %8
%28 = load i32, i32* %7
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), i32 %26, i32 %27, i32 %28)
%30 = load i32, i32* %9
%31 = load i32, i32* %8
%32 = mul nsw i32 %30, %31
%33 = call i64 @calloc(i32 %32, i32 4)
%34 = inttoptr i64 %33 to i32*
store i32* %34, i32** %13
store i32 0, i32* %10
br label %35
35: ; preds = %62, %2
%36 = load i32, i32* %10
%37 = load i32, i32* %9
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %65
39: ; preds = %35
%40 = load i32, i32* %8
%41 = load i32, i32* %10
%42 = add nsw i32 %41, 1
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %40, i32 %42)
store i32 0, i32* %11
br label %44
44: ; preds = %58, %39
%45 = load i32, i32* %11
%46 = load i32, i32* %8
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %61
48: ; preds = %44
%49 = load i32*, i32** %13
%50 = load i32, i32* %10
%51 = load i32, i32* %8
%52 = mul nsw i32 %50, %51
%53 = load i32, i32* %11
%54 = add nsw i32 %52, %53
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %49, i64 %55
%57 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %56)
br label %58
58: ; preds = %48
%59 = load i32, i32* %11
%60 = add nsw i32 %59, 1
store i32 %60, i32* %11
br label %44
61: ; preds = %44
br label %62
62: ; preds = %61
%63 = load i32, i32* %10
%64 = add nsw i32 %63, 1
store i32 %64, i32* %10
br label %35
65: ; preds = %35
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %10
br label %67
67: ; preds = %100, %65
%68 = load i32, i32* %10
%69 = load i32, i32* %9
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %103
71: ; preds = %67
%72 = load i32*, i32** %13
%73 = load i32, i32* %10
%74 = load i32, i32* %8
%75 = mul nsw i32 %73, %74
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds i32, i32* %72, i64 %76
%78 = load i32, i32* %77
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %78)
store i32 1, i32* %11
br label %80
80: ; preds = %95, %71
%81 = load i32, i32* %11
%82 = load i32, i32* %8
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %98
84: ; preds = %80
%85 = load i32*, i32** %13
%86 = load i32, i32* %10
%87 = load i32, i32* %8
%88 = mul nsw i32 %86, %87
%89 = load i32, i32* %11
%90 = add nsw i32 %88, %89
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %85, i64 %91
%93 = load i32, i32* %92
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %93)
br label %95
95: ; preds = %84
%96 = load i32, i32* %11
%97 = add nsw i32 %96, 1
store i32 %97, i32* %11
br label %80
98: ; preds = %80
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %100
100: ; preds = %98
%101 = load i32, i32* %10
%102 = add nsw i32 %101, 1
store i32 %102, i32* %10
br label %67
103: ; preds = %67
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%105 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %16)
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.13, i64 0, i64 0))
%107 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %16)
%108 = call i32 (...) @adainit()
%109 = load i8, i8* %16
%110 = sext i8 %109 to i32
%111 = icmp ne i32 %110, 121
br i1 %111, label %112, label %119
112: ; preds = %103
%113 = load i32, i32* %7
%114 = load i32, i32* %8
%115 = load i32, i32* %9
%116 = load i32*, i32** %13
%117 = load i32, i32* %14
%118 = call i32 @resolve_Schubert_conditions(i32 %113, i32 %114, i32 %115, i32* %116, i32 %117, i32* %12)
store i32 %118, i32* %6
br label %167
119: ; preds = %103
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0))
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.17, i64 0, i64 0))
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.18, i64 0, i64 0))
%125 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %17)
%126 = load i32, i32* %17
%127 = icmp eq i32 %126, 0
br i1 %127, label %128, label %136
128: ; preds = %119
%129 = load i32, i32* %9
%130 = sub nsw i32 %129, 2
%131 = mul nsw i32 2, %130
%132 = load i32, i32* %7
%133 = mul nsw i32 %131, %132
%134 = load i32, i32* %7
%135 = mul nsw i32 %133, %134
store i32 %135, i32* %18
br label %136
136: ; preds = %128, %119
%137 = load i32, i32* %17
%138 = icmp eq i32 %137, 1
br i1 %138, label %139, label %147
139: ; preds = %136
%140 = load i32, i32* %9
%141 = sub nsw i32 %140, 2
%142 = mul nsw i32 4, %141
%143 = load i32, i32* %7
%144 = mul nsw i32 %142, %143
%145 = load i32, i32* %7
%146 = mul nsw i32 %144, %145
store i32 %146, i32* %18
br label %147
147: ; preds = %139, %136
%148 = load i32, i32* %17
%149 = icmp eq i32 %148, 2
br i1 %149, label %150, label %158
150: ; preds = %147
%151 = load i32, i32* %9
%152 = sub nsw i32 %151, 2
%153 = mul nsw i32 8, %152
%154 = load i32, i32* %7
%155 = mul nsw i32 %153, %154
%156 = load i32, i32* %7
%157 = mul nsw i32 %155, %156
store i32 %157, i32* %18
br label %158
158: ; preds = %150, %147
%159 = load i32, i32* %7
%160 = load i32, i32* %8
%161 = load i32, i32* %9
%162 = load i32*, i32** %13
%163 = load i32, i32* %14
%164 = load i32, i32* %15
%165 = load i32, i32* %18
%166 = call i32 @call_Littlewood_Richardson_homotopies(i32 %159, i32 %160, i32 %161, i32* %162, i32 %163, i32 %164, i32 %165, i32* %12)
store i32 %166, i32* %6
br label %167
167: ; preds = %158, %112
%168 = load i32, i32* %12
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0), i32 %168)
%170 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [45 x i8] c" give the ambient dimension of the space : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [47 x i8] c" give the dimension of the solution planes : \00"
@.str.4 = [48 x i8] c" give the number of intersection conditions : \00"
@.str.5 = [53 x i8] c"\0Areading %d conditions on %d-planes in %d-space ...\0A\00"
@.str.6 = [39 x i8] c" give %d integers for condition %d : \00"
@.str.8 = [4 x i8] c"[%d\00"
@.str.9 = [4 x i8] c" %d\00"
@.str.12 = [3 x i8] c"%c\00"
@.str.13 = [50 x i8] c"Run the Littlewood-Richardson homotopies ? (y/n) \00"
@.str.18 = [43 x i8] c"Type 0, 1, or 2 to select the precision : \00"
@.str.19 = [28 x i8] c"The formal root count : %d\0A\00"
@str = [57 x i8] c"\0Aresolving a general Schubert intersection condition ...\00"
@str.20 = [31 x i8] c"\0Athe intersection conditions :\00"
@str.21 = [27 x i8] c"\0AMENU for the precision : \00"
@str.22 = [33 x i8] c" 0. standard double precision; \00"
@str.23 = [31 x i8] c" 1. double double precision; \00"
@str.24 = [29 x i8] c" 2. quad double precision; \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast i32* %8 to i8*
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
%25 = load i32, i32* %5
%26 = load i32, i32* %4
%27 = mul nsw i32 %26, %25
%28 = call i64 @calloc(i32 %27, i32 4)
%29 = inttoptr i64 %28 to i32*
%30 = load i32, i32* %5
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %56
32: ; preds = %2
%33 = load i32, i32* %4
br label %38
34: ; preds = %45, %38
%35 = phi i32 [ %43, %38 ], [ %54, %45 ]
%36 = load i32, i32* %5
%37 = icmp slt i32 %41, %36
br i1 %37, label %38, label %56
38: ; preds = %32, %34
%39 = phi i32 [ %35, %34 ], [ %33, %32 ]
%40 = phi i32 [ %41, %34 ], [ 0, %32 ]
%41 = add nuw nsw i32 %40, 1
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %39, i32 %41)
%43 = load i32, i32* %4
%44 = icmp sgt i32 %43, 0
br i1 %44, label %45, label %34
45: ; preds = %38, %45
%46 = phi i32 [ %54, %45 ], [ %43, %38 ]
%47 = phi i32 [ %53, %45 ], [ 0, %38 ]
%48 = mul nsw i32 %46, %40
%49 = add nsw i32 %48, %47
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i32, i32* %29, i64 %50
%52 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %51)
%53 = add nuw nsw i32 %47, 1
%54 = load i32, i32* %4
%55 = icmp slt i32 %53, %54
br i1 %55, label %45, label %34
56: ; preds = %34, %2
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.20, i64 0, i64 0))
%58 = load i32, i32* %5
%59 = icmp sgt i32 %58, 0
br i1 %59, label %60, label %87
60: ; preds = %56, %82
%61 = phi i32 [ %84, %82 ], [ 0, %56 ]
%62 = load i32, i32* %4
%63 = mul nsw i32 %62, %61
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i32, i32* %29, i64 %64
%66 = load i32, i32* %65
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %66)
%68 = load i32, i32* %4
%69 = icmp sgt i32 %68, 1
br i1 %69, label %70, label %82
70: ; preds = %60, %70
%71 = phi i32 [ %80, %70 ], [ %68, %60 ]
%72 = phi i32 [ %79, %70 ], [ 1, %60 ]
%73 = mul nsw i32 %71, %61
%74 = add nsw i32 %73, %72
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i32, i32* %29, i64 %75
%77 = load i32, i32* %76
%78 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %77)
%79 = add nuw nsw i32 %72, 1
%80 = load i32, i32* %4
%81 = icmp slt i32 %79, %80
br i1 %81, label %70, label %82
82: ; preds = %70, %60
%83 = call i32 @putchar(i32 93)
%84 = add nuw nsw i32 %61, 1
%85 = load i32, i32* %5
%86 = icmp slt i32 %84, %85
br i1 %86, label %60, label %87
87: ; preds = %82, %56
%88 = call i32 @putchar(i32 10)
%89 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %7)
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.13, i64 0, i64 0))
%91 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %7)
%92 = call i32 (...) @adainit()
%93 = load i8, i8* %7
%94 = icmp eq i8 %93, 121
br i1 %94, label %100, label %95
95: ; preds = %87
%96 = load i32, i32* %3
%97 = load i32, i32* %4
%98 = load i32, i32* %5
%99 = call i32 @resolve_Schubert_conditions(i32 %96, i32 %97, i32 %98, i32* %29, i32 0, i32* %6)
br label %136
100: ; preds = %87
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.21, i64 0, i64 0))
%102 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.22, i64 0, i64 0))
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.23, i64 0, i64 0))
%104 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.24, i64 0, i64 0))
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.18, i64 0, i64 0))
%106 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %8)
%107 = load i32, i32* %8
switch i32 %107, label %129 [
i32 0, label %108
i32 1, label %115
i32 2, label %122
]
108: ; preds = %100
%109 = load i32, i32* %5
%110 = shl i32 %109, 1
%111 = add i32 %110, -4
%112 = load i32, i32* %3
%113 = mul i32 %112, %112
%114 = mul i32 %113, %111
br label %130
115: ; preds = %100
%116 = load i32, i32* %5
%117 = shl i32 %116, 2
%118 = add i32 %117, -8
%119 = load i32, i32* %3
%120 = mul i32 %119, %119
%121 = mul i32 %120, %118
br label %130
122: ; preds = %100
%123 = load i32, i32* %5
%124 = shl i32 %123, 3
%125 = add i32 %124, -16
%126 = load i32, i32* %3
%127 = mul i32 %126, %126
%128 = mul i32 %127, %125
br label %130
129: ; preds = %100
unreachable
130: ; preds = %115, %108, %122
%131 = phi i32 [ %123, %122 ], [ %109, %108 ], [ %116, %115 ]
%132 = phi i32 [ %126, %122 ], [ %112, %108 ], [ %119, %115 ]
%133 = phi i32 [ %128, %122 ], [ %114, %108 ], [ %121, %115 ]
%134 = load i32, i32* %4
%135 = call i32 @call_Littlewood_Richardson_homotopies(i32 %132, i32 %134, i32 %131, i32* %29, i32 0, i32 0, i32 %133, i32* %6)
br label %136
136: ; preds = %130, %95
%137 = load i32, i32* %6
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0), i32 %137)
%139 = call i32 (...) @adafinal()
ret i32 0
}