#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_Pade(int *idx, int *numdeg, int *dendeg, int *nbr,
                          int *verbose) {
  char ch;
  printf("\nReading the settings of the Pade approximant constructor ...\n");
  printf("  Give the index of the series parameter : ");
  scanf("%d", idx);
  printf("  Give the degree of the numerator : ");
  scanf("%d", numdeg);
  printf("  Give the degree of the denominator : ");
  scanf("%d", dendeg);
  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_Pade>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf0c(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf01(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf13(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf1a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3a(%rip),%rdi
lea    -0x29(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf28(%rip),%rdi
lea    -0x29(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x29(%rbp),%edx
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x79,%edx
cmove  %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
lea    0xeff(%rip),%rdi
lea    -0x29(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask_options_for_Pade>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbp
lea    0xf80(%rip),%rdi
call   1030 <puts@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xec3(%rip),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
lea    0xefa(%rip),%rbx
lea    0x7(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
xor    %eax,%eax
cmpb   $0x79,0x7(%rsp)
sete   %al
mov    %eax,(%r14)
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [63 x i8] c"\0AReading the settings of the Pade approximant constructor ...\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 = [38 x i8] c" Give the degree of the numerator : \00"
@.str.4 = [40 x i8] c" Give the degree of the denominator : \00"
@.str.5 = [37 x i8] c" Give the number of Newton steps : \00"
@.str.6 = [44 x i8] c" Extra output during computations ? (y/n) \00"
@.str.7 = [3 x i8] c"%c\00"
define void @ask_options_for_Pade(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32*, i32** %6
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%17 = load i32*, i32** %7
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%20 = load i32*, i32** %8
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%23 = load i32*, i32** %9
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %11)
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %11)
%28 = load i8, i8* %11
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 121
%31 = zext i1 %30 to i64
%32 = select i1 %30, i32 1, i32 0
%33 = load i32*, i32** %10
store i32 %32, i32* %33
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %11)
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 = [38 x i8] c" Give the degree of the numerator : \00"
@.str.4 = [40 x i8] c" Give the degree of the denominator : \00"
@.str.5 = [37 x i8] c" Give the number of Newton steps : \00"
@.str.6 = [44 x i8] c" Extra output during computations ? (y/n) \00"
@.str.7 = [3 x i8] c"%c\00"
@str = [62 x i8] c"\0AReading the settings of the Pade approximant constructor ...\00"
define void @ask_options_for_Pade(i32* %0, i32* %1, i32* %2, i32* %3, i32* nocapture writeonly %4) {
%6 = alloca i8
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %0)
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%16 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%19 = load i8, i8* %6
%20 = icmp eq i8 %19, 121
%21 = zext i1 %20 to i32
store i32 %21, i32* %4
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
ret void
}