#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 prompt_for_precision(void) {
  int answer = 0;
  char nlc;
  printf("\n");
  printf("Welcome to the path tracking with generators ...\n");
  printf("  0. run in standard double precision arithmetic;\n");
  printf("  1. run in double double precision arithmetic;\n");
  printf("  2. run in quad double precision arithmetic;\n");
  printf("  3. run in multiprecision arithmetic;\n");
  printf("  4. run in variable precision arithmetic.\n");
  printf("Type 0, 1, 2, 3, or 4 to select precision : ");
  scanf("%d", &answer);
  scanf("%c", &nlc);
  return answer;
}


x86 assembly (clang, -O0):
<prompt_for_precision>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf30(%rip),%rdi
call   1030 <printf@plt>
lea    0xf53(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6f(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8f(%rip),%rdi
call   1030 <printf@plt>
lea    0xfb0(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xfa1(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_for_precision>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
lea    0xefe(%rip),%rdi
call   1040 <puts@plt>
lea    0xf24(%rip),%rdi
call   1040 <puts@plt>
lea    0xf48(%rip),%rdi
call   1040 <puts@plt>
lea    0xf6a(%rip),%rdi
call   1040 <puts@plt>
lea    0xf85(%rip),%rdi
call   1040 <puts@plt>
lea    0xe5e(%rip),%rdi
call   1050 <printf@plt>
lea    0xe7f(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe6f(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [50 x i8] c"Welcome to the path tracking with generators ...\0A\00"
@.str.2 = [51 x i8] c" 0. run in standard double precision arithmetic;\0A\00"
@.str.3 = [49 x i8] c" 1. run in double double precision arithmetic;\0A\00"
@.str.4 = [47 x i8] c" 2. run in quad double precision arithmetic;\0A\00"
@.str.5 = [40 x i8] c" 3. run in multiprecision arithmetic;\0A\00"
@.str.6 = [44 x i8] c" 4. run in variable precision arithmetic.\0A\00"
@.str.7 = [45 x i8] c"Type 0, 1, 2, 3, or 4 to select precision : \00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [3 x i8] c"%c\00"
define i32 @prompt_for_precision() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str.7 = [45 x i8] c"Type 0, 1, 2, 3, or 4 to select precision : \00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [3 x i8] c"%c\00"
@str = [49 x i8] c"Welcome to the path tracking with generators ...\00"
@str.10 = [50 x i8] c" 0. run in standard double precision arithmetic;\00"
@str.11 = [48 x i8] c" 1. run in double double precision arithmetic;\00"
@str.12 = [46 x i8] c" 2. run in quad double precision arithmetic;\00"
@str.13 = [39 x i8] c" 3. run in multiprecision arithmetic;\00"
@str.14 = [43 x i8] c" 4. run in variable precision arithmetic.\00"
define i32 @prompt_for_precision() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.10, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.12, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.13, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.14, i64 0, i64 0))
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%14 = load i32, i32* %1
ret i32 %14
}