#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 */
double f(float, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, ...);
int main() {
  float a, begin, end, increment;
  printf("Qual o valor de a? ");
  scanf("%f", &a);
  printf("Qual o intervalo? ");
  scanf("%f %f", &begin, &end);
  printf("Qual o incremento? ");
  scanf("%f", &increment);
  for (float x = begin; x <= end; x += increment) {
    printf("f(%f) = %f\n", x, f(a, x));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe92(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1207 <main+0xd7>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
call   1030 <f@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xe55(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    11ad <main+0x7d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%rbx
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
ucomiss %xmm1,%xmm0
jb     120e <main+0xde>
lea    0xe8d(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  %xmm1,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
movss  0x14(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1030 <f@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm1
addss  0xc(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
ucomiss %xmm1,%xmm0
jae    11c0 <main+0x90>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Qual o valor de a? \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Qual o intervalo? \00"
@.str.3 = [6 x i8] c"%f %f\00"
@.str.4 = [20 x i8] c"Qual o incremento? \00"
@.str.5 = [12 x i8] c"f(%f) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float* %3, float* %4)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %5)
%13 = load float, float* %3
store float %13, float* %6
br label %14
14: ; preds = %25, %0
%15 = load float, float* %6
%16 = load float, float* %4
%17 = fcmp ole float %15, %16
br i1 %17, label %18, label %29
18: ; preds = %14
%19 = load float, float* %6
%20 = fpext float %19 to double
%21 = load float, float* %2
%22 = load float, float* %6
%23 = call double @f(float %21, float %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), double %20, double %23)
br label %25
25: ; preds = %18
%26 = load float, float* %5
%27 = load float, float* %6
%28 = fadd float %27, %26
store float %28, float* %6
br label %14
29: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Qual o valor de a? \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [19 x i8] c"Qual o intervalo? \00"
@.str.3 = [6 x i8] c"%f %f\00"
@.str.4 = [20 x i8] c"Qual o incremento? \00"
@.str.5 = [12 x i8] c"f(%f) = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), float* %2, float* %3)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, float*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%15 = load float, float* %2
%16 = load float, float* %3
%17 = fcmp ugt float %15, %16
br i1 %17, label %18, label %19
18: ; preds = %19, %0
ret i32 0
19: ; preds = %0, %19
%20 = phi float [ %26, %19 ], [ %15, %0 ]
%21 = fpext float %20 to double
%22 = load float, float* %1
%23 = call double @f(float %22, float %20)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), double %21, double %23)
%25 = load float, float* %4
%26 = fadd float %20, %25
%27 = load float, float* %3
%28 = fcmp ugt float %26, %27
br i1 %28, label %18, label %19
}