#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, int, int, int *);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ prompt_for_options(int *, int *, int *);
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;
  int minrep = 1;
  int tosquare = 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;
    prompt_for_options(&verify, &minrep, &tosquare);
    fail = call_Littlewood_Richardson_homotopies(n, k, c, brackets, precision,
                                                 verbose, verify, minrep,
                                                 tosquare, size, &r);
  }
  printf("The formal root count : %d\n", r);
  adafinal();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
movl   $0x0,-0x14(%rbp)
mov    %edi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
movl   $0x1,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf6c(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf4c(%rip),%rdi
lea    -0x2c(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf2c(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0x30(%rbp),%esi
mov    -0x2c(%rbp),%edx
mov    -0x28(%rbp),%ecx
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x30(%rbp),%edi
imul   -0x2c(%rbp),%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    12d5 <main+0x155>
mov    -0x2c(%rbp),%esi
mov    -0x34(%rbp),%edx
add    $0x1,%edx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12c2 <main+0x142>
mov    -0x48(%rbp),%rsi
mov    -0x34(%rbp),%eax
imul   -0x2c(%rbp),%eax
add    -0x38(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1283 <main+0x103>
jmp    12c7 <main+0x147>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1259 <main+0xd9>
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1374 <main+0x1f4>
mov    -0x48(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1358 <main+0x1d8>
mov    -0x48(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    131c <main+0x19c>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12ea <main+0x16a>
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdc3(%rip),%rdi
lea    -0x59(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xdb4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xda3(%rip),%rdi
lea    -0x59(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    $0x0,%al
call   1090 <adainit@plt>
movsbl -0x59(%rbp),%eax
cmp    $0x79,%eax
je     13ea <main+0x26a>
mov    -0x28(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x48(%rbp),%rcx
mov    -0x4c(%rbp),%r8d
lea    -0x3c(%rbp),%r9
call   10a0 <resolve_Schubert_conditions@plt>
mov    %eax,-0x24(%rbp)
jmp    14f4 <main+0x374>
lea    0xd90(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd10(%rip),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
cmpl   $0x0,-0x60(%rbp)
jne    1460 <main+0x2e0>
mov    -0x30(%rbp),%eax
sub    $0x2,%eax
shl    $0x1,%eax
imul   -0x28(%rbp),%eax
imul   -0x28(%rbp),%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x1,-0x60(%rbp)
jne    147e <main+0x2fe>
mov    -0x30(%rbp),%eax
sub    $0x2,%eax
shl    $0x2,%eax
imul   -0x28(%rbp),%eax
imul   -0x28(%rbp),%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x2,-0x60(%rbp)
jne    149c <main+0x31c>
mov    -0x30(%rbp),%eax
sub    $0x2,%eax
shl    $0x3,%eax
imul   -0x28(%rbp),%eax
imul   -0x28(%rbp),%eax
mov    %eax,-0x64(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1040 <prompt_for_options@plt>
mov    -0x28(%rbp),%edi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x48(%rbp),%rcx
mov    -0x60(%rbp),%r8d
mov    -0x4c(%rbp),%r9d
mov    -0x50(%rbp),%r14d
mov    -0x54(%rbp),%ebx
mov    -0x58(%rbp),%r11d
mov    -0x64(%rbp),%r10d
lea    -0x3c(%rbp),%rax
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <call_Littlewood_Richardson_homotopies@plt>
mov    %eax,-0x24(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xd2a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1070 <adafinal@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movl   $0x0,0x20(%rsp)
movl   $0x1,0x1c(%rsp)
movl   $0x0,0x18(%rsp)
lea    0xf9f(%rip),%rdi
call   1060 <puts@plt>
lea    0xe27(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xf06(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <scanf@plt>
lea    0xe30(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <scanf@plt>
lea    0xe42(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <scanf@plt>
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x10(%rsp),%ecx
lea    0xe49(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rsp),%edi
imul   0x4(%rsp),%edi
mov    $0x4,%esi
call   1080 <calloc@plt>
mov    %rax,%r12
cmpl   $0x0,0x4(%rsp)
jle    12d5 <main+0x135>
mov    0x8(%rsp),%esi
lea    0xe4f(%rip),%r14
lea    0xe74(%rip),%r13
xor    %r15d,%r15d
jmp    1287 <main+0xe7>
xchg   %ax,%ax
cmp    0x4(%rsp),%r15d
jge    12d5 <main+0x135>
mov    %r15d,%ebp
lea    0x1(%rbp),%r15d
mov    %r14,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rsp),%esi
test   %esi,%esi
jle    1280 <main+0xe0>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
imul   %ebp,%esi
movslq %esi,%rax
add    %rbx,%rax
lea    (%r12,%rax,4),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   10a0 <scanf@plt>
mov    0x8(%rsp),%esi
add    $0x1,%rbx
cmp    %esi,%ebx
jl     12b0 <main+0x110>
jmp    1280 <main+0xe0>
lea    0xec9(%rip),%rdi
call   1060 <puts@plt>
cmpl   $0x0,0x4(%rsp)
jle    1364 <main+0x1c4>
lea    0xdf9(%rip),%r14
lea    0xdf6(%rip),%r15
xor    %ebx,%ebx
jmp    1313 <main+0x173>
nopw   0x0(%rax,%rax,1)
mov    $0x5d,%edi
call   1040 <putchar@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jge    1364 <main+0x1c4>
movslq 0x8(%rsp),%rax
movslq %ebx,%rcx
imul   %rax,%rcx
mov    (%r12,%rcx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rsp),%eax
cmp    $0x2,%eax
jl     1300 <main+0x160>
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
imul   %ebx,%eax
cltq
add    %rbp,%rax
mov    (%r12,%rax,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rsp),%eax
add    $0x1,%rbp
cmp    %eax,%ebp
jl     1340 <main+0x1a0>
jmp    1300 <main+0x160>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xd7b(%rip),%rbx
lea    0xf(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
lea    0xd65(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
xor    %eax,%eax
call   10b0 <adainit@plt>
cmpb   $0x79,0xf(%rsp)
jne    141e <main+0x27e>
lea    0xe0d(%rip),%rdi
call   1060 <puts@plt>
lea    0xe1c(%rip),%rdi
call   1060 <puts@plt>
lea    0xe31(%rip),%rdi
call   1060 <puts@plt>
lea    0xe44(%rip),%rdi
call   1060 <puts@plt>
lea    0xd3e(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xcf8(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   10a0 <scanf@plt>
mov    0x14(%rsp),%eax
cmp    $0x2,%eax
je     143c <main+0x29c>
cmp    $0x1,%eax
je     1449 <main+0x2a9>
test   %eax,%eax
jne    145e <main+0x2be>
mov    0x4(%rsp),%eax
add    %eax,%eax
add    $0xfffffffc,%eax
jmp    1454 <main+0x2b4>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
lea    0x24(%rsp),%r9
mov    %r12,%rcx
xor    %r8d,%r8d
call   10c0 <resolve_Schubert_conditions@plt>
jmp    14af <main+0x30f>
mov    0x4(%rsp),%eax
lea    -0x10(,%rax,8),%eax
jmp    1454 <main+0x2b4>
mov    0x4(%rsp),%eax
lea    -0x8(,%rax,4),%eax
mov    0x10(%rsp),%ebx
imul   %ebx,%ebx
imul   %eax,%ebx
lea    0x20(%rsp),%rdi
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
call   1050 <prompt_for_options@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    0x14(%rsp),%r8d
mov    0x20(%rsp),%r10d
mov    0x1c(%rsp),%ebp
mov    0x18(%rsp),%eax
sub    $0x8,%rsp
lea    0x2c(%rsp),%r11
mov    %r12,%rcx
xor    %r9d,%r9d
push   %r11
push   %rbx
push   %rax
push   %rbp
push   %r10
call   1030 <call_Littlewood_Richardson_homotopies@plt>
add    $0x30,%rsp
mov    0x24(%rsp),%esi
lea    0xc96(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   1090 <adafinal@plt>
xor    %eax,%eax
add    $0x28,%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 i32
%17 = alloca i32
%18 = alloca i8
%19 = alloca i32
%20 = 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
store i32 1, i32* %16
store i32 0, i32* %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, 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* %7)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, 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* %8)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %9)
%28 = load i32, i32* %9
%29 = load i32, i32* %8
%30 = load i32, i32* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), i32 %28, i32 %29, i32 %30)
%32 = load i32, i32* %9
%33 = load i32, i32* %8
%34 = mul nsw i32 %32, %33
%35 = call i64 @calloc(i32 %34, i32 4)
%36 = inttoptr i64 %35 to i32*
store i32* %36, i32** %13
store i32 0, i32* %10
br label %37
37: ; preds = %64, %2
%38 = load i32, i32* %10
%39 = load i32, i32* %9
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %67
41: ; preds = %37
%42 = load i32, i32* %8
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 1
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %42, i32 %44)
store i32 0, i32* %11
br label %46
46: ; preds = %60, %41
%47 = load i32, i32* %11
%48 = load i32, i32* %8
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %63
50: ; preds = %46
%51 = load i32*, i32** %13
%52 = load i32, i32* %10
%53 = load i32, i32* %8
%54 = mul nsw i32 %52, %53
%55 = load i32, i32* %11
%56 = add nsw i32 %54, %55
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %51, i64 %57
%59 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %58)
br label %60
60: ; preds = %50
%61 = load i32, i32* %11
%62 = add nsw i32 %61, 1
store i32 %62, i32* %11
br label %46
63: ; preds = %46
br label %64
64: ; preds = %63
%65 = load i32, i32* %10
%66 = add nsw i32 %65, 1
store i32 %66, i32* %10
br label %37
67: ; preds = %37
%68 = 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 %69
69: ; preds = %102, %67
%70 = load i32, i32* %10
%71 = load i32, i32* %9
%72 = icmp slt i32 %70, %71
br i1 %72, label %73, label %105
73: ; preds = %69
%74 = load i32*, i32** %13
%75 = load i32, i32* %10
%76 = load i32, i32* %8
%77 = mul nsw i32 %75, %76
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds i32, i32* %74, i64 %78
%80 = load i32, i32* %79
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %80)
store i32 1, i32* %11
br label %82
82: ; preds = %97, %73
%83 = load i32, i32* %11
%84 = load i32, i32* %8
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %100
86: ; preds = %82
%87 = load i32*, i32** %13
%88 = load i32, i32* %10
%89 = load i32, i32* %8
%90 = mul nsw i32 %88, %89
%91 = load i32, i32* %11
%92 = add nsw i32 %90, %91
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i32, i32* %87, i64 %93
%95 = load i32, i32* %94
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %95)
br label %97
97: ; preds = %86
%98 = load i32, i32* %11
%99 = add nsw i32 %98, 1
store i32 %99, i32* %11
br label %82
100: ; preds = %82
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %102
102: ; preds = %100
%103 = load i32, i32* %10
%104 = add nsw i32 %103, 1
store i32 %104, i32* %10
br label %69
105: ; preds = %69
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, 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* %18)
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.13, i64 0, i64 0))
%109 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %18)
%110 = call i32 (...) @adainit()
%111 = load i8, i8* %18
%112 = sext i8 %111 to i32
%113 = icmp ne i32 %112, 121
br i1 %113, label %114, label %121
114: ; preds = %105
%115 = load i32, i32* %7
%116 = load i32, i32* %8
%117 = load i32, i32* %9
%118 = load i32*, i32** %13
%119 = load i32, i32* %14
%120 = call i32 @resolve_Schubert_conditions(i32 %115, i32 %116, i32 %117, i32* %118, i32 %119, i32* %12)
store i32 %120, i32* %6
br label %173
121: ; preds = %105
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0))
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0))
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.16, i64 0, i64 0))
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.17, i64 0, i64 0))
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.18, i64 0, i64 0))
%127 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %19)
%128 = load i32, i32* %19
%129 = icmp eq i32 %128, 0
br i1 %129, label %130, label %138
130: ; preds = %121
%131 = load i32, i32* %9
%132 = sub nsw i32 %131, 2
%133 = mul nsw i32 2, %132
%134 = load i32, i32* %7
%135 = mul nsw i32 %133, %134
%136 = load i32, i32* %7
%137 = mul nsw i32 %135, %136
store i32 %137, i32* %20
br label %138
138: ; preds = %130, %121
%139 = load i32, i32* %19
%140 = icmp eq i32 %139, 1
br i1 %140, label %141, label %149
141: ; preds = %138
%142 = load i32, i32* %9
%143 = sub nsw i32 %142, 2
%144 = mul nsw i32 4, %143
%145 = load i32, i32* %7
%146 = mul nsw i32 %144, %145
%147 = load i32, i32* %7
%148 = mul nsw i32 %146, %147
store i32 %148, i32* %20
br label %149
149: ; preds = %141, %138
%150 = load i32, i32* %19
%151 = icmp eq i32 %150, 2
br i1 %151, label %152, label %160
152: ; preds = %149
%153 = load i32, i32* %9
%154 = sub nsw i32 %153, 2
%155 = mul nsw i32 8, %154
%156 = load i32, i32* %7
%157 = mul nsw i32 %155, %156
%158 = load i32, i32* %7
%159 = mul nsw i32 %157, %158
store i32 %159, i32* %20
br label %160
160: ; preds = %152, %149
%161 = call i32 @prompt_for_options(i32* %15, i32* %16, i32* %17)
%162 = load i32, i32* %7
%163 = load i32, i32* %8
%164 = load i32, i32* %9
%165 = load i32*, i32** %13
%166 = load i32, i32* %19
%167 = load i32, i32* %14
%168 = load i32, i32* %15
%169 = load i32, i32* %16
%170 = load i32, i32* %17
%171 = load i32, i32* %20
%172 = call i32 @call_Littlewood_Richardson_homotopies(i32 %162, i32 %163, i32 %164, i32* %165, i32 %166, i32 %167, i32 %168, i32 %169, i32 %170, i32 %171, i32* %12)
store i32 %172, i32* %6
br label %173
173: ; preds = %160, %114
%174 = load i32, i32* %12
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0), i32 %174)
%176 = 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 i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca i32
%12 = bitcast i32* %3 to i8*
%13 = bitcast i32* %4 to i8*
%14 = bitcast i32* %5 to i8*
%15 = bitcast i32* %6 to i8*
%16 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%17 = bitcast i32* %8 to i8*
store i32 1, i32* %8
%18 = bitcast i32* %9 to i8*
store i32 0, i32* %9
%19 = bitcast i32* %11 to i8*
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%27 = load i32, i32* %5
%28 = load i32, i32* %4
%29 = load i32, i32* %3
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.5, i64 0, i64 0), i32 %27, i32 %28, i32 %29)
%31 = load i32, i32* %5
%32 = load i32, i32* %4
%33 = mul nsw i32 %32, %31
%34 = call i64 @calloc(i32 %33, i32 4)
%35 = inttoptr i64 %34 to i32*
%36 = load i32, i32* %5
%37 = icmp sgt i32 %36, 0
br i1 %37, label %38, label %62
38: ; preds = %2
%39 = load i32, i32* %4
br label %44
40: ; preds = %51, %44
%41 = phi i32 [ %49, %44 ], [ %60, %51 ]
%42 = load i32, i32* %5
%43 = icmp slt i32 %47, %42
br i1 %43, label %44, label %62
44: ; preds = %38, %40
%45 = phi i32 [ %41, %40 ], [ %39, %38 ]
%46 = phi i32 [ %47, %40 ], [ 0, %38 ]
%47 = add nuw nsw i32 %46, 1
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0), i32 %45, i32 %47)
%49 = load i32, i32* %4
%50 = icmp sgt i32 %49, 0
br i1 %50, label %51, label %40
51: ; preds = %44, %51
%52 = phi i32 [ %60, %51 ], [ %49, %44 ]
%53 = phi i32 [ %59, %51 ], [ 0, %44 ]
%54 = mul nsw i32 %52, %46
%55 = add nsw i32 %54, %53
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i32, i32* %35, i64 %56
%58 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %57)
%59 = add nuw nsw i32 %53, 1
%60 = load i32, i32* %4
%61 = icmp slt i32 %59, %60
br i1 %61, label %51, label %40
62: ; preds = %40, %2
%63 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.20, i64 0, i64 0))
%64 = load i32, i32* %5
%65 = icmp sgt i32 %64, 0
br i1 %65, label %66, label %93
66: ; preds = %62, %88
%67 = phi i32 [ %90, %88 ], [ 0, %62 ]
%68 = load i32, i32* %4
%69 = mul nsw i32 %68, %67
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i32, i32* %35, i64 %70
%72 = load i32, i32* %71
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %72)
%74 = load i32, i32* %4
%75 = icmp sgt i32 %74, 1
br i1 %75, label %76, label %88
76: ; preds = %66, %76
%77 = phi i32 [ %86, %76 ], [ %74, %66 ]
%78 = phi i32 [ %85, %76 ], [ 1, %66 ]
%79 = mul nsw i32 %77, %67
%80 = add nsw i32 %79, %78
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i32, i32* %35, i64 %81
%83 = load i32, i32* %82
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %83)
%85 = add nuw nsw i32 %78, 1
%86 = load i32, i32* %4
%87 = icmp slt i32 %85, %86
br i1 %87, label %76, label %88
88: ; preds = %76, %66
%89 = call i32 @putchar(i32 93)
%90 = add nuw nsw i32 %67, 1
%91 = load i32, i32* %5
%92 = icmp slt i32 %90, %91
br i1 %92, label %66, label %93
93: ; preds = %88, %62
%94 = call i32 @putchar(i32 10)
%95 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %10)
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.13, i64 0, i64 0))
%97 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i8* %10)
%98 = call i32 (...) @adainit()
%99 = load i8, i8* %10
%100 = icmp eq i8 %99, 121
br i1 %100, label %106, label %101
101: ; preds = %93
%102 = load i32, i32* %3
%103 = load i32, i32* %4
%104 = load i32, i32* %5
%105 = call i32 @resolve_Schubert_conditions(i32 %102, i32 %103, i32 %104, i32* %35, i32 0, i32* %6)
br label %146
106: ; preds = %93
%107 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.21, i64 0, i64 0))
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.22, i64 0, i64 0))
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.23, i64 0, i64 0))
%110 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.24, i64 0, i64 0))
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.18, i64 0, i64 0))
%112 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %11)
%113 = load i32, i32* %11
switch i32 %113, label %135 [
i32 0, label %114
i32 1, label %121
i32 2, label %128
]
114: ; preds = %106
%115 = load i32, i32* %5
%116 = shl i32 %115, 1
%117 = add i32 %116, -4
%118 = load i32, i32* %3
%119 = mul i32 %118, %118
%120 = mul i32 %119, %117
br label %135
121: ; preds = %106
%122 = load i32, i32* %5
%123 = shl i32 %122, 2
%124 = add i32 %123, -8
%125 = load i32, i32* %3
%126 = mul i32 %125, %125
%127 = mul i32 %126, %124
br label %135
128: ; preds = %106
%129 = load i32, i32* %5
%130 = shl i32 %129, 3
%131 = add i32 %130, -16
%132 = load i32, i32* %3
%133 = mul i32 %132, %132
%134 = mul i32 %133, %131
br label %135
135: ; preds = %106, %121, %114, %128
%136 = phi i32 [ %134, %128 ], [ %120, %114 ], [ %127, %121 ], [ undef, %106 ]
%137 = call i32 @prompt_for_options(i32* %7, i32* %8, i32* %9)
%138 = load i32, i32* %3
%139 = load i32, i32* %4
%140 = load i32, i32* %5
%141 = load i32, i32* %11
%142 = load i32, i32* %7
%143 = load i32, i32* %8
%144 = load i32, i32* %9
%145 = call i32 @call_Littlewood_Richardson_homotopies(i32 %138, i32 %139, i32 %140, i32* %35, i32 %141, i32 0, i32 %142, i32 %143, i32 %144, i32 %136, i32* %6)
br label %146
146: ; preds = %135, %101
%147 = load i32, i32* %6
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.19, i64 0, i64 0), i32 %147)
%149 = call i32 (...) @adafinal()
ret i32 0
}