#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 *, ...);
main() {
  long int num1, num2, dif;
  int i, numr;
  printf("Entre com o numero de elementos: ");
  scanf("%d", &numr);
  printf("Entre com o 1o numero: ");
  scanf("%d", &num1);
  printf("Entre com o 2o numero: ");
  scanf("%d", &num2);
  printf("%d %d ", num1, num2);
  dif = num2 - num1;
  for (i = 3; i <= numr; i++) {
    num2 += dif;
    printf("%d ", num2);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x3,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jg     11f0 <main+0xd0>
mov    -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b8 <main+0x98>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x18(%rsp),%rsi
mov    0x10(%rsp),%rdx
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x3,0xc(%rsp)
jl     1200 <main+0xe0>
mov    0x10(%rsp),%rsi
mov    %rsi,%rbx
sub    0x18(%rsp),%rbx
add    %rbx,%rsi
mov    %rsi,0x10(%rsp)
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmpl   $0x4,0xc(%rsp)
jl     1200 <main+0xe0>
mov    $0x3,%ebp
lea    0xe7d(%rip),%r14
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    0x10(%rsp),%rsi
add    %rbx,%rsi
mov    %rsi,0x10(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    0xc(%rsp),%ebp
jl     11e0 <main+0xc0>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [34 x i8] c"Entre com o numero de elementos: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"Entre com o 1o numero: \00"
@.str.3 = [24 x i8] c"Entre com o 2o numero: \00"
@.str.4 = [7 x i8] c"%d %d \00"
@.str.5 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i32
%4 = bitcast i64* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%13 = load i64, i64* %1
%14 = load i64, i64* %2
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i64 %13, i64 %14)
%16 = load i64, i64* %2
%17 = load i64, i64* %1
%18 = sub nsw i64 %16, %17
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 3
br i1 %20, label %34, label %21
21: ; preds = %0
%22 = add nsw i64 %16, %18
store i64 %22, i64* %2
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 %22)
%24 = load i32, i32* %3
%25 = icmp sgt i32 %24, 3
br i1 %25, label %26, label %34
26: ; preds = %21, %26
%27 = phi i32 [ %28, %26 ], [ 3, %21 ]
%28 = add nuw nsw i32 %27, 1
%29 = load i64, i64* %2
%30 = add nsw i64 %29, %18
store i64 %30, i64* %2
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i64 %30)
%32 = load i32, i32* %3
%33 = icmp slt i32 %28, %32
br i1 %33, label %26, label %34
34: ; preds = %26, %21, %0
ret i32 0
}