#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*/ clear_set_structure();
int is_set_structure_supporting(int *);
int linear_product_root_count(int *);
int /*<<< orphan*/ parse_set_structure(int, char *);
int /*<<< orphan*/ printf(char *, ...);
int set_structure_string(int *, char *);
int supporting_set_structure();
int syscon_read_standard_system();
int syscon_write_standard_system();
int write_set_structure();
int compute_root_count(int *r) {
  int fail, inout;
  fail = syscon_read_standard_system();
  printf("\nThe system in the container : \n");
  fail = syscon_write_standard_system();
  fail = supporting_set_structure();
  printf("\nA supporting set structure : \n");
  fail = write_set_structure();
  {
    int nc;
    char ss[200];
    fail = set_structure_string(&nc, ss);
    printf("\nthe set structure string : \n%s\n", ss);
    printf("clearing the set structure ...\n");
    clear_set_structure();
    printf("parsing the set structure string ...\n");
    parse_set_structure(nc, ss);
    printf("after parsing the set structure string :\n");
    fail = write_set_structure();
  }
  inout = 1;
  fail = is_set_structure_supporting(&inout);
  if (inout == 1)
    printf("The set structure supports the polynomial system.\n");
  else
    printf("The set structure does not support the polynomial system.\n");
  fail = linear_product_root_count(r);
  printf("\nThe linear-product root count : %d\n", *r);
  return fail;
}


x86 assembly (clang, -O0):
<compute_root_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   10b0 <syscon_read_standard_system@plt>
mov    %eax,-0xc(%rbp)
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <syscon_write_standard_system@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <supporting_set_structure@plt>
mov    %eax,-0xc(%rbp)
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <write_set_structure@plt>
mov    %eax,-0xc(%rbp)
lea    -0xe0(%rbp),%rsi
lea    -0x14(%rbp),%rdi
call   1080 <set_structure_string@plt>
mov    %eax,-0xc(%rbp)
lea    -0xe0(%rbp),%rsi
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   10c0 <clear_set_structure@plt>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0xe0(%rbp),%rsi
call   1070 <parse_set_structure@plt>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <write_set_structure@plt>
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <is_set_structure_supporting@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1295 <compute_root_count+0xf5>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12a3 <compute_root_count+0x103>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1090 <linear_product_root_count@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_root_count>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
mov    %rdi,%r14
xor    %eax,%eax
call   10c0 <syscon_read_standard_system@plt>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10b0 <syscon_write_standard_system@plt>
xor    %eax,%eax
call   1070 <supporting_set_structure@plt>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <write_set_structure@plt>
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1090 <set_structure_string@plt>
lea    0xdf6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe6a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10d0 <clear_set_structure@plt>
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%edi
mov    %rbx,%rsi
call   1080 <parse_set_structure@plt>
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <write_set_structure@plt>
movl   $0x1,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <is_set_structure_supporting@plt>
cmpl   $0x1,0x10(%rsp)
lea    0xebc(%rip),%rax
lea    0xe7b(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   10a0 <linear_product_root_count@plt>
mov    %eax,%ebx
mov    (%r14),%esi
lea    0xd8d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %ebx,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0AThe system in the container : \0A\00"
@.str.1 = [32 x i8] c"\0AA supporting set structure : \0A\00"
@.str.2 = [33 x i8] c"\0Athe set structure string : \0A%s\0A\00"
@.str.3 = [32 x i8] c"clearing the set structure ...\0A\00"
@.str.4 = [38 x i8] c"parsing the set structure string ...\0A\00"
@.str.5 = [42 x i8] c"after parsing the set structure string :\0A\00"
@.str.6 = [51 x i8] c"The set structure supports the polynomial system.\0A\00"
@.str.7 = [59 x i8] c"The set structure does not support the polynomial system.\0A\00"
@.str.8 = [37 x i8] c"\0AThe linear-product root count : %d\0A\00"
define i32 @compute_root_count(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [200 x i8]
store i32* %0, i32** %2
%7 = call i32 (...) @syscon_read_standard_system()
store i32 %7, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @syscon_write_standard_system()
store i32 %9, i32* %3
%10 = call i32 (...) @supporting_set_structure()
store i32 %10, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (...) @write_set_structure()
store i32 %12, i32* %3
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%14 = call i32 @set_structure_string(i32* %5, i8* %13)
store i32 %14, i32* %3
%15 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (...) @clear_set_structure()
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0))
%20 = load i32, i32* %5
%21 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%22 = call i32 @parse_set_structure(i32 %20, i8* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%24 = call i32 (...) @write_set_structure()
store i32 %24, i32* %3
store i32 1, i32* %4
%25 = call i32 @is_set_structure_supporting(i32* %4)
store i32 %25, i32* %3
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %30
28: ; preds = %1
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
br label %32
30: ; preds = %1
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.7, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
%33 = load i32*, i32** %2
%34 = call i32 @linear_product_root_count(i32* %33)
store i32 %34, i32* %3
%35 = load i32*, i32** %2
%36 = load i32, i32* %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i32 %36)
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
@.str.2 = [33 x i8] c"\0Athe set structure string : \0A%s\0A\00"
@.str.8 = [37 x i8] c"\0AThe linear-product root count : %d\0A\00"
@str = [32 x i8] c"\0AThe system in the container : \00"
@str.9 = [31 x i8] c"\0AA supporting set structure : \00"
@str.10 = [31 x i8] c"clearing the set structure ...\00"
@str.11 = [37 x i8] c"parsing the set structure string ...\00"
@str.12 = [41 x i8] c"after parsing the set structure string :\00"
@str.13 = [58 x i8] c"The set structure does not support the polynomial system.\00"
@str.14 = [50 x i8] c"The set structure supports the polynomial system.\00"
define i32 @compute_root_count(i32* %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [200 x i8]
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 (...) @syscon_read_standard_system()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (...) @syscon_write_standard_system()
%9 = tail call i32 (...) @supporting_set_structure()
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.9, i64 0, i64 0))
%11 = tail call i32 (...) @write_set_structure()
%12 = bitcast i32* %3 to i8*
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%14 = call i32 @set_structure_string(i32* %3, i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.10, i64 0, i64 0))
%17 = call i32 (...) @clear_set_structure()
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.11, i64 0, i64 0))
%19 = load i32, i32* %3
%20 = call i32 @parse_set_structure(i32 %19, i8* %13)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.12, i64 0, i64 0))
%22 = call i32 (...) @write_set_structure()
store i32 1, i32* %2
%23 = call i32 @is_set_structure_supporting(i32* %2)
%24 = load i32, i32* %2
%25 = icmp eq i32 %24, 1
%26 = select i1 %25, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @str.14, i64 0, i64 0), i8* getelementptr inbounds ([58 x i8], [58 x i8]* @str.13, i64 0, i64 0)
%27 = call i32 @puts(i8* dereferenceable(1) %26)
%28 = call i32 @linear_product_root_count(i32* %0)
%29 = load i32, i32* %0
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i32 %29)
ret i32 %28
}