#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 test_dobldobl_crude_tracker(int);
int test_quaddobl_crude_tracker(int);
int test_standard_crude_tracker(int);
int test_crude_trackers(int verbose) {
  int precision = 0;
  char nlch;
  printf("\nMENU for the working precision :\n");
  printf("  0. double precision,\n");
  printf("  1. double double precision, or\n");
  printf("  2. quad double precision.\n");
  printf("Type 0, 1, or 2 to select the precision : ");
  scanf("%d", &precision);
  scanf("%c", &nlch);
  if (precision == 0)
    return test_standard_crude_tracker(verbose);
  else if (precision == 1)
    return test_dobldobl_crude_tracker(verbose);
  else if (precision == 2)
    return test_quaddobl_crude_tracker(verbose);
  else
    printf("Invalid value for the precision.");
  return 0;
}


x86 assembly (clang, -O0):
<test_crude_trackers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
call   1040 <printf@plt>
lea    0xf00(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xef1(%rip),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    11dc <test_crude_trackers+0x8c>
mov    -0x8(%rbp),%edi
call   1030 <test_standard_crude_tracker@plt>
mov    %eax,-0x4(%rbp)
jmp    122d <test_crude_trackers+0xdd>
cmpl   $0x1,-0xc(%rbp)
jne    11f6 <test_crude_trackers+0xa6>
mov    -0x8(%rbp),%edi
call   1070 <test_dobldobl_crude_tracker@plt>
mov    %eax,-0x4(%rbp)
jmp    122d <test_crude_trackers+0xdd>
cmpl   $0x2,-0xc(%rbp)
jne    1210 <test_crude_trackers+0xc0>
mov    -0x8(%rbp),%edi
call   1050 <test_quaddobl_crude_tracker@plt>
mov    %eax,-0x4(%rbp)
jmp    122d <test_crude_trackers+0xdd>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
jmp    1221 <test_crude_trackers+0xd1>
jmp    1226 <test_crude_trackers+0xd6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_crude_trackers>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x0,0xc(%rsp)
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf12(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe79(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe69(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
je     11ec <test_crude_trackers+0x8c>
cmp    $0x1,%eax
je     11f5 <test_crude_trackers+0x95>
test   %eax,%eax
jne    11fe <test_crude_trackers+0x9e>
mov    %ebx,%edi
call   1040 <test_standard_crude_tracker@plt>
jmp    120c <test_crude_trackers+0xac>
mov    %ebx,%edi
call   1060 <test_quaddobl_crude_tracker@plt>
jmp    120c <test_crude_trackers+0xac>
mov    %ebx,%edi
call   1080 <test_dobldobl_crude_tracker@plt>
jmp    120c <test_crude_trackers+0xac>
lea    0xe2c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0AMENU for the working precision :\0A\00"
@.str.1 = [24 x i8] c" 0. double precision,\0A\00"
@.str.2 = [34 x i8] c" 1. double double precision, or\0A\00"
@.str.3 = [29 x i8] c" 2. quad double precision.\0A\00"
@.str.4 = [43 x i8] c"Type 0, 1, or 2 to select the precision : \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [33 x i8] c"Invalid value for the precision.\00"
define i32 @test_crude_trackers(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 0, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %5)
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i32, i32* %3
%17 = call i32 @test_standard_crude_tracker(i32 %16)
store i32 %17, i32* %2
br label %35
18: ; preds = %1
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = call i32 @test_dobldobl_crude_tracker(i32 %22)
store i32 %23, i32* %2
br label %35
24: ; preds = %18
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %3
%29 = call i32 @test_quaddobl_crude_tracker(i32 %28)
store i32 %29, i32* %2
br label %35
30: ; preds = %24
%31 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
br label %32
32: ; preds = %30
br label %33
33: ; preds = %32
br label %34
34: ; preds = %33
store i32 0, i32* %2
br label %35
35: ; preds = %34, %27, %21, %15
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
@.str.4 = [43 x i8] c"Type 0, 1, or 2 to select the precision : \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [33 x i8] c"Invalid value for the precision.\00"
@str = [34 x i8] c"\0AMENU for the working precision :\00"
@str.8 = [23 x i8] c" 0. double precision,\00"
@str.9 = [33 x i8] c" 1. double double precision, or\00"
@str.10 = [28 x i8] c" 2. quad double precision.\00"
define i32 @test_crude_trackers(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.8, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.9, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.10, i64 0, i64 0))
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%12 = load i32, i32* %2
switch i32 %12, label %19 [
i32 0, label %13
i32 1, label %15
i32 2, label %17
]
13: ; preds = %1
%14 = call i32 @test_standard_crude_tracker(i32 %0)
br label %21
15: ; preds = %1
%16 = call i32 @test_dobldobl_crude_tracker(i32 %0)
br label %21
17: ; preds = %1
%18 = call i32 @test_quaddobl_crude_tracker(i32 %0)
br label %21
19: ; preds = %1
%20 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.7, i64 0, i64 0))
br label %21
21: ; preds = %19, %17, %15, %13
%22 = phi i32 [ %14, %13 ], [ %16, %15 ], [ %18, %17 ], [ 0, %19 ]
ret i32 %22
}