#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, float);
int main(void) {
  float x = 0.0;
  int y = 1.0;
  float sum1 = 0.0;
  float sum2 = 0.0;
  for (x = 0.0; x <= 1.0; x += 0.01) {
    sum1 += x;
  }
  for (; y <= 100; y++) {
    sum2 += y / 100.0;
  }
  printf("%f\n%f\n", sum1, sum2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1193 <main+0x83>
movss  -0x8(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1146 <main+0x36>
jmp    1198 <main+0x88>
cmpl   $0x64,-0xc(%rbp)
jg     11d7 <main+0xc7>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe59(%rip),%xmm0
divsd  %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1198 <main+0x88>
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
lea    0xe30(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xorps  %xmm0,%xmm0
movsd  0xee4(%rip),%xmm1
movss  0xefc(%rip),%xmm2
xorps  %xmm3,%xmm3
nopw   0x0(%rax,%rax,1)
xorps  %xmm4,%xmm4
cvtss2sd %xmm3,%xmm4
addss  %xmm3,%xmm0
addsd  %xmm1,%xmm4
xorps  %xmm3,%xmm3
cvtsd2ss %xmm4,%xmm3
ucomiss %xmm3,%xmm2
jae    1130 <main+0x20>
movsd  0xeb5(%rip),%xmm2
xorpd  %xmm1,%xmm1
mov    $0x2,%eax
movsd  0xeac(%rip),%xmm3
movsd  0xeac(%rip),%xmm4
nopl   0x0(%rax)
movapd %xmm2,%xmm5
divsd  %xmm3,%xmm5
cvtss2sd %xmm1,%xmm1
addsd  %xmm5,%xmm1
cvtsd2ss %xmm1,%xmm1
xorps  %xmm5,%xmm5
cvtsi2sd %eax,%xmm5
divsd  %xmm3,%xmm5
cvtss2sd %xmm1,%xmm1
addsd  %xmm5,%xmm1
cvtsd2ss %xmm1,%xmm1
addsd  %xmm4,%xmm2
add    $0x2,%eax
cmp    $0x66,%eax
jne    1170 <main+0x60>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%f\0A%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
store i32 1, i32* %3
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %2
br label %6
6: ; preds = %14, %0
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fcmp ole double %8, 1.000000e+00
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load float, float* %2
%12 = load float, float* %4
%13 = fadd float %12, %11
store float %13, float* %4
br label %14
14: ; preds = %10
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = fadd double %16, 1.000000e-02
%18 = fptrunc double %17 to float
store float %18, float* %2
br label %6
19: ; preds = %6
br label %20
20: ; preds = %31, %19
%21 = load i32, i32* %3
%22 = icmp sle i32 %21, 100
br i1 %22, label %23, label %34
23: ; preds = %20
%24 = load i32, i32* %3
%25 = sitofp i32 %24 to double
%26 = fdiv double %25, 1.000000e+02
%27 = load float, float* %5
%28 = fpext float %27 to double
%29 = fadd double %28, %26
%30 = fptrunc double %29 to float
store float %30, float* %5
br label %31
31: ; preds = %23
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %20
34: ; preds = %20
%35 = load float, float* %4
%36 = load float, float* %5
%37 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %35, float %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%f\0A%f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi float [ 0.000000e+00, %0 ], [ %5, %1 ]
%3 = phi float [ 0.000000e+00, %0 ], [ %7, %1 ]
%4 = fpext float %3 to double
%5 = fadd float %3, %2
%6 = fadd double %4, 1.000000e-02
%7 = fptrunc double %6 to float
%8 = fcmp ugt float %7, 1.000000e+00
br i1 %8, label %9, label %1
9: ; preds = %1, %9
%10 = phi float [ %22, %9 ], [ 0.000000e+00, %1 ]
%11 = phi i32 [ %23, %9 ], [ 1, %1 ]
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, 1.000000e+02
%14 = fpext float %10 to double
%15 = fadd double %13, %14
%16 = fptrunc double %15 to float
%17 = add nuw nsw i32 %11, 1
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, 1.000000e+02
%20 = fpext float %16 to double
%21 = fadd double %19, %20
%22 = fptrunc double %21 to float
%23 = add nuw nsw i32 %11, 2
%24 = icmp eq i32 %23, 101
br i1 %24, label %25, label %9
25: ; preds = %9
%26 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %5, float %22)
ret i32 0
}