#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() {
  float i;
  float value;
  float addition;
  printf("Please, insert a something value:\n");
  scanf("%f", &value);
  addition = 0;
  for (i = 1; i <= value; i++) {
    addition = addition + (1 / i);
  }
  printf("\nTotal result: %f \n", addition);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xea3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11a7 <main+0x87>
movss  -0x10(%rbp),%xmm0
movss  0xe7e(%rip),%xmm1
divss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe68(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1162 <main+0x42>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe73(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm1
xorps  %xmm0,%xmm0
ucomiss 0xea2(%rip),%xmm1
jb     1188 <main+0x58>
movss  0xe98(%rip),%xmm2
xorps  %xmm0,%xmm0
movaps %xmm2,%xmm3
xchg   %ax,%ax
movaps %xmm2,%xmm4
divss  %xmm3,%xmm4
addss  %xmm4,%xmm0
addss  %xmm2,%xmm3
ucomiss %xmm3,%xmm1
jae    1170 <main+0x40>
cvtss2sd %xmm0,%xmm0
lea    0xe78(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Please, insert a something value:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [20 x i8] c"\0ATotal result: %f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 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)
store float 0.000000e+00, float* %4
store float 1.000000e+00, float* %2
br label %7
7: ; preds = %16, %0
%8 = load float, float* %2
%9 = load float, float* %3
%10 = fcmp ole float %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load float, float* %4
%13 = load float, float* %2
%14 = fdiv float 1.000000e+00, %13
%15 = fadd float %12, %14
store float %15, float* %4
br label %16
16: ; preds = %11
%17 = load float, float* %2
%18 = fadd float %17, 1.000000e+00
store float %18, float* %2
br label %7
19: ; preds = %7
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %21)
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [20 x i8] c"\0ATotal result: %f \0A\00"
@str = [34 x i8] c"Please, insert a something value:\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fcmp ult float %5, 1.000000e+00
br i1 %6, label %16, label %7
7: ; preds = %0, %7
%8 = phi float [ %11, %7 ], [ 0.000000e+00, %0 ]
%9 = phi float [ %12, %7 ], [ 1.000000e+00, %0 ]
%10 = fdiv float 1.000000e+00, %9
%11 = fadd float %8, %10
%12 = fadd float %9, 1.000000e+00
%13 = fcmp ugt float %12, %5
br i1 %13, label %14, label %7
14: ; preds = %7
%15 = fpext float %11 to double
br label %16
16: ; preds = %14, %0
%17 = phi double [ 0.000000e+00, %0 ], [ %15, %14 ]
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %17)
ret i32 0
}