#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);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int primeiro, segundo, termo = 0, constante, i;
  puts("informe o Primeiro numero: ");
  scanf("%d", &primeiro);
  puts("informe o Segundo numero: ");
  scanf("%d", &segundo);
  constante = segundo - primeiro;
  printf("######## PA com const = %d ##########\n", constante);
  for (i = 0; i < 10; i++) {
    printf("->  %d\n", termo);
    termo = termo + constante;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xea7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    11cd <main+0x9d>
mov    -0x10(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    119d <main+0x6d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%ebx
sub    0x4(%rsp),%ebx
lea    0xebe(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    0xed7(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
lea    (%rbx,%rbx,1),%r15d
mov    %r14,%rdi
mov    %r15d,%esi
call   1040 <printf@plt>
lea    (%rbx,%rbx,2),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
lea    0x0(,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
lea    (%rbx,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
lea    (%r15,%r15,2),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
lea    0x0(,%rbx,8),%ebp
mov    %ebp,%esi
sub    %ebx,%esi
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
lea    (%rbx,%rbx,8),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"informe o Primeiro numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"informe o Segundo numero: \00"
@.str.3 = [39 x i8] c"######## PA com const = %d ##########\0A\00"
@.str.4 = [8 x i8] c"-> %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%7 = call i32 @puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %14)
store i32 0, i32* %6
br label %16
16: ; preds = %25, %0
%17 = load i32, i32* %6
%18 = icmp slt i32 %17, 10
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i32, i32* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = add nsw i32 %22, %23
store i32 %24, i32* %4
br label %25
25: ; preds = %19
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %16
28: ; preds = %16
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str = [28 x i8] c"informe o Primeiro numero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"informe o Segundo numero: \00"
@.str.3 = [39 x i8] c"######## PA com const = %d ##########\0A\00"
@.str.4 = [8 x i8] c"-> %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 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 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 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = load i32, i32* %1
%11 = sub nsw i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 0)
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%15 = shl nsw i32 %11, 1
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%17 = mul nsw i32 %11, 3
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = shl nsw i32 %11, 2
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = mul nsw i32 %11, 5
%22 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %21)
%23 = mul nsw i32 %11, 6
%24 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%25 = mul nsw i32 %11, 7
%26 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = shl nsw i32 %11, 3
%28 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = mul nsw i32 %11, 9
%30 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i32 %29)
ret i32 0
}