#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 *, float);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int target;
  int i;
  float tmp;
  float result;
  int count;
  tmp = 1;
  result = 0.0;
  scanf("%d", &target);
  count = 10;
  for (i = 0; i < 10; i++) {
    tmp /= target;
    result += tmp;
  }
  printf("%f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xeb9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0xa,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    119c <main+0x7c>
cvtsi2ssl -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <main+0x42>
movss  -0x14(%rbp),%xmm0
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cvtsi2ssl 0x4(%rsp),%xmm1
movss  0xec0(%rip),%xmm0
divss  %xmm1,%xmm0
xorps  %xmm2,%xmm2
addss  %xmm0,%xmm2
divss  %xmm1,%xmm0
addss  %xmm0,%xmm2
divss  %xmm1,%xmm0
addss  %xmm0,%xmm2
divss  %xmm1,%xmm0
addss  %xmm0,%xmm2
divss  %xmm1,%xmm0
addss  %xmm0,%xmm2
divss  %xmm1,%xmm0
addss  %xmm0,%xmm2
divss  %xmm1,%xmm0
addss  %xmm0,%xmm2
divss  %xmm1,%xmm0
addss  %xmm0,%xmm2
divss  %xmm1,%xmm0
addss  %xmm0,%xmm2
divss  %xmm1,%xmm0
addss  %xmm2,%xmm0
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store i32 0, i32* %1
store float 1.000000e+00, float* %4
store float 0.000000e+00, float* %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 10, i32* %6
store i32 0, i32* %3
br label %8
8: ; preds = %19, %0
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to float
%14 = load float, float* %4
%15 = fdiv float %14, %13
store float %15, float* %4
%16 = load float, float* %4
%17 = load float, float* %5
%18 = fadd float %17, %16
store float %18, float* %5
br label %19
19: ; preds = %11
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %8
22: ; preds = %8
%23 = load float, float* %5
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to float
%6 = fdiv float 1.000000e+00, %5
%7 = fadd float %6, 0.000000e+00
%8 = fdiv float %6, %5
%9 = fadd float %7, %8
%10 = fdiv float %8, %5
%11 = fadd float %9, %10
%12 = fdiv float %10, %5
%13 = fadd float %11, %12
%14 = fdiv float %12, %5
%15 = fadd float %13, %14
%16 = fdiv float %14, %5
%17 = fadd float %15, %16
%18 = fdiv float %16, %5
%19 = fadd float %17, %18
%20 = fdiv float %18, %5
%21 = fadd float %19, %20
%22 = fdiv float %20, %5
%23 = fadd float %21, %22
%24 = fdiv float %22, %5
%25 = fadd float %23, %24
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %25)
ret i32 0
}