#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int solcon_write_dobldobl_solutions();
int solcon_write_quaddobl_solutions();
int solcon_write_standard_solutions();
int solve_Laurent_system(int *, int /*<<< orphan*/, int);
int solve_dobldobl_Laurent_system(int *, int /*<<< orphan*/, int);
int solve_quaddobl_Laurent_system(int *, int /*<<< orphan*/, int);
int syscon_read_dobldobl_Laurent_system();
int syscon_read_quaddobl_Laurent_system();
int syscon_read_standard_Laurent_system();
int syscon_write_dobldobl_Laurent_system();
int syscon_write_quaddobl_Laurent_system();
int syscon_write_standard_Laurent_system();
int Laurent_input_output_on_files(int precision) {
  int fail, rc, nbtasks;
  if (precision == 0) {
    fail = syscon_read_standard_Laurent_system();
    printf("\nThe system in the container : \n");
    fail = syscon_write_standard_Laurent_system();
    printf("\nGive the number of tasks : ");
    scanf("%d", &nbtasks);
    fail = solve_Laurent_system(&rc, 0, nbtasks);
    printf("\nThe root count : %d\n", rc);
    printf("\nThe solutions :\n");
    fail = solcon_write_standard_solutions();
  } else if (precision == 1) {
    fail = syscon_read_dobldobl_Laurent_system();
    printf("\nThe system in the container : \n");
    fail = syscon_write_dobldobl_Laurent_system();
    printf("\nGive the number of tasks : ");
    scanf("%d", &nbtasks);
    fail = solve_dobldobl_Laurent_system(&rc, 0, nbtasks);
    printf("\nThe root count : %d\n", rc);
    printf("\nThe solutions :\n");
    fail = solcon_write_dobldobl_solutions();
  } else if (precision == 2) {
    fail = syscon_read_quaddobl_Laurent_system();
    printf("\nThe system in the container : \n");
    fail = syscon_write_quaddobl_Laurent_system();
    printf("\nGive the number of tasks : ");
    scanf("%d", &nbtasks);
    fail = solve_quaddobl_Laurent_system(&rc, 0, nbtasks);
    printf("\nThe root count : %d\n", rc);
    printf("\nThe solutions :\n");
    fail = solcon_write_quaddobl_solutions();
  }
  return fail;
}


x86 assembly (clang, -O0):
<Laurent_input_output_on_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1274 <Laurent_input_output_on_files+0x94>
mov    $0x0,%al
call   10a0 <syscon_read_standard_Laurent_system@plt>
mov    %eax,-0x8(%rbp)
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10f0 <syscon_write_standard_Laurent_system@plt>
mov    %eax,-0x8(%rbp)
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe12(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10c0 <scanf@plt>
mov    -0x10(%rbp),%edx
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
call   1070 <solve_Laurent_system@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1080 <solcon_write_standard_solutions@plt>
mov    %eax,-0x8(%rbp)
jmp    138b <Laurent_input_output_on_files+0x1ab>
cmpl   $0x1,-0x4(%rbp)
jne    12fd <Laurent_input_output_on_files+0x11d>
mov    $0x0,%al
call   1090 <syscon_read_dobldobl_Laurent_system@plt>
mov    %eax,-0x8(%rbp)
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <syscon_write_dobldobl_Laurent_system@plt>
mov    %eax,-0x8(%rbp)
lea    0xd7a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd89(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10c0 <scanf@plt>
mov    -0x10(%rbp),%edx
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
call   1100 <solve_dobldobl_Laurent_system@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xd68(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd70(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <solcon_write_dobldobl_solutions@plt>
mov    %eax,-0x8(%rbp)
jmp    1386 <Laurent_input_output_on_files+0x1a6>
cmpl   $0x2,-0x4(%rbp)
jne    1381 <Laurent_input_output_on_files+0x1a1>
mov    $0x0,%al
call   10b0 <syscon_read_quaddobl_Laurent_system@plt>
mov    %eax,-0x8(%rbp)
lea    0xce8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10d0 <syscon_write_quaddobl_Laurent_system@plt>
mov    %eax,-0x8(%rbp)
lea    0xcf1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xd00(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10c0 <scanf@plt>
mov    -0x10(%rbp),%edx
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
call   10e0 <solve_quaddobl_Laurent_system@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xcdf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xce7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <solcon_write_quaddobl_solutions@plt>
mov    %eax,-0x8(%rbp)
jmp    1386 <Laurent_input_output_on_files+0x1a6>
jmp    138b <Laurent_input_output_on_files+0x1ab>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Laurent_input_output_on_files>:
push   %rax
cmp    $0x2,%edi
je     1274 <Laurent_input_output_on_files+0x84>
cmp    $0x1,%edi
je     12e1 <Laurent_input_output_on_files+0xf1>
test   %edi,%edi
jne    12df <Laurent_input_output_on_files+0xef>
xor    %eax,%eax
call   10b0 <syscon_read_standard_Laurent_system@plt>
lea    0xe21(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1100 <syscon_write_standard_Laurent_system@plt>
lea    0xdd8(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xde7(%rip),%rdi
mov    %rsp,%rsi
call   10d0 <scanf@plt>
mov    (%rsp),%edx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1080 <solve_Laurent_system@plt>
mov    0x4(%rsp),%esi
lea    0xdc8(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdf0(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1090 <solcon_write_standard_solutions@plt>
pop    %rcx
ret
xor    %eax,%eax
call   10c0 <syscon_read_quaddobl_Laurent_system@plt>
lea    0xdb4(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   10e0 <syscon_write_quaddobl_Laurent_system@plt>
lea    0xd6b(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd7a(%rip),%rdi
mov    %rsp,%rsi
call   10d0 <scanf@plt>
mov    (%rsp),%edx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   10f0 <solve_quaddobl_Laurent_system@plt>
mov    0x4(%rsp),%esi
lea    0xd5b(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd83(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1040 <solcon_write_quaddobl_solutions@plt>
pop    %rcx
ret
xor    %eax,%eax
call   10a0 <syscon_read_dobldobl_Laurent_system@plt>
lea    0xd47(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1030 <syscon_write_dobldobl_Laurent_system@plt>
lea    0xcfe(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd0d(%rip),%rdi
mov    %rsp,%rsi
call   10d0 <scanf@plt>
mov    (%rsp),%edx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1110 <solve_dobldobl_Laurent_system@plt>
mov    0x4(%rsp),%esi
lea    0xcee(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd16(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1070 <solcon_write_dobldobl_solutions@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0AThe system in the container : \0A\00"
@.str.1 = [29 x i8] c"\0AGive the number of tasks : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [22 x i8] c"\0AThe root count : %d\0A\00"
@.str.4 = [18 x i8] c"\0AThe solutions :\0A\00"
define i32 @Laurent_input_output_on_files(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %1
%9 = call i32 (...) @syscon_read_standard_Laurent_system()
store i32 %9, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (...) @syscon_write_standard_Laurent_system()
store i32 %11, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %5
%15 = call i32 @solve_Laurent_system(i32* %4, i32 0, i32 %14)
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 (...) @solcon_write_standard_solutions()
store i32 %19, i32* %3
br label %52
20: ; preds = %1
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %35
23: ; preds = %20
%24 = call i32 (...) @syscon_read_dobldobl_Laurent_system()
store i32 %24, i32* %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%26 = call i32 (...) @syscon_write_dobldobl_Laurent_system()
store i32 %26, i32* %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%29 = load i32, i32* %5
%30 = call i32 @solve_dobldobl_Laurent_system(i32* %4, i32 0, i32 %29)
store i32 %30, i32* %3
%31 = load i32, i32* %4
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%34 = call i32 (...) @solcon_write_dobldobl_solutions()
store i32 %34, i32* %3
br label %51
35: ; preds = %20
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 2
br i1 %37, label %38, label %50
38: ; preds = %35
%39 = call i32 (...) @syscon_read_quaddobl_Laurent_system()
store i32 %39, i32* %3
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%41 = call i32 (...) @syscon_write_quaddobl_Laurent_system()
store i32 %41, i32* %3
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%43 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%44 = load i32, i32* %5
%45 = call i32 @solve_quaddobl_Laurent_system(i32* %4, i32 0, i32 %44)
store i32 %45, i32* %3
%46 = load i32, i32* %4
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%49 = call i32 (...) @solcon_write_quaddobl_solutions()
store i32 %49, i32* %3
br label %50
50: ; preds = %38, %35
br label %51
51: ; preds = %50, %23
br label %52
52: ; preds = %51, %8
%53 = load i32, i32* %3
ret i32 %53
}

LLVM IR (-O2):
@.str.1 = [29 x i8] c"\0AGive the number of tasks : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [22 x i8] c"\0AThe root count : %d\0A\00"
@str.8 = [32 x i8] c"\0AThe system in the container : \00"
@str.9 = [17 x i8] c"\0AThe solutions :\00"
define i32 @Laurent_input_output_on_files(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
switch i32 %0, label %42 [
i32 0, label %6
i32 1, label %18
i32 2, label %30
]
6: ; preds = %1
%7 = tail call i32 (...) @syscon_read_standard_Laurent_system()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
%9 = tail call i32 (...) @syscon_write_standard_Laurent_system()
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = call i32 @solve_Laurent_system(i32* %2, i32 0, i32 %12)
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.9, i64 0, i64 0))
%17 = call i32 (...) @solcon_write_standard_solutions()
br label %42
18: ; preds = %1
%19 = tail call i32 (...) @syscon_read_dobldobl_Laurent_system()
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
%21 = tail call i32 (...) @syscon_write_dobldobl_Laurent_system()
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%24 = load i32, i32* %3
%25 = call i32 @solve_dobldobl_Laurent_system(i32* %2, i32 0, i32 %24)
%26 = load i32, i32* %2
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.9, i64 0, i64 0))
%29 = call i32 (...) @solcon_write_dobldobl_solutions()
br label %42
30: ; preds = %1
%31 = tail call i32 (...) @syscon_read_quaddobl_Laurent_system()
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
%33 = tail call i32 (...) @syscon_write_quaddobl_Laurent_system()
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%36 = load i32, i32* %3
%37 = call i32 @solve_quaddobl_Laurent_system(i32* %2, i32 0, i32 %36)
%38 = load i32, i32* %2
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %38)
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.9, i64 0, i64 0))
%41 = call i32 (...) @solcon_write_quaddobl_solutions()
br label %42
42: ; preds = %1, %18, %30, %6
%43 = phi i32 [ %17, %6 ], [ %29, %18 ], [ %41, %30 ], [ undef, %1 ]
ret i32 %43
}