#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 main() {
  double toplam = 1;
  double sonuc = 0;
  printf("1. asama = Sonuc: 1\n");
  for (int i = 1; i < 64; i++) {
    toplam *= 2;
    printf("%d. asama = Sonuc: %.0f\n", i + 1, toplam);
    sonuc += toplam;
  }
  printf("Sonuc: %.0f\n", sonuc);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x40,-0x1c(%rbp)
jge    119b <main+0x8b>
movsd  0xead(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%esi
add    $0x1,%esi
movsd  -0x10(%rbp),%xmm0
lea    0xeae(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1149 <main+0x39>
movsd  -0x18(%rbp),%xmm0
lea    0xe8a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
movsd  0xec5(%rip),%xmm1
xorpd  %xmm0,%xmm0
mov    $0x2,%ebx
lea    0xebd(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x10(%rsp)
addsd  %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x1,%ebx
cmp    $0x41,%ebx
jne    1150 <main+0x30>
lea    0xe85(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str.1 = [25 x i8] c"%d. asama = Sonuc: %.0f\0A\00"
@.str.2 = [13 x i8] c"Sonuc: %.0f\0A\00"
@str = [20 x i8] c"1. asama = Sonuc: 1\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %4
2: ; preds = %4
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), double %11)
ret i32 0
4: ; preds = %0, %4
%5 = phi i32 [ 1, %0 ], [ %9, %4 ]
%6 = phi double [ 0.000000e+00, %0 ], [ %11, %4 ]
%7 = phi double [ 1.000000e+00, %0 ], [ %8, %4 ]
%8 = fmul double %7, 2.000000e+00
%9 = add nuw nsw i32 %5, 1
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %9, double %8)
%11 = fadd double %6, %8
%12 = icmp eq i32 %9, 64
br i1 %12, label %2, label %4
}