#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 answer(int);
int answer2(int);
int answer3(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, r;
  printf(" Input a first number, please? ");
  scanf("%d", &n);
  printf("The first progression is %d.\n", answer(n));
  printf("The second progression is %d.\n", answer2(n));
  printf(" Input a first number, please?  ");
  scanf("%d", &n);
  printf(" Input a second number, please?  ");
  scanf("%d", &r);
  printf("The third progression is %d.\n", answer3(n, r));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <answer@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1070 <answer2@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe40(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <answer3@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb7(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    (%rsp),%edi
call   1050 <answer@plt>
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%edi
call   1070 <answer2@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1040 <answer3@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c" Input a first number, please? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"The first progression is %d.\0A\00"
@.str.3 = [31 x i8] c"The second progression is %d.\0A\00"
@.str.4 = [33 x i8] c" Input a first number, please? \00"
@.str.5 = [34 x i8] c" Input a second number, please? \00"
@.str.6 = [30 x i8] c"The third progression is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @answer(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @answer2(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 @answer3(i32 %16, i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c" Input a first number, please? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [30 x i8] c"The first progression is %d.\0A\00"
@.str.3 = [31 x i8] c"The second progression is %d.\0A\00"
@.str.4 = [33 x i8] c" Input a first number, please? \00"
@.str.5 = [34 x i8] c" Input a second number, please? \00"
@.str.6 = [30 x i8] c"The third progression is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @answer(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
%11 = call i32 @answer2(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = call i32 @answer3(i32 %17, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %19)
ret i32 0
}