#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 *, ...);
void ask_options_for_series(int *idx, int *maxdeg, int *nbr, int *verbose) {
  char ch;
  printf("\nReading the settings of the power series method ...\n");
  printf("  Give the index of the series parameter : ");
  scanf("%d", idx);
  printf("  Give the maximal degree of the series : ");
  scanf("%d", maxdeg);
  printf("  Give the number of Newton steps : ");
  scanf("%d", nbr);
  printf("  Extra output during computations ? (y/n) ");
  scanf("%c", &ch);
  scanf("%c", &ch);
  *verbose = (ch == 'y' ? 1 : 0);
  scanf("%c", &ch);
}


x86 assembly (clang, -O0):
<ask_options_for_series>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xefc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf10(%rip),%rdi
call   1030 <printf@plt>
lea    0xf30(%rip),%rdi
lea    -0x21(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf1e(%rip),%rdi
lea    -0x21(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x21(%rbp),%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x79,%edx
cmove  %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
lea    0xef5(%rip),%rdi
lea    -0x21(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask_options_for_series>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xf5e(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%r13
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
lea    0xef1(%rip),%rbx
lea    0xf(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
xor    %eax,%eax
cmpb   $0x79,0xf(%rsp)
sete   %al
mov    %eax,(%r14)
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [54 x i8] c"\0AReading the settings of the power series method ...\0A\00"
@.str.1 = [44 x i8] c" Give the index of the series parameter : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [43 x i8] c" Give the maximal degree of the series : \00"
@.str.4 = [37 x i8] c" Give the number of Newton steps : \00"
@.str.5 = [44 x i8] c" Extra output during computations ? (y/n) \00"
@.str.6 = [3 x i8] c"%c\00"
define void @ask_options_for_series(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32*, i32** %5
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%15 = load i32*, i32** %6
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%18 = load i32*, i32** %7
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %9)
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %9)
%23 = load i8, i8* %9
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 121
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 1, i32 0
%28 = load i32*, i32** %8
store i32 %27, i32* %28
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str.1 = [44 x i8] c" Give the index of the series parameter : \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [43 x i8] c" Give the maximal degree of the series : \00"
@.str.4 = [37 x i8] c" Give the number of Newton steps : \00"
@.str.5 = [44 x i8] c" Extra output during computations ? (y/n) \00"
@.str.6 = [3 x i8] c"%c\00"
@str = [53 x i8] c"\0AReading the settings of the power series method ...\00"
define void @ask_options_for_series(i32* %0, i32* %1, i32* %2, i32* nocapture writeonly %3) {
%5 = alloca i8
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %0)
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %5)
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %5)
%16 = load i8, i8* %5
%17 = icmp eq i8 %16, 121
%18 = zext i1 %17 to i32
store i32 %18, i32* %3
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %5)
ret void
}