#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*/ Prusecik(int, double *, double *, double);
int /*<<< orphan*/ PrusecikRek(int, double *, double *, double);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, double);
int scanf(char *, double *, ...);
int main() {
  double koef[3 + 1];
  double tolerance, interval[2];
  for (int i = 3; i; i--) {
    if (scanf("%lf;", &koef[i]) != 1)
      return 1;
  }
  if (scanf("%lf", koef) != 1)
    return 1;
  if (scanf("%lf;%lf;%lf", &interval[0], &interval[1], &tolerance) != 3)
    return 1;
  if (interval[0] > interval[1])
    return 2;
  if (tolerance <= 0)
    return 3;
  printf("Vysledek (nerekurzivne) je %lf +- %lf\n",
         Prusecik(3, koef, interval, tolerance), tolerance);
  printf("Vysledek (rekurzivne) je %lf +- %lf\n",
         PrusecikRek(3, koef, interval, tolerance), tolerance);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     11a5 <main+0x65>
movslq -0x54(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     1192 <main+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1290 <main+0x150>
jmp    1197 <main+0x57>
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    1156 <main+0x16>
lea    -0x30(%rbp),%rsi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     11cc <main+0x8c>
movl   $0x1,-0x4(%rbp)
jmp    1290 <main+0x150>
lea    -0x50(%rbp),%rsi
lea    -0x50(%rbp),%rdx
add    $0x8,%rdx
lea    0xe26(%rip),%rdi
lea    -0x38(%rbp),%rcx
mov    $0x0,%al
call   1060 <scanf@plt>
cmp    $0x3,%eax
je     11ff <main+0xbf>
movl   $0x1,-0x4(%rbp)
jmp    1290 <main+0x150>
movsd  -0x50(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    121b <main+0xdb>
movl   $0x2,-0x4(%rbp)
jmp    1290 <main+0x150>
xorps  %xmm0,%xmm0
ucomisd -0x38(%rbp),%xmm0
jb     1235 <main+0xf5>
movl   $0x3,-0x4(%rbp)
jmp    1290 <main+0x150>
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdx
movsd  -0x38(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <Prusecik@plt>
mov    %eax,%esi
movsd  -0x38(%rbp),%xmm0
lea    0xdb7(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdx
movsd  -0x38(%rbp),%xmm0
mov    $0x3,%edi
call   1050 <PrusecikRek@plt>
mov    %eax,%esi
movsd  -0x38(%rbp),%xmm0
lea    0xdb4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0x38(%rsp),%rsi
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    $0x1,%ebx
cmp    $0x1,%eax
jne    1264 <main+0x124>
lea    0x30(%rsp),%rsi
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1264 <main+0x124>
lea    0x28(%rsp),%rsi
lea    0xe70(%rip),%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1264 <main+0x124>
lea    0xe66(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1264 <main+0x124>
lea    0x18(%rsp),%rdx
lea    0xe3d(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
xor    %eax,%eax
call   1060 <scanf@plt>
cmp    $0x3,%eax
jne    1264 <main+0x124>
movsd  0x10(%rsp),%xmm0
mov    $0x2,%ebx
ucomisd 0x18(%rsp),%xmm0
ja     1264 <main+0x124>
movsd  0x8(%rsp),%xmm0
mov    $0x3,%ebx
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1264 <main+0x124>
lea    0x20(%rsp),%rbx
lea    0x10(%rsp),%r14
mov    $0x3,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <Prusecik@plt>
movsd  0x8(%rsp),%xmm0
lea    0xde0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    $0x3,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <PrusecikRek@plt>
movsd  0x8(%rsp),%xmm0
lea    0xddd(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lf;\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [12 x i8] c"%lf;%lf;%lf\00"
@.str.3 = [39 x i8] c"Vysledek (nerekurzivne) je %lf +- %lf\0A\00"
@.str.4 = [37 x i8] c"Vysledek (rekurzivne) je %lf +- %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x double]
%3 = alloca double
%4 = alloca [2 x double]
%5 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %5
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 %11
%13 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %12)
%14 = icmp ne i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 1, i32* %1
br label %55
16: ; preds = %9
br label %17
17: ; preds = %16
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%22 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %21)
%23 = icmp ne i32 %22, 1
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %1
br label %55
25: ; preds = %20
%26 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%27 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 1
%28 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double* %26, double* %27, double* %3)
%29 = icmp ne i32 %28, 3
br i1 %29, label %30, label %31
30: ; preds = %25
store i32 1, i32* %1
br label %55
31: ; preds = %25
%32 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%33 = load double, double* %32
%34 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 1
%35 = load double, double* %34
%36 = fcmp ogt double %33, %35
br i1 %36, label %37, label %38
37: ; preds = %31
store i32 2, i32* %1
br label %55
38: ; preds = %31
%39 = load double, double* %3
%40 = fcmp ole double %39, 0.000000e+00
br i1 %40, label %41, label %42
41: ; preds = %38
store i32 3, i32* %1
br label %55
42: ; preds = %38
%43 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%44 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%45 = load double, double* %3
%46 = call i32 @Prusecik(i32 3, double* %43, double* %44, double %45)
%47 = load double, double* %3
%48 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %46, double %47)
%49 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%50 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%51 = load double, double* %3
%52 = call i32 @PrusecikRek(i32 3, double* %49, double* %50, double %51)
%53 = load double, double* %3
%54 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %52, double %53)
store i32 0, i32* %1
br label %55
55: ; preds = %42, %41, %37, %30, %24, %15
%56 = load i32, i32* %1
ret i32 %56
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf;\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [12 x i8] c"%lf;%lf;%lf\00"
@.str.3 = [39 x i8] c"Vysledek (nerekurzivne) je %lf +- %lf\0A\00"
@.str.4 = [37 x i8] c"Vysledek (rekurzivne) je %lf +- %lf\0A\00"
define i32 @main() {
%1 = alloca [4 x double]
%2 = alloca double
%3 = alloca [2 x double]
%4 = bitcast [4 x double]* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast [2 x double]* %3 to i8*
%7 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 3
%8 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %7)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %42
10: ; preds = %0
%11 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 2
%12 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %11)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %42
14: ; preds = %10
%15 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 1
%16 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double* %15)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %42
18: ; preds = %14
%19 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%20 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %19)
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %42
22: ; preds = %18
%23 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%24 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%25 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), double* %23, double* %24, double* %2)
%26 = icmp eq i32 %25, 3
br i1 %26, label %27, label %42
27: ; preds = %22
%28 = load double, double* %23
%29 = load double, double* %24
%30 = fcmp ogt double %28, %29
br i1 %30, label %42, label %31
31: ; preds = %27
%32 = load double, double* %2
%33 = fcmp ugt double %32, 0.000000e+00
br i1 %33, label %34, label %42
34: ; preds = %31
%35 = call i32 @Prusecik(i32 3, double* %19, double* %23, double %32)
%36 = load double, double* %2
%37 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %35, double %36)
%38 = load double, double* %2
%39 = call i32 @PrusecikRek(i32 3, double* %19, double* %23, double %38)
%40 = load double, double* %2
%41 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i32 %39, double %40)
br label %42
42: ; preds = %0, %10, %14, %31, %27, %22, %18, %34
%43 = phi i32 [ 0, %34 ], [ 1, %18 ], [ 1, %22 ], [ 2, %27 ], [ 3, %31 ], [ 1, %14 ], [ 1, %10 ], [ 1, %0 ]
ret i32 %43
}