#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 *, int *);
int main() {
  int n1, n2;
  printf("Para saber os inteiros entre dois numeros siga os passos abaixo: \n");
  printf("Digite o primeiro numero: ");
  scanf("%d", &n1);
  printf("Digite o segundo numero: ");
  scanf("%d", &n2);
  if (n1 == n2)
    printf("NUMEROS IGUAIS!\n");
  else if (n1 < n2)
    while (n1 <= n2)
      printf("%d\n", n1++);
  else
    while (n1 >= n2)
      printf("%d\n", n1--);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1198 <main+0x78>
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1211 <main+0xf1>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d8 <main+0xb8>
jmp    11a9 <main+0x89>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11d3 <main+0xb3>
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a9 <main+0x89>
jmp    120c <main+0xec>
jmp    11dd <main+0xbd>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1207 <main+0xe7>
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dd <main+0xbd>
jmp    120c <main+0xec>
jmp    1211 <main+0xf1>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%esi
cmp    0xc(%rsp),%esi
jne    1196 <main+0x66>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
jmp    11db <main+0xab>
lea    0xe9b(%rip),%rbx
jge    11c0 <main+0x90>
nop
lea    0x1(%rsi),%eax
mov    %eax,0x8(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
cmp    0xc(%rsp),%esi
jle    11a0 <main+0x70>
jmp    11db <main+0xab>
nopl   (%rax)
lea    -0x1(%rsi),%eax
mov    %eax,0x8(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
cmp    0xc(%rsp),%esi
jge    11c0 <main+0x90>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [67 x i8] c"Para saber os inteiros entre dois numeros siga os passos abaixo: \0A\00"
@.str.1 = [27 x i8] c"Digite o primeiro numero: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"Digite o segundo numero: \00"
@.str.4 = [17 x i8] c"NUMEROS IGUAIS!\0A\00"
@.str.5 = [4 x i8] c"%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 ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %39
14: ; preds = %0
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
br label %19
19: ; preds = %23, %18
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = icmp sle i32 %20, %21
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %24)
br label %19
27: ; preds = %19
br label %38
28: ; preds = %14
br label %29
29: ; preds = %33, %28
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = icmp sge i32 %30, %31
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = load i32, i32* %2
%35 = add nsw i32 %34, -1
store i32 %35, i32* %2
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %34)
br label %29
37: ; preds = %29
br label %38
38: ; preds = %37, %27
br label %39
39: ; preds = %38, %12
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"Digite o primeiro numero: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"Digite o segundo numero: \00"
@.str.5 = [4 x i8] c"%d\0A\00"
@str = [66 x i8] c"Para saber os inteiros entre dois numeros siga os passos abaixo: \00"
@str.6 = [16 x i8] c"NUMEROS IGUAIS!\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 ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.6, i64 0, i64 0))
br label %31
15: ; preds = %0
%16 = icmp slt i32 %10, %11
br i1 %16, label %17, label %24
17: ; preds = %15, %17
%18 = phi i32 [ %21, %17 ], [ %10, %15 ]
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = icmp sgt i32 %21, %22
br i1 %23, label %31, label %17
24: ; preds = %15, %24
%25 = phi i32 [ %28, %24 ], [ %10, %15 ]
%26 = add nsw i32 %25, -1
store i32 %26, i32* %1
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %25)
%28 = load i32, i32* %1
%29 = load i32, i32* %2
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %24
31: ; preds = %24, %17, %13
ret i32 0
}