#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 */
double pow(int, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double sum, temp, weight, i;
  for (int i = 0; i < 64; i++) {
    temp = pow(2, i);
    sum = sum + temp;
  }
  weight = sum / 25000;
  printf("舍罕王应该给达依尓%f粒麦子 \n", sum);
  printf("共%f公斤 \n", weight);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x40,-0x2c(%rbp)
jge    116f <main+0x4f>
mov    -0x2c(%rbp),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1136 <main+0x16>
movsd  -0x10(%rbp),%xmm0
movsd  0xe84(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
mov    %ebx,%esi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x1(%rbx),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x2(%rbx),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x3(%rbx),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x4(%rbx),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x5(%rbx),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x6(%rbx),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x7(%rbx),%esi
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
add    $0x8,%ebx
cmp    $0x40,%ebx
jne    1130 <main+0x10>
movapd %xmm0,%xmm1
divsd  0xdf1(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
lea    0xe09(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\E8\88\8D\E7\BD\95\E7\8E\8B\E5\BA\94\E8\AF\A5\E7\BB\99\E8\BE\BE\E4\BE\9D\E5\B0\93%f\E7\B2\92\E9\BA\A6\E5\AD\90 \0A\00"
@.str.1 = [14 x i8] c"\E5\85\B1%f\E5\85\AC\E6\96\A4 \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 64
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call double @pow(i32 2, i32 %11)
store double %12, double* %3
%13 = load double, double* %2
%14 = load double, double* %3
%15 = fadd double %13, %14
store double %15, double* %2
br label %16
16: ; preds = %10
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %7
19: ; preds = %7
%20 = load double, double* %2
%21 = fdiv double %20, 2.500000e+04
store double %21, double* %4
%22 = load double, double* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double %22)
%24 = load double, double* %4
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"\E8\88\8D\E7\BD\95\E7\8E\8B\E5\BA\94\E8\AF\A5\E7\BB\99\E8\BE\BE\E4\BE\9D\E5\B0\93%f\E7\B2\92\E9\BA\A6\E5\AD\90 \0A\00"
@.str.1 = [14 x i8] c"\E5\85\B1%f\E5\85\AC\E6\96\A4 \0A\00"
define i32 @main() {
br label %5
1: ; preds = %5
%2 = fdiv double %30, 2.500000e+04
%3 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), double %30)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %2)
ret i32 0
5: ; preds = %5, %0
%6 = phi i32 [ 0, %0 ], [ %31, %5 ]
%7 = phi double [ undef, %0 ], [ %30, %5 ]
%8 = tail call double @pow(i32 2, i32 %6)
%9 = fadd double %7, %8
%10 = or i32 %6, 1
%11 = tail call double @pow(i32 2, i32 %10)
%12 = fadd double %9, %11
%13 = or i32 %6, 2
%14 = tail call double @pow(i32 2, i32 %13)
%15 = fadd double %12, %14
%16 = or i32 %6, 3
%17 = tail call double @pow(i32 2, i32 %16)
%18 = fadd double %15, %17
%19 = or i32 %6, 4
%20 = tail call double @pow(i32 2, i32 %19)
%21 = fadd double %18, %20
%22 = or i32 %6, 5
%23 = tail call double @pow(i32 2, i32 %22)
%24 = fadd double %21, %23
%25 = or i32 %6, 6
%26 = tail call double @pow(i32 2, i32 %25)
%27 = fadd double %24, %26
%28 = or i32 %6, 7
%29 = tail call double @pow(i32 2, i32 %28)
%30 = fadd double %27, %29
%31 = add nuw nsw i32 %6, 8
%32 = icmp eq i32 %31, 64
br i1 %32, label %1, label %5
}