#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 *, float *);
int main(int argc, const char *argv[]) {
  float i, n, m, e, soma;
  n = 1.0;
  m = 1.0;
  soma = n / m;
  printf("informe um valor: ");
  scanf("%f", &e);
  printf("%.0f/%.0f", n, m);
  for (i = 1; i <= e; i++) {
    n++;
    m += 2;
    soma = soma + (n / m);
    printf(" + %.0f/%.0f ", n, m);
  }
  printf("\nO valor da soma dos termos é: \t %.2f \n", soma);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xec2(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xeb5(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm0
divss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe88(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0xe5b(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x20(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1230 <main+0x110>
movss  0xe3b(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe2d(%rip),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x24(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
divss  -0x1c(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x1c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe16(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0xddf(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11aa <main+0x8a>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xf04(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xefb(%rip),%rdi
movsd  0xead(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
ucomiss 0xe9e(%rip),%xmm0
movsd  0xe8e(%rip),%xmm0
jb     120a <main+0xea>
movaps 0xe91(%rip),%xmm2
movss  0xe81(%rip),%xmm0
lea    0xec2(%rip),%rbx
movaps %xmm0,%xmm3
movaps %xmm0,%xmm1
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  %xmm1,0x8(%rsp)
addps  0xe73(%rip),%xmm2
movaps %xmm2,0x10(%rsp)
movaps %xmm2,%xmm1
shufps $0x55,%xmm2,%xmm1
movaps %xmm2,%xmm0
divss  %xmm1,%xmm0
addss  %xmm0,%xmm3
movss  %xmm3,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
cvtss2sd %xmm1,%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm3
movaps 0x10(%rsp),%xmm2
addss  0xe10(%rip),%xmm1
movss  0x4(%rsp),%xmm0
ucomiss %xmm1,%xmm0
jae    11a0 <main+0x80>
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
lea    0xe4d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"informe um valor: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"%.0f/%.0f\00"
@.str.3 = [14 x i8] c" + %.0f/%.0f \00"
@.str.4 = [41 x i8] c"\0AO valor da soma dos termos \C3\A9: \09 %.2f \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 1.000000e+00, float* %7
store float 1.000000e+00, float* %8
%11 = load float, float* %7
%12 = load float, float* %8
%13 = fdiv float %11, %12
store float %13, float* %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %9)
%16 = load float, float* %7
%17 = fpext float %16 to double
%18 = load float, float* %8
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %17, double %19)
store float 1.000000e+00, float* %6
br label %21
21: ; preds = %40, %2
%22 = load float, float* %6
%23 = load float, float* %9
%24 = fcmp ole float %22, %23
br i1 %24, label %25, label %43
25: ; preds = %21
%26 = load float, float* %7
%27 = fadd float %26, 1.000000e+00
store float %27, float* %7
%28 = load float, float* %8
%29 = fadd float %28, 2.000000e+00
store float %29, float* %8
%30 = load float, float* %10
%31 = load float, float* %7
%32 = load float, float* %8
%33 = fdiv float %31, %32
%34 = fadd float %30, %33
store float %34, float* %10
%35 = load float, float* %7
%36 = fpext float %35 to double
%37 = load float, float* %8
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %36, double %38)
br label %40
40: ; preds = %25
%41 = load float, float* %6
%42 = fadd float %41, 1.000000e+00
store float %42, float* %6
br label %21
43: ; preds = %21
%44 = load float, float* %10
%45 = fpext float %44 to double
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), double %45)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"informe um valor: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [10 x i8] c"%.0f/%.0f\00"
@.str.3 = [14 x i8] c" + %.0f/%.0f \00"
@.str.4 = [41 x i8] c"\0AO valor da soma dos termos \C3\A9: \09 %.2f \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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), float* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+00, double 1.000000e+00)
%8 = load float, float* %3
%9 = fcmp ult float %8, 1.000000e+00
br i1 %9, label %27, label %10
10: ; preds = %2, %10
%11 = phi float [ %18, %10 ], [ 1.000000e+00, %2 ]
%12 = phi float [ %22, %10 ], [ 1.000000e+00, %2 ]
%13 = phi <2 x float> [ %14, %10 ], [ <float 1.000000e+00, float 1.000000e+00>, %2 ]
%14 = fadd <2 x float> %13, <float 1.000000e+00, float 2.000000e+00>
%15 = extractelement <2 x float> %14, i64 0
%16 = extractelement <2 x float> %14, i64 1
%17 = fdiv float %15, %16
%18 = fadd float %11, %17
%19 = fpext float %15 to double
%20 = fpext float %16 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %19, double %20)
%22 = fadd float %12, 1.000000e+00
%23 = load float, float* %3
%24 = fcmp ugt float %22, %23
br i1 %24, label %25, label %10
25: ; preds = %10
%26 = fpext float %18 to double
br label %27
27: ; preds = %25, %2
%28 = phi double [ 1.000000e+00, %2 ], [ %26, %25 ]
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), double %28)
ret i32 0
}