#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 pon(int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  scanf("%d", &n);
  double sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n; i++) {
    sum1 += 1.0 / i;
    sum2 += pon(i) / i;
  }
  printf("Sum of the first series: %f\n", sum1);
  printf("Sum of the second series: %f\n", sum2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11b5 <main+0x85>
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xe81(%rip),%xmm0
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <pon@plt>
cltd
idivl  -0x1c(%rbp)
cvtsi2sd %eax,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1166 <main+0x36>
movsd  -0x10(%rbp),%xmm0
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11af <main+0x7f>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %ebx,%ebx
xorpd  %xmm2,%xmm2
nopl   (%rax)
add    $0x1,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  0xe8e(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  %xmm1,%xmm2
movsd  %xmm2,0x18(%rsp)
mov    %ebx,%edi
call   1040 <pon@plt>
movsd  0x18(%rsp),%xmm2
cltd
idiv   %ebx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
cmp    0xc(%rsp),%ebx
jl     1160 <main+0x30>
jmp    11bd <main+0x8d>
xorpd  %xmm2,%xmm2
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0xe47(%rip),%rdi
movapd %xmm2,%xmm0
call   1030 <printf@plt>
lea    0xe54(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [29 x i8] c"Sum of the first series: %f\0A\00"
@.str.2 = [30 x i8] c"Sum of the second series: %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 = icmp slt i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %11, %0
%7 = phi double [ 0.000000e+00, %0 ], [ %17, %11 ]
%8 = phi double [ 0.000000e+00, %0 ], [ %21, %11 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), double %7)
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
11: ; preds = %0, %11
%12 = phi i32 [ %22, %11 ], [ 1, %0 ]
%13 = phi double [ %21, %11 ], [ 0.000000e+00, %0 ]
%14 = phi double [ %17, %11 ], [ 0.000000e+00, %0 ]
%15 = sitofp i32 %12 to double
%16 = fdiv double 1.000000e+00, %15
%17 = fadd double %14, %16
%18 = call i32 @pon(i32 %12)
%19 = sdiv i32 %18, %12
%20 = sitofp i32 %19 to double
%21 = fadd double %13, %20
%22 = add nuw nsw i32 %12, 1
%23 = load i32, i32* %1
%24 = icmp slt i32 %12, %23
br i1 %24, label %11, label %6
}