#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 main() {
  while (1) {
    float vi, vf;
    printf("\n#############################");
    printf("\nValor Inicial: ");
    scanf("%f", &vi);
    printf("\nValor Final: ");
    scanf("%f", &vf);
    int o = (vi <= vf) ? 1 : -1;
    for (int i = vi; i != vf + o; i += o)
      printf("\n %d", i);
    char continuar;
    printf("\nDigite F para encerrar: ");
    scanf("%c", &continuar);
    if (continuar == 'F')
      break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    -0x8(%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    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmovae %ecx,%eax
mov    %eax,-0x10(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
cvtsi2ssl -0x10(%rbp),%xmm2
addss  %xmm2,%xmm1
ucomiss %xmm1,%xmm0
jne    11c9 <main+0xa9>
jp     11c9 <main+0xa9>
jmp    11e8 <main+0xc8>
mov    -0x14(%rbp),%esi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11a2 <main+0x82>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe64(%rip),%rdi
lea    -0x15(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x15(%rbp),%eax
cmp    $0x46,%eax
jne    121a <main+0xfa>
jmp    121f <main+0xff>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xefb(%rip),%rbx
lea    0xf06(%rip),%r14
lea    0xf1e(%rip),%r12
lea    0xb(%rsp),%r13
jmp    1176 <main+0x56>
nopw   0x0(%rax,%rax,1)
lea    0xef0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpb   $0x46,0xb(%rsp)
je     1242 <main+0x122>
lea    0xe83(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setae  %al
lea    (%rax,%rax,1),%r15d
add    $0xffffffff,%r15d
xorps  %xmm3,%xmm3
cvtsi2ss %r15d,%xmm3
cvttps2dq %xmm0,%xmm2
cvtdq2ps %xmm2,%xmm2
addss  %xmm3,%xmm1
ucomiss %xmm2,%xmm1
jne    11f8 <main+0xd8>
jnp    1150 <main+0x30>
cvttss2si %xmm0,%ebp
movss  %xmm3,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movss  0x10(%rsp),%xmm3
add    %r15d,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
movss  0xc(%rsp),%xmm1
addss  %xmm3,%xmm1
ucomiss %xmm0,%xmm1
jne    1210 <main+0xf0>
jp     1210 <main+0xf0>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0A#############################\00"
@.str.1 = [17 x i8] c"\0AValor Inicial: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [15 x i8] c"\0AValor Final: \00"
@.str.4 = [5 x i8] c"\0A %d\00"
@.str.5 = [26 x i8] c"\0ADigite F para encerrar: \00"
@.str.6 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 0, i32* %1
br label %7
7: ; preds = %0, %42
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%13 = load float, float* %2
%14 = load float, float* %3
%15 = fcmp ole float %13, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 -1
store i32 %17, i32* %4
%18 = load float, float* %2
%19 = fptosi float %18 to i32
store i32 %19, i32* %5
br label %20
20: ; preds = %31, %7
%21 = load i32, i32* %5
%22 = sitofp i32 %21 to float
%23 = load float, float* %3
%24 = load i32, i32* %4
%25 = sitofp i32 %24 to float
%26 = fadd float %23, %25
%27 = fcmp une float %22, %26
br i1 %27, label %28, label %35
28: ; preds = %20
%29 = load i32, i32* %5
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %29)
br label %31
31: ; preds = %28
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = add nsw i32 %33, %32
store i32 %34, i32* %5
br label %20
35: ; preds = %20
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%37 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %6)
%38 = load i8, i8* %6
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 70
br i1 %40, label %41, label %42
41: ; preds = %35
br label %43
42: ; preds = %35
br label %7
43: ; preds = %41
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0A#############################\00"
@.str.1 = [17 x i8] c"\0AValor Inicial: \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [15 x i8] c"\0AValor Final: \00"
@.str.4 = [5 x i8] c"\0A %d\00"
@.str.5 = [26 x i8] c"\0ADigite F para encerrar: \00"
@.str.6 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca i8
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
br label %6
6: ; preds = %21, %0
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%12 = load float, float* %1
%13 = load float, float* %2
%14 = fcmp ole float %12, %13
%15 = select i1 %14, i32 1, i32 -1
%16 = fptosi float %12 to i32
%17 = sitofp i32 %15 to float
%18 = sitofp i32 %16 to float
%19 = fadd float %13, %17
%20 = fcmp une float %19, %18
br i1 %20, label %26, label %21
21: ; preds = %26, %6
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%24 = load i8, i8* %3
%25 = icmp eq i8 %24, 70
br i1 %25, label %34, label %6
26: ; preds = %6, %26
%27 = phi i32 [ %29, %26 ], [ %16, %6 ]
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %27)
%29 = add nsw i32 %27, %15
%30 = sitofp i32 %29 to float
%31 = load float, float* %2
%32 = fadd float %31, %17
%33 = fcmp une float %32, %30
br i1 %33, label %26, label %21
34: ; preds = %21
ret i32 0
}